smarty support in intltext, fix old pending accounts query in ping, log failed email register notify
This commit is contained in:
parent
6022a9e9cd
commit
e0cbbbf918
@ -247,14 +247,14 @@ function send_reg_approval_email($arr) {
|
|||||||
push_lang('en');
|
push_lang('en');
|
||||||
|
|
||||||
$email_msg = replace_macros(get_intltext_template('register_verify_email.tpl'), array(
|
$email_msg = replace_macros(get_intltext_template('register_verify_email.tpl'), array(
|
||||||
'$sitename' => get_config('config','sitename'),
|
'$sitename' => get_config('system','sitename'),
|
||||||
'$siteurl' => z_root(),
|
'$siteurl' => z_root(),
|
||||||
'$email' => $arr['email'],
|
'$email' => $arr['email'],
|
||||||
'$uid' => $arr['account']['account_id'],
|
'$uid' => $arr['account']['account_id'],
|
||||||
'$hash' => $hash
|
'$hash' => $hash
|
||||||
));
|
));
|
||||||
|
|
||||||
$res = mail($admin['email'], sprintf( t('Registration request at %s'), get_config('config','sitename')),
|
$res = mail($admin['email'], sprintf( t('Registration request at %s'), get_config('system','sitename')),
|
||||||
$email_msg,
|
$email_msg,
|
||||||
'From: ' . t('Administrator') . '@' . get_app()->get_hostname() . "\n"
|
'From: ' . t('Administrator') . '@' . get_app()->get_hostname() . "\n"
|
||||||
. 'Content-type: text/plain; charset=UTF-8' . "\n"
|
. 'Content-type: text/plain; charset=UTF-8' . "\n"
|
||||||
@ -263,6 +263,9 @@ function send_reg_approval_email($arr) {
|
|||||||
|
|
||||||
if($res)
|
if($res)
|
||||||
$delivered ++;
|
$delivered ++;
|
||||||
|
else
|
||||||
|
logger('send_reg_approval_email: failed to ' . $admin['email'] . 'account_id: ' . $arr['account']['account_id']);
|
||||||
|
|
||||||
pop_lang();
|
pop_lang();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -514,12 +514,22 @@ function get_intltext_template($s) {
|
|||||||
if($a->get_template_engine() === 'smarty3')
|
if($a->get_template_engine() === 'smarty3')
|
||||||
$engine = "/smarty3";
|
$engine = "/smarty3";
|
||||||
|
|
||||||
|
$file = '';
|
||||||
if(file_exists("view/{$a->language}$engine/$s"))
|
if(file_exists("view/{$a->language}$engine/$s"))
|
||||||
return file_get_contents("view/{$a->language}$engine/$s");
|
$file = "view/{$a->language}$engine/$s";
|
||||||
elseif(file_exists("view/en$engine/$s"))
|
elseif(file_exists("view/en$engine/$s"))
|
||||||
return file_get_contents("view/en$engine/$s");
|
$file = "view/en$engine/$s";
|
||||||
else
|
else
|
||||||
return file_get_contents("view/tpl/$engine/$s");
|
$file = "view/tpl/$engine/$s";
|
||||||
|
if($engine === '/smarty3') {
|
||||||
|
$template = new FriendicaSmarty();
|
||||||
|
$template->filename = $file;
|
||||||
|
|
||||||
|
return $template;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
return file_get_contents($file);
|
||||||
|
|
||||||
}}
|
}}
|
||||||
|
|
||||||
if(! function_exists('get_markup_template')) {
|
if(! function_exists('get_markup_template')) {
|
||||||
|
@ -327,7 +327,9 @@ function ping_init(&$a) {
|
|||||||
$result['mail'] = intval($mails[0]['total']);
|
$result['mail'] = intval($mails[0]['total']);
|
||||||
|
|
||||||
if ($a->config['system']['register_policy'] == REGISTER_APPROVE && is_site_admin()) {
|
if ($a->config['system']['register_policy'] == REGISTER_APPROVE && is_site_admin()) {
|
||||||
$regs = q("SELECT `contact`.`name`, `contact`.`url`, `contact`.`micro`, `register`.`created`, COUNT(*) as `total` FROM `contact` RIGHT JOIN `register` ON `register`.`uid`=`contact`.`uid` WHERE `contact`.`self`=1");
|
$regs = q("SELECT count(account_id) as total from account where (account_flags & %d)",
|
||||||
|
intval(ACCOUNT_PENDING)
|
||||||
|
);
|
||||||
if($regs)
|
if($regs)
|
||||||
$result['register'] = intval($regs[0]['total']);
|
$result['register'] = intval($regs[0]['total']);
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user