Commit 097f6209 authored by Dries's avatar Dries

- First take at improving the user module's code: replaced the custom error
  printing with calls to drupal_set_message().
parent cb7c2e09
......@@ -648,7 +648,7 @@ function user_login($edit = array(), $msg = "") {
*/
if ($error) {
$output .= theme("error", $error);
drupal_set_message($error, 'error');
}
/*
......@@ -753,7 +753,7 @@ function user_pass($edit = array()) {
// Display error message if necessary.
if ($error) {
$output .= theme("error", $error);
drupal_set_message($error, 'error');
}
/*
......@@ -876,7 +876,7 @@ function user_register($edit = array()) {
}
else {
if ($error) {
$output .= theme("error", $error);
drupal_set_message($error, 'error');
}
}
......@@ -981,7 +981,7 @@ function user_edit($edit = array()) {
}
if ($error) {
$output .= theme("error", $error);
drupal_set_message($error, 'error');
}
if (!$edit) {
......@@ -1172,7 +1172,7 @@ function user_admin_create($edit = array()) {
else {
if ($error) {
$output .= theme("error", $error);
drupal_set_message($error, 'error');
}
$output .= form_textfield(t("Username"), "name", $edit["name"], 30, 55, t("Provide the username of the new account."));
......@@ -1429,7 +1429,7 @@ function user_admin_edit($edit = array()) {
drupal_set_message(t("user information changes have been saved."));
}
else {
$output .= theme("error", $error);
drupal_set_message($error, 'error');
}
}
else if ($op == t("Delete account")) {
......@@ -1441,7 +1441,7 @@ function user_admin_edit($edit = array()) {
}
else {
$error = t("Failed to delete account: the account has to be blocked first.");
$output .= theme("error", $error);
drupal_set_message($error, 'error');
}
}
......
......@@ -648,7 +648,7 @@ function user_login($edit = array(), $msg = "") {
*/
if ($error) {
$output .= theme("error", $error);
drupal_set_message($error, 'error');
}
/*
......@@ -753,7 +753,7 @@ function user_pass($edit = array()) {
// Display error message if necessary.
if ($error) {
$output .= theme("error", $error);
drupal_set_message($error, 'error');
}
/*
......@@ -876,7 +876,7 @@ function user_register($edit = array()) {
}
else {
if ($error) {
$output .= theme("error", $error);
drupal_set_message($error, 'error');
}
}
......@@ -981,7 +981,7 @@ function user_edit($edit = array()) {
}
if ($error) {
$output .= theme("error", $error);
drupal_set_message($error, 'error');
}
if (!$edit) {
......@@ -1172,7 +1172,7 @@ function user_admin_create($edit = array()) {
else {
if ($error) {
$output .= theme("error", $error);
drupal_set_message($error, 'error');
}
$output .= form_textfield(t("Username"), "name", $edit["name"], 30, 55, t("Provide the username of the new account."));
......@@ -1429,7 +1429,7 @@ function user_admin_edit($edit = array()) {
drupal_set_message(t("user information changes have been saved."));
}
else {
$output .= theme("error", $error);
drupal_set_message($error, 'error');
}
}
else if ($op == t("Delete account")) {
......@@ -1441,7 +1441,7 @@ function user_admin_edit($edit = array()) {
}
else {
$error = t("Failed to delete account: the account has to be blocked first.");
$output .= theme("error", $error);
drupal_set_message($error, 'error');
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment