From 412e8052f3e3555f83c3b9f38a4f493b54f480ff Mon Sep 17 00:00:00 2001 From: Lars Kneschke Date: Sat, 30 Aug 2003 06:06:11 +0000 Subject: [PATCH] a field name has changed removed some ugly output added utf8_decode for usernames --- setup/ldapmodify.php | 69 +++++++++++++++++++++++--------------------- 1 file changed, 36 insertions(+), 33 deletions(-) diff --git a/setup/ldapmodify.php b/setup/ldapmodify.php index 062ab59d43..8cb39023f6 100644 --- a/setup/ldapmodify.php +++ b/setup/ldapmodify.php @@ -110,7 +110,7 @@ $group_info = array(); } - $GLOBALS['phpgw_setup']->db->query("SELECT app_name FROM phpgw_applications WHERE app_enabled!='0' AND app_enabled!='3' ORDER BY app_title",__LINE__,__FILE__); + $GLOBALS['phpgw_setup']->db->query("SELECT app_name FROM phpgw_applications WHERE app_enabled!='0' AND app_enabled!='3' ORDER BY app_name",__LINE__,__FILE__); while ($GLOBALS['phpgw_setup']->db->next_record()) { $apps[$GLOBALS['phpgw_setup']->db->f('app_name')] = lang($GLOBALS['phpgw_setup']->db->f('app_name')); @@ -188,39 +188,42 @@ } /* Now make the members a member of this group in phpgw. */ - while (list($key,$members) = each($thismembers)) + if(is_array($thismembers)) { - if ($key == 'count') + foreach($thismembers as $key => $members) { - continue; - } - /* echo '
members: ' . $members; */ - $tmpid = 0; - @reset($account_info); - while(list($x,$y) = each($account_info)) - { - /* echo '
checking: '.$y['account_lid']; */ - if ($members == $y['account_lid']) + if ($key == 'count') { - $tmpid = $y['account_id']; + continue; + } + /* echo '
members: ' . $members; */ + $tmpid = 0; + @reset($account_info); + while(list($x,$y) = each($account_info)) + { + /* echo '
checking: '.$y['account_lid']; */ + if ($members == $y['account_lid']) + { + $tmpid = $y['account_id']; + } + } + // Insert acls for this group based on memberuid field. + // Since the group has app rights, we don't need to give users + // these rights. Instead, we maintain group membership here. + if($tmpid) + { + $acl->account_id = intval($tmpid); + $acl->read_repository(); + + $acl->delete('phpgw_group',$thisacctid,1); + $acl->add('phpgw_group',$thisacctid,1); + + // Now add the acl to let them change their password + $acl->delete('preferences','changepassword',1); + $acl->add('preferences','changepassword',1); + + $acl->save_repository(); } - } - // Insert acls for this group based on memberuid field. - // Since the group has app rights, we don't need to give users - // these rights. Instead, we maintain group membership here. - if($tmpid) - { - $acl->account_id = intval($tmpid); - $acl->read_repository(); - - $acl->delete('phpgw_group',$thisacctid,1); - $acl->add('phpgw_group',$thisacctid,1); - - // Now add the acl to let them change their password - $acl->delete('preferences','changepassword',1); - $acl->add('preferences','changepassword',1); - - $acl->save_repository(); } } /* Now give this group some rights */ @@ -362,18 +365,18 @@ while (list($key,$account) = @each($account_info)) { - $user_list .= ''; + $user_list .= ''; } @reset($account_info); while (list($key,$account) = @each($account_info)) { - $admin_list .= ''; + $admin_list .= ''; } while (list($key,$group) = @each($group_info)) { - $group_list .= ''; + $group_list .= ''; } while(list($appname,$apptitle) = each($apps))