fix group edit bug detected by Maanus, so after editing groups in combination

with LDAP, the remain with account type "g" and not getting "u".
This commit is contained in:
ak703 2005-01-28 20:12:28 +00:00
parent ae73d19085
commit c7c29c30aa

View File

@ -916,8 +916,8 @@
$p->set_file(Array('edit' => 'group_form.tpl'));
$p->set_block('edit','select');
$p->set_block('edit','popwin');
$accounts = CreateObject('phpgwapi.accounts',$group_info['account_id'],'u');
//fix from Maanus 280105
$accounts = CreateObject('phpgwapi.accounts',$group_info['account_id'],'g');
if (!is_object($GLOBALS['phpgw']->uiaccountsel))
{
@ -1020,6 +1020,7 @@
$GLOBALS['phpgw']->js = CreateObject('phpgwapi.javascript');
}
$GLOBALS['phpgw']->js->validate_file('jscode','openwindow','admin');
$GLOBALS['phpgw']->common->phpgw_header();
$t = CreateObject('phpgwapi.Template',PHPGW_APP_TPL);
@ -1038,6 +1039,9 @@
$t->set_block('account','form_buttons_','form_buttons_');
$t->set_block('account','link_row','link_row');
$theme = $GLOBALS['phpgw_info']['user']['preferences']['common']['theme'];
$t->set_var('icon_create_edit', '<img src="'. $GLOBALS['phpgw_info']['server']['webserver_url'] .'/admin/templates/'.$theme.'/images/useradm.gif">');
print_debug('Type : '.gettype($_userData).'<br>_userData(size) = "'.$_userData.'"('.strlen($_userData).')');
if (is_array($_userData))
{
@ -1113,9 +1117,7 @@
if ($GLOBALS['phpgw_info']['server']['ldap_extra_attributes']) {
$lang_homedir = lang('home directory');
$lang_shell = lang('login shell');
$homedirectory = '<input name="homedirectory" value="'
. ($_account_id?$userData['homedirectory']:$GLOBALS['phpgw_info']['server']['ldap_account_home'].$account_lid)
. '">';
$homedirectory = '<input name="homedirectory" value="'. ($_account_id?$userData['homedirectory']:$GLOBALS['phpgw_info']['server']['ldap_account_home'].$account_lid).'">';
$loginshell = '<input name="loginshell" value="'
. ($_account_id?$userData['loginshell']:$GLOBALS['phpgw_info']['server']['ldap_account_shell'])
. '">';
@ -1172,7 +1174,7 @@
'homedirectory' => $homedirectory,
'loginshell' => $loginshell,
'anonymous' => '<input type="checkbox" name="anonymous" value="1"'.($userData['anonymous'] ? ' checked' : '').'>',
'changepassword'=> '<input type="checkbox" name="changepassword" value="1"'.($userData['changepassword'] ? ' checked' : '').'>',
'changepassword' => '<input type="checkbox" name="changepassword" value="1"'.($userData['changepassword'] ? ' checked' : '').'>',
'account_status' => '<input type="checkbox" name="account_status" value="A"'.($userData['status']?' checked':'').'>',
'account_firstname' => '<input name="account_firstname" value="' . $userData['firstname'] . '">',
'account_lastname' => '<input name="account_lastname" value="' . $userData['lastname'] . '">',
@ -1206,8 +1208,7 @@
/* print
"Los1:".$userData["account_id"].$userGroups[$i]['account_id']." :
".$value['account_id']."<br>"; */
if (@$userGroups[$i]['account_id'] ==
$value['account_id'])
if (@$userGroups[$i]['account_id'] == $value['account_id'])
{
$groups_select .= ' checked';
}
@ -1269,7 +1270,7 @@
$var = Array(
'groups_select'
=> '<div style="overflow:auto; height:100px;width:150px>"' .
=> '<div id="groupselector">' .
"\n".$groups_select. '</div>' . "\n",
'primary_group_select'
=> '<select