]> git.datanom.net - qtadmin.git/blobdiff - lib/utils.inc.php
Enhance security
[qtadmin.git] / lib / utils.inc.php
index 89f226d98963a47ca12fa99279d001f7a7269de2..eec51cd2674dee5b65cfbba17a205147cb56b0b8 100644 (file)
@@ -22,9 +22,10 @@ class Utils {
     <script src="__ROOT__js/forms.js"></script>
     <title>__TITLE__</title>
 </head>
-<body>';
-    private $footer = '<p class="footer">Powered by <a href="https://qtadmin.datanom.net"
-            title="Goto QtAdmin homepage">QtAdmin</a>. &copy; 2015 by Michael Rasmussen</p></body></html>';
+<body><div id="container">';
+    private $footer = '</div><div id="footer"><p>Powered by <a href="https://qtadmin.datanom.net"
+            title="Goto QtAdmin homepage">QtAdmin</a>. &copy; 2015 by Michael Rasmussen</p>
+    </div></body></html>';
     private $heading = '<p id="time" class="time">Session timeout:
             <span id="timer"></span></p><h1 class="h1">__TITLE__</h1>';
 
@@ -313,6 +314,19 @@ class Utils {
         return $user;
     }
 
+    public function authorized($recipient) {
+        $authorized = false;
+
+        $this->log("authorized '$recipient'", 3);
+
+        if ($this->isAdmin() || $this->getUser() == $recipient) {
+            $authorized = true;
+        }
+        $this->log("authorized '".$this->getUser()."'", 3);
+
+        return $authorized;
+    }
+
     public function getHeader() {
         $this->log("getHeader", 4);
 
This page took 0.028878 seconds and 5 git commands to generate.