]> git.mxchange.org Git - friendica.git/blobdiff - mod/register.php
File was missing
[friendica.git] / mod / register.php
index 1963bd7a6023c8b6c67196f95a0d1f7271f8211d..f0348ef4e5c6b1d61fd26a5c2f1c6473870adca1 100644 (file)
@@ -52,6 +52,7 @@ function register_post(&$a) {
 
        $arr['blocked'] = $blocked;
        $arr['verified'] = $verified;
+       $arr['language'] = get_browser_language();
 
        $result = create_user($arr);
 
@@ -64,7 +65,7 @@ function register_post(&$a) {
 
        if($netpublish && $a->config['register_policy'] != REGISTER_APPROVE) {
                $url = $a->get_baseurl() . '/profile/' . $user['nickname'];
-               proc_run('php',"include/directory.php","$url");
+               proc_run(PRIORITY_LOW, "include/directory.php", $url);
        }
 
        $using_invites = get_config('system','invitation_only');
@@ -100,6 +101,9 @@ function register_post(&$a) {
                                                 ). EOL
                                );
                        }
+               } else {
+                       info( t('Registration successful.') . EOL ) ;
+                       goaway(z_root());
                }
        }
        elseif($a->config['register_policy'] == REGISTER_APPROVE) {
@@ -109,12 +113,13 @@ function register_post(&$a) {
                }
 
                $hash = random_string();
-               $r = q("INSERT INTO `register` ( `hash`, `created`, `uid`, `password`, `language` ) VALUES ( '%s', '%s', %d, '%s', '%s' ) ",
+               $r = q("INSERT INTO `register` ( `hash`, `created`, `uid`, `password`, `language`, `note` ) VALUES ( '%s', '%s', %d, '%s', '%s', '%s' ) ",
                        dbesc($hash),
                        dbesc(datetime_convert()),
                        intval($user['uid']),
                        dbesc($result['password']),
-                       dbesc($lang)
+                       dbesc($lang),
+                       dbesc($_POST['permonlybox'])
                );
 
                // invite system
@@ -129,7 +134,7 @@ function register_post(&$a) {
                        $admin_mail_list
                );
 
-
+               // send notification to admins
                foreach ($adminlist as $admin) {
                        notification(array(
                                'type' => NOTIFY_SYSTEM,
@@ -142,10 +147,15 @@ function register_post(&$a) {
                                'source_photo' => $a->get_baseurl() . "/photo/avatar/".$user['uid'].".jpg",
                                'to_email' => $admin['email'],
                                'uid' => $admin['uid'],
-                               'language' => ($admin['language']?$admin['language']:'en'))
-                       );
+                               'language' => ($admin['language']?$admin['language']:'en'),
+                               'show_in_notification_page' => false
+                       ));
                }
-
+               // send notification to the user, that the registration is pending
+               send_register_pending_eml(
+                               $user['email'],
+                               $a->config['sitename'],
+                               $user['username']);
 
                info( t('Your registration is pending approval by the site owner.') . EOL ) ;
                goaway(z_root());
@@ -253,6 +263,8 @@ function register_content(&$a) {
        $o = replace_macros($o, array(
                '$oidhtml' => $oidhtml,
                '$invitations' => get_config('system','invitation_only'),
+               '$permonly' => $a->config['register_policy'] == REGISTER_APPROVE,
+               '$permonlybox' => array('permonlybox', t('Note for the admin'), '', t('Leave a message for the admin, why you want to join this node')),
                '$invite_desc' => t('Membership on this site is by invitation only.'),
                '$invite_label' => t('Your invitation ID: '),
                '$invite_id' => $invite_id,
@@ -265,7 +277,7 @@ function register_content(&$a) {
                '$fillext'   => $fillext,
                '$oidlabel'  => $oidlabel,
                '$openid'    => $openid_url,
-               '$namelabel' => t('Your Full Name ' . "\x28" . 'e.g. Joe Smith' . "\x29" . ': '),
+               '$namelabel' => t('Your Full Name ' . "\x28" . 'e.g. Joe Smith, real or real-looking' . "\x29" . ': '),
                '$addrlabel' => t('Your Email Address: '),
                '$passwords' => $passwords,
                '$password1' => array('password1', t('New Password:'), '', t('Leave empty for an auto generated password.')),