Added a temp fix for edit and add accounts, I am now going to go through it and clean up the variable names to make them more standard and understandable

This commit is contained in:
jengo 2001-02-21 03:03:16 +00:00
parent b733042a9a
commit d26840b61f
2 changed files with 19 additions and 21 deletions

View File

@ -25,8 +25,9 @@
{
global $phpgw,$phpgw_info;
$t = new Template($phpgw->common->get_tpl_dir("admin"));
$t->set_file(array("form" => "account_form.tpl"));
$t = new Template($phpgw->common->get_tpl_dir("admin"));
$t->set_unknowns('remove');
$t->set_file(array("form" => "account_form.tpl"));
if ($_userData)
{
@ -53,11 +54,11 @@
// groups list
$groups_select = '<select name="n_groups[]" multiple>';
$accounts = $account->get_list();
$accounts = $account->get_list('groups');
for($i=0;$i<count($accounts);$i++) {
//echo $account->get_type($accounts[$i]["account_id"]);
if ($account->get_type($accounts[$i]["account_id"]) == "g") {
// if ($account->get_type($accounts[$i]["account_id"]) == "g") {
$groups_select .= '<option value="' . $accounts[$i]["account_id"] . '"';
$members = $account->members($accounts[$i]["account_id"]);
if (!$members) { $members = array(); }
@ -68,7 +69,7 @@
}
}
$groups_select .= ">" . $accounts[$i]["account_lid"] . "</option>\n";
}
// }
}
$groups_select .= "</select>";
$t->set_var("groups_select",$groups_select);
@ -103,12 +104,9 @@
if ($userData["status"])
{
$t->set_var('account_status','checked');
$t->set_var('account_status',' checked');
}
else
{
$t->set_var('account_status','');
}
$t->set_var("n_firstname_value",$userData["firstname"]);
$t->set_var("n_lastname_value",$userData["lastname"]);
@ -199,7 +197,7 @@
$t->set_var("permissions_list",$appRightsOutput);
$t->pparse('out','form');
echo $t->finish($t->parse('out','form'));
}
// stores the userdata
@ -327,9 +325,9 @@
if ($submit)
{
$userData = array(
'account_lid' => $account_lid, 'firstname' => $n_firstname,
'lastname' => $n_lastname, 'passwd' => $n_passwd,
'status' => $n_account_status, 'old_loginid' => rawurldecode($old_loginid),
'account_lid' => $account_lid, 'firstname' => $firstname,
'lastname' => $lastname, 'passwd' => $n_passwd,
'status' => $account_status, 'old_loginid' => rawurldecode($old_loginid),
'account_id' => $account_id, 'passwd_2' => $n_passwd_2,
'n_groups' => $n_groups, 'new_permissions' => $new_permissions
);

View File

@ -36,13 +36,13 @@
}
}
if (! $n_loginid)
if (! $account_lid)
$error[$totalerrors++] = lang("You must enter a loginid");
if (! $n_passwd)
$error[$totalerrors++] = lang("You must enter a password");
if ($n_passwd == $n_loginid)
if ($n_passwd == $account_lid)
$error[$totalerrors++] = lang("The login and password can not be the same");
if ($n_passwd != $n_passwd_2)
@ -52,7 +52,7 @@
$error[$totalerrors++] = "<br>" . lang("You must add at least 1 permission or group to this account");
}
if ($phpgw->accounts->exists($n_loginid)) {
if ($phpgw->accounts->exists($account_lid)) {
$error[$totalerrors++] = lang("That loginid has already been taken");
}
@ -65,9 +65,9 @@
'phpgw_acl',
'phpgw_applications'
));
$phpgw->accounts->create('u', $n_loginid, $n_passwd, $n_firstname, $n_lastname, $n_account_status);
$phpgw->accounts->create('u', $account_lid, $n_passwd, $n_firstname, $n_lastname, $n_account_status);
$account_id = $phpgw->accounts->name2id($n_loginid);
$account_id = $phpgw->accounts->name2id($account_lid);
$apps = CreateObject('phpgwapi.applications',array($account_id,'u'));
$apps->read_installed_apps();
@ -112,7 +112,7 @@
// Assign user to groups
for ($i=0;$i<count($n_groups);$i++)
{
$phpgw->acl->add_repository('phpgw_group',$n_groups[$i],$account_id,'u',1);
$phpgw->acl->add_repository('phpgw_group',$n_groups[$i],$account_id,1);
}
$pref = CreateObject('phpgwapi.preferences',$account_id);
@ -172,7 +172,7 @@
$phpgw->template->set_var('account_status',' checked');
}
$phpgw->template->set_var("n_loginid_value",$n_loginid);
$phpgw->template->set_var("n_loginid_value",$account_lid);
$phpgw->template->set_var("lang_account_active",lang("Account active"));