Compare commits
2 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
0ff6294faa | ||
|
|
757d7ae01d |
@@ -117,7 +117,7 @@ if (isset($login->loginGetAcl()['unit'])) {
|
||||
if ($login->loginCheckEditAccessCuid($edit_access_cuid)) {
|
||||
print "Set new:" . $edit_access_cuid . "<br>";
|
||||
} else {
|
||||
print "Load default unit id: " . $login->loginGetAcl()['unit_id'] . "<br>";
|
||||
print "Load default unit id: " . $login->loginGetAcl()['unit_cuid'] . "<br>";
|
||||
}
|
||||
} else {
|
||||
print "Something went wrong with the login<br>";
|
||||
@@ -140,4 +140,14 @@ $login->writeLog(
|
||||
write_type:'JSON'
|
||||
);
|
||||
|
||||
echo "<hr>";
|
||||
print "<h3>Legacy Lookups</h3>";
|
||||
|
||||
$edit_access_id = 1;
|
||||
$edit_access_cuid = $login->loginGetEditAccessCuidFromId($edit_access_id);
|
||||
$edit_access_id_rev = $login->loginGetEditAccessIdFromCuid($edit_access_cuid);
|
||||
print "EA ID: " . $edit_access_id . "<br>";
|
||||
print "EA CUID: " . $edit_access_cuid . "<br>";
|
||||
print "REV EA CUID: " . $edit_access_id_rev . "<br>";
|
||||
|
||||
print "</body></html>";
|
||||
|
||||
@@ -1532,7 +1532,7 @@ class Login
|
||||
$this->acl['page'] = $_SESSION['LOGIN_PAGES_ACL_LEVEL'][$this->page_name];
|
||||
}
|
||||
|
||||
$this->acl['unit_id'] = null;
|
||||
$this->acl['unit_cuid'] = null;
|
||||
$this->acl['unit_name'] = null;
|
||||
$this->acl['unit_uid'] = null;
|
||||
$this->acl['unit'] = [];
|
||||
@@ -3290,10 +3290,24 @@ HTML;
|
||||
*/
|
||||
public function loginGetEditAccessCuidFromId(int $id): string|false
|
||||
{
|
||||
if (!isset($_SESSION['LOGIN_UNIT_ACL_LEVEL'][$id])) {
|
||||
if (!isset($_SESSION['LOGIN_UNIT_LEGACY'][$id])) {
|
||||
return false;
|
||||
}
|
||||
return (string)$_SESSION['LOGIN_UNIT_ACL_LEVEL'][$id]['cuid'];
|
||||
return (string)$_SESSION['LOGIN_UNIT_LEGACY'][$id]['cuid'];
|
||||
}
|
||||
|
||||
/**
|
||||
* This is a Legacy lookup from the edit access id to cuid for further lookups in the normal list
|
||||
*
|
||||
* @param string $cuid edit access cuid
|
||||
* @return int|false false on not found or edit access id PK
|
||||
*/
|
||||
public function loginGetEditAccessIdFromCuid(string $cuid): int|false
|
||||
{
|
||||
if (!isset($_SESSION['LOGIN_UNIT'][$cuid])) {
|
||||
return false;
|
||||
}
|
||||
return $_SESSION['LOGIN_UNIT'][$cuid]['id'];
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user