From 5ea5350deb37777e815248488fd49699c18ab9e2 Mon Sep 17 00:00:00 2001 From: mistic100 Date: Sat, 14 Jan 2012 13:08:43 +0000 Subject: feature:2021 email notification on user creation, add checkboxes on register and install pages git-svn-id: http://piwigo.org/svn/trunk@12885 68402e56-0260-453c-a942-63ccdbb3a9ee --- register.php | 44 ++++++++++++++++++++++++-------------------- 1 file changed, 24 insertions(+), 20 deletions(-) (limited to 'register.php') diff --git a/register.php b/register.php index 93f962391..67736e7af 100644 --- a/register.php +++ b/register.php @@ -60,30 +60,34 @@ if (isset($_POST['submit'])) if (count($page['errors']) == 0) { // email notification - include_once(PHPWG_ROOT_PATH.'include/functions_mail.inc.php'); - - $keyargs_content = array( - get_l10n_args('Hello %s,', $_POST['login']), - get_l10n_args('Thank you for registering at %s!', $conf['gallery_title']), - get_l10n_args('', ''), - get_l10n_args('Here is your password: %s', $_POST['password']), - get_l10n_args('', ''), - get_l10n_args('If you think you\'ve received this email in error, please contact us at %s', get_webmaster_mail_address()), - ); - - pwg_mail( - $_POST['mail_address'], - array( - 'subject' => '['.$conf['gallery_title'].'] '.l10n('Registration'), - 'content' => l10n_args($keyargs_content), - 'content_format' => 'text/plain', - ) - ); + if (isset($_POST['send_password_by_mail']) and isset($_POST['mail_address'])) + { + include_once(PHPWG_ROOT_PATH.'include/functions_mail.inc.php'); + + $keyargs_content = array( + get_l10n_args('Hello %s,', $_POST['login']), + get_l10n_args('Thank you for registering at %s!', $conf['gallery_title']), + get_l10n_args('', ''), + get_l10n_args('Here is your password: %s', $_POST['password']), + get_l10n_args('', ''), + get_l10n_args('If you think you\'ve received this email in error, please contact us at %s', get_webmaster_mail_address()), + ); + + pwg_mail( + $_POST['mail_address'], + array( + 'subject' => '['.$conf['gallery_title'].'] '.l10n('Registration'), + 'content' => l10n_args($keyargs_content), + 'content_format' => 'text/plain', + ) + ); + + $_SESSION['page_infos'][] = l10n('Successfully registered, an email with your password has been sent to you. Welcome!'); + } // log user and redirect $user_id = get_userid($_POST['login']); log_user($user_id, false); - $_SESSION['page_infos'][] = l10n('Successfully registered, an email with your password has been sent to you. Welcome!'); redirect(make_index_url()); } $registration_post_key = get_ephemeral_key(2); -- cgit v1.2.3