- First take at improving the user module's code: replaced the custom error

printing with calls to drupal_set_message().
4.4.x
Dries Buytaert 2003-12-26 13:44:18 +00:00
parent cb7c2e09ed
commit 097f6209e5
2 changed files with 14 additions and 14 deletions

View File

@ -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');
}
}

View File

@ -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');
}
}