Bug fix for not allowing access to admin because of a file not found error 'head.txt'

This commit is contained in:
Yigit Kerem Oktay 2020-12-15 15:08:17 +03:00
parent 8007097d2f
commit 1408d0ad91
2 changed files with 13 additions and 2 deletions

4
.gitignore vendored Normal file
View File

@ -0,0 +1,4 @@
config.php
.idea/
.vscode/
.code/

View File

@ -58,9 +58,13 @@ class Template{
<html lang="en">
<head>
<?php
if(!admin){
$headfile = fopen("head.txt", "r") or die("Unable to open head.txt!");
$head_additionalcode = fread($versionfile,filesize("head.txt"));
fclose($headfile); ?>
fclose($headfile);
echo $head_additionalcode;
}
?>
<meta charset="utf-8">
<title><?php echo $page_name." - ".NAME ?></title>
<meta name="viewport" content="width=device-width, initial-scale=1">
@ -174,6 +178,9 @@ class Template{
/**
* Renders a toggle switch
* Created by Yigit Kerem Oktay
* @param String $toggletext will decide what the description text next to the toggle will be
* @param String $input_name will decide what the HTML Name attribute of the toggle will be
* @param Boolean $checked will decide if the toggle will initially be on or off
*/
public static function render_toggle($toggletext,$input_name,$checked){
?>
@ -199,7 +206,7 @@ class Template{
<div id="footerwrap">
<div class="container">
<div class="row centered">
<div class="col-md-4 text-left"><a href="https://github.com/Pryx/server-status/graphs/contributors" target="_blank">Copyright © <?php echo date("Y");?> Server Status Project Contributors </a><?php if(strlen(COPYRIGHT_TEXT)>1){ echo " and ".COPYRIGHT_TEXT; } ?></div>
<div class="col-md-4 text-left"><a href="https://github.com/server-status-project/server-status/graphs/contributors" target="_blank">Copyright © <?php echo date("Y");?> Server Status Project Contributors </a><?php if(strlen(COPYRIGHT_TEXT)>1){ echo " and ".COPYRIGHT_TEXT; } ?></div>
<div class="col-md-4 text-center">
<div class="btn-group dropup">
<button type="button" class="btn btn-primary"><?php echo '<img src="'.WEB_URL.'/locale/'.$_SESSION['locale'].'/flag.png" alt="'.$lang_names[$_SESSION['locale']].'">'.$lang_names[$_SESSION['locale']];?></button>