diff --git a/admin/editaccount.php b/admin/editaccount.php
index d1cbb01840..7ddbe18d0c 100755
--- a/admin/editaccount.php
+++ b/admin/editaccount.php
@@ -25,9 +25,14 @@
}
if ($submit) {
+ $totalerrors = 0;
+
+ if (strlen($n_loginid) > 8)
+ $error[$totalerrors++] = lang("The loginid can not be more then 8 characters");
+
if ($old_loginid != $n_loginid) {
if (account_exsists($n_loginid)) {
- $error .= " " . lang("That loginid has already been taken");
+ $error[$totalerrors++] = lang("That loginid has already been taken");
}
$c_loginid = $n_loginid;
$n_loginid = $old_loginid;
@@ -35,18 +40,18 @@
if ($n_passwd || $n_passwd_2) {
if ($n_passwd != $n_passwd_2) {
- $error .= lang("The two passwords are not the same");
+ $error[$totalerrors++] = lang("The two passwords are not the same");
}
if (! $n_passwd){
- $error .= lang("You must enter a password");
+ $error[$totalerrors++] = lang("You must enter a password");
}
}
if (count($new_permissions) == 0){
- $error .= " " . lang("You must add at least 1 permission to this account");
+ $error[$totalerrors++] = " " . lang("You must add at least 1 permission to this account");
}
- if (! $error) {
+ if (! $totalerrors) {
$cd = account_edit(array("loginid" => $n_loginid, "permissions" => $new_permissions,
"firstname" => $n_firstname, "lastname" => $n_lastname,
"passwd" => $n_passwd, "account_status" => $account_status,
@@ -74,7 +79,7 @@
">
" . lang("Error") . ":$error";
+ echo "
" . $phpgw->common->error_list($error) . "
";
}
?>
diff --git a/admin/editapplication.php b/admin/editapplication.php
index 3f1f5fce08..514ed66537 100644
--- a/admin/editapplication.php
+++ b/admin/editapplication.php
@@ -24,9 +24,25 @@
$t->set_file(array("form" => "application_form.tpl"));
if ($submit) {
- if (! $n_app_name || ! $n_app_title) {
- $error = lang("You must enter an application name and title.");
- } else {
+ $totalerrors = 0;
+
+ if (! $n_app_name)
+ $error[$totalerrors++] = lang("You must enter an application name.");
+
+ if (! $n_app_title)
+ $error[$totalerrors++] = lang("You must enter an application title.");
+
+ if ($old_app_name != $n_app_name) {
+ $phpgw->db->query("select count(*) from applications where app_name='"
+ . addslashes($n_app_name) . "'");
+ $phpgw->db->next_record();
+
+ if ($phpgw->db->f(0) != 0) {
+ $error[$totalerrors++] = lang("That application name already exsists.");
+ }
+ }
+
+ if (! $totalerrors) {
$phpgw->db->query("update applications set app_name='" . addslashes($n_app_name) . "',"
. "app_title='" . addslashes($n_app_title) . "', app_enabled='"
. "$n_app_enabled' where app_name='$old_app_name'");
@@ -38,19 +54,22 @@
$phpgw->db->query("select * from applications where app_name='$app_name'");
$phpgw->db->next_record();
- if ($error) {
+ if ($totalerrors) {
$phpgw->common->phpgw_header();
$phpgw->common->navbar();
+
+ $t->set_var("error","