From 5008306a5d62f77077445a8cbaacf708f44e909d Mon Sep 17 00:00:00 2001 From: jengo Date: Mon, 2 Oct 2000 20:43:56 +0000 Subject: [PATCH] Converted new accounts to work off templates --- admin/newaccount.php | 176 ++++++++++++++++++++----------------------- 1 file changed, 82 insertions(+), 94 deletions(-) diff --git a/admin/newaccount.php b/admin/newaccount.php index 904e485d80..776b700e7b 100755 --- a/admin/newaccount.php +++ b/admin/newaccount.php @@ -11,11 +11,9 @@ /* $Id$ */ - $phpgw_info["flags"] = array("noheader" => True, "nonavbar" => True); + $phpgw_info["flags"] = array("noheader" => True, "nonavbar" => True, "disable_message_class" => True, + "disable_send_class" => True, "currentapp" => "admin"); - $phpgw_info["flags"]["disable_message_class"] = True; - $phpgw_info["flags"]["disable_send_class"] = True; - $phpgw_info["flags"]["currentapp"] = "admin"; include("../header.inc.php"); if ($submit) { $totalerrors = 0; @@ -92,98 +90,88 @@ exit; } } + + $t = new Template($phpgw_info["server"]["template_dir"]); + $t->set_file(array("form" => "account_form.tpl")); - $phpgw->common->phpgw_header(); - $phpgw->common->navbar(); - - echo "

" . lang("Add new account") . "



"; + $phpgw->common->phpgw_header(); + $phpgw->common->navbar(); - if ($totalerrors) { - echo "
" . $phpgw->common->error_list($error) . "
"; + $t->set_var("lang_action",lang("Add new account")); + + if ($totalerrors) { + $t->set_var("error_messages","
" . $phpgw->common->error_list($error) . "
"); + } else { + $t->set_var("error_messages",""); + } + + $t->set_var("form_action",$phpgw->link("newaccount.php")); + $t->set_var("lang_loginid",lang("LoginID")); + $t->set_var("n_loginid_value",$n_loginid); + + $t->set_var("lang_password",lang("Password")); + $t->set_var("n_passwd_value",$n_passwd); + + $t->set_var("lang_reenter_password",lang("Re-Enter Password")); + $t->set_var("n_passwd_2_value",$n_passwd_2); + + $t->set_var("lang_firstname",lang("First Name")); + $t->set_var("n_firstname_value",$firstname_value); + + $t->set_var("lang_lastname",lang("Last Name")); + $t->set_var("n_lastname_value",$lastname_value); + + $t->set_var("lang_groups",lang("Groups")); + $group_select = '"; + $t->set_var("groups_select",$group_select); + + $t->set_var("",""); + $i = 0; + while ($permission = each($phpgw_info["apps"])) { + if ($permission[1]["enabled"]) { + $perm_display[$i][0] = $permission[0]; + $perm_display[$i][1] = $permission[1]["title"]; + $i++; + } + } + + for ($i=0;$i<200;) { // The $i<200 is only used for a brake + if (! $perm_display[$i][1]) break; + + $perms_html .= '' . lang($perm_display[$i][1]) . '' + . '' + . ' -
"> -
- - - - - - - - - - - - - - - - - - - - - - - - - - set_var("permissions_list",$perms_html); - for ($i=0;$i<200;) { // The $i<200 is only used for a brake - if (! $perm_display[$i][1]) break; - - echo '' - . '"; - - $i++; - - if (! $perm_display[$i][1]) break; - - echo '' - . '"; - - $i++; - } - ?> - - - -
' . lang($perm_display[$i][1]) . '' . lang($perm_display[$i][1]) . '
- "> -
-
-
- common->phpgw_footer(); - ?> + $t->set_var("lang_button",Lang("Add")); + $t->pparse("out","form"); + $phpgw->common->phpgw_footer(); +?>