Skip to content

Commit

Permalink
Bug fix for not allowing access to admin because of a file not found …
Browse files Browse the repository at this point in the history
…error 'head.txt'
  • Loading branch information
yigitkerem committed Dec 15, 2020
1 parent 8007097 commit 1408d0a
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
config.php
.idea/
.vscode/
.code/
11 changes: 9 additions & 2 deletions template.php
Original file line number Diff line number Diff line change
Expand Up @@ -58,9 +58,13 @@ public static function render_header($page_name, $admin = false){
<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">
Expand Down Expand Up @@ -174,6 +178,9 @@ public static function render_header($page_name, $admin = false){
/**
* 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){
?>
Expand All @@ -199,7 +206,7 @@ public static function render_footer($admin = false)
<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>
Expand Down

0 comments on commit 1408d0a

Please sign in to comment.