$server = $a->get_hostname();
$logo = System::baseUrl() . '/images/friendica-64.png';
$email = Config::get('config', 'admin_email');
- $closed = Config::get('config', 'register_policy') == REGISTER_CLOSED ? 'true' : 'false';
+ $closed = intval(Config::get('config', 'register_policy')) === REGISTER_CLOSED ? 'true' : 'false';
$private = Config::get('system', 'block_public') ? 'true' : 'false';
$textlimit = (string) Config::get('config', 'api_import_size', Config::get('config', 'max_import_size', 200000));
$ssl = Config::get('system', 'have_ssl') ? 'true' : 'false';
{
if (!local_user()) {
$o = '<h2>' . L10n::t('Login') . '</h2>';
- $o .= Login::form($a->query_string, Config::get('config', 'register_policy') === REGISTER_CLOSED ? false : true);
+ $o .= Login::form($a->query_string, intval(Config::get('config', 'register_policy')) === REGISTER_CLOSED ? false : true);
return $o;
}
'url' => System::baseUrl(),
'addons' => $visible_addons,
'locked_features' => $locked_features,
- 'register_policy' => $register_policy[Config::get('config', 'register_policy')],
+ 'register_policy' => $register_policy[intval(Config::get('config', 'register_policy'))],
'admin' => $admin,
'site_name' => Config::get('config', 'sitename'),
'platform' => FRIENDICA_PLATFORM,
}
}
- $login = Login::form($a->query_string, Config::get('config', 'register_policy') === REGISTER_CLOSED ? 0 : 1);
+ $login = Login::form($a->query_string, intval(Config::get('config', 'register_policy')) === REGISTER_CLOSED ? 0 : 1);
$content = '';
Addon::callHooks("home_content",$content);
$dirloc = Config::get('system', 'directory');
if (strlen($dirloc)) {
- if (Config::get('config', 'register_policy') === REGISTER_CLOSED) {
+ if (intval(Config::get('config', 'register_policy')) === REGISTER_CLOSED) {
$linktxt = L10n::t('Visit %s for a list of public sites that you can join. Friendica members on other sites can all connect with each other, as well as with members of many other social networks.', $dirloc . '/servers');
} else {
$linktxt = L10n::t('To accept this invitation, please visit and register at %s or any other public Friendica website.', System::baseUrl())
. "\r\n" . "\r\n" . L10n::t('Friendica sites all inter-connect to create a huge privacy-enhanced social web that is owned and controlled by its members. They can also connect with many traditional social networks. See %s for a list of alternate Friendica sites you can join.', $dirloc . '/servers');
}
} else { // there is no global directory URL defined
- if (Config::get('config', 'register_policy') === REGISTER_CLOSED) {
+ if (intval(Config::get('config', 'register_policy')) === REGISTER_CLOSED) {
$o = L10n::t('Our apologies. This system is not currently configured to connect with other public sites or invite members.');
return $o;
} else {
$nodeinfo['usage'] = [];
- $nodeinfo['openRegistrations'] = Config::get('config', 'register_policy') !== REGISTER_CLOSED;
+ $nodeinfo['openRegistrations'] = intval(Config::get('config', 'register_policy')) !== REGISTER_CLOSED;
$nodeinfo['metadata'] = ['nodeName' => Config::get('config', 'sitename')];
// Successful OpenID login - but we can't match it to an existing account.
// New registration?
- if (Config::get('config', 'register_policy') === REGISTER_CLOSED) {
+ if (intval(Config::get('config', 'register_policy')) === REGISTER_CLOSED) {
notice(L10n::t('Account not found and OpenID registration is not permitted on this site.') . EOL);
goaway(System::baseUrl());
}
);
$mail_count = count($mails);
- if (Config::get('config', 'register_policy') === REGISTER_APPROVE && is_site_admin()) {
+ if (intval(Config::get('config', 'register_policy')) === REGISTER_APPROVE && is_site_admin()) {
$regs = q(
"SELECT `contact`.`name`, `contact`.`url`, `contact`.`micro`, `register`.`created`
FROM `contact` RIGHT JOIN `register` ON `register`.`uid` = `contact`.`uid`
$user = $result['user'];
- if ($netpublish && Config::get('config', 'register_policy') !== REGISTER_APPROVE) {
+ if ($netpublish && intval(Config::get('config', 'register_policy')) !== REGISTER_APPROVE) {
$url = System::baseUrl() . '/profile/' . $user['nickname'];
Worker::add(PRIORITY_LOW, "Directory", $url);
}
$num_invites = Config::get('system', 'number_invites');
$invite_id = ((x($_POST, 'invite_id')) ? notags(trim($_POST['invite_id'])) : '');
- if (Config::get('config', 'register_policy') === REGISTER_OPEN) {
+ if (intval(Config::get('config', 'register_policy')) === REGISTER_OPEN) {
if ($using_invites && $invite_id) {
q("delete * from register where hash = '%s' limit 1", dbesc($invite_id));
PConfig::set($user['uid'], 'system', 'invites_remaining', $num_invites);
info(L10n::t('Registration successful.') . EOL);
goaway(System::baseUrl());
}
- } elseif (Config::get('config', 'register_policy') === REGISTER_APPROVE) {
+ } elseif (intval(Config::get('config', 'register_policy')) === REGISTER_APPROVE) {
if (!strlen(Config::get('config', 'admin_email'))) {
notice(L10n::t('Your registration can not be processed.') . EOL);
goaway(System::baseUrl());
return;
}
- if ((!local_user()) && (Config::get('config', 'register_policy') === REGISTER_CLOSED)) {
+ if ((!local_user()) && (intval(Config::get('config', 'register_policy')) === REGISTER_CLOSED)) {
notice("Permission denied." . EOL);
return;
}
$o = replace_macros($tpl, [
'$oidhtml' => $oidhtml,
'$invitations' => Config::get('system', 'invitation_only'),
- '$permonly' => Config::get('config', 'register_policy') === REGISTER_APPROVE,
+ '$permonly' => intval(Config::get('config', 'register_policy')) === REGISTER_APPROVE,
'$permonlybox' => ['permonlybox', L10n::t('Note for the admin'), '', L10n::t('Leave a message for the admin, why you want to join this node')],
'$invite_desc' => L10n::t('Membership on this site is by invitation only.'),
'$invite_label' => L10n::t('Your invitation code: '),
{
if (!local_user()) {
info(L10n::t('Please login.') . EOL);
- $o = '<br /><br />' . Login::form($a->query_string, Config::get('config', 'register_policy') === REGISTER_CLOSED ? 0 : 1);
+ $o = '<br /><br />' . Login::form($a->query_string, intval(Config::get('config', 'register_policy')) === REGISTER_CLOSED ? 0 : 1);
return $o;
}
"name" => Config::get('config', 'sitename'),
"network" => FRIENDICA_PLATFORM,
"version" => FRIENDICA_VERSION . "-" . DB_UPDATE_VERSION,
- "registrations_open" => Config::get('config', 'register_policy') !== REGISTER_CLOSED,
+ "registrations_open" => intval(Config::get('config', 'register_policy')) !== REGISTER_CLOSED,
"total_users" => Config::get('nodeinfo', 'total_users'),
"active_users_halfyear" => Config::get('nodeinfo', 'active_users_halfyear'),
"active_users_monthly" => Config::get('nodeinfo', 'active_users_monthly'),
function uimport_content(App $a) {
- if ((!local_user()) && (Config::get('config', 'register_policy') === REGISTER_CLOSED)) {
+ if ((!local_user()) && (intval(Config::get('config', 'register_policy')) === REGISTER_CLOSED)) {
notice("Permission denied." . EOL);
return;
}
$nav['home'] = [$homelink, L10n::t('Home'), '', L10n::t('Home Page')];
}
- if ((Config::get('config', 'register_policy') === REGISTER_OPEN) && (! local_user()) && (! remote_user())) {
+ if (intval(Config::get('config', 'register_policy')) === REGISTER_OPEN && !local_user() && !remote_user()) {
$nav['register'] = ['register', L10n::t('Register'), '', L10n::t('Create an account')];
}
goaway(self::getApp()->get_baseurl());
}
- return self::form(self::getApp()->get_baseurl(), Config::get('config', 'register_policy') !== REGISTER_CLOSED);
+ return self::form(self::getApp()->get_baseurl(), intval(Config::get('config', 'register_policy')) !== REGISTER_CLOSED);
}
public static function post()