Skip to content

Commit 1408d0a

Browse files
committed
Bug fix for not allowing access to admin because of a file not found error 'head.txt'
1 parent 8007097 commit 1408d0a

File tree

2 files changed

+13
-2
lines changed

2 files changed

+13
-2
lines changed

.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
config.php
2+
.idea/
3+
.vscode/
4+
.code/

template.php

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,9 +58,13 @@ public static function render_header($page_name, $admin = false){
5858
<html lang="en">
5959
<head>
6060
<?php
61+
if(!admin){
6162
$headfile = fopen("head.txt", "r") or die("Unable to open head.txt!");
6263
$head_additionalcode = fread($versionfile,filesize("head.txt"));
63-
fclose($headfile); ?>
64+
fclose($headfile);
65+
echo $head_additionalcode;
66+
}
67+
?>
6468
<meta charset="utf-8">
6569
<title><?php echo $page_name." - ".NAME ?></title>
6670
<meta name="viewport" content="width=device-width, initial-scale=1">
@@ -174,6 +178,9 @@ public static function render_header($page_name, $admin = false){
174178
/**
175179
* Renders a toggle switch
176180
* Created by Yigit Kerem Oktay
181+
* @param String $toggletext will decide what the description text next to the toggle will be
182+
* @param String $input_name will decide what the HTML Name attribute of the toggle will be
183+
* @param Boolean $checked will decide if the toggle will initially be on or off
177184
*/
178185
public static function render_toggle($toggletext,$input_name,$checked){
179186
?>
@@ -199,7 +206,7 @@ public static function render_footer($admin = false)
199206
<div id="footerwrap">
200207
<div class="container">
201208
<div class="row centered">
202-
<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>
209+
<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>
203210
<div class="col-md-4 text-center">
204211
<div class="btn-group dropup">
205212
<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>

0 commit comments

Comments
 (0)