]> git.mxchange.org Git - friendica.git/commitdiff
Restore admin notification email on register approval
authorHypolite Petovan <ben.lort@gmail.com>
Fri, 30 Sep 2016 12:57:16 +0000 (08:57 -0400)
committerHypolite Petovan <ben.lort@gmail.com>
Fri, 30 Sep 2016 12:57:16 +0000 (08:57 -0400)
- Reverted changes to mod/register.php
- Added "show_in_notification_page" flag to prevent `notify` DB
insertion

include/enotify.php
mod/register.php

index bed00c5eaf95ac1969855d1ed8190a04dbf19c4c..4973bedc24c4270053b606d289ab7d8ab354e571 100644 (file)
@@ -49,7 +49,7 @@ function notification($params) {
        // with $params['show_in_notification_page'] == false, the notification isn't inserted into
        // the database, and an email is sent if applicable.
        // default, if not specified: true
-       $show_in_notification_page = ((x($params, 'show_in_notification_page')) ? $params['show_in_notification_page']:True);
+       $show_in_notification_page = ((x($params, 'show_in_notification_page')) ? $params['show_in_notification_page']:true);
 
        $additional_mail_header = "";
        $additional_mail_header .= "Precedence: list\n";
index 62b6a5f033353c478fb0bb956e11df28cdd58818..0d29b3f9e515fec882d8cbf6b717378828fdd0c8 100644 (file)
@@ -132,6 +132,23 @@ function register_post(&$a) {
                        $admin_mail_list
                );
 
+               foreach ($adminlist as $admin) {
+                       notification(array(
+                               'type' => NOTIFY_SYSTEM,
+                               'event' => 'SYSTEM_REGISTER_REQUEST',
+                               'source_name' => $user['username'],
+                               'source_mail' => $user['email'],
+                               'source_nick' => $user['nickname'],
+                               'source_link' => $a->get_baseurl()."/admin/users/",
+                               'link' => $a->get_baseurl()."/admin/users/",
+                               'source_photo' => $a->get_baseurl() . "/photo/avatar/".$user['uid'].".jpg",
+                               'to_email' => $admin['email'],
+                               'uid' => $admin['uid'],
+                               'language' => ($admin['language']?$admin['language']:'en'),
+                               'show_in_notification_page' => false
+                       ));
+               }
+
                info( t('Your registration is pending approval by the site owner.') . EOL ) ;
                goaway(z_root());