fix email for

- registration request
- registration approval
- account created by admin

add a reditect after registration approval or deny
This commit is contained in:
fabrixxm 2014-09-09 22:07:47 +02:00
parent bec92bf22e
commit 7687342849
4 changed files with 11 additions and 13 deletions

View file

@ -320,7 +320,7 @@ function notification($params) {
$sitelink = t('Please visit %s to approve or reject the request.'); $sitelink = t('Please visit %s to approve or reject the request.');
$tsitelink = sprintf( $sitelink, $params['link'] ); $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']; $itemlink = $params['link'];
break; break;
case "SYSTEM_DB_UPDATE_FAIL": case "SYSTEM_DB_UPDATE_FAIL":
@ -336,11 +336,6 @@ function notification($params) {
// add a notification to the user, with could be inexistent) // add a notification to the user, with could be inexistent)
$subject = $params['subject']; $subject = $params['subject'];
$preamble = $params['preamble']; $preamble = $params['preamble'];
if (x($params,'epreamble')){
$epreamble = $params['epreamble'];
} else {
$epreamble = str_replace("\n","<br>\n",$preamble);
}
$body = $params['body']; $body = $params['body'];
$sitelink = ""; $sitelink = "";
$tsitelink = ""; $tsitelink = "";
@ -554,7 +549,7 @@ function notification($params) {
$email_html_body = replace_macros($tpl,array( $email_html_body = replace_macros($tpl,array(
'$banner' => $datarray['banner'], '$banner' => $datarray['banner'],
'$product' => $datarray['product'], '$product' => $datarray['product'],
'$preamble' => $datarray['preamble'], '$preamble' => str_replace("\n","<br>\n",$datarray['preamble']),
'$sitename' => $datarray['sitename'], '$sitename' => $datarray['sitename'],
'$siteurl' => $datarray['siteurl'], '$siteurl' => $datarray['siteurl'],
'$source_name' => $datarray['source_name'], '$source_name' => $datarray['source_name'],

View file

@ -795,7 +795,7 @@ function admin_page_users_post(&$a){
notification(array( notification(array(
'type' => "SYSTEM_EMAIL", 'type' => "SYSTEM_EMAIL",
'to_email' => $email, 'to_email' => $nu['email'],
'subject'=> sprintf( t('Registration details for %s'), $a->config['sitename']), 'subject'=> sprintf( t('Registration details for %s'), $a->config['sitename']),
'preamble'=> $preamble, 'preamble'=> $preamble,
'body' => $body)); 'body' => $body));

View file

@ -48,8 +48,6 @@ function register_post(&$a) {
} }
require_once('include/user.php');
$arr = $_POST; $arr = $_POST;
$arr['blocked'] = $blocked; $arr['blocked'] = $blocked;
@ -140,7 +138,7 @@ function register_post(&$a) {
'source_link' => $a->get_baseurl()."/admin/users/", 'source_link' => $a->get_baseurl()."/admin/users/",
'link' => $a->get_baseurl()."/admin/users/", 'link' => $a->get_baseurl()."/admin/users/",
'source_photo' => $a->get_baseurl() . "/photo/avatar/".$user['uid'].".jpg", 'source_photo' => $a->get_baseurl() . "/photo/avatar/".$user['uid'].".jpg",
'to_email' => $admin['mail'], 'to_email' => $admin['email'],
'uid' => $admin['uid'], 'uid' => $admin['uid'],
'language' => ($admin['language']?$admin['language']:'en')) 'language' => ($admin['language']?$admin['language']:'en'))
); );

View file

@ -1,6 +1,7 @@
<?php <?php
require_once('include/enotify.php'); require_once('include/enotify.php');
require_once('include/user.php');
function user_allow($hash) { function user_allow($hash) {
@ -119,10 +120,14 @@ function regmod_content(&$a) {
if($cmd === 'deny') { if($cmd === 'deny') {
if (!user_deny($hash)) killme(); user_deny($hash);
goaway("/admin/users/");
killme();
} }
if($cmd === 'allow') { if($cmd === 'allow') {
if (!user_allow($hash)) killme(); user_allow($hash);
goaway("/admin/users/");
killme();
} }
} }