X-Git-Url: http://git.datanom.net/qtadmin.git/blobdiff_plain/815fed0cc9ba502f9450833008f7c9dd50b2e4da..56c841014682b373b486d3627ce1ea1f37403ff1:/lib/utils.inc.php diff --git a/lib/utils.inc.php b/lib/utils.inc.php index a15369e..197b26f 100644 --- a/lib/utils.inc.php +++ b/lib/utils.inc.php @@ -1,6 +1,7 @@ root .'config.php'; +require_once $CFG->root . 'lib/session_handler.inc.php'; class Utils { @@ -18,11 +19,13 @@ class Utils { + __TITLE__ -'; - private $footer = ''; +
'; + private $footer = '
'; private $heading = '

Session timeout:

__TITLE__

'; @@ -92,6 +95,7 @@ class Utils { $file = $CFG->root.'qtadmin.log'; } file_put_contents($file, "[$time]: $message\n", FILE_APPEND | LOCK_EX); + chmod($file, 0600); break; case 'stderr': file_put_contents('php://stderr', "[$time]: $message\n"); @@ -310,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("authorize '".$this->getUser()."' rcpt '$recipient'", 3); + + return $authorized; + } + public function getHeader() { $this->log("getHeader", 4);