watchdog('user',t('Password mailed to %name at %email.',array('%name'=>theme('placeholder',$account->name),'%email'=>theme('placeholder',$account->mail))));
drupal_set_message(t('Your password and further instructions have been sent to your e-mail address.'));
watchdog('user',t('Password reset instructions mailed to %name at %email.',array('%name'=>'<em>'.$account->name.'</em>','%email'=>'<em>'.$account->mail.'</em>')));
drupal_set_message(t('Further instructions have been sent to your e-mail address.'));
}
else{
watchdog('user',t('Error mailing password to %name at %email.',array('%name'=>theme('placeholder',$account->name),'%email'=>theme('placeholder',$account->mail))),WATCHDOG_ERROR);
watchdog('user',t('Error mailing password reset instructions to %name at %email.',array('%name'=>theme('placeholder',$account->name),'%email'=>theme('placeholder',$account->mail))),WATCHDOG_ERROR);
drupal_set_message(t('Unable to send mail. Please contact the site admin.'));
}
drupal_goto('user');
}
else{
if($edit){
drupal_set_message(t('You must provider either a username or e-mail address.'),'error');
drupal_set_message(t('You must provide either a username or e-mail address.'),'error');
}
// Display form:
$output='<p>'.t('Enter your username <strong><em>or</em></strong> your e-mail address.').'</p>';
...
...
@@ -957,6 +955,50 @@ function user_pass() {
}
}
/**
* Menu callback; process one time login URL, and redirects to the user page on success.
// The first user may login immediately, and receives a customized welcome e-mail.
if($account->uid==1){
...
...
@@ -1256,15 +1298,15 @@ function _user_mail_text($messageid, $variables = array()) {
case'welcome_subject':
returnt('Account details for %username at %site',$variables);
case'welcome_body':
returnt("%username,\n\nThank you for registering at %site. You may now log in to %login_uri using the following username and password:\n\nusername: %username\npassword: %password\n\nAfter logging in, you may wish to change your password at %edit_uri\n\nYour new %site membership also enables to you to login to other Drupal powered websites (e.g. http://www.drupal.org/) without registering. Just use the following Drupal ID and password:\n\nDrupal ID: %username@%uri_brief\npassword: %password\n\n\n-- %site team",$variables);
returnt("%username,\n\nThank you for registering at %site. You may now log in to %login_uri using the following username and password:\n\nusername: %username\npassword: %password\n\nYou may also log in by clicking on this link or copying and pasting it in your browser:\n\n%login_url\n\nThis is a one-time login, so it can be used only once.\n\nAfter logging in, you will be redirected to %edit_uri so you can change your password.\n\nYour new %site membership also enables to you to login to other Drupal powered websites (e.g. http://www.drop.org/) without registering. Just use the following Drupal ID and password:\n\nDrupal ID: %username@%uri_brief\npassword: %password\n\n\n-- %site team",$variables);
case'approval_subject':
returnt('Account details for %username at %site (pending admin approval)',$variables);
case'approval_body':
returnt("%username,\n\nThank you for registering at %site. Your application for an account is currently pending approval. Once it has been granted, you may log in to %login_uri using the following username and password:\n\nusername: %username\npassword: %password\n\nAfter logging in, you may wish to change your password at %edit_uri\n\nYour new %site membership also enables to you to login to other Drupal powered websites (e.g. http://www.drupal.org/) without registering. Just use the following Drupal ID and password:\n\nDrupal ID: %username@%uri_brief\npassword: %password\n\n\n-- %site team",$variables);
returnt("%username,\n\nThank you for registering at %site. Your application for an account is currently pending approval. Once it has been granted, you may log in to %login_uri using the following username and password:\n\nusername: %username\npassword: %password\n\nYou may also log in by clicking on this link or copying and pasting it in your browser:\n\n%login_url\n\nThis is a one-time login, so it can be used only once.\n\nAfter logging in, you may wish to change your password at %edit_uri\n\nYour new %site membership also enables to you to login to other Drupal powered websites (e.g. http://www.drop.org/) without registering. Just use the following Drupal ID and password:\n\nDrupal ID: %username@%uri_brief\npassword: %password\n\n\n-- %site team",$variables);
case'pass_subject':
returnt('Replacement login information for %username at %site',$variables);
case'pass_body':
returnt("%username,\n\nHere is your new password for %site.You may now login to %login_uri using the following username and password:\n\nusername: %username\npassword: %password\n\nAfter logging in, you may wish to change your password at %edit_uri",$variables);
returnt("%username,\n\nA request to reset the password for your account has been made at %site.\n\nYou may now login to %uri_brief clicking on this link or copying and pasting it in your browser:\n\n%login_url\n\nThis is a one-time login, so it can be used only once. It expires after one day and nothing will happen if it's not used.\n\nAfter logging in, you will be redirected to %edit_uri so you can change your password.",$variables);
}
}
}
...
...
@@ -1276,12 +1318,12 @@ function user_configure_settings() {
$group=form_textfield(t('Subject of welcome e-mail'),'user_mail_welcome_subject',_user_mail_text('welcome_subject'),70,180,t('Customize the subject of your welcome e-mail, which is sent to new members upon registering.').' '.t('Available variables are:').' %username, %site, %password, %uri, %uri_brief, %mailto, %date, %login_uri, %edit_uri.');
$group.=form_textarea(t('Body of welcome e-mail'),'user_mail_welcome_body',_user_mail_text('welcome_body'),70,10,t('Customize the body of the welcome e-mail, which is sent to new members upon registering.').' '.t('Available variables are:').' %username, %site, %password, %uri, %uri_brief, %mailto, %login_uri, %edit_uri.');
$group.=form_textfield(t('Subject of welcome e-mail (awaiting admin approval)'),'user_mail_approval_subject',_user_mail_text('approval_subject'),70,180,t('Customize the subject of your awaiting approval welcome e-mail, which is sent to new members upon registering.').' '.t('Available variables are:').' %username, %site, %password, %uri, %uri_brief, %mailto, %date, %login_uri, %edit_uri.');
$group.=form_textarea(t('Body of welcome e-mail (awaiting admin approval)'),'user_mail_approval_body',_user_mail_text('approval_body'),70,10,t('Customize the body of the awaiting approval welcome e-mail, which is sent to new members upon registering.').' '.t('Available variables are:').' %username, %site, %password, %uri, %uri_brief, %mailto, %login_uri, %edit_uri.');
$group.=form_textfield(t('Subject of password recovery e-mail'),'user_mail_pass_subject',_user_mail_text('pass_subject'),70,180,t('Customize the Subject of your forgotten password e-mail.').' '.t('Available variables are:').' %username, %site, %password, %uri, %uri_brief, %mailto, %date, %login_uri, %edit_uri.');
$group.=form_textarea(t('Body of password recovery e-mail'),'user_mail_pass_body',_user_mail_text('pass_body'),70,10,t('Customize the body of the forgotten password e-mail.').' '.t('Available variables are:').' %username, %site, %password, %uri, %uri_brief, %mailto, %login_uri, %edit_uri.');
$group=form_textfield(t('Subject of welcome e-mail'),'user_mail_welcome_subject',_user_mail_text('welcome_subject'),70,180,t('Customize the subject of your welcome e-mail, which is sent to new members upon registering.').' '.t('Available variables are:').' %username, %site, %password, %uri, %uri_brief, %mailto, %date, %login_uri, %edit_uri, %login_url.');
$group.=form_textarea(t('Body of welcome e-mail'),'user_mail_welcome_body',_user_mail_text('welcome_body'),70,10,t('Customize the body of the welcome e-mail, which is sent to new members upon registering.').' '.t('Available variables are:').' %username, %site, %password, %uri, %uri_brief, %mailto, %login_uri, %edit_uri, %login_url.');
$group.=form_textfield(t('Subject of welcome e-mail (awaiting admin approval)'),'user_mail_approval_subject',_user_mail_text('approval_subject'),70,180,t('Customize the subject of your awaiting approval welcome e-mail, which is sent to new members upon registering.').' '.t('Available variables are:').' %username, %site, %password, %uri, %uri_brief, %mailto, %date, %login_uri, %edit_uri, %login_url.');
$group.=form_textarea(t('Body of welcome e-mail (awaiting admin approval)'),'user_mail_approval_body',_user_mail_text('approval_body'),70,10,t('Customize the body of the awaiting approval welcome e-mail, which is sent to new members upon registering.').' '.t('Available variables are:').' %username, %site, %password, %uri, %uri_brief, %mailto, %login_uri, %edit_uri, %login_url.');
$group.=form_textfield(t('Subject of password recovery e-mail'),'user_mail_pass_subject',_user_mail_text('pass_subject'),70,180,t('Customize the Subject of your forgotten password e-mail.').' '.t('Available variables are:').' %username, %site, %login_url, %uri, %uri_brief, %mailto, %date, %login_uri, %edit_uri.');
$group.=form_textarea(t('Body of password recovery e-mail'),'user_mail_pass_body',_user_mail_text('pass_body'),70,10,t('Customize the body of the forgotten password e-mail.').' '.t('Available variables are:').' %username, %site, %login_url, %uri, %uri_brief, %mailto, %login_uri, %edit_uri.');
watchdog('user',t('Password mailed to %name at %email.',array('%name'=>theme('placeholder',$account->name),'%email'=>theme('placeholder',$account->mail))));
drupal_set_message(t('Your password and further instructions have been sent to your e-mail address.'));
watchdog('user',t('Password reset instructions mailed to %name at %email.',array('%name'=>'<em>'.$account->name.'</em>','%email'=>'<em>'.$account->mail.'</em>')));
drupal_set_message(t('Further instructions have been sent to your e-mail address.'));
}
else{
watchdog('user',t('Error mailing password to %name at %email.',array('%name'=>theme('placeholder',$account->name),'%email'=>theme('placeholder',$account->mail))),WATCHDOG_ERROR);
watchdog('user',t('Error mailing password reset instructions to %name at %email.',array('%name'=>theme('placeholder',$account->name),'%email'=>theme('placeholder',$account->mail))),WATCHDOG_ERROR);
drupal_set_message(t('Unable to send mail. Please contact the site admin.'));
}
drupal_goto('user');
}
else{
if($edit){
drupal_set_message(t('You must provider either a username or e-mail address.'),'error');
drupal_set_message(t('You must provide either a username or e-mail address.'),'error');
}
// Display form:
$output='<p>'.t('Enter your username <strong><em>or</em></strong> your e-mail address.').'</p>';
...
...
@@ -957,6 +955,50 @@ function user_pass() {
}
}
/**
* Menu callback; process one time login URL, and redirects to the user page on success.
// The first user may login immediately, and receives a customized welcome e-mail.
if($account->uid==1){
...
...
@@ -1256,15 +1298,15 @@ function _user_mail_text($messageid, $variables = array()) {
case'welcome_subject':
returnt('Account details for %username at %site',$variables);
case'welcome_body':
returnt("%username,\n\nThank you for registering at %site. You may now log in to %login_uri using the following username and password:\n\nusername: %username\npassword: %password\n\nAfter logging in, you may wish to change your password at %edit_uri\n\nYour new %site membership also enables to you to login to other Drupal powered websites (e.g. http://www.drupal.org/) without registering. Just use the following Drupal ID and password:\n\nDrupal ID: %username@%uri_brief\npassword: %password\n\n\n-- %site team",$variables);
returnt("%username,\n\nThank you for registering at %site. You may now log in to %login_uri using the following username and password:\n\nusername: %username\npassword: %password\n\nYou may also log in by clicking on this link or copying and pasting it in your browser:\n\n%login_url\n\nThis is a one-time login, so it can be used only once.\n\nAfter logging in, you will be redirected to %edit_uri so you can change your password.\n\nYour new %site membership also enables to you to login to other Drupal powered websites (e.g. http://www.drop.org/) without registering. Just use the following Drupal ID and password:\n\nDrupal ID: %username@%uri_brief\npassword: %password\n\n\n-- %site team",$variables);
case'approval_subject':
returnt('Account details for %username at %site (pending admin approval)',$variables);
case'approval_body':
returnt("%username,\n\nThank you for registering at %site. Your application for an account is currently pending approval. Once it has been granted, you may log in to %login_uri using the following username and password:\n\nusername: %username\npassword: %password\n\nAfter logging in, you may wish to change your password at %edit_uri\n\nYour new %site membership also enables to you to login to other Drupal powered websites (e.g. http://www.drupal.org/) without registering. Just use the following Drupal ID and password:\n\nDrupal ID: %username@%uri_brief\npassword: %password\n\n\n-- %site team",$variables);
returnt("%username,\n\nThank you for registering at %site. Your application for an account is currently pending approval. Once it has been granted, you may log in to %login_uri using the following username and password:\n\nusername: %username\npassword: %password\n\nYou may also log in by clicking on this link or copying and pasting it in your browser:\n\n%login_url\n\nThis is a one-time login, so it can be used only once.\n\nAfter logging in, you may wish to change your password at %edit_uri\n\nYour new %site membership also enables to you to login to other Drupal powered websites (e.g. http://www.drop.org/) without registering. Just use the following Drupal ID and password:\n\nDrupal ID: %username@%uri_brief\npassword: %password\n\n\n-- %site team",$variables);
case'pass_subject':
returnt('Replacement login information for %username at %site',$variables);
case'pass_body':
returnt("%username,\n\nHere is your new password for %site.You may now login to %login_uri using the following username and password:\n\nusername: %username\npassword: %password\n\nAfter logging in, you may wish to change your password at %edit_uri",$variables);
returnt("%username,\n\nA request to reset the password for your account has been made at %site.\n\nYou may now login to %uri_brief clicking on this link or copying and pasting it in your browser:\n\n%login_url\n\nThis is a one-time login, so it can be used only once. It expires after one day and nothing will happen if it's not used.\n\nAfter logging in, you will be redirected to %edit_uri so you can change your password.",$variables);
}
}
}
...
...
@@ -1276,12 +1318,12 @@ function user_configure_settings() {
$group=form_textfield(t('Subject of welcome e-mail'),'user_mail_welcome_subject',_user_mail_text('welcome_subject'),70,180,t('Customize the subject of your welcome e-mail, which is sent to new members upon registering.').' '.t('Available variables are:').' %username, %site, %password, %uri, %uri_brief, %mailto, %date, %login_uri, %edit_uri.');
$group.=form_textarea(t('Body of welcome e-mail'),'user_mail_welcome_body',_user_mail_text('welcome_body'),70,10,t('Customize the body of the welcome e-mail, which is sent to new members upon registering.').' '.t('Available variables are:').' %username, %site, %password, %uri, %uri_brief, %mailto, %login_uri, %edit_uri.');
$group.=form_textfield(t('Subject of welcome e-mail (awaiting admin approval)'),'user_mail_approval_subject',_user_mail_text('approval_subject'),70,180,t('Customize the subject of your awaiting approval welcome e-mail, which is sent to new members upon registering.').' '.t('Available variables are:').' %username, %site, %password, %uri, %uri_brief, %mailto, %date, %login_uri, %edit_uri.');
$group.=form_textarea(t('Body of welcome e-mail (awaiting admin approval)'),'user_mail_approval_body',_user_mail_text('approval_body'),70,10,t('Customize the body of the awaiting approval welcome e-mail, which is sent to new members upon registering.').' '.t('Available variables are:').' %username, %site, %password, %uri, %uri_brief, %mailto, %login_uri, %edit_uri.');
$group.=form_textfield(t('Subject of password recovery e-mail'),'user_mail_pass_subject',_user_mail_text('pass_subject'),70,180,t('Customize the Subject of your forgotten password e-mail.').' '.t('Available variables are:').' %username, %site, %password, %uri, %uri_brief, %mailto, %date, %login_uri, %edit_uri.');
$group.=form_textarea(t('Body of password recovery e-mail'),'user_mail_pass_body',_user_mail_text('pass_body'),70,10,t('Customize the body of the forgotten password e-mail.').' '.t('Available variables are:').' %username, %site, %password, %uri, %uri_brief, %mailto, %login_uri, %edit_uri.');
$group=form_textfield(t('Subject of welcome e-mail'),'user_mail_welcome_subject',_user_mail_text('welcome_subject'),70,180,t('Customize the subject of your welcome e-mail, which is sent to new members upon registering.').' '.t('Available variables are:').' %username, %site, %password, %uri, %uri_brief, %mailto, %date, %login_uri, %edit_uri, %login_url.');
$group.=form_textarea(t('Body of welcome e-mail'),'user_mail_welcome_body',_user_mail_text('welcome_body'),70,10,t('Customize the body of the welcome e-mail, which is sent to new members upon registering.').' '.t('Available variables are:').' %username, %site, %password, %uri, %uri_brief, %mailto, %login_uri, %edit_uri, %login_url.');
$group.=form_textfield(t('Subject of welcome e-mail (awaiting admin approval)'),'user_mail_approval_subject',_user_mail_text('approval_subject'),70,180,t('Customize the subject of your awaiting approval welcome e-mail, which is sent to new members upon registering.').' '.t('Available variables are:').' %username, %site, %password, %uri, %uri_brief, %mailto, %date, %login_uri, %edit_uri, %login_url.');
$group.=form_textarea(t('Body of welcome e-mail (awaiting admin approval)'),'user_mail_approval_body',_user_mail_text('approval_body'),70,10,t('Customize the body of the awaiting approval welcome e-mail, which is sent to new members upon registering.').' '.t('Available variables are:').' %username, %site, %password, %uri, %uri_brief, %mailto, %login_uri, %edit_uri, %login_url.');
$group.=form_textfield(t('Subject of password recovery e-mail'),'user_mail_pass_subject',_user_mail_text('pass_subject'),70,180,t('Customize the Subject of your forgotten password e-mail.').' '.t('Available variables are:').' %username, %site, %login_url, %uri, %uri_brief, %mailto, %date, %login_uri, %edit_uri.');
$group.=form_textarea(t('Body of password recovery e-mail'),'user_mail_pass_body',_user_mail_text('pass_body'),70,10,t('Customize the body of the forgotten password e-mail.').' '.t('Available variables are:').' %username, %site, %login_url, %uri, %uri_brief, %mailto, %login_uri, %edit_uri.');