aboutsummaryrefslogtreecommitdiffstats
path: root/register.php
diff options
context:
space:
mode:
authormistic100 <mistic@piwigo.org>2012-01-14 12:00:47 +0000
committermistic100 <mistic@piwigo.org>2012-01-14 12:00:47 +0000
commitaf2302c1dbefa94968bd1dc067b9488790fd6f9c (patch)
tree49606f9b5751ed2007a9c26a99ec36a3f735b5c6 /register.php
parent25481da931ae564320d2d2cc0f4735c8b058a161 (diff)
2021: email notification on user creation + mail for admin at installation
git-svn-id: http://piwigo.org/svn/trunk@12883 68402e56-0260-453c-a942-63ccdbb3a9ee
Diffstat (limited to 'register.php')
-rw-r--r--register.php23
1 files changed, 23 insertions, 0 deletions
diff --git a/register.php b/register.php
index b5cdfb61c..93f962391 100644
--- a/register.php
+++ b/register.php
@@ -59,8 +59,31 @@ 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',
+ )
+ );
+
+ // 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);