mirror of
https://github.com/pandorafms/pandorafms.git
synced 2025-07-27 15:54:29 +02:00
Fixed problems with AD
(cherry picked from commit c59598969c1ae21d7320024e954e3c575c2ad4bd)
This commit is contained in:
parent
7e055f77f0
commit
f1a083eede
@ -52,10 +52,6 @@ function config_update_value ($token, $value) {
|
|||||||
io_safe_output($value));
|
io_safe_output($value));
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($token == 'ad_adv_perms') {
|
|
||||||
$value = io_safe_output($value);
|
|
||||||
}
|
|
||||||
|
|
||||||
if ($token == 'default_assign_tags') {
|
if ($token == 'default_assign_tags') {
|
||||||
$value = ($value);
|
$value = ($value);
|
||||||
}
|
}
|
||||||
@ -1219,15 +1215,65 @@ function config_process_config () {
|
|||||||
if (!isset ($config['ad_adv_perms'])) {
|
if (!isset ($config['ad_adv_perms'])) {
|
||||||
config_update_value ('ad_adv_perms', '');
|
config_update_value ('ad_adv_perms', '');
|
||||||
}
|
}
|
||||||
else{
|
else {
|
||||||
$temp_ad_adv_perms = array();
|
if (!json_decode(io_safe_output($config['ad_adv_perms']))) {
|
||||||
if (isset($config['ad_adv_perms'])) {
|
$temp_ad_adv_perms = array();
|
||||||
if (!empty($config['ad_adv_perms'])) {
|
if ($config['ad_adv_perms'] != '') {
|
||||||
$temp_ad_adv_perms = $config['ad_adv_perms'];
|
$perms = explode(';', io_safe_output($config['ad_adv_perms']));
|
||||||
|
foreach ($perms as $ad_adv_perm) {
|
||||||
|
if (preg_match('/[\[\]]/',$ad_adv_perm)) {
|
||||||
|
$all_data = explode (",", io_safe_output($ad_adv_perm));
|
||||||
|
$profile = $all_data[0];
|
||||||
|
$group_pnd = $all_data[1];
|
||||||
|
$groups_ad = str_replace(array("[","]"), "", $all_data[2]);
|
||||||
|
$tags = str_replace(array("[","]"), "", $all_data[3]);
|
||||||
|
$groups_ad = explode('|', $groups_ad);
|
||||||
|
$tags_name = explode('|', $tags);
|
||||||
|
$tags_ids = array();
|
||||||
|
foreach ($tags_name as $tag) {
|
||||||
|
$tags_ids[] = tags_get_id($tag);
|
||||||
|
}
|
||||||
|
$profile = profile_get_profiles(
|
||||||
|
array(
|
||||||
|
"name" => io_safe_input($profile)));
|
||||||
|
if (!$profile)
|
||||||
|
continue;
|
||||||
|
$profile_id = array_keys($profile);
|
||||||
|
$id_grupo = groups_get_id (io_safe_input($group_pnd), false);
|
||||||
|
$new_ad_adv_perms[] =
|
||||||
|
array('profile' => $profile_id[0],
|
||||||
|
'group' => array($id_grupo),
|
||||||
|
'tags' => $tags_ids,
|
||||||
|
'groups_ad' => $groups_ad);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
$all_data = explode (",", io_safe_output($ad_adv_perm));
|
||||||
|
$profile = $all_data[0];
|
||||||
|
$group_pnd = $all_data[1];
|
||||||
|
$groups_ad = $all_data[2];
|
||||||
|
$tags = $all_data[3];
|
||||||
|
$profile = profile_get_profiles(
|
||||||
|
array(
|
||||||
|
"name" => io_safe_input($profile)));
|
||||||
|
if (!$profile)
|
||||||
|
continue;
|
||||||
|
$profile_id = array_keys($profile);
|
||||||
|
$id_grupo = groups_get_id (io_safe_input($group_pnd), false);
|
||||||
|
|
||||||
|
$new_ad_adv_perms[] =
|
||||||
|
array('profile' => $profile_id[0],
|
||||||
|
'group' => array($id_grupo),
|
||||||
|
'tags' => array($tags),
|
||||||
|
'groups_ad' => array($groups_ad));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!empty($new_ad_adv_perms)) {
|
||||||
|
$temp_ad_adv_perms = json_encode($new_ad_adv_perms);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
config_update_value ('ad_adv_perms', $temp_ad_adv_perms);
|
||||||
}
|
}
|
||||||
$config['ad_adv_perms'] = $temp_ad_adv_perms;
|
|
||||||
$keysConfig = array_keys($config);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!isset ($config['rpandora_server'])) {
|
if (!isset ($config['rpandora_server'])) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user