]> git.mxchange.org Git - friendica.git/commitdiff
Add new REGISTER_INVITATION value to mod/friendica output
authorHypolite Petovan <hypolite@mrpetovan.com>
Thu, 22 Nov 2018 03:27:28 +0000 (22:27 -0500)
committerHypolite Petovan <hypolite@mrpetovan.com>
Thu, 22 Nov 2018 03:27:50 +0000 (22:27 -0500)
mod/friendica.php

index 0e647eb5ea18ae31bc28035d54165f83af7b3eef..77adccbfb6954f6fd7ee0f8fe178b10666fe527c 100644 (file)
@@ -13,7 +13,13 @@ use Friendica\Database\DBA;
 function friendica_init(App $a)
 {
        if (!empty($a->argv[1]) && ($a->argv[1] == "json")) {
-               $register_policy = ['REGISTER_CLOSED', 'REGISTER_APPROVE', 'REGISTER_OPEN'];
+               $register_policies = ['REGISTER_CLOSED', 'REGISTER_APPROVE', 'REGISTER_OPEN'];
+
+               $register_policy = $register_policies[intval(Config::get('config', 'register_policy'))];
+
+               if ($register_policy == 'REGISTER_OPEN' && Config::get('config', 'invitation_only')) {
+                       $register_policy = 'REGISTER_INVITATION';
+               }
 
                $sql_extra = '';
                if (x($a->config, 'admin_nickname')) {
@@ -52,7 +58,7 @@ function friendica_init(App $a)
                        'locked_features'  => $locked_features,
                        'explicit_content' => (int)Config::get('system', 'explicit_content', false),
                        'language'         => Config::get('system','language'),
-                       'register_policy'  => $register_policy[intval(Config::get('config', 'register_policy'))],
+                       'register_policy'  => $register_policy,
                        'admin'            => $admin,
                        'site_name'        => Config::get('config', 'sitename'),
                        'platform'         => FRIENDICA_PLATFORM,