Skip to content

Commit e4cd4be

Browse files
committed
separated OPERATOR and USER vars
1 parent 0fff0ae commit e4cd4be

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

resources/init.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -95,11 +95,13 @@
9595
// SSO is available
9696
$_SESSION["SSO"] = $SSO;
9797

98-
$USER = new UnityUser($SSO["user"], $LDAP, $SQL, $MAILER, $REDIS, $WEBHOOK);
99-
$_SESSION["is_admin"] = $USER->isAdmin();
98+
$OPERATOR = new UnityUser($SSO["user"], $LDAP, $SQL, $MAILER, $REDIS, $WEBHOOK);
99+
$_SESSION["is_admin"] = $OPERATOR->isAdmin();
100100

101101
if (isset($_SESSION["viewUser"]) && $_SESSION["is_admin"]) {
102102
$USER = new UnityUser($_SESSION["viewUser"], $LDAP, $SQL, $MAILER, $REDIS, $WEBHOOK);
103+
} else {
104+
$USER = $OPERATOR;
103105
}
104106

105107
$_SESSION["user_exists"] = $USER->exists();

0 commit comments

Comments
 (0)