]> git.mxchange.org Git - friendica.git/blobdiff - mod/register.php
Merge pull request #1057 from annando/master
[friendica.git] / mod / register.php
index f4c6570877ff2dc7e681d02c452a1db588b06306..5e011cb9a94a0edd358cb1aa1ccdb974e80a52e7 100644 (file)
@@ -1,5 +1,8 @@
 <?php
 
+require_once('include/email.php');
+require_once('include/bbcode.php');
+
 if(! function_exists('register_post')) {
 function register_post(&$a) {
 
@@ -21,7 +24,7 @@ function register_post(&$a) {
 
        switch($a->config['register_policy']) {
 
-       
+
        case REGISTER_OPEN:
                $blocked = 0;
                $verified = 1;
@@ -86,9 +89,9 @@ function register_post(&$a) {
                                '$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' );
 
@@ -116,8 +119,11 @@ function register_post(&$a) {
                        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']);
@@ -140,9 +146,9 @@ function register_post(&$a) {
                                '$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' );
 
@@ -258,7 +264,7 @@ function register_content(&$a) {
                '$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,
@@ -276,7 +282,9 @@ function register_content(&$a) {
                '$nickname'  => $nickname,
                '$license'   => $license,
                '$sitename'  => $a->get_hostname(),
-      
+               '$importh'   => t('Import'),
+               '$importt'   => t('Import your profile to this friendica instance'),
+
        ));
        return $o;