<?php
+require_once('include/email.php');
+require_once('include/bbcode.php');
+
if(! function_exists('register_post')) {
function register_post(&$a) {
call_hooks('register_post', $arr);
$max_dailies = intval(get_config('system','max_daily_registrations'));
- if($max_dailes) {
+ if($max_dailies) {
$r = q("select count(*) as total from user where register_date > UTC_TIMESTAMP - INTERVAL 1 day");
if($r && $r[0]['total'] >= $max_dailies) {
return;
switch($a->config['register_policy']) {
-
+
case REGISTER_OPEN:
$blocked = 0;
$verified = 1;
$verified = 0;
break;
}
+
require_once('include/user.php');
'$password' => $result['password'],
'$uid' => $user['uid'] ));
- $res = mail($user['email'], sprintf(t('Registration details for %s'), $a->config['sitename']),
+ $res = mail($user['email'], email_header_encode( sprintf( t('Registration details for %s'), $a->config['sitename']),'UTF-8'),
$email_tpl,
- 'From: ' . t('Administrator') . '@' . $_SERVER['SERVER_NAME'] . "\n"
+ 'From: ' . 'Administrator' . '@' . $_SERVER['SERVER_NAME'] . "\n"
. 'Content-type: text/plain; charset=UTF-8' . "\n"
. 'Content-transfer-encoding: 8bit' );
dbesc($lang)
);
+ $adminlist = explode(",", str_replace(" ", "", $a->config['admin_email']));
+
$r = q("SELECT `language` FROM `user` WHERE `email` = '%s' LIMIT 1",
- dbesc($a->config['admin_email'])
+ //dbesc($a->config['admin_email'])
+ dbesc($adminlist[0])
);
if(count($r))
push_lang($r[0]['language']);
'$hash' => $hash
));
- $res = mail($a->config['admin_email'], sprintf(t('Registration request at %s'), $a->config['sitename']),
+ $res = mail($a->config['admin_email'], email_header_encode( sprintf(t('Registration request at %s'), $a->config['sitename']),'UTF-8'),
$email_tpl,
- 'From: ' . t('Administrator') . '@' . $_SERVER['SERVER_NAME'] . "\n"
+ 'From: ' . 'Administrator' . '@' . $_SERVER['SERVER_NAME'] . "\n"
. 'Content-type: text/plain; charset=UTF-8' . "\n"
. 'Content-transfer-encoding: 8bit' );
}
$max_dailies = intval(get_config('system','max_daily_registrations'));
- if($max_dailes) {
+ if($max_dailies) {
$r = q("select count(*) as total from user where register_date > UTC_TIMESTAMP - INTERVAL 1 day");
if($r && $r[0]['total'] >= $max_dailies) {
logger('max daily registrations exceeded.');
if(x($_SESSION,'theme'))
unset($_SESSION['theme']);
+ if(x($_SESSION,'mobile-theme'))
+ unset($_SESSION['mobile-theme']);
$username = ((x($_POST,'username')) ? $_POST['username'] : ((x($_GET,'username')) ? $_GET['username'] : ''));
'$yes_selected' => ' checked="checked" ',
'$no_selected' => '',
'$str_yes' => t('Yes'),
- '$str_no' => t('No')
+ '$str_no' => t('No'),
));
}
-
$license = '';
$o = get_markup_template("register.tpl");
call_hooks('register_form',$arr);
+ $o = $arr['template'];
+
$o = replace_macros($o, array(
'$oidhtml' => $oidhtml,
'$invitations' => get_config('system','invitation_only'),
'$realpeople' => $realpeople,
'$regtitle' => t('Registration'),
'$registertext' =>((x($a->config,'register_text'))
- ? '<div class="error-message">' . $a->config['register_text'] . '</div>'
+ ? bbcode($a->config['register_text'])
: "" ),
'$fillwith' => $fillwith,
'$fillext' => $fillext,
'$openid' => $openid_url,
'$namelabel' => t('Your Full Name ' . "\x28" . 'e.g. Joe Smith' . "\x29" . ': '),
'$addrlabel' => t('Your Email Address: '),
- '$nickdesc' => t('Choose a profile nickname. This must begin with a text character. Your profile address on this site will then be \'<strong>nickname@$sitename</strong>\'.'),
+ '$nickdesc' => str_replace('$sitename',$a->get_hostname(),t('Choose a profile nickname. This must begin with a text character. Your profile address on this site will then be \'<strong>nickname@$sitename</strong>\'.')),
'$nicklabel' => t('Choose a nickname: '),
'$photo' => $photo,
'$publish' => $profile_publish,
'$email' => $email,
'$nickname' => $nickname,
'$license' => $license,
- '$sitename' => $a->get_hostname()
+ '$sitename' => $a->get_hostname(),
+ '$importh' => t('Import'),
+ '$importt' => t('Import your profile to this friendica instance'),
+
));
return $o;