aboutsummaryrefslogtreecommitdiffstats
path: root/mod/register.php
diff options
context:
space:
mode:
authorFriendika <info@friendika.com>2011-05-23 20:30:37 -0700
committerFriendika <info@friendika.com>2011-05-23 20:30:37 -0700
commit040fc247a0caa51e0d4da4169980dc32e80ee804 (patch)
treeedbf6122cc4b099222bf9ca6acf38f0aa7982aea /mod/register.php
parent19ccd658ebcf13a7cc208a3e460e44d152dda32f (diff)
downloadvolse-hubzilla-040fc247a0caa51e0d4da4169980dc32e80ee804.tar.gz
volse-hubzilla-040fc247a0caa51e0d4da4169980dc32e80ee804.tar.bz2
volse-hubzilla-040fc247a0caa51e0d4da4169980dc32e80ee804.zip
bug #85
Diffstat (limited to 'mod/register.php')
-rw-r--r--mod/register.php19
1 files changed, 17 insertions, 2 deletions
diff --git a/mod/register.php b/mod/register.php
index 95bf60e32..78dc75f77 100644
--- a/mod/register.php
+++ b/mod/register.php
@@ -3,6 +3,8 @@
if(! function_exists('register_post')) {
function register_post(&$a) {
+ global $lang;
+
$verified = 0;
$blocked = 1;
@@ -350,12 +352,22 @@ function register_post(&$a) {
}
$hash = random_string();
- $r = q("INSERT INTO `register` ( `hash`, `created`, `uid`, `password` ) VALUES ( '%s', '%s', %d, '%s' ) ",
+ $r = q("INSERT INTO `register` ( `hash`, `created`, `uid`, `password`, `language` ) VALUES ( '%s', '%s', %d, '%s', '%s' ) ",
dbesc($hash),
dbesc(datetime_convert()),
intval($newuid),
- dbesc($new_password)
+ dbesc($new_password),
+ dbesc($lang)
+ );
+
+ $r = q("SELECT `language` FROM `user` WHERE `email` = '%s' LIMIT 1",
+ dbesc($a->config['admin_email'])
);
+ if(count($r))
+ push_lang($r[0]['language']);
+ else
+ push_lang('en');
+
$email_tpl = get_intltext_template("register_verify_eml.tpl");
$email_tpl = replace_macros($email_tpl, array(
@@ -373,6 +385,9 @@ function register_post(&$a) {
'From: ' . t('Administrator') . '@' . $_SERVER['SERVER_NAME'] . "\n"
. 'Content-type: text/plain; charset=UTF-8' . "\n"
. 'Content-transfer-encoding: 8bit' );
+
+ pop_lang();
+
if($res) {
info( t('Your registration is pending approval by the site owner.') . EOL ) ;
goaway($a->get_baseurl());