]> git.mxchange.org Git - friendica.git/commitdiff
fix email for
authorfabrixxm <fabrix.xm@gmail.com>
Tue, 9 Sep 2014 20:07:47 +0000 (22:07 +0200)
committerfabrixxm <fabrix.xm@gmail.com>
Tue, 9 Sep 2014 20:07:47 +0000 (22:07 +0200)
- registration request
- registration approval
- account created by admin

add a reditect after registration approval or deny

include/enotify.php
mod/admin.php
mod/register.php
mod/regmod.php

index bad94597aa6a5cb8fcaa491b5964483a118ce570..04db10500a1a337616a195de88e0a7457fff84ae 100644 (file)
@@ -320,7 +320,7 @@ function notification($params) {
 
                                $sitelink = t('Please visit %s to approve or reject the request.');
                                $tsitelink = sprintf( $sitelink, $params['link'] );
-                               $hsitelink = sprintf( $sitelink, '<a href="' . $params['link'] . '">' . $sitename . '</a>');
+                               $hsitelink = sprintf( $sitelink, '<a href="' . $params['link'] . '">' . $sitename . '</a><br><br>');
                                $itemlink =  $params['link'];
                                break;
                        case "SYSTEM_DB_UPDATE_FAIL":
@@ -336,11 +336,6 @@ function notification($params) {
                // add a notification to the user, with could be inexistent)
                        $subject = $params['subject'];
                        $preamble = $params['preamble'];
-                       if (x($params,'epreamble')){
-                               $epreamble = $params['epreamble'];
-                       } else {
-                               $epreamble = str_replace("\n","<br>\n",$preamble);
-                       }
                        $body =  $params['body'];
                        $sitelink = "";
                        $tsitelink = "";
@@ -554,7 +549,7 @@ function notification($params) {
                $email_html_body = replace_macros($tpl,array(
                        '$banner'       => $datarray['banner'],
                        '$product'      => $datarray['product'],
-                       '$preamble'     => $datarray['preamble'],
+                       '$preamble'     => str_replace("\n","<br>\n",$datarray['preamble']),
                        '$sitename'     => $datarray['sitename'],
                        '$siteurl'      => $datarray['siteurl'],
                        '$source_name'  => $datarray['source_name'],
index 537702b55bf512f993a2de28d08e3d91e5d56c6e..dff8ee15674b846e318e62080cafcf3e4765edca 100644 (file)
@@ -795,7 +795,7 @@ function admin_page_users_post(&$a){
 
                notification(array(
                        'type' => "SYSTEM_EMAIL",
-                       'to_email' => $email,
+                       'to_email' => $nu['email'],
                        'subject'=> sprintf( t('Registration details for %s'), $a->config['sitename']),
                        'preamble'=> $preamble,
                        'body' => $body));
index 4ad84ecd6f872c01da1a6d0ae6b69ba80346c9a5..4c0860e6e3f3362a9ace2b2a732886114e95a85b 100644 (file)
@@ -48,8 +48,6 @@ function register_post(&$a) {
        }
 
 
-       require_once('include/user.php');
-
        $arr = $_POST;
 
        $arr['blocked'] = $blocked;
@@ -140,7 +138,7 @@ function register_post(&$a) {
                                '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['mail'],
+                               'to_email' => $admin['email'],
                                'uid' => $admin['uid'],
                                'language' => ($admin['language']?$admin['language']:'en'))
                        );
index 05f33ab11fff88031e19e727dc7c5ada7143bc71..53e6716f265c7be0cbec9eb6a7a6b18abd635b9e 100644 (file)
@@ -1,6 +1,7 @@
 <?php
 
 require_once('include/enotify.php');
+require_once('include/user.php');
 
 function user_allow($hash) {
 
@@ -119,10 +120,14 @@ function regmod_content(&$a) {
 
 
        if($cmd === 'deny') {
-               if (!user_deny($hash)) killme();
+               user_deny($hash);
+               goaway("/admin/users/");
+               killme();
        }
 
        if($cmd === 'allow') {
-               if (!user_allow($hash)) killme();
+               user_allow($hash);
+               goaway("/admin/users/");
+               killme();
        }
 }