2
0
mirror of https://github.com/ACSPRI/queXS synced 2024-04-02 12:12:16 +00:00

Added authentication includes to all files

This commit is contained in:
Adam Zammit
2015-08-14 16:15:20 +10:00
parent cfba7e27f4
commit ec8522e316
95 changed files with 738 additions and 173 deletions

View File

@@ -893,24 +893,24 @@ function get_extension($operator_id)
/**
* Return the current operator id based on PHP_AUTH_USER
* Return the current operator id based on SESSION loginID
*
* @return bool|int False if none otherwise the operator id
*
*/
function get_operator_id()
{
if (!isset($_SERVER['PHP_AUTH_USER']))
if (!isset($_SESSION['loginID']))
{
print "<p>" . T_("ERROR: You do not have server side authentication enabled therefore queXS cannot determine which user is accessing the system.") . "</p>";
return false;
print "<p>" . T_("ERROR: You are not logged in.") . "</p>";
die();
}
global $db;
$sql = "SELECT operator_id
FROM operator
WHERE username = " . $db->qstr($_SERVER['PHP_AUTH_USER']) . "
WHERE username = " . $db->qstr($_SESSION['loginID']) . "
AND enabled = 1";
$o = $db->GetRow($sql);