Changed for metaconsole

This commit is contained in:
marcos.alconada 2019-05-22 13:57:31 +02:00
parent 0c9f8892e0
commit 07b42f7241
1 changed files with 31 additions and 1 deletions

View File

@ -1254,6 +1254,36 @@ function fill_permissions_ldap($sr)
global $config;
$permissions = [];
$permissions_profile = [];
if (defined('METACONSOLE')) {
$meta = true;
}
if ($meta && (bool) $config['ldap_save_profile'] === false && $config['ldap_advanced_config'] == 0) {
$result = 0;
$result = db_get_all_rows_filter(
'tusuario_perfil',
['id_usuario' => $sr['uid'][0]]
);
if ($result == false) {
$permissions[0]['profile'] = $config['default_remote_profile'];
$permissions[0]['groups'][] = $config['default_remote_group'];
$permissions[0]['tags'] = $config['default_assign_tags'];
$permissions[0]['no_hierarchy'] = $config['default_no_hierarchy'];
return $permissions;
}
foreach ($result as $perms) {
$permissions_profile[] = [
'profile' => $perms['id_perfil'],
'groups' => [$perms['id_grupo']],
'tags' => $perms['tags'],
'no_hierarchy' => (bool) $perms['no_hierarchy'] ? 1 : 0,
];
}
return $permissions_profile;
}
if ((bool) $config['ldap_save_profile'] === false && $config['ldap_advanced_config'] == '') {
$result = db_get_all_rows_filter(
'tusuario_perfil',
@ -1293,7 +1323,7 @@ function fill_permissions_ldap($sr)
return $permissions;
}
if ($config['ldap_advanced_config'] == 1 && $config['ldap_save_profile'] == '') {
if ($config['ldap_advanced_config'] == 1 && $config['ldap_save_profile'] == 0) {
$result = db_get_all_rows_filter(
'tusuario_perfil',
['id_usuario' => $sr['uid'][0]]