@@ -1747,7 +1747,7 @@ function _install_configure_form($form, &$form_state, &$install_state) {
'#weight'=>-20,
);
$form['site_information']['site_mail']=array(
'#type'=>'textfield',
'#type'=>'email',
'#title'=>st('Site e-mail address'),
'#default_value'=>ini_get('sendmail_from'),
'#description'=>st("Automated e-mails, such as registration information, will be sent from this address. Use an address ending in your site's domain to help prevent these e-mails from being flagged as spam."),
...
...
@@ -1770,9 +1770,9 @@ function _install_configure_form($form, &$form_state, &$install_state) {
form_set_error('homepage',t('The URL of your homepage is not valid. Remember that it must be fully qualified, i.e. of the form <code>http://example.com/directory</code>.'));
'#description'=>t("The <em>From</em> address in automated e-mails sent during registration and new password requests, and other notifications. (Use an address ending in your site's domain to help prevent this e-mail being flagged as spam.)"),
...
...
@@ -1532,10 +1532,6 @@ function system_site_information_settings() {
@@ -608,28 +605,6 @@ function user_validate_name($name) {
}
}
/**
* Validates a user's email address.
*
* Checks that a user's email address exists and follows all standard
* validation rules. Returns error messages when the address is invalid.
*
* @param $mail
* A user's email address.
*
* @return
* If the address is invalid, a human-readable error message is returned.
* If the address is valid, nothing is returned.
*/
functionuser_validate_mail($mail){
if(!$mail){
returnt('You must enter an e-mail address.');
}
if(!valid_email_address($mail)){
returnt('The e-mail address %mail is not valid.',array('%mail'=>$mail));
}
}
/**
* Validates an image uploaded by a user.
*
...
...
@@ -965,9 +940,8 @@ function user_account_form(&$form, &$form_state) {
);
$form['account']['mail']=array(
'#type'=>'textfield',
'#type'=>'email',
'#title'=>t('E-mail address'),
'#maxlength'=>EMAIL_MAX_LENGTH,
'#description'=>t('A valid e-mail address. All e-mails from the system will be sent to this address. The e-mail address is not made public and will only be used if you wish to receive a new password or wish to receive certain news or notifications by e-mail.'),
'#required'=>TRUE,
'#default_value'=>(!$register?$account->mail:''),
...
...
@@ -1149,22 +1123,15 @@ function user_account_form_validate($form, &$form_state) {
}
}
// Trim whitespace from mail, to prevent confusing 'e-mail not valid'
// Format error message dependent on whether the user is logged in or not.
if($GLOBALS['user']->uid){
form_set_error('mail',t('The e-mail address %email is already taken.',array('%email'=>$form_state['values']['mail'])));
form_set_error('mail',t('The e-mail address %email is already taken.',array('%email'=>$mail)));
}
else{
form_set_error('mail',t('The e-mail address %email is already registered. <a href="@password">Have you forgotten your password?</a>',array('%email'=>$form_state['values']['mail'],'@password'=>url('user/password'))));
form_set_error('mail',t('The e-mail address %email is already registered. <a href="@password">Have you forgotten your password?</a>',array('%email'=>$mail,'@password'=>url('user/password'))));