]> git.mxchange.org Git - friendica.git/commitdiff
Bugfix: Mails weren't sent
authorMichael <heluecht@pirati.ca>
Fri, 8 Sep 2017 15:14:33 +0000 (15:14 +0000)
committerMichael <heluecht@pirati.ca>
Fri, 8 Sep 2017 15:14:33 +0000 (15:14 +0000)
boot.php
include/dbstructure.php
include/enotify.php
include/user.php
mod/admin.php
mod/lostpass.php

index c3ad39cd5750c80ff81d3a1fb90540daaf9595ae..b8be70229c8a2336e3ee5efed1695704abea606a 100644 (file)
--- a/boot.php
+++ b/boot.php
@@ -320,6 +320,8 @@ define ( 'NOTIFY_TAGSHARE', 0x0100 );
 define ( 'NOTIFY_POKE',     0x0200 );
 define ( 'NOTIFY_SHARE',    0x0400 );
 
+define ( 'SYSTEM_EMAIL',    0x4000 );
+
 define ( 'NOTIFY_SYSTEM',   0x8000 );
 /* @}*/
 
index a2599fc392f49f9f8fb48c87e5e62df45458162f..d87f3948d2b1475012e18e01ef5753aa00cd7e97 100644 (file)
@@ -74,7 +74,7 @@ function update_fail($update_id, $error_message) {
                $body = sprintf($body, $error_message);
 
                notification(array(
-                       'type' => "SYSTEM_EMAIL",
+                       'type' => SYSTEM_EMAIL,
                        'to_email' => $admin['email'],
                        'preamble' => $preamble,
                        'body' => $body,
index 62328c01fdfea5667aa84e9001d3075767bd6270..10723fb418af41432d91f80d3a8da7f7f8320d03 100644 (file)
@@ -46,12 +46,14 @@ function notification($params) {
        if (empty($sender_email))
                $sender_email = t('noreply').'@'.$hostname;
 
-       $user = dba::select('user', array('nickname', 'page-flags'),
+       if ($params['type'] != SYSTEM_EMAIL) {
+               $user = dba::select('user', array('nickname', 'page-flags'),
                        array('uid' => $params['uid']), array('limit' => 1));
 
-       // There is no need to create notifications for forum accounts
-       if (!dbm::is_result($user) || in_array($user["page-flags"], array(PAGE_COMMUNITY, PAGE_PRVGROUP))) {
-               return;
+               // There is no need to create notifications for forum accounts
+               if (!dbm::is_result($user) || in_array($user["page-flags"], array(PAGE_COMMUNITY, PAGE_PRVGROUP))) {
+                       return;
+               }
        }
        $nickname = $user["nickname"];
 
@@ -366,7 +368,7 @@ function notification($params) {
                }
        }
 
-       if ($params['type'] == "SYSTEM_EMAIL") {
+       if ($params['type'] == SYSTEM_EMAIL) {
                // not part of the notifications.
                // it just send a mail to the user.
                // It will be used by the system to send emails to users (like
@@ -517,7 +519,7 @@ function notification($params) {
        // send email notification if notification preferences permit
        if ((intval($params['notify_flags']) & intval($params['type']))
                || $params['type'] == NOTIFY_SYSTEM
-               || $params['type'] == "SYSTEM_EMAIL") {
+               || $params['type'] == SYSTEM_EMAIL) {
 
                logger('sending notification email');
 
@@ -586,8 +588,8 @@ function notification($params) {
                call_hooks('enotify_mail', $datarray);
 
                // check whether sending post content in email notifications is allowed
-               // always true for "SYSTEM_EMAIL"
-               $content_allowed = ((!get_config('system', 'enotify_no_content')) || ($params['type'] == "SYSTEM_EMAIL"));
+               // always true for SYSTEM_EMAIL
+               $content_allowed = ((!get_config('system', 'enotify_no_content')) || ($params['type'] == SYSTEM_EMAIL));
 
                // load the template for private message notifications
                $tpl = get_markup_template('email_notify_html.tpl');
index 4ed5e57f3d39464f2a8bf7ddcb5cfdade6f95430..a05bd831a8e7d81aa19344d3853846acc363ee36 100644 (file)
@@ -404,7 +404,7 @@ function send_register_pending_eml($email, $sitename, $username) {
        $body = sprintf($body, $username, $sitename);
 
        return notification(array(
-               'type' => "SYSTEM_EMAIL",
+               'type' => SYSTEM_EMAIL,
                'to_email' => $email,
                'subject'=> sprintf( t('Registration at %s'), $sitename),
                'body' => $body));
@@ -450,7 +450,7 @@ function send_register_open_eml($email, $sitename, $siteurl, $username, $passwor
                $body = sprintf($body, $email, $sitename, $siteurl, $username, $password);
 
                return notification(array(
-                       'type' => "SYSTEM_EMAIL",
+                       'type' => SYSTEM_EMAIL,
                        'to_email' => $email,
                        'subject'=> sprintf( t('Registration details for %s'), $sitename),
                        'preamble'=> $preamble,
index c5043f2252e22cb767f61359b93f16513c64b7a2..6d1adc7012fc3ce0030b74e3a967c9821a586254 100644 (file)
@@ -1395,7 +1395,7 @@ function admin_page_users_post(App $a) {
                $body = sprintf($body, System::baseUrl(), $nu['email'], $result['password'], $a->config['sitename']);
 
                notification(array(
-                       'type' => "SYSTEM_EMAIL",
+                       'type' => SYSTEM_EMAIL,
                        'to_email' => $nu['email'],
                        'subject'=> sprintf(t('Registration details for %s'), $a->config['sitename']),
                        'preamble'=> $preamble,
index a2e69ffb090d2422a7f5253ee731735ddd53d961..e7e1a33bd02b22d72c90d621cd2d50656638f127 100644 (file)
@@ -69,7 +69,7 @@ function lostpass_post(App $a) {
        $body = sprintf($body, $resetlink, System::baseUrl(), $email);
 
        notification(array(
-               'type' => "SYSTEM_EMAIL",
+               'type' => SYSTEM_EMAIL,
                'to_email' => $email,
                'subject'=> sprintf( t('Password reset requested at %s'),$sitename),
                'preamble'=> $preamble,
@@ -145,7 +145,7 @@ function lostpass_content(App $a) {
                        $body = sprintf($body, System::baseUrl(), $email, $new_password);
 
                        notification(array(
-                               'type' => "SYSTEM_EMAIL",
+                               'type' => SYSTEM_EMAIL,
                                'to_email' => $email,
                                'subject'=> sprintf( t('Your password has been changed at %s'),$sitename),
                                'preamble'=> $preamble,