mirror of
https://github.com/pandorafms/pandorafms.git
synced 2025-07-31 01:35:36 +02:00
Revert "Use session and not exec sql if already exists acl perms in session - #1017"
This reverts commit 78bb583824ebe779b263852493d1e2a4144235b0.
This commit is contained in:
parent
94f6683c16
commit
179325447f
@ -1796,26 +1796,6 @@ function check_acl($id_user, $id_group, $access, $onlyOneGroup = false) {
|
|||||||
$id_group = (int) $id_group;
|
$id_group = (int) $id_group;
|
||||||
}
|
}
|
||||||
|
|
||||||
if($_SESSION['check_acl'] != null){
|
|
||||||
if (empty ($_SESSION['check_acl']))
|
|
||||||
return 0;
|
|
||||||
|
|
||||||
$result = 0;
|
|
||||||
$acl_column = get_acl_column($access);
|
|
||||||
foreach ($_SESSION['check_acl'] as $row) {
|
|
||||||
// For each profile for this pair of group and user do...
|
|
||||||
if (isset($row[$acl_column])) {
|
|
||||||
$result += $row[$acl_column];
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if ($result >= 1) {
|
|
||||||
return 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
$parents_id = array($id_group);
|
$parents_id = array($id_group);
|
||||||
if ($id_group != 0 && $onlyOneGroup !== true) {
|
if ($id_group != 0 && $onlyOneGroup !== true) {
|
||||||
$group = db_get_row_filter('tgrupo', array('id_grupo' => $id_group));
|
$group = db_get_row_filter('tgrupo', array('id_grupo' => $id_group));
|
||||||
@ -1864,13 +1844,8 @@ function check_acl($id_user, $id_group, $access, $onlyOneGroup = false) {
|
|||||||
OR tusuario_perfil.id_grupo = 0)", $id_user, implode(', ', $parents_id));
|
OR tusuario_perfil.id_grupo = 0)", $id_user, implode(', ', $parents_id));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
$rowdup = db_get_all_rows_sql ($query);
|
$rowdup = db_get_all_rows_sql ($query);
|
||||||
|
|
||||||
$_SESSION['check_acl'] = $rowdup;
|
|
||||||
|
|
||||||
if (empty ($rowdup))
|
if (empty ($rowdup))
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user