Browse Source

Icon/text tweaks, add security headers

tags/1.0beta
Skylar Ittner 2 years ago
parent
commit
8b091c59f6
3 changed files with 19 additions and 9 deletions
  1. 4
    4
      home.php
  2. 1
    0
      lang/en_us.php
  3. 14
    5
      required.php

+ 4
- 4
home.php View File

@@ -75,11 +75,11 @@ if (!is_empty($_GET['page'])) {
75 75
                         </ul>
76 76
                         <ul class="nav navbar-nav navbar-right">
77 77
                             <li class="dropdown">
78
-                                <a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-expanded="false"><i class="fa fa-gears"></i> <?php lang("settings"); ?> <span class="caret"></span></a>
78
+                                <a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-expanded="false"><i class="fa fa-gears fa-fw"></i> <?php lang("options") ?> <span class="caret"></span></a>
79 79
                                 <ul class="dropdown-menu" role="menu">
80
-                                    <li><a href="home.php?page=security"><i class="fa fa-lock"></i> <?php lang("account security"); ?></a></li>
80
+                                    <li><a href="home.php?page=security"><i class="fa fa-lock fa-fw"></i> <?php lang("account security") ?></a></li>
81 81
                                     <li class="divider"></li>
82
-                                    <li><a href="action.php?action=signout"><?php lang("sign out"); ?></a></li>
82
+                                    <li><a href="action.php?action=signout"><i class="fa fa-sign-out fa-fw"></i> <?php lang("sign out") ?></a></li>
83 83
                                 </ul>
84 84
                             </li>
85 85
                         </ul>
@@ -145,7 +145,7 @@ END;
145 145
                     if (file_exists(__DIR__ . "/apps/" . $app . ".php")) {
146 146
                         include_once __DIR__ . "/apps/" . $app . ".php";
147 147
                         $apptitle = $APPS[$app]['title'];
148
-                        $appicon = (is_empty($APPS[$app]['icon']) ? "" : "fa fa-" . $APPS[$app]['icon']);
148
+                        $appicon = (is_empty($APPS[$app]['icon']) ? "" : "fa fa-fw fa-" . $APPS[$app]['icon']);
149 149
                         $apptype = (is_empty($APPS[$app]['type']) ? "default" : $APPS[$app]['type']);
150 150
                         $appcontent = $APPS[$app]['content'];
151 151
                         echo <<<END

+ 1
- 0
lang/en_us.php View File

@@ -19,6 +19,7 @@ define("STRINGS", [
19 19
     "account security" => "Account security",
20 20
     "sign out" => "Sign out",
21 21
     "settings" => "Settings",
22
+    "options" => "Options",
22 23
     "404 error" => "404 Error",
23 24
     "page not found" => "Page not found.",
24 25
     "current password incorrect" => "The current password is incorrect.  Try again.",

+ 14
- 5
required.php View File

@@ -3,18 +3,27 @@
3 3
 /**
4 4
  * This file contains global settings and utility functions.
5 5
  */
6
-ob_start();
7
-session_start();
8
-
6
+ob_start(); // allow sending headers after content
7
+// Unicode, solves almost all stupid encoding problems
9 8
 header('Content-Type: text/html; charset=utf-8');
10 9
 
10
+// l33t $ecurity h4x
11
+header('X-Content-Type-Options: nosniff');
12
+header('X-XSS-Protection: 1; mode=block');
13
+header('X-Powered-By: Late-night coding frenzies (plz send caffeine, thx)');
14
+header('X-Hacker: Why are you looking at HTTP headers? Get a life! </sarcasm>');
15
+$session_length = 60 * 60; // 1 hour
16
+session_set_cookie_params($session_length, "/", null, false, true);
17
+
18
+session_start(); // stick some cookies in it
19
+
11 20
 // Composer
12 21
 require __DIR__ . '/vendor/autoload.php';
13 22
 // Settings file
14 23
 require __DIR__ . '/settings.php';
15
-
24
+// List of alert messages
16 25
 require __DIR__ . '/lang/messages.php';
17
-
26
+// text strings (i18n)
18 27
 require __DIR__ . '/lang/' . LANGUAGE . ".php";
19 28
 
20 29
 function sendError($error) {

Loading…
Cancel
Save