Commit 87a108f2 authored by Côme Chilliet's avatar Côme Chilliet
Browse files

Fixes #5673 Fixed PHP errors on login in some cases

Showing with 16 additions and 14 deletions
+16 -14
...@@ -60,20 +60,22 @@ class applicationManagement extends simpleManagement ...@@ -60,20 +60,22 @@ class applicationManagement extends simpleManagement
); );
} else { /* allowed */ } else { /* allowed */
$apps = array(); $apps = array();
$roles = objects::ls( if (is_object($ui) && isset($ui->dn)) {
'role', $roles = objects::ls(
array('fdApplicationAllowed' => '*'), 'role',
NULL, array('fdApplicationAllowed' => '*'),
'(&(objectClass=fdApplicationRights)(roleOccupant='.$ui->dn.'))' NULL,
); '(&(objectClass=fdApplicationRights)(roleOccupant='.$ui->dn.'))'
foreach ($roles as $role) { );
foreach ($role['fdApplicationAllowed'] as $appdn) { foreach ($roles as $role) {
if (!isset($apps[$appdn])) { foreach ($role['fdApplicationAllowed'] as $appdn) {
$ldap->cat($appdn); if (!isset($apps[$appdn])) {
if ($ldap->count()) { $ldap->cat($appdn);
$attrs = $ldap->fetch(); if ($ldap->count()) {
if (in_array_ics('fdWebApplication', $attrs['objectClass'])) { $attrs = $ldap->fetch();
$apps[$appdn] = $attrs; if (in_array_ics('fdWebApplication', $attrs['objectClass'])) {
$apps[$appdn] = $attrs;
}
} }
} }
} }
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment