From f4c52f5a0e0ba502ba5c18a96f17a387834d4561 Mon Sep 17 00:00:00 2001 From: Tobias Diekershoff Date: Fri, 18 Nov 2016 20:16:22 +0100 Subject: [PATCH 1/3] send email confirming pending registration #2916 --- include/user.php | 22 ++++++++++++++++++++++ mod/register.php | 6 ++++++ 2 files changed, 28 insertions(+) diff --git a/include/user.php b/include/user.php index 3997a8a61f..a3cd27e6ce 100644 --- a/include/user.php +++ b/include/user.php @@ -378,6 +378,28 @@ function create_user($arr) { } +/** + * @brief send registration confiƕmation with the intormation that reg is pending + * + * @param string $email + * @param string $sitename + * @param string $username + */ +function send_register_pending_eml($email, $sitename, $username) { + $body = deindent(t(' + Dear %1$s, + Thank you for registering at %2$s. Your account is pending for approval by the administrator. + ')); + + $body = sprintf($body, $username, $sitename); + + return notification(array( + 'type' => "SYSTEM_EMAIL", + 'to_email' => $email, + 'subject'=> sprintf( t('Registration at %s'), $sitename), + 'body' => $body)); +} + /* * send registration confirmation. * It's here as a function because the mail is sent diff --git a/mod/register.php b/mod/register.php index 3e124bd5bf..42127ce81c 100644 --- a/mod/register.php +++ b/mod/register.php @@ -133,6 +133,7 @@ function register_post(&$a) { $admin_mail_list ); + // send notification to admins foreach ($adminlist as $admin) { notification(array( 'type' => NOTIFY_SYSTEM, @@ -149,6 +150,11 @@ function register_post(&$a) { 'show_in_notification_page' => false )); } + // send notification to the user, that the registration is pending + send_register_pending_eml( + $user['email'], + $a->config['sitename'], + $user['username']); info( t('Your registration is pending approval by the site owner.') . EOL ) ; goaway(z_root()); From 32c0a9ef439a07d09c8529cc762ef5b2c68a2463 Mon Sep 17 00:00:00 2001 From: Tobias Diekershoff Date: Sat, 19 Nov 2016 14:32:01 +0100 Subject: [PATCH 2/3] added return value to doxygen header --- include/user.php | 1 + 1 file changed, 1 insertion(+) diff --git a/include/user.php b/include/user.php index a3cd27e6ce..f2abd9c0ef 100644 --- a/include/user.php +++ b/include/user.php @@ -384,6 +384,7 @@ function create_user($arr) { * @param string $email * @param string $sitename * @param string $username + * @return NULL|boolean */ function send_register_pending_eml($email, $sitename, $username) { $body = deindent(t(' From a7dae15e8299e440c747f30061d17f42c93f9e11 Mon Sep 17 00:00:00 2001 From: Tobias Diekershoff Date: Sat, 19 Nov 2016 14:34:06 +0100 Subject: [PATCH 3/3] added return value to doxygen header --- include/user.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/user.php b/include/user.php index f2abd9c0ef..5e8014abf8 100644 --- a/include/user.php +++ b/include/user.php @@ -384,7 +384,7 @@ function create_user($arr) { * @param string $email * @param string $sitename * @param string $username - * @return NULL|boolean + * @return NULL|boolean from notification() and email() inherited */ function send_register_pending_eml($email, $sitename, $username) { $body = deindent(t('