summaryrefslogtreecommitdiff
path: root/modules/user.module
diff options
context:
space:
mode:
authorDries Buytaert <dries@buytaert.net>2003-11-28 19:22:23 +0000
committerDries Buytaert <dries@buytaert.net>2003-11-28 19:22:23 +0000
commitfa5aca1ef79e318793fe9cc13befabe8b01e3b36 (patch)
tree741564327dfa3d9a1dd1f0c71725df278c16948a /modules/user.module
parent8f00019551d8c96d2ed0ecbf87cc4003fbe226da (diff)
downloadbrdo-fa5aca1ef79e318793fe9cc13befabe8b01e3b36.tar.gz
brdo-fa5aca1ef79e318793fe9cc13befabe8b01e3b36.tar.bz2
- Fixed error messages not being shown. Patch by Matt.
Diffstat (limited to 'modules/user.module')
-rw-r--r--modules/user.module7
1 files changed, 4 insertions, 3 deletions
diff --git a/modules/user.module b/modules/user.module
index bef94efe9..3ef659104 100644
--- a/modules/user.module
+++ b/modules/user.module
@@ -134,6 +134,7 @@ function user_validate_name($name) {
}
function user_validate_mail($mail) {
+ if (!$mail) return t("You must enter an e-mail address.");
if ($mail && !valid_email_address($mail)) {
return t("The e-mail address '%mail' is not valid.", array("%mail" => $mail));
}
@@ -228,7 +229,7 @@ function user_mail($mail, $subject, $message, $header) {
$mail,
user_mail_encode($subject),
str_replace("\r", "", $message),
- "MIME-Version: 1.0\nContent-type: text/plain; charset=UTF-8; format=flowed\nContent-transfer-encoding: 8Bit\n" . $header
+ "MIME-Version: 1.0\nContent-Type: text/plain; charset=UTF-8; format=flowed\nContent-transfer-encoding: 8Bit\n" . $header
);
}
}
@@ -778,7 +779,7 @@ function user_register($edit = array()) {
drupal_goto(url("user/edit"));
}
- if ($edit["name"] && $edit["mail"]) {
+ if (!(is_null($edit["name"]) && is_null($edit["mail"]))) {
if ($error = user_validate_name($edit["name"])) {
// do nothing
}
@@ -899,7 +900,7 @@ function user_edit($edit = array()) {
global $user;
if ($user->uid) {
- if ($edit["name"]) {
+ if (!(is_null($edit["name"]) && is_null($edit["mail"]))) {
if ($error = user_validate_name($edit["name"])) {
// do nothing
}