Merge pull request #1138 from fabrixxm/notifix

fix some emails
This commit is contained in:
fabrixxm 2014-09-09 22:10:16 +02:00
commit c311db4420
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.');
$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'],

View 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));

View 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'))
);

View 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();
}
}