This commit is contained in:
ceb 2003-04-27 20:28:34 +00:00
parent 0349874425
commit 9e5ae9f83b
3 changed files with 30 additions and 34 deletions

View File

@ -295,11 +295,10 @@
$GLOBALS['phpgw']->db->unlock(); $GLOBALS['phpgw']->db->unlock();
} }
function add_user() function add_user($values)
{ {
if ($GLOBALS['phpgw']->acl->check('account_access',4,'admin')) if ($GLOBALS['phpgw']->acl->check('account_access',4,'admin'))
{ {
ExecMethod('admin.uiaccounts.list_users');
return False; return False;
} }
@ -519,7 +518,6 @@
{ {
if ($GLOBALS['phpgw']->acl->check('account_access',16,'admin')) if ($GLOBALS['phpgw']->acl->check('account_access',16,'admin'))
{ {
ExecMethod('admin.uiaccounts.list_users');
return False; return False;
} }

View File

@ -471,22 +471,17 @@
function edit_user() function edit_user()
{ {
$cd = get_var('cd',array('GET')); $cd = get_var('cd',array('GET'));
$account_id = get_var('account_id',array('GET','POST')); $account_id = get_var('account_id',array('GET','POST'));
$values = get_var('values',array('POST')); $values = get_var('values',array('POST'));
$account_groups = get_var('account_groups',array('POST')); $account_groups = get_var('account_groups',array('POST'));
$account_permissions = get_var('account_permissions',array('POST')); $account_apps = get_var('account_apps',array('POST'));
if (!$account_id && $GLOBALS['phpgw']->acl->check('account_access',4,'admin')) _debug_array($values);
{
$this->list_user();
return False;
}
if ($account_id && $GLOBALS['phpgw']->acl->check('account_access',16,'admin')) if ($values['cancel'] || (!$account_id && $GLOBALS['phpgw']->acl->check('account_access',4,'admin')) || ($account_id && $GLOBALS['phpgw']->acl->check('account_access',16,'admin')))
{ {
$this->list_user(); $GLOBALS['phpgw']->redirect_link('/index.php','menuaction=admin.uiaccounts.list_users');
return False;
} }
/*$cdid = $cd; /*$cdid = $cd;
@ -541,6 +536,16 @@
$GLOBALS['phpgw']->xslttpl->add_file(array('app_data','users')); $GLOBALS['phpgw']->xslttpl->add_file(array('app_data','users'));
$GLOBALS['phpgw_info']['flags']['app_header'] = lang('administration') . ': ' . ($account_id?lang('edit user account'):lang('add user account')); $GLOBALS['phpgw_info']['flags']['app_header'] = lang('administration') . ': ' . ($account_id?lang('edit user account'):lang('add user account'));
if ($account_id)
{
$user_info = Array
(
'account_name' => $GLOBALS['phpgw']->accounts->id2name($account_id),
'account_user' => $this->bo->load_group_users($account_id),
'account_apps' => $this->bo->load_group_apps($account_id)
);
}
if (is_array($_userData)) if (is_array($_userData))
{ {
$userData = Array(); $userData = Array();
@ -682,17 +687,16 @@
); );
} }
$page_params['menuaction'] = 'admin.boaccounts.edit_user'; $page_params['menuaction'] = 'admin.uiaccounts.edit_user';
if($_account_id) if($account_id)
{ {
$page_params['account_id'] = $_account_id; $page_params['account_id'] = $account_id;
$page_params['old_loginid'] = rawurlencode($userData['account_lid']); $page_params['old_loginid'] = rawurlencode($userData['account_lid']);
} }
$data = array $data = array
( (
'edit_url' => $GLOBALS['phpgw']->link('/index.php',$page_params), 'edit_url' => $GLOBALS['phpgw']->link('/index.php',$page_params),
'cancel_url' => $GLOBALS['phpgw']->link('/index.php','menuaction=admin.uiaccounts.list_user'),
'lang_lid' => lang('loginid'), 'lang_lid' => lang('loginid'),
'lang_account_active' => lang('account active'), 'lang_account_active' => lang('account active'),
'lang_password' => lang('password'), 'lang_password' => lang('password'),

View File

@ -140,15 +140,15 @@
<!-- {rows} --> <!-- {rows} -->
</td> </td>
<td valign="top"> <td valign="top">
<xsl:variable name="edit_url"><xsl:value-of select="edit_url"/></xsl:variable>
<form method="POST" action="{$edit_url}">
<table border="0" width="100%"> <table border="0" width="100%">
<xsl:variable name="edit_url"><xsl:value-of select="edit_url"/></xsl:variable>
<xsl:variable name="account_id" select="account_id"/> <xsl:variable name="account_id" select="account_id"/>
<xsl:variable name="account_lid" select="account_lid"/> <xsl:variable name="account_lid" select="account_lid"/>
<xsl:variable name="account_firstname" select="account_firstname"/> <xsl:variable name="account_firstname" select="account_firstname"/>
<xsl:variable name="account_lastname" select="account_lastname"/> <xsl:variable name="account_lastname" select="account_lastname"/>
<xsl:variable name="account_passwd" select="account_passwd"/> <xsl:variable name="account_passwd" select="account_passwd"/>
<xsl:variable name="account_passwd_2" select="account_passwd_2"/> <xsl:variable name="account_passwd_2" select="account_passwd_2"/>
<form action="{$edit_url}" method="POST">
<input type="hidden" name="values[account_id]" value="{$account_id}"/> <input type="hidden" name="values[account_id]" value="{$account_id}"/>
<tr class="row_on"> <tr class="row_on">
<td width="25%"><xsl:value-of select="lang_lid"/></td> <td width="25%"><xsl:value-of select="lang_lid"/></td>
@ -221,24 +221,18 @@
</table> </table>
</td> </td>
</tr> </tr>
<tr height="50" valign="bottom">
<tr> <td colspan="3">
<td colspan="2">
<xsl:variable name="lang_save"><xsl:value-of select="lang_save"/></xsl:variable> <xsl:variable name="lang_save"><xsl:value-of select="lang_save"/></xsl:variable>
<input type="submit" name="values[save]" value="{$lang_save}"/> <input type="submit" name="values[save]" value="{$lang_save}"/>
</td> </td>
</tr> <td colspan="3" align="right">
</form> <xsl:variable name="lang_cancel"><xsl:value-of select="lang_cancel"/></xsl:variable>
<tr> <input type="submit" name="values[cancel]" value="{$lang_cancel}"/>
<xsl:variable name="cancel_url"><xsl:value-of select="cancel_url"/></xsl:variable>
<xsl:variable name="lang_done"><xsl:value-of select="lang_cancel"/></xsl:variable>
<form method="POST" action="{$cancel_url}">
<td>
<input type="submit" name="cancel" value="{$lang_cancel}"/>
</td> </td>
</form>
</tr> </tr>
</table> </table>
</form>
</td> </td>
</tr> </tr>
</table> </table>