Merge pull request #6182 from MrPetovan/task/6172-add-registration-invitation

Add new REGISTRATION_INVITATION value to mod/friendica output
This commit is contained in:
Tobias Diekershoff 2018-11-22 08:01:19 +01:00 committed by GitHub
commit 540321d0aa
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 9 additions and 3 deletions

View file

@ -13,7 +13,13 @@ use Friendica\Database\DBA;
function friendica_init(App $a) function friendica_init(App $a)
{ {
if (!empty($a->argv[1]) && ($a->argv[1] == "json")) { 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 = ''; $sql_extra = '';
if (x($a->config, 'admin_nickname')) { if (x($a->config, 'admin_nickname')) {
@ -52,7 +58,7 @@ function friendica_init(App $a)
'locked_features' => $locked_features, 'locked_features' => $locked_features,
'explicit_content' => (int)Config::get('system', 'explicit_content', false), 'explicit_content' => (int)Config::get('system', 'explicit_content', false),
'language' => Config::get('system','language'), 'language' => Config::get('system','language'),
'register_policy' => $register_policy[intval(Config::get('config', 'register_policy'))], 'register_policy' => $register_policy,
'admin' => $admin, 'admin' => $admin,
'site_name' => Config::get('config', 'sitename'), 'site_name' => Config::get('config', 'sitename'),
'platform' => FRIENDICA_PLATFORM, 'platform' => FRIENDICA_PLATFORM,

View file

@ -43,7 +43,7 @@ function redir_init(App $a) {
if ($contact['uid'] == 0 && local_user()) { if ($contact['uid'] == 0 && local_user()) {
// Let's have a look if there is an established connection // Let's have a look if there is an established connection
// between the puplic contact we have found and the local user. // between the public contact we have found and the local user.
$contact = DBA::selectFirst('contact', $fields, ['nurl' => $contact['nurl'], 'uid' => local_user()]); $contact = DBA::selectFirst('contact', $fields, ['nurl' => $contact['nurl'], 'uid' => local_user()]);
if (DBA::isResult($contact)) { if (DBA::isResult($contact)) {