mirror of
https://github.com/EGroupware/egroupware.git
synced 2025-06-25 04:11:49 +02:00
update
This commit is contained in:
parent
265ab3f48e
commit
4f6fc8d85a
@ -17,11 +17,10 @@
|
|||||||
var $public_functions = array
|
var $public_functions = array
|
||||||
(
|
(
|
||||||
'add_group' => True,
|
'add_group' => True,
|
||||||
'add_user' => True,
|
|
||||||
'delete_group' => True,
|
'delete_group' => True,
|
||||||
'delete_user' => True,
|
'delete_user' => True,
|
||||||
'edit_group' => True,
|
'edit_group' => True,
|
||||||
'edit_user' => True,
|
'save_user' => True,
|
||||||
'set_group_managers' => True
|
'set_group_managers' => True
|
||||||
);
|
);
|
||||||
|
|
||||||
@ -96,93 +95,6 @@
|
|||||||
return False;
|
return False;
|
||||||
}
|
}
|
||||||
|
|
||||||
function delete_group($account_id)
|
|
||||||
{
|
|
||||||
if ($GLOBALS['phpgw']->acl->check('group_access',32,'admin'))
|
|
||||||
{
|
|
||||||
return False;
|
|
||||||
}
|
|
||||||
|
|
||||||
$GLOBALS['phpgw']->db->lock(array
|
|
||||||
(
|
|
||||||
'phpgw_accounts',
|
|
||||||
'phpgw_acl'
|
|
||||||
)
|
|
||||||
);
|
|
||||||
|
|
||||||
$old_group_list = $GLOBALS['phpgw']->acl->get_ids_for_location($account_id,1,'phpgw_group');
|
|
||||||
|
|
||||||
@reset($old_group_list);
|
|
||||||
while($old_group_list && $id = each($old_group_list))
|
|
||||||
{
|
|
||||||
$GLOBALS['phpgw']->acl->delete_repository('phpgw_group',$account_id,intval($id[1]));
|
|
||||||
$GLOBALS['phpgw']->session->delete_cache(intval($id[1]));
|
|
||||||
}
|
|
||||||
|
|
||||||
$GLOBALS['phpgw']->acl->delete_repository('%%','run',$account_id);
|
|
||||||
|
|
||||||
if (! @rmdir($GLOBALS['phpgw_info']['server']['files_dir'].SEP.'groups'.SEP.$GLOBALS['phpgw']->accounts->id2name($account_id)))
|
|
||||||
{
|
|
||||||
$cd = 38;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
$cd = 32;
|
|
||||||
}
|
|
||||||
|
|
||||||
$GLOBALS['phpgw']->accounts->delete($account_id);
|
|
||||||
$GLOBALS['phpgw']->db->unlock();
|
|
||||||
}
|
|
||||||
|
|
||||||
function delete_user()
|
|
||||||
{
|
|
||||||
if (isset($GLOBALS['HTTP_POST_VARS']['cancel']) || $GLOBALS['phpgw']->acl->check('account_access',32,'admin'))
|
|
||||||
{
|
|
||||||
ExecMethod('admin.uiaccounts.list_users');
|
|
||||||
return False;
|
|
||||||
}
|
|
||||||
elseif($GLOBALS['HTTP_POST_VARS']['delete_account'])
|
|
||||||
{
|
|
||||||
$accountid = $GLOBALS['HTTP_POST_VARS']['account_id'];
|
|
||||||
settype($account_id,'integer');
|
|
||||||
$account_id = get_account_id($accountid);
|
|
||||||
$lid = $GLOBALS['phpgw']->accounts->id2name($account_id);
|
|
||||||
$db = $GLOBALS['phpgw']->db;
|
|
||||||
$db->query('SELECT app_name,app_order FROM phpgw_applications WHERE app_enabled!=0 ORDER BY app_order',__LINE__,__FILE__);
|
|
||||||
if($db->num_rows())
|
|
||||||
{
|
|
||||||
while($db->next_record())
|
|
||||||
{
|
|
||||||
$appname = $db->f('app_name');
|
|
||||||
|
|
||||||
if($appname <> 'admin')
|
|
||||||
{
|
|
||||||
$GLOBALS['phpgw']->hooks->single('deleteaccount', $appname);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
$GLOBALS['phpgw']->hooks->single('deleteaccount','preferences');
|
|
||||||
$GLOBALS['phpgw']->hooks->single('deleteaccount','admin');
|
|
||||||
|
|
||||||
$GLOBALS['hook_values']['account_id'] = $account_id;
|
|
||||||
$GLOBALS['phpgw']->hooks->process('deleteaccount');
|
|
||||||
|
|
||||||
$basedir = $GLOBALS['phpgw_info']['server']['files_dir'] . SEP . 'users' . SEP;
|
|
||||||
|
|
||||||
if (! @rmdir($basedir . $lid))
|
|
||||||
{
|
|
||||||
$cd = 34;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
$cd = 29;
|
|
||||||
}
|
|
||||||
|
|
||||||
ExecMethod('admin.uiaccounts.list_users');
|
|
||||||
return False;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
function add_group($values)
|
function add_group($values)
|
||||||
{
|
{
|
||||||
@ -295,60 +207,6 @@
|
|||||||
$GLOBALS['phpgw']->db->unlock();
|
$GLOBALS['phpgw']->db->unlock();
|
||||||
}
|
}
|
||||||
|
|
||||||
function add_user($values)
|
|
||||||
{
|
|
||||||
if ($GLOBALS['phpgw']->acl->check('account_access',4,'admin'))
|
|
||||||
{
|
|
||||||
return False;
|
|
||||||
}
|
|
||||||
|
|
||||||
if ($GLOBALS['HTTP_POST_VARS']['submit'])
|
|
||||||
{
|
|
||||||
$userData = array(
|
|
||||||
'account_type' => 'u',
|
|
||||||
'account_lid' => $GLOBALS['HTTP_POST_VARS']['account_lid'],
|
|
||||||
'account_firstname' => $GLOBALS['HTTP_POST_VARS']['account_firstname'],
|
|
||||||
'account_lastname' => $GLOBALS['HTTP_POST_VARS']['account_lastname'],
|
|
||||||
'account_passwd' => $GLOBALS['HTTP_POST_VARS']['account_passwd'],
|
|
||||||
'status' => ($GLOBALS['HTTP_POST_VARS']['account_status'] ? 'A' : ''),
|
|
||||||
'account_status' => ($GLOBALS['HTTP_POST_VARS']['account_status'] ? 'A' : ''),
|
|
||||||
'old_loginid' => ($GLOBALS['HTTP_GET_VARS']['old_loginid']?rawurldecode($GLOBALS['HTTP_GET_VARS']['old_loginid']):''),
|
|
||||||
'account_id' => ($GLOBALS['HTTP_GET_VARS']['account_id']?$GLOBALS['HTTP_GET_VARS']['account_id']:0),
|
|
||||||
'account_passwd_2' => $GLOBALS['HTTP_POST_VARS']['account_passwd_2'],
|
|
||||||
'account_groups' => $GLOBALS['HTTP_POST_VARS']['account_groups'],
|
|
||||||
'account_permissions' => $GLOBALS['HTTP_POST_VARS']['account_permissions'],
|
|
||||||
'homedirectory' => $GLOBALS['HTTP_POST_VARS']['homedirectory'],
|
|
||||||
'loginshell' => $GLOBALS['HTTP_POST_VARS']['loginshell'],
|
|
||||||
'account_expires_month' => $GLOBALS['HTTP_POST_VARS']['account_expires_month'],
|
|
||||||
'account_expires_day' => $GLOBALS['HTTP_POST_VARS']['account_expires_day'],
|
|
||||||
'account_expires_year' => $GLOBALS['HTTP_POST_VARS']['account_expires_year'],
|
|
||||||
'account_expires_never' => $GLOBALS['HTTP_POST_VARS']['never_expires']
|
|
||||||
/* 'file_space' => $GLOBALS['HTTP_POST_VARS']['account_file_space_number'] . "-" . $GLOBALS['HTTP_POST_VARS']['account_file_space_type'] */
|
|
||||||
);
|
|
||||||
|
|
||||||
if (!$errors = $this->validate_user($userData))
|
|
||||||
{
|
|
||||||
$this->so->add_user($userData);
|
|
||||||
$GLOBALS['hook_values']['account_lid'] = $userData['account_lid'];
|
|
||||||
$GLOBALS['hook_values']['account_id'] = $userData['account_id'];
|
|
||||||
$GLOBALS['hook_values']['new_passwd'] = $userData['account_passwd'];
|
|
||||||
$GLOBALS['phpgw']->hooks->process('addaccount');
|
|
||||||
ExecMethod('admin.uiaccounts.list_users');
|
|
||||||
return False;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
$ui = createobject('admin.uiaccounts');
|
|
||||||
$ui->create_edit_user($userData['account_id'],$userData,$errors);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
ExecMethod('admin.uiaccounts.list_users');
|
|
||||||
return False;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
function edit_group($values)
|
function edit_group($values)
|
||||||
{
|
{
|
||||||
if ($GLOBALS['phpgw']->acl->check('group_access',16,'admin'))
|
if ($GLOBALS['phpgw']->acl->check('group_access',16,'admin'))
|
||||||
@ -514,61 +372,129 @@
|
|||||||
$GLOBALS['phpgw']->db->unlock();
|
$GLOBALS['phpgw']->db->unlock();
|
||||||
}
|
}
|
||||||
|
|
||||||
function edit_user()
|
function save_user($values)
|
||||||
{
|
{
|
||||||
if ($GLOBALS['phpgw']->acl->check('account_access',16,'admin'))
|
if (is_array($values))
|
||||||
{
|
{
|
||||||
return False;
|
if($values['expires_never'])
|
||||||
}
|
{
|
||||||
|
$values['expires'] = $values['account_expires'] = -1;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$values['expires'] = $values['account_expires'] = mktime(2,0,0,$values['account_expires_month'],$values['account_expires_day'],$values['account_expires_year']);
|
||||||
|
}
|
||||||
|
|
||||||
if ($GLOBALS['HTTP_POST_VARS']['submit'])
|
$userData = array
|
||||||
{
|
(
|
||||||
$userData = array(
|
'account_type' => 'u',
|
||||||
'account_lid' => $GLOBALS['HTTP_POST_VARS']['account_lid'],
|
'account_lid' => $values['account_lid'],
|
||||||
'firstname' => $GLOBALS['HTTP_POST_VARS']['account_firstname'],
|
'account_firstname' => $values['account_firstname'],
|
||||||
'lastname' => $GLOBALS['HTTP_POST_VARS']['account_lastname'],
|
'account_lastname' => $values['account_lastname'],
|
||||||
'account_passwd' => $GLOBALS['HTTP_POST_VARS']['account_passwd'],
|
'account_passwd' => $values['account_passwd'],
|
||||||
'status' => ($GLOBALS['HTTP_POST_VARS']['account_status'] ? 'A' : ''),
|
'status' => ($values['account_status'] ? 'A' : ''),
|
||||||
'account_status' => ($GLOBALS['HTTP_POST_VARS']['account_status'] ? 'A' : ''),
|
'account_status' => ($values['account_status'] ? 'A' : ''),
|
||||||
'old_loginid' => ($GLOBALS['HTTP_GET_VARS']['old_loginid']?rawurldecode($GLOBALS['HTTP_GET_VARS']['old_loginid']):''),
|
'old_loginid' => ($values['old_loginid']?rawurldecode($GLOBALS['HTTP_GET_VARS']['old_loginid']):''),
|
||||||
'account_id' => ($GLOBALS['HTTP_GET_VARS']['account_id']?$GLOBALS['HTTP_GET_VARS']['account_id']:0),
|
'account_id' => ($values['account_id']?$GLOBALS['HTTP_GET_VARS']['account_id']:0),
|
||||||
'account_passwd_2' => $GLOBALS['HTTP_POST_VARS']['account_passwd_2'],
|
'account_passwd_2' => $values['account_passwd_2'],
|
||||||
'account_groups' => $GLOBALS['HTTP_POST_VARS']['account_groups'],
|
'account_groups' => $values['account_groups'],
|
||||||
'account_permissions' => $GLOBALS['HTTP_POST_VARS']['account_permissions'],
|
'account_permissions' => $values['account_permissions'],
|
||||||
'homedirectory' => $GLOBALS['HTTP_POST_VARS']['homedirectory'],
|
'homedirectory' => $values['homedirectory'],
|
||||||
'loginshell' => $GLOBALS['HTTP_POST_VARS']['loginshell'],
|
'loginshell' => $values['loginshell'],
|
||||||
'account_expires_month' => $GLOBALS['HTTP_POST_VARS']['account_expires_month'],
|
'account_expires_month' => $values['account_expires_month'],
|
||||||
'account_expires_day' => $GLOBALS['HTTP_POST_VARS']['account_expires_day'],
|
'account_expires_day' => $values['account_expires_day'],
|
||||||
'account_expires_year' => $GLOBALS['HTTP_POST_VARS']['account_expires_year'],
|
'account_expires_year' => $values['account_expires_year'],
|
||||||
'account_expires_never' => $GLOBALS['HTTP_POST_VARS']['never_expires']
|
'account_expires_never' => $values['expires'],
|
||||||
|
'expires' => $values['expires'],
|
||||||
|
'account_expires' => $values['expires']
|
||||||
/* 'file_space' => $GLOBALS['HTTP_POST_VARS']['account_file_space_number'] . "-" . $GLOBALS['HTTP_POST_VARS']['account_file_space_type'] */
|
/* 'file_space' => $GLOBALS['HTTP_POST_VARS']['account_file_space_number'] . "-" . $GLOBALS['HTTP_POST_VARS']['account_file_space_type'] */
|
||||||
);
|
);
|
||||||
|
|
||||||
if (!$errors = $this->validate_user($userData))
|
if ($values['account_id'])
|
||||||
{
|
{
|
||||||
$this->save_user($userData);
|
$userData['account_id'] = $values['account_id'];
|
||||||
// check if would create a menu
|
$this->update_user($userData);
|
||||||
|
/* check if would create a menu
|
||||||
// if we do, we can't return to the users list, because
|
// if we do, we can't return to the users list, because
|
||||||
// there are also some other plugins
|
// there are also some other plugins
|
||||||
if (!ExecMethod('admin.uimenuclass.createHTMLCode','edit_user'))
|
if (!ExecMethod('admin.uimenuclass.createHTMLCode','edit_user'))
|
||||||
{
|
{
|
||||||
ExecMethod('admin.uiaccounts.list_users');
|
}*/
|
||||||
return False;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
ExecMethod('admin.uiaccounts.edit_user',$GLOBALS['HTTP_GET_VARS']['account_id']);
|
|
||||||
return False;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$ui = createobject('admin.uiaccounts');
|
$account_id = $this->so->add_user($userData);
|
||||||
$ui->create_edit_user($userData['account_id'],$userData,$errors);
|
$GLOBALS['hook_values']['account_lid'] = $userData['account_lid'];
|
||||||
|
$GLOBALS['hook_values']['account_id'] = $account_id; //$userData['account_id'];
|
||||||
|
$GLOBALS['hook_values']['new_passwd'] = $userData['account_passwd'];
|
||||||
|
$GLOBALS['phpgw']->hooks->process('addaccount');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* stores the userdata */
|
||||||
|
function update_user($userData)
|
||||||
|
{
|
||||||
|
$account = CreateObject('phpgwapi.accounts',$userData['account_id'],'u');
|
||||||
|
$account->update_data($userData);
|
||||||
|
$account->save_repository();
|
||||||
|
if ($userData['account_passwd'])
|
||||||
|
{
|
||||||
|
$auth = CreateObject('phpgwapi.auth');
|
||||||
|
$auth->change_password($old_passwd,$userData['account_passwd'],$userData['account_id']);
|
||||||
|
$GLOBALS['hook_values']['account_id'] = $userData['account_id'];
|
||||||
|
$GLOBALS['hook_values']['old_passwd'] = $old_passwd;
|
||||||
|
$GLOBALS['hook_values']['new_passwd'] = $userData['account_passwd'];
|
||||||
|
$GLOBALS['phpgw']->hooks->process('changepassword');
|
||||||
|
}
|
||||||
|
|
||||||
|
$apps = CreateObject('phpgwapi.applications',array(intval($userData['account_id']),'u'));
|
||||||
|
|
||||||
|
$apps->account_id = $userData['account_id'];
|
||||||
|
if ($_userData['account_permissions'])
|
||||||
|
{
|
||||||
|
while($app = each($userData['account_permissions']))
|
||||||
|
{
|
||||||
|
if($app[1])
|
||||||
|
{
|
||||||
|
$apps->add($app[0]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
$apps->save_repository();
|
||||||
|
|
||||||
|
$account = CreateObject('phpgwapi.accounts',$userData['account_id'],'u');
|
||||||
|
$allGroups = $account->get_list('groups');
|
||||||
|
|
||||||
|
if ($userData['account_groups'])
|
||||||
|
{
|
||||||
|
reset($userData['account_groups']);
|
||||||
|
while (list($key,$value) = each($userData['account_groups']))
|
||||||
|
{
|
||||||
|
$newGroups[$value] = $value;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
$acl = CreateObject('phpgwapi.acl',$userData['account_id']);
|
||||||
|
|
||||||
|
reset($allGroups);
|
||||||
|
while (list($key,$groupData) = each($allGroups))
|
||||||
|
{
|
||||||
|
/* print "$key,". $groupData['account_id'] ."<br>";*/
|
||||||
|
/* print "$key,". $userData['account_groups'][1] ."<br>"; */
|
||||||
|
|
||||||
|
if ($newGroups[$groupData['account_id']])
|
||||||
|
{
|
||||||
|
$acl->add_repository('phpgw_group',$groupData['account_id'],$userData['account_id'],1);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$acl->delete_repository('phpgw_group',$groupData['account_id'],$userData['account_id']);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
$GLOBALS['phpgw']->session->delete_cache(intval($userData['account_id']));
|
||||||
|
}
|
||||||
|
|
||||||
function set_group_managers()
|
function set_group_managers()
|
||||||
{
|
{
|
||||||
if($GLOBALS['phpgw']->acl->check('group_access',16,'admin') || $GLOBALS['HTTP_POST_VARS']['cancel'])
|
if($GLOBALS['phpgw']->acl->check('group_access',16,'admin') || $GLOBALS['HTTP_POST_VARS']['cancel'])
|
||||||
@ -604,9 +530,9 @@
|
|||||||
$group = CreateObject('phpgwapi.accounts',$values['account_id'],'g');
|
$group = CreateObject('phpgwapi.accounts',$values['account_id'],'g');
|
||||||
$group->read_repository();
|
$group->read_repository();
|
||||||
|
|
||||||
if ($GLOBALS['phpgw']->acl->check('group_access',4,'admin'))
|
if (!$values['account_id'] && $GLOBALS['phpgw']->acl->check('group_access',4,'admin'))
|
||||||
{
|
{
|
||||||
$error[] = lang('no permission to create groups');
|
$error[] = lang('no permission to add groups');
|
||||||
}
|
}
|
||||||
|
|
||||||
if(!$values['account_name'])
|
if(!$values['account_name'])
|
||||||
@ -638,45 +564,44 @@
|
|||||||
returns FALSE if the data are correct
|
returns FALSE if the data are correct
|
||||||
otherwise the error array
|
otherwise the error array
|
||||||
*/
|
*/
|
||||||
function validate_user(&$_userData)
|
function validate_user($values)
|
||||||
{
|
{
|
||||||
$totalerrors = 0;
|
if (!$values['account_id'] && $GLOBALS['phpgw']->acl->check('account_access',4,'admin'))
|
||||||
|
{
|
||||||
|
$error[] = lang('no permission to add users');
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
if ($GLOBALS['phpgw_info']['server']['account_repository'] == 'ldap' && ! $allow_long_loginids)
|
if ($GLOBALS['phpgw_info']['server']['account_repository'] == 'ldap' && ! $values['allow_long_loginids'])
|
||||||
{
|
{
|
||||||
if (strlen($_userData['account_lid']) > 8)
|
if (strlen($values['account_lid']) > 8)
|
||||||
{
|
{
|
||||||
$error[$totalerrors] = lang('The loginid can not be more then 8 characters');
|
$error[] = lang('The loginid can not be more then 8 characters');
|
||||||
$totalerrors++;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
*/
|
*/
|
||||||
|
|
||||||
if (!$_userData['account_lid'])
|
if (!$values['account_lid'])
|
||||||
{
|
{
|
||||||
$error[$totalerrors] = lang('You must enter a loginid');
|
$error[] = lang('You must enter a loginid');
|
||||||
$totalerrors++;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($_userData['old_loginid'] != $_userData['account_lid'])
|
if ($values['old_loginid'] != $values['account_lid'])
|
||||||
{
|
{
|
||||||
if ($GLOBALS['phpgw']->accounts->exists($_userData['account_lid']))
|
if ($GLOBALS['phpgw']->accounts->exists($values['account_lid']))
|
||||||
{
|
{
|
||||||
$error[$totalerrors] = lang('That loginid has already been taken');
|
$error[] = lang('That loginid has already been taken');
|
||||||
$totalerrors++;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($_userData['account_passwd'] || $_userData['account_passwd_2'])
|
if ($values['account_passwd'] || $values['account_passwd_2'])
|
||||||
{
|
{
|
||||||
if ($_userData['account_passwd'] != $_userData['account_passwd_2'])
|
if ($values['account_passwd'] != $values['account_passwd_2'])
|
||||||
{
|
{
|
||||||
$error[$totalerrors] = lang('The two passwords are not the same');
|
$error[] = lang('The two passwords are not the same');
|
||||||
$totalerrors++;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
$temp_msgbox_data = $GLOBALS['phpgw_info']['flags']['msgbox_data'];
|
/* $temp_msgbox_data = $GLOBALS['phpgw_info']['flags']['msgbox_data'];
|
||||||
unset($GLOBALS['phpgw_info']['flags']['msgbox_data']);
|
unset($GLOBALS['phpgw_info']['flags']['msgbox_data']);
|
||||||
if(!sanitize($_userData['account_passwd'],'password'))
|
if(!sanitize($_userData['account_passwd'],'password'))
|
||||||
{
|
{
|
||||||
@ -688,40 +613,20 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
$GLOBALS['phpgw_info']['flags']['msgbox_data'] = $temp_msgbox_data;
|
$GLOBALS['phpgw_info']['flags']['msgbox_data'] = $temp_msgbox_data;
|
||||||
unset($temp_msgbox_data);
|
unset($temp_msgbox_data); */
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!count($_userData['account_permissions']) && !count($_userData['account_groups']))
|
if (!count($values['account_permissions']) && !count($values['account_groups']))
|
||||||
{
|
{
|
||||||
$error[$totalerrors] = lang('You must add at least 1 permission or group to this account');
|
$error[] = lang('You must add at least 1 permission or group to this account');
|
||||||
$totalerrors++;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($_userData['account_expires_month'] || $_userData['account_expires_day'] || $_userData['account_expires_year'] || $_userData['account_expires_never'])
|
if ($values['account_expires_month'] || $values['account_expires_day'] || $values['account_expires_year'] || $values['account_expires_never'])
|
||||||
{
|
{
|
||||||
if($_userData['account_expires_never'])
|
if (! checkdate($values['account_expires_month'],$values['account_expires_day'],$values['account_expires_year']))
|
||||||
{
|
{
|
||||||
$_userData['expires'] = -1;
|
$error[] = lang('You have entered an invalid expiration date');
|
||||||
$_userData['account_expires'] = $_userData['expires'];
|
|
||||||
}
|
}
|
||||||
else
|
|
||||||
{
|
|
||||||
if (! checkdate($_userData['account_expires_month'],$_userData['account_expires_day'],$_userData['account_expires_year']))
|
|
||||||
{
|
|
||||||
$error[$totalerrors] = lang('You have entered an invalid expiration date');
|
|
||||||
$totalerrors++;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
$_userData['expires'] = mktime(2,0,0,$_userData['account_expires_month'],$_userData['account_expires_day'],$_userData['account_expires_year']);
|
|
||||||
$_userData['account_expires'] = $_userData['expires'];
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
$_userData['expires'] = -1;
|
|
||||||
$_userData['account_expires'] = $_userData['expires'];
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -733,77 +638,99 @@
|
|||||||
}
|
}
|
||||||
*/
|
*/
|
||||||
|
|
||||||
if ($totalerrors == 0)
|
if (is_array($error))
|
||||||
{
|
|
||||||
return FALSE;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
{
|
||||||
return $error;
|
return $error;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* stores the userdata */
|
|
||||||
function save_user($_userData)
|
function delete_group($account_id)
|
||||||
{
|
{
|
||||||
$account = CreateObject('phpgwapi.accounts',$_userData['account_id'],'u');
|
if ($GLOBALS['phpgw']->acl->check('group_access',32,'admin'))
|
||||||
$account->update_data($_userData);
|
|
||||||
$account->save_repository();
|
|
||||||
if ($_userData['account_passwd'])
|
|
||||||
{
|
{
|
||||||
$auth = CreateObject('phpgwapi.auth');
|
return False;
|
||||||
$auth->change_password($old_passwd, $_userData['account_passwd'], $_userData['account_id']);
|
|
||||||
$GLOBALS['hook_values']['account_id'] = $_userData['account_id'];
|
|
||||||
$GLOBALS['hook_values']['old_passwd'] = $old_passwd;
|
|
||||||
$GLOBALS['hook_values']['new_passwd'] = $_userData['account_passwd'];
|
|
||||||
$GLOBALS['phpgw']->hooks->process('changepassword');
|
|
||||||
}
|
}
|
||||||
|
|
||||||
$apps = CreateObject('phpgwapi.applications',array(intval($_userData['account_id']),'u'));
|
$GLOBALS['phpgw']->db->lock(array
|
||||||
|
(
|
||||||
|
'phpgw_accounts',
|
||||||
|
'phpgw_acl'
|
||||||
|
)
|
||||||
|
);
|
||||||
|
|
||||||
$apps->account_id = $_userData['account_id'];
|
$old_group_list = $GLOBALS['phpgw']->acl->get_ids_for_location($account_id,1,'phpgw_group');
|
||||||
if ($_userData['account_permissions'])
|
|
||||||
|
@reset($old_group_list);
|
||||||
|
while($old_group_list && $id = each($old_group_list))
|
||||||
{
|
{
|
||||||
while($app = each($_userData['account_permissions']))
|
$GLOBALS['phpgw']->acl->delete_repository('phpgw_group',$account_id,intval($id[1]));
|
||||||
|
$GLOBALS['phpgw']->session->delete_cache(intval($id[1]));
|
||||||
|
}
|
||||||
|
|
||||||
|
$GLOBALS['phpgw']->acl->delete_repository('%%','run',$account_id);
|
||||||
|
|
||||||
|
if (! @rmdir($GLOBALS['phpgw_info']['server']['files_dir'].SEP.'groups'.SEP.$GLOBALS['phpgw']->accounts->id2name($account_id)))
|
||||||
|
{
|
||||||
|
$cd = 38;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$cd = 32;
|
||||||
|
}
|
||||||
|
|
||||||
|
$GLOBALS['phpgw']->accounts->delete($account_id);
|
||||||
|
$GLOBALS['phpgw']->db->unlock();
|
||||||
|
}
|
||||||
|
|
||||||
|
function delete_user()
|
||||||
|
{
|
||||||
|
if (isset($GLOBALS['HTTP_POST_VARS']['cancel']) || $GLOBALS['phpgw']->acl->check('account_access',32,'admin'))
|
||||||
|
{
|
||||||
|
ExecMethod('admin.uiaccounts.list_users');
|
||||||
|
return False;
|
||||||
|
}
|
||||||
|
elseif($GLOBALS['HTTP_POST_VARS']['delete_account'])
|
||||||
|
{
|
||||||
|
$accountid = $GLOBALS['HTTP_POST_VARS']['account_id'];
|
||||||
|
settype($account_id,'integer');
|
||||||
|
$account_id = get_account_id($accountid);
|
||||||
|
$lid = $GLOBALS['phpgw']->accounts->id2name($account_id);
|
||||||
|
$db = $GLOBALS['phpgw']->db;
|
||||||
|
$db->query('SELECT app_name,app_order FROM phpgw_applications WHERE app_enabled!=0 ORDER BY app_order',__LINE__,__FILE__);
|
||||||
|
if($db->num_rows())
|
||||||
{
|
{
|
||||||
if($app[1])
|
while($db->next_record())
|
||||||
{
|
{
|
||||||
$apps->add($app[0]);
|
$appname = $db->f('app_name');
|
||||||
|
|
||||||
|
if($appname <> 'admin')
|
||||||
|
{
|
||||||
|
$GLOBALS['phpgw']->hooks->single('deleteaccount', $appname);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
$apps->save_repository();
|
|
||||||
|
|
||||||
$account = CreateObject('phpgwapi.accounts',$_userData['account_id'],'u');
|
$GLOBALS['phpgw']->hooks->single('deleteaccount','preferences');
|
||||||
$allGroups = $account->get_list('groups');
|
$GLOBALS['phpgw']->hooks->single('deleteaccount','admin');
|
||||||
|
|
||||||
if ($_userData['account_groups'])
|
$GLOBALS['hook_values']['account_id'] = $account_id;
|
||||||
{
|
$GLOBALS['phpgw']->hooks->process('deleteaccount');
|
||||||
reset($_userData['account_groups']);
|
|
||||||
while (list($key,$value) = each($_userData['account_groups']))
|
$basedir = $GLOBALS['phpgw_info']['server']['files_dir'] . SEP . 'users' . SEP;
|
||||||
|
|
||||||
|
if (! @rmdir($basedir . $lid))
|
||||||
{
|
{
|
||||||
$newGroups[$value] = $value;
|
$cd = 34;
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
$acl = CreateObject('phpgwapi.acl',$_userData['account_id']);
|
|
||||||
|
|
||||||
reset($allGroups);
|
|
||||||
while (list($key,$groupData) = each($allGroups))
|
|
||||||
{
|
|
||||||
/* print "$key,". $groupData['account_id'] ."<br>";*/
|
|
||||||
/* print "$key,". $_userData['account_groups'][1] ."<br>"; */
|
|
||||||
|
|
||||||
if ($newGroups[$groupData['account_id']])
|
|
||||||
{
|
|
||||||
$acl->add_repository('phpgw_group',$groupData['account_id'],$_userData['account_id'],1);
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$acl->delete_repository('phpgw_group',$groupData['account_id'],$_userData['account_id']);
|
$cd = 29;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ExecMethod('admin.uiaccounts.list_users');
|
||||||
|
return False;
|
||||||
}
|
}
|
||||||
$GLOBALS['phpgw']->session->delete_cache(intval($_userData['account_id']));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function load_group_users($account_id)
|
function load_group_users($account_id)
|
||||||
|
@ -19,9 +19,10 @@
|
|||||||
|
|
||||||
function add_user($userData)
|
function add_user($userData)
|
||||||
{
|
{
|
||||||
$userData['account_expires'] = $userData['expires'];
|
$GLOBALS['phpgw']->db->lock
|
||||||
$GLOBALS['phpgw']->db->lock(
|
(
|
||||||
Array(
|
array
|
||||||
|
(
|
||||||
'phpgw_accounts',
|
'phpgw_accounts',
|
||||||
'phpgw_nextid',
|
'phpgw_nextid',
|
||||||
'phpgw_preferences',
|
'phpgw_preferences',
|
||||||
|
@ -293,7 +293,7 @@
|
|||||||
|
|
||||||
if (is_array($error))
|
if (is_array($error))
|
||||||
{
|
{
|
||||||
|
$error_list = $GLOBALS['phpgw']->common->error_list($error);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -364,7 +364,6 @@
|
|||||||
$account_list = $accounts->get_list('accounts');
|
$account_list = $accounts->get_list('accounts');
|
||||||
$account_num = count($account_list);
|
$account_num = count($account_list);
|
||||||
|
|
||||||
$user_list = '';
|
|
||||||
while (list($key,$entry) = each($account_list))
|
while (list($key,$entry) = each($account_list))
|
||||||
{
|
{
|
||||||
$user_list[] = array
|
$user_list[] = array
|
||||||
@ -446,12 +445,12 @@
|
|||||||
|
|
||||||
$data = array
|
$data = array
|
||||||
(
|
(
|
||||||
|
'msgbox_data' => $error_list,
|
||||||
'edit_url' => $GLOBALS['phpgw']->link('/index.php',$link_data),
|
'edit_url' => $GLOBALS['phpgw']->link('/index.php',$link_data),
|
||||||
'account_id' => $group_info['account_id'],
|
'account_id' => $group_info['account_id'],
|
||||||
'lang_account_name' => lang('group name'),
|
'lang_account_name' => lang('group name'),
|
||||||
'value_account_name' => $group_info['account_name'],
|
'value_account_name' => $group_info['account_name'],
|
||||||
'lang_include_user' => lang('select users for inclusion'),
|
'lang_include_user' => lang('select users for inclusion'),
|
||||||
'error' => (!$_errors?'':$GLOBALS['phpgw']->common->error_list($_errors)),
|
|
||||||
'select_size' => ($account_num < 5?$account_num:5),
|
'select_size' => ($account_num < 5?$account_num:5),
|
||||||
'user_list' => $user_list,
|
'user_list' => $user_list,
|
||||||
'lang_permissions' => lang('permissions this group has'),
|
'lang_permissions' => lang('permissions this group has'),
|
||||||
@ -471,13 +470,11 @@
|
|||||||
|
|
||||||
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_apps = get_var('account_apps',array('POST'));
|
$account_permissions = get_var('account_permissions',array('POST'));
|
||||||
|
|
||||||
_debug_array($values);
|
|
||||||
|
|
||||||
if ($values['cancel'] || (!$account_id && $GLOBALS['phpgw']->acl->check('account_access',4,'admin')) || ($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')))
|
||||||
{
|
{
|
||||||
@ -494,34 +491,30 @@
|
|||||||
|
|
||||||
if ($values['save'])
|
if ($values['save'])
|
||||||
{
|
{
|
||||||
|
if (is_array($account_groups))
|
||||||
|
{
|
||||||
|
$values['account_groups'] = $account_groups;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (is_array($account_permissions))
|
||||||
|
{
|
||||||
|
$values['account_permissions'] = $account_permissions;
|
||||||
|
}
|
||||||
|
|
||||||
$error = $this->bo->validate_user($values);
|
$error = $this->bo->validate_user($values);
|
||||||
|
|
||||||
if (is_array($error))
|
if (is_array($error))
|
||||||
{
|
{
|
||||||
|
$error_list = $GLOBALS['phpgw']->common->error_list($error);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (is_array($account_groups))
|
if ($account_id)
|
||||||
{
|
{
|
||||||
$values['account_groups'] = $account_groups;
|
$values['account_id'] = $account_id;
|
||||||
}
|
|
||||||
|
|
||||||
if (is_array($account_permissions))
|
|
||||||
{
|
|
||||||
$values['account_permissions'] = $account_permissions;
|
|
||||||
}
|
|
||||||
|
|
||||||
if ($values['account_id'])
|
|
||||||
{
|
|
||||||
$this->bo->edit_user($values);
|
|
||||||
$account_id = $values['account_id'];
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
$this->bo->add_user($values);
|
|
||||||
Header('Location: ' . $GLOBALS['phpgw']->link('/index.php','menuaction=admin.uiaccounts.list_user'));
|
|
||||||
}
|
}
|
||||||
|
$this->bo->save_user($values);
|
||||||
|
$GLOBALS['phpgw']->redirect_link('/index.php','menuaction=admin.uiaccounts.list_users');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -546,50 +539,34 @@
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (is_array($_userData))
|
if($account_id)
|
||||||
{
|
{
|
||||||
$userData = Array();
|
$account = CreateObject('phpgwapi.accounts',intval($account_id),'u');
|
||||||
$userData=$_userData;
|
$userData = $account->read_repository();
|
||||||
@reset($userData['account_groups']);
|
$userGroups = $account->membership($account_id);
|
||||||
while (list($key, $value) = @each($userData['account_groups']))
|
|
||||||
{
|
|
||||||
$userGroups[$key]['account_id'] = $value;
|
|
||||||
}
|
|
||||||
|
|
||||||
$account = CreateObject('phpgwapi.accounts');
|
|
||||||
$allGroups = $account->get_list('groups');
|
|
||||||
}
|
}
|
||||||
elseif(is_string($_userData) && $_userData=='')
|
else
|
||||||
{
|
{
|
||||||
if($_account_id)
|
$account = CreateObject('phpgwapi.accounts');
|
||||||
{
|
$userData = Array();
|
||||||
$account = CreateObject('phpgwapi.accounts',intval($_account_id),'u');
|
$userData['status'] = 'A';
|
||||||
$userData = $account->read_repository();
|
$userGroups = Array();
|
||||||
$userGroups = $account->membership($_account_id);
|
}
|
||||||
}
|
$allGroups = $account->get_list('groups');
|
||||||
else
|
|
||||||
{
|
|
||||||
$account = CreateObject('phpgwapi.accounts');
|
|
||||||
$userData = Array();
|
|
||||||
$userData['status'] = 'A';
|
|
||||||
$userGroups = Array();
|
|
||||||
}
|
|
||||||
$allGroups = $account->get_list('groups');
|
|
||||||
|
|
||||||
if ($userData['expires'] == -1)
|
if ($userData['expires'] == -1)
|
||||||
{
|
{
|
||||||
$userData['account_expires_month'] = 0;
|
$userData['account_expires_month'] = 0;
|
||||||
$userData['account_expires_day'] = 0;
|
$userData['account_expires_day'] = 0;
|
||||||
$userData['account_expires_year'] = 0;
|
$userData['account_expires_year'] = 0;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
/* Change this to be an admin/setup setting. For now, default to expire one week from today. */
|
/* Change this to be an admin/setup setting. For now, default to expire one week from today. */
|
||||||
$time_var = time() + (60*60*24*7);
|
$time_var = time() + (60*60*24*7);
|
||||||
$userData['account_expires_month'] = date('m',$userData['expires'] > 0 ? $userData['expires'] : $time_var);
|
$userData['account_expires_month'] = date('m',$userData['expires'] > 0 ? $userData['expires'] : $time_var);
|
||||||
$userData['account_expires_day'] = date('d',$userData['expires'] > 0 ? $userData['expires'] : $time_var);
|
$userData['account_expires_day'] = date('d',$userData['expires'] > 0 ? $userData['expires'] : $time_var);
|
||||||
$userData['account_expires_year'] = date('Y',$userData['expires'] > 0 ? $userData['expires'] : $time_var);
|
$userData['account_expires_year'] = date('Y',$userData['expires'] > 0 ? $userData['expires'] : $time_var);
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($GLOBALS['phpgw_info']['server']['ldap_extra_attributes'])
|
if ($GLOBALS['phpgw_info']['server']['ldap_extra_attributes'])
|
||||||
@ -597,10 +574,10 @@
|
|||||||
$lang_homedir = lang('home directory');
|
$lang_homedir = lang('home directory');
|
||||||
$lang_shell = lang('login shell');
|
$lang_shell = lang('login shell');
|
||||||
$homedirectory = '<input name="homedirectory" value="'
|
$homedirectory = '<input name="homedirectory" value="'
|
||||||
. ($_account_id?$userData['homedirectory']:$GLOBALS['phpgw_info']['server']['ldap_account_home'].SEP.$account_lid)
|
. ($account_id?$userData['homedirectory']:$GLOBALS['phpgw_info']['server']['ldap_account_home'].SEP.$account_lid)
|
||||||
. '">';
|
. '">';
|
||||||
$loginshell = '<input name="loginshell" value="'
|
$loginshell = '<input name="loginshell" value="'
|
||||||
. ($_account_id?$userData['loginshell']:$GLOBALS['phpgw_info']['server']['ldap_account_shell'])
|
. ($account_id?$userData['loginshell']:$GLOBALS['phpgw_info']['server']['ldap_account_shell'])
|
||||||
. '">';
|
. '">';
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -635,7 +612,6 @@
|
|||||||
$t->set_var($var);
|
$t->set_var($var);
|
||||||
*/
|
*/
|
||||||
|
|
||||||
$groups_select = '';
|
|
||||||
reset($allGroups);
|
reset($allGroups);
|
||||||
while (list($key,$value) = each($allGroups))
|
while (list($key,$value) = each($allGroups))
|
||||||
{
|
{
|
||||||
@ -644,20 +620,22 @@
|
|||||||
'account_id' => $value['account_id'],
|
'account_id' => $value['account_id'],
|
||||||
'account_lid' => $value['account_lid']
|
'account_lid' => $value['account_lid']
|
||||||
);
|
);
|
||||||
|
}
|
||||||
|
|
||||||
for ($i=0; $i<count($userGroups); $i++)
|
for ($i=0;$i<count($userGroups);$i++)
|
||||||
|
{
|
||||||
|
for($j=0;$j<count($group_list);$j++)
|
||||||
{
|
{
|
||||||
/* print "Los1:".$userData["account_id"].$userGroups[$i]['account_id']." : ".$value['account_id']."<br>"; */
|
if ($userGroups[$i]['account_id'] == $group_list[$j]['account_id'])
|
||||||
if (@$userGroups[$i]['account_id'] == $value['account_id'])
|
|
||||||
{
|
{
|
||||||
$group_list[]['selected'] = 'yes';
|
$group_list[$j]['selected'] = 'yes';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* create list of available apps */
|
/* create list of available apps */
|
||||||
$i = 0;
|
$i = 0;
|
||||||
$apps = CreateObject('phpgwapi.applications',$_account_id);
|
$apps = CreateObject('phpgwapi.applications',$account_id);
|
||||||
$db_perms = $apps->read_account_specific();
|
$db_perms = $apps->read_account_specific();
|
||||||
|
|
||||||
@reset($GLOBALS['phpgw_info']['apps']);
|
@reset($GLOBALS['phpgw_info']['apps']);
|
||||||
@ -696,6 +674,7 @@
|
|||||||
|
|
||||||
$data = array
|
$data = array
|
||||||
(
|
(
|
||||||
|
'msgbox_data' => $error_list,
|
||||||
'edit_url' => $GLOBALS['phpgw']->link('/index.php',$page_params),
|
'edit_url' => $GLOBALS['phpgw']->link('/index.php',$page_params),
|
||||||
'lang_lid' => lang('loginid'),
|
'lang_lid' => lang('loginid'),
|
||||||
'lang_account_active' => lang('account active'),
|
'lang_account_active' => lang('account active'),
|
||||||
@ -720,7 +699,7 @@
|
|||||||
'account_lastname' => $userData['lastname'],
|
'account_lastname' => $userData['lastname'],
|
||||||
'account_passwd' => $account_passwd,
|
'account_passwd' => $account_passwd,
|
||||||
'account_passwd_2' => $account_passwd_2,
|
'account_passwd_2' => $account_passwd_2,
|
||||||
'expires' => (($userData['expires'] == -1)?'yes':''),
|
'expires_never' => (($userData['expires'] == -1)?'yes':''),
|
||||||
'group_list' => $group_list,
|
'group_list' => $group_list,
|
||||||
'app_list' => $app_list
|
'app_list' => $app_list
|
||||||
);
|
);
|
||||||
|
@ -92,6 +92,17 @@
|
|||||||
'global_cats' => $global_cats
|
'global_cats' => $global_cats
|
||||||
);
|
);
|
||||||
|
|
||||||
|
if ($_POST['add'])
|
||||||
|
{
|
||||||
|
$link_data['menuaction'] = 'admin.uicategories.edit';
|
||||||
|
$GLOBALS['phpgw']->redirect_link('/index.php',$link_data);
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($_POST['done'])
|
||||||
|
{
|
||||||
|
$GLOBALS['phpgw']->redirect_link('/index.php','menuaction=admin.iumainscreen.mainscreen');
|
||||||
|
}
|
||||||
|
|
||||||
if ($GLOBALS['appname'])
|
if ($GLOBALS['appname'])
|
||||||
{
|
{
|
||||||
$GLOBALS['phpgw_info']['flags']['app_header'] = lang($GLOBALS['appname']) . ' ' . lang('global categories') . ': ' . lang('category list');
|
$GLOBALS['phpgw_info']['flags']['app_header'] = lang($GLOBALS['appname']) . ' ' . lang('global categories') . ': ' . lang('category list');
|
||||||
@ -211,17 +222,16 @@
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
$link_data['menuaction'] = 'admin.uicategories.edit';
|
$link_data['menuaction'] = 'admin.uicategories.index';
|
||||||
$link_data['parent'] = '';
|
$link_data['parent'] = '';
|
||||||
|
|
||||||
$cat_add[] = array
|
$cat_add[] = array
|
||||||
(
|
(
|
||||||
'lang_add' => lang('add'),
|
'lang_add' => lang('add'),
|
||||||
'lang_add_statustext' => lang('add a category'),
|
'lang_add_statustext' => lang('add a category'),
|
||||||
'add_url' => $GLOBALS['phpgw']->link('/index.php',$link_data),
|
'action_url' => $GLOBALS['phpgw']->link('/index.php',$link_data),
|
||||||
'lang_done' => lang('done'),
|
'lang_done' => lang('done'),
|
||||||
'lang_done_statustext' => lang('return to admin mainscreen'),
|
'lang_done_statustext' => lang('return to admin mainscreen')
|
||||||
'done_url' => $GLOBALS['phpgw']->link('/index.php','menuaction=admin.uimainscreen.mainscreen')
|
|
||||||
);
|
);
|
||||||
|
|
||||||
$link_data['menuaction'] = 'admin.uicategories.index';
|
$link_data['menuaction'] = 'admin.uicategories.index';
|
||||||
@ -254,13 +264,22 @@
|
|||||||
$parent = get_var('parent',array('GET'));
|
$parent = get_var('parent',array('GET'));
|
||||||
$values = get_var('values',array('POST'));
|
$values = get_var('values',array('POST'));
|
||||||
|
|
||||||
if ($values['save'])
|
$link_data = array
|
||||||
|
(
|
||||||
|
'menuaction' => 'admin.uicategories.index',
|
||||||
|
'appname' => $GLOBALS['appname'],
|
||||||
|
'global_cats' => $global_cats
|
||||||
|
);
|
||||||
|
|
||||||
|
if ($values['cancel'])
|
||||||
{
|
{
|
||||||
if (is_array($values))
|
$GLOBALS['phpgw']->redirect_link('/index.php',$link_data);
|
||||||
{
|
}
|
||||||
$values['cat_id'] = $this->cat_id;
|
|
||||||
$values['access'] = 'public';
|
if ($values['save'] || $values['apply'])
|
||||||
}
|
{
|
||||||
|
$values['cat_id'] = $this->cat_id;
|
||||||
|
$values['access'] = 'public';
|
||||||
|
|
||||||
$error = $this->bo->check_values($values);
|
$error = $this->bo->check_values($values);
|
||||||
if (is_array($error))
|
if (is_array($error))
|
||||||
@ -270,27 +289,26 @@
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
$this->cat_id = $this->bo->save_cat($values);
|
$this->cat_id = $this->bo->save_cat($values);
|
||||||
$message = lang('Category %1 has been saved !',$values['name']);
|
if ($values['apply'])
|
||||||
|
{
|
||||||
|
$message = lang('Category %1 has been saved !',$values['name']);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$GLOBALS['phpgw']->redirect_link('/index.php',$link_data);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!$this->cat_id)
|
if ($this->cat_id)
|
||||||
{
|
{
|
||||||
$function = lang('add category');
|
|
||||||
$action = 'add';
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
$action = 'edit';
|
|
||||||
$function = lang('edit category');
|
|
||||||
$cats = $this->bo->cats->return_single($this->cat_id);
|
$cats = $this->bo->cats->return_single($this->cat_id);
|
||||||
|
|
||||||
$parent = $cats['parent'];
|
$parent = $cats['parent'];
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($GLOBALS['appname'])
|
if ($GLOBALS['appname'])
|
||||||
{
|
{
|
||||||
$GLOBALS['phpgw_info']['flags']['app_header'] = lang($GLOBALS['appname']) . ' ' . lang('global categories') . ': ' . $function;
|
$GLOBALS['phpgw_info']['flags']['app_header'] = lang($GLOBALS['appname']) . ' ' . lang('global categories') . ': ' . ($this->cat_id?lang('edit category'):lang('add category'));
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -308,31 +326,22 @@
|
|||||||
$GLOBALS['phpgw']->template->set_var('title_categories',lang('Edit global category'));
|
$GLOBALS['phpgw']->template->set_var('title_categories',lang('Edit global category'));
|
||||||
}
|
}
|
||||||
|
|
||||||
$link_data = array
|
|
||||||
(
|
|
||||||
'menuaction' => 'admin.uicategories.index',
|
|
||||||
'appname' => $GLOBALS['appname'],
|
|
||||||
'global_cats' => $global_cats
|
|
||||||
);
|
|
||||||
|
|
||||||
$data = array
|
$data = array
|
||||||
(
|
(
|
||||||
'action' => $action,
|
|
||||||
'done_url' => $GLOBALS['phpgw']->link('/index.php',$link_data),
|
|
||||||
'lang_name' => lang('name'),
|
'lang_name' => lang('name'),
|
||||||
'lang_descr' => lang('description'),
|
'lang_descr' => lang('description'),
|
||||||
'lang_parent' => lang('parent category'),
|
'lang_parent' => lang('parent category'),
|
||||||
'old_parent' => $cats['parent'],
|
'old_parent' => $cats['parent'],
|
||||||
'lang_save' => lang('save'),
|
'lang_save' => lang('save'),
|
||||||
'lang_done' => lang('done'),
|
'lang_apply' => lang('apply'),
|
||||||
'lang_delete' => lang('delete'),
|
'lang_cancel' => lang('cancel'),
|
||||||
'lang_reset' => lang('reset'),
|
|
||||||
'value_name' => $GLOBALS['phpgw']->strip_html($cats['name']),
|
'value_name' => $GLOBALS['phpgw']->strip_html($cats['name']),
|
||||||
'value_descr' => $GLOBALS['phpgw']->strip_html($cats['descr']),
|
'value_descr' => $GLOBALS['phpgw']->strip_html($cats['descr']),
|
||||||
'message' => $message,
|
'message' => $message,
|
||||||
'lang_content_statustext' => lang('Enter a description for the category'),
|
'lang_content_statustext' => lang('enter a description for the category'),
|
||||||
'lang_done_statustext' => lang('Back to the list'),
|
'lang_cancel_statustext' => lang('leave the category untouched and return back to the list'),
|
||||||
'lang_save_statustext' => lang('Save the category'),
|
'lang_save_statustext' => lang('save the category and return back to the list'),
|
||||||
|
'lang_apply_statustext' => lang('save the category'),
|
||||||
'lang_no_cat' => lang('no category'),
|
'lang_no_cat' => lang('no category'),
|
||||||
'lang_cat_statustext' => lang('Select the parent category. If this is a main category select NO CATEGORY'),
|
'lang_cat_statustext' => lang('Select the parent category. If this is a main category select NO CATEGORY'),
|
||||||
'select_name' => 'values[parent]',
|
'select_name' => 'values[parent]',
|
||||||
@ -345,7 +354,6 @@
|
|||||||
$link_data['cat_id'] = $this->cat_id;
|
$link_data['cat_id'] = $this->cat_id;
|
||||||
}
|
}
|
||||||
$data['edit_url'] = $GLOBALS['phpgw']->link('/index.php',$link_data);
|
$data['edit_url'] = $GLOBALS['phpgw']->link('/index.php',$link_data);
|
||||||
$data['delete_url'] = $GLOBALS['phpgw']->link('/index.php',$link_data);
|
|
||||||
|
|
||||||
$GLOBALS['phpgw']->xslttpl->set_var('phpgw',array('cat_edit' => $data));
|
$GLOBALS['phpgw']->xslttpl->set_var('phpgw',array('cat_edit' => $data));
|
||||||
}
|
}
|
||||||
@ -354,15 +362,6 @@
|
|||||||
{
|
{
|
||||||
$global_cats = get_var('global_cats',array('POST','GET'));
|
$global_cats = get_var('global_cats',array('POST','GET'));
|
||||||
|
|
||||||
if ($GLOBALS['appname'])
|
|
||||||
{
|
|
||||||
$GLOBALS['phpgw_info']['flags']['app_header'] = lang($GLOBALS['appname']) . ' ' . lang('global categories') . ': ' . lang('delete category');
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
$GLOBALS['phpgw_info']['flags']['app_header'] = lang('global categories') . ': ' . lang('delete category');
|
|
||||||
}
|
|
||||||
|
|
||||||
$link_data = array
|
$link_data = array
|
||||||
(
|
(
|
||||||
'menuaction' => 'admin.uicategories.index',
|
'menuaction' => 'admin.uicategories.index',
|
||||||
@ -370,24 +369,24 @@
|
|||||||
'global_cats' => $global_cats
|
'global_cats' => $global_cats
|
||||||
);
|
);
|
||||||
|
|
||||||
if (!$this->cat_id)
|
if ($_POST['cancel'] || !$this->cat_id)
|
||||||
{
|
{
|
||||||
Header('Location: ' . $GLOBALS['phpgw']->link('/index.php',$link_data));
|
$GLOBALS['phpgw']->redirect_link('/index.php',$link_data);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (get_var('confirm',array('POST')))
|
if ($_POST['delete'])
|
||||||
{
|
{
|
||||||
if (get_var('subs',array('POST')))
|
if ($_POST['subs'])
|
||||||
{
|
{
|
||||||
switch (get_var('subs',array('POST')))
|
switch ($_POST['subs'])
|
||||||
{
|
{
|
||||||
case 'move':
|
case 'move':
|
||||||
$this->bo->delete(array('cat_id' => $this->cat_id, 'modify_subs' => True));
|
$this->bo->delete(array('cat_id' => $this->cat_id, 'modify_subs' => True));
|
||||||
Header('Location: ' . $GLOBALS['phpgw']->link('/index.php',$link_data));
|
$GLOBALS['phpgw']->redirect_link('/index.php',$link_data);
|
||||||
break;
|
break;
|
||||||
case 'drop':
|
case 'drop':
|
||||||
$this->bo->delete(array('cat_id' => $this->cat_id, 'drop_subs' => True));
|
$this->bo->delete(array('cat_id' => $this->cat_id, 'drop_subs' => True));
|
||||||
Header('Location: ' . $GLOBALS['phpgw']->link('/index.php',$link_data));
|
$GLOBALS['phpgw']->redirect_link('/index.php',$link_data);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
$error_msg = lang('Please choose one of the methods to handle the subcategories');
|
$error_msg = lang('Please choose one of the methods to handle the subcategories');
|
||||||
@ -397,26 +396,19 @@
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
$this->bo->delete(array('cat_id' => $this->cat_id));
|
$this->bo->delete(array('cat_id' => $this->cat_id));
|
||||||
Header('Location: ' . $GLOBALS['phpgw']->link('/index.php',$link_data));
|
$GLOBALS['phpgw']->redirect_link('/index.php',$link_data);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$GLOBALS['phpgw']->xslttpl->add_file(array($GLOBALS['phpgw']->common->get_tpl_dir('phpgwapi','default') . SEP . 'app_delete'));
|
$GLOBALS['phpgw']->xslttpl->add_file(array($GLOBALS['phpgw']->common->get_tpl_dir('phpgwapi','default') . SEP . 'app_delete'));
|
||||||
|
|
||||||
if ($GLOBALS['appname'])
|
$GLOBALS['phpgw_info']['flags']['app_header'] = ($GLOBALS['appname']?lang($GLOBALS['appname']) . ' ':'') . lang('global categories') . ': ' . lang('delete category');
|
||||||
{
|
|
||||||
$type = 'noglobalapp';
|
$type = ($GLOBALS['appname']?'noglobalapp':'noglobal');
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
$type = 'noglobal';
|
|
||||||
}
|
|
||||||
|
|
||||||
$apps_cats = $this->bo->exists(array('type' => $type,
|
$apps_cats = $this->bo->exists(array('type' => $type,
|
||||||
'cat_name' => '',
|
'cat_name' => '',
|
||||||
'cat_id' => $this->cat_id));
|
'cat_id' => $this->cat_id));
|
||||||
|
|
||||||
|
|
||||||
if ($apps_cats)
|
if ($apps_cats)
|
||||||
{
|
{
|
||||||
$lang_confirm_msg = lang('This category is currently being used by applications as a parent category. ')
|
$lang_confirm_msg = lang('This category is currently being used by applications as a parent category. ')
|
||||||
@ -443,16 +435,15 @@
|
|||||||
|
|
||||||
$data = array
|
$data = array
|
||||||
(
|
(
|
||||||
'done_url' => $GLOBALS['phpgw']->link('/index.php',$link_data),
|
'lang_delete_msg' => $lang_confirm_msg,
|
||||||
'lang_confirm_msg' => $lang_confirm_msg,
|
'lang_delete' => lang('delete'),
|
||||||
'lang_yes' => lang('yes'),
|
'subs' => $subs,
|
||||||
'subs' => $subs,
|
'lang_sub_select_move' => $lang_sub_select_move,
|
||||||
'lang_sub_select_move' => $lang_sub_select_move,
|
'lang_sub_select_drop' => $lang_sub_select_drop,
|
||||||
'lang_sub_select_drop' => $lang_sub_select_drop,
|
'lang_delete_statustext' => lang('delete the category'),
|
||||||
'lang_yes_statustext' => lang('Delete the entry'),
|
'lang_cancel_statustext' => lang('do NOT delete the category and return back to the list'),
|
||||||
'lang_no_statustext' => lang('Back to the list'),
|
'lang_cancel' => lang('cancel'),
|
||||||
'lang_no' => lang('no'),
|
'lang_error_msg' => $error_msg
|
||||||
'lang_error_msg' => $error_msg
|
|
||||||
);
|
);
|
||||||
|
|
||||||
$link_data['menuaction'] = 'admin.uicategories.delete';
|
$link_data['menuaction'] = 'admin.uicategories.delete';
|
||||||
|
@ -96,35 +96,30 @@
|
|||||||
<!-- BEGIN cat_add -->
|
<!-- BEGIN cat_add -->
|
||||||
|
|
||||||
<xsl:template match="cat_add">
|
<xsl:template match="cat_add">
|
||||||
<tr>
|
<tr height="50" valign="bottom">
|
||||||
<td height="50" valign="bottom">
|
<xsl:variable name="action_url"><xsl:value-of select="action_url"/></xsl:variable>
|
||||||
<xsl:variable name="add_url"><xsl:value-of select="add_url"/></xsl:variable>
|
<form method="post" action="{$action_url}">
|
||||||
<xsl:variable name="lang_add"><xsl:value-of select="lang_add"/></xsl:variable>
|
<td colspan="2">
|
||||||
<form method="post" action="{$add_url}">
|
<xsl:variable name="lang_add"><xsl:value-of select="lang_add"/></xsl:variable>
|
||||||
<input type="submit" name="add" value="{$lang_add}" onMouseout="window.status='';return true;">
|
<input type="submit" name="add" value="{$lang_add}" onMouseout="window.status='';return true;">
|
||||||
<xsl:attribute name="onMouseover">
|
<xsl:attribute name="onMouseover">
|
||||||
<xsl:text>window.status='</xsl:text>
|
<xsl:text>window.status='</xsl:text>
|
||||||
<xsl:value-of select="lang_add_statustext"/>
|
<xsl:value-of select="lang_add_statustext"/>
|
||||||
<xsl:text>'; return true;</xsl:text>
|
<xsl:text>'; return true;</xsl:text>
|
||||||
</xsl:attribute>
|
</xsl:attribute>
|
||||||
</input>
|
</input>
|
||||||
</form>
|
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
<td colspan="3" align="right">
|
||||||
<tr>
|
<xsl:variable name="lang_done"><xsl:value-of select="lang_done"/></xsl:variable>
|
||||||
<td height="50" valign="bottom">
|
<input type="submit" name="done" value="{$lang_done}" onMouseout="window.status='';return true;">
|
||||||
<xsl:variable name="done_url"><xsl:value-of select="done_url"/></xsl:variable>
|
<xsl:attribute name="onMouseover">
|
||||||
<xsl:variable name="lang_done"><xsl:value-of select="lang_done"/></xsl:variable>
|
<xsl:text>window.status='</xsl:text>
|
||||||
<form method="post" action="{$done_url}">
|
<xsl:value-of select="lang_done_statustext"/>
|
||||||
<input type="submit" name="done" value="{$lang_done}" onMouseout="window.status='';return true;">
|
<xsl:text>'; return true;</xsl:text>
|
||||||
<xsl:attribute name="onMouseover">
|
</xsl:attribute>
|
||||||
<xsl:text>window.status='</xsl:text>
|
</input>
|
||||||
<xsl:value-of select="lang_done_statustext"/>
|
|
||||||
<xsl:text>'; return true;</xsl:text>
|
|
||||||
</xsl:attribute>
|
|
||||||
</input>
|
|
||||||
</form>
|
|
||||||
</td>
|
</td>
|
||||||
|
</form>
|
||||||
</tr>
|
</tr>
|
||||||
</xsl:template>
|
</xsl:template>
|
||||||
|
|
||||||
@ -135,14 +130,14 @@
|
|||||||
<xsl:template match="cat_edit">
|
<xsl:template match="cat_edit">
|
||||||
<table cellpadding="2" cellspacing="2" align="center">
|
<table cellpadding="2" cellspacing="2" align="center">
|
||||||
<tr>
|
<tr>
|
||||||
<td colspan="2" align="center">
|
<td colspan="3" align="center">
|
||||||
<xsl:value-of select="message"/>
|
<xsl:value-of select="message"/>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
<xsl:variable name="edit_url" select="edit_url"/>
|
<xsl:variable name="edit_url" select="edit_url"/>
|
||||||
<form method="post" action="{$edit_url}">
|
<form method="post" action="{$edit_url}">
|
||||||
<tr>
|
<tr>
|
||||||
<td width="23%">
|
<td width="23%" colspan="2">
|
||||||
<xsl:value-of select="lang_parent"/>
|
<xsl:value-of select="lang_parent"/>
|
||||||
</td>
|
</td>
|
||||||
<td width="77%">
|
<td width="77%">
|
||||||
@ -150,7 +145,7 @@
|
|||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td><xsl:value-of select="lang_name"/>:</td>
|
<td colspan="2"><xsl:value-of select="lang_name"/>:</td>
|
||||||
<td><input name="values[name]" size="50" onMouseout="window.status='';return true;">
|
<td><input name="values[name]" size="50" onMouseout="window.status='';return true;">
|
||||||
<xsl:attribute name="onMouseover">
|
<xsl:attribute name="onMouseover">
|
||||||
<xsl:text>window.status='</xsl:text>
|
<xsl:text>window.status='</xsl:text>
|
||||||
@ -164,7 +159,7 @@
|
|||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td valign="top"><xsl:value-of select="lang_descr"/>:</td>
|
<td colspan="2" valign="top"><xsl:value-of select="lang_descr"/>:</td>
|
||||||
<td><textarea cols="60" rows="10" name="values[descr]" wrap="virtual" onMouseout="window.status='';return true;">
|
<td><textarea cols="60" rows="10" name="values[descr]" wrap="virtual" onMouseout="window.status='';return true;">
|
||||||
<xsl:attribute name="onMouseover">
|
<xsl:attribute name="onMouseover">
|
||||||
<xsl:text>window.status='</xsl:text>
|
<xsl:text>window.status='</xsl:text>
|
||||||
@ -176,7 +171,7 @@
|
|||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
|
||||||
<tr height="50">
|
<tr height="50" valign="bottom">
|
||||||
<td>
|
<td>
|
||||||
<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>
|
||||||
<xsl:variable name="old_parent"><xsl:value-of select="old_parent"/></xsl:variable>
|
<xsl:variable name="old_parent"><xsl:value-of select="old_parent"/></xsl:variable>
|
||||||
@ -190,46 +185,26 @@
|
|||||||
</input>
|
</input>
|
||||||
</td>
|
</td>
|
||||||
<td>
|
<td>
|
||||||
<xsl:choose>
|
<xsl:variable name="lang_apply" select="lang_apply"/>
|
||||||
<xsl:when test="action = 'add'">
|
<input type="reset" name="values[apply]" value="{$lang_apply}" onMouseout="window.status='';return true;">
|
||||||
<xsl:variable name="lang_reset" select="lang_reset"/>
|
<xsl:attribute name="onMouseover">
|
||||||
<input type="reset" name="reset" value="{$lang_reset}"/>
|
<xsl:text>window.status='</xsl:text>
|
||||||
</xsl:when>
|
<xsl:value-of select="lang_apply_statustext"/>
|
||||||
<xsl:otherwise>
|
<xsl:text>'; return true;</xsl:text>
|
||||||
<xsl:text> </xsl:text>
|
</xsl:attribute>
|
||||||
</xsl:otherwise>
|
</input>
|
||||||
</xsl:choose>
|
</td>
|
||||||
|
<td align="right">
|
||||||
|
<xsl:variable name="lang_cancel"><xsl:value-of select="lang_cancel"/></xsl:variable>
|
||||||
|
<input type="submit" name="values[cancel]" value="{$lang_cancel}" onMouseout="window.status='';return true;">
|
||||||
|
<xsl:attribute name="onMouseover">
|
||||||
|
<xsl:text>window.status='</xsl:text>
|
||||||
|
<xsl:value-of select="lang_cancel_statustext"/>
|
||||||
|
<xsl:text>'; return true;</xsl:text>
|
||||||
|
</xsl:attribute>
|
||||||
|
</input>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
</form>
|
</form>
|
||||||
<tr>
|
|
||||||
<td>
|
|
||||||
<xsl:variable name="done_url"><xsl:value-of select="done_url"/></xsl:variable>
|
|
||||||
<xsl:variable name="lang_done"><xsl:value-of select="lang_done"/></xsl:variable>
|
|
||||||
<form method="post" action="{$done_url}">
|
|
||||||
<input type="submit" name="values[done]" value="{$lang_done}" onMouseout="window.status='';return true;">
|
|
||||||
<xsl:attribute name="onMouseover">
|
|
||||||
<xsl:text>window.status='</xsl:text>
|
|
||||||
<xsl:value-of select="lang_done_statustext"/>
|
|
||||||
<xsl:text>'; return true;</xsl:text>
|
|
||||||
</xsl:attribute>
|
|
||||||
</input>
|
|
||||||
</form>
|
|
||||||
</td>
|
|
||||||
<td>
|
|
||||||
<xsl:choose>
|
|
||||||
<xsl:when test="action = 'edit'">
|
|
||||||
<xsl:variable name="delete_url"><xsl:value-of select="delete_url"/></xsl:variable>
|
|
||||||
<xsl:variable name="lang_delete"><xsl:value-of select="lang_delete"/></xsl:variable>
|
|
||||||
<form method="POST" action="{$delete_url}">
|
|
||||||
<input type="submit" name="values[delete]" value="{$lang_delete}"/>
|
|
||||||
</form>
|
|
||||||
</xsl:when>
|
|
||||||
<xsl:otherwise>
|
|
||||||
<xsl:text> </xsl:text>
|
|
||||||
</xsl:otherwise>
|
|
||||||
</xsl:choose>
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
</table>
|
</table>
|
||||||
</xsl:template>
|
</xsl:template>
|
||||||
|
@ -120,9 +120,13 @@
|
|||||||
|
|
||||||
<xsl:template match="group_edit">
|
<xsl:template match="group_edit">
|
||||||
<table border="0" cellpadding="2" cellspacing="2" align="center" width="79%">
|
<table border="0" cellpadding="2" cellspacing="2" align="center" width="79%">
|
||||||
<tr>
|
<xsl:choose>
|
||||||
<td><xsl:value-of select="error"/></td>
|
<xsl:when test="msgbox_data != ''">
|
||||||
</tr>
|
<tr>
|
||||||
|
<td align="center"><xsl:call-template name="msgbox"/></td>
|
||||||
|
</tr>
|
||||||
|
</xsl:when>
|
||||||
|
</xsl:choose>
|
||||||
<tr>
|
<tr>
|
||||||
<td valign="top">
|
<td valign="top">
|
||||||
<!-- {rows} -->
|
<!-- {rows} -->
|
||||||
|
@ -132,9 +132,13 @@
|
|||||||
|
|
||||||
<xsl:template match="account_edit">
|
<xsl:template match="account_edit">
|
||||||
<table border="0" cellpadding="2" cellspacing="2" align="center" width="95%">
|
<table border="0" cellpadding="2" cellspacing="2" align="center" width="95%">
|
||||||
<tr>
|
<xsl:choose>
|
||||||
<td><xsl:value-of select="error"/></td>
|
<xsl:when test="msgbox_data != ''">
|
||||||
</tr>
|
<tr>
|
||||||
|
<td align="center" colspan="2"><xsl:call-template name="msgbox"/></td>
|
||||||
|
</tr>
|
||||||
|
</xsl:when>
|
||||||
|
</xsl:choose>
|
||||||
<tr>
|
<tr>
|
||||||
<td valign="top">
|
<td valign="top">
|
||||||
<!-- {rows} -->
|
<!-- {rows} -->
|
||||||
@ -149,7 +153,6 @@
|
|||||||
<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"/>
|
||||||
<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>
|
||||||
<td width="25%"><input type="text" name="values[account_lid]" value="{$account_lid}"/></td>
|
<td width="25%"><input type="text" name="values[account_lid]" value="{$account_lid}"/></td>
|
||||||
@ -198,11 +201,11 @@
|
|||||||
<td><xsl:value-of select="lang_never"/></td>
|
<td><xsl:value-of select="lang_never"/></td>
|
||||||
<td>
|
<td>
|
||||||
<xsl:choose>
|
<xsl:choose>
|
||||||
<xsl:when test="never_expires = 'yes'">
|
<xsl:when test="expires_never = 'yes'">
|
||||||
<input type="checkbox" name="values[never_expires]" value="True" checked="checked"/>
|
<input type="checkbox" name="values[expires_never]" value="True" checked="checked"/>
|
||||||
</xsl:when>
|
</xsl:when>
|
||||||
<xsl:otherwise>
|
<xsl:otherwise>
|
||||||
<input type="checkbox" name="values[never_expires]" value="True"/>
|
<input type="checkbox" name="values[expires_never]" value="True"/>
|
||||||
</xsl:otherwise>
|
</xsl:otherwise>
|
||||||
</xsl:choose>
|
</xsl:choose>
|
||||||
</td>
|
</td>
|
||||||
@ -244,10 +247,10 @@
|
|||||||
<xsl:variable name="account_id" select="account_id"/>
|
<xsl:variable name="account_id" select="account_id"/>
|
||||||
<xsl:choose>
|
<xsl:choose>
|
||||||
<xsl:when test="selected != ''">
|
<xsl:when test="selected != ''">
|
||||||
<option value="{$account_id}" selected="selected"><xsl:value-of select="account_name"/></option>
|
<option value="{$account_id}" selected="selected"><xsl:value-of select="account_lid"/></option>
|
||||||
</xsl:when>
|
</xsl:when>
|
||||||
<xsl:otherwise>
|
<xsl:otherwise>
|
||||||
<option value="{$account_id}"><xsl:value-of select="account_name"/></option>
|
<option value="{$account_id}"><xsl:value-of select="account_lid"/></option>
|
||||||
</xsl:otherwise>
|
</xsl:otherwise>
|
||||||
</xsl:choose>
|
</xsl:choose>
|
||||||
</xsl:template>
|
</xsl:template>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user