fix register_policy globally

This commit is contained in:
friendica 2013-01-03 13:50:23 -08:00
parent 781f49768a
commit 7df33bb963
11 changed files with 16 additions and 16 deletions

View File

@ -1033,7 +1033,7 @@ function check_config(&$a) {
// wrapper for adding a login box. If $register == true provide a registration
// link. This will most always depend on the value of $a->config['register_policy'].
// link. This will most always depend on the value of $a->config['system']['register_policy'].
// returns the complete html for inserting into the page
if(! function_exists('login')) {

View File

@ -1467,7 +1467,7 @@
$server = $a->get_hostname();
$logo = $a->get_baseurl() . '/images/friendica-64.png';
$email = $a->config['admin_email'];
$closed = (($a->config['register_policy'] == REGISTER_CLOSED) ? 'true' : 'false');
$closed = (($a->config['system']['register_policy'] == REGISTER_CLOSED) ? 'true' : 'false');
$private = (($a->config['system']['block_public']) ? 'true' : 'false');
$textlimit = (string) (($a->config['max_import_size']) ? $a->config['max_import_size'] : 200000);
if($a->config['api_import_size'])

View File

@ -468,8 +468,8 @@ class enotify {
// generate a multipart/alternative message header
$messageHeader =
$params['additionalMailHeader'] .
"From: {$params['fromName']} <{$params['fromEmail']}>\n" .
"Reply-To: {$params['fromName']} <{$params['replyTo']}>\n" .
"From: $fromName <{$params['fromEmail']}>\n" .
"Reply-To: $fromName <{$params['replyTo']}>\n" .
"MIME-Version: 1.0\n" .
"Content-Type: multipart/alternative; boundary=\"{$mimeBoundary}\"";
@ -490,7 +490,7 @@ class enotify {
// send the message
$res = mail(
$params['toEmail'], // send to address
$params['messageSubject'], // subject
$messageSubject, // subject
$multipartMessageBody, // message body
$messageHeader // message headers
);

View File

@ -104,7 +104,7 @@ EOT;
$nav['home'] = array($homelink, t('Home'), "", t('Home Page'));
if(($a->config['register_policy'] == REGISTER_OPEN) && (! local_user()) && (! remote_user()))
if(($a->config['system']['register_policy'] == REGISTER_OPEN) && (! local_user()) && (! remote_user()))
$nav['register'] = array('register',t('Register'), "", t('Create an account'));
$help_url = $a->get_baseurl($ssl_state) . '/help';

View File

@ -300,9 +300,9 @@ function admin_page_site_post(&$a){
set_config('system','theme', $theme);
set_config('system','maximagesize', $maximagesize);
set_config('config','register_policy', $register_policy);
set_config('system','register_policy', $register_policy);
set_config('system','account_abandon_days', $abandon_days);
set_config('config','register_text', $register_text);
set_config('system','register_text', $register_text);
set_config('system','allowed_sites', $allowed_sites);
set_config('system','allowed_email', $allowed_email);
set_config('system','block_public', $block_public);
@ -403,7 +403,7 @@ function admin_page_site(&$a) {
'$theme' => array('theme', t("System theme"), get_config('system','theme'), t("Default system theme - may be over-ridden by user profiles - <a href='#' id='cnftheme'>change theme settings</a>"), $theme_choices),
'$ssl_policy' => array('ssl_policy', t("SSL link policy"), (string) intval(get_config('system','ssl_policy')), t("Determines whether generated links should be forced to use SSL"), $ssl_choices),
'$maximagesize' => array('maximagesize', t("Maximum image size"), get_config('system','maximagesize'), t("Maximum size in bytes of uploaded images. Default is 0, which means no limits.")),
'$register_policy' => array('register_policy', t("Register policy"), $a->config['register_policy'], "", $register_choices),
'$register_policy' => array('register_policy', t("Register policy"), $a->config['system']['register_policy'], "", $register_choices),
'$register_text' => array('register_text', t("Register text"), htmlentities($a->config['register_text'], ENT_QUOTES, 'UTF-8'), t("Will be displayed prominently on the registration page.")),
'$abandon_days' => array('abandon_days', t('Accounts abandoned after x days'), get_config('system','account_abandon_days'), t('Will not waste system resources polling external sites for abandonded accounts. Enter 0 for no time limit.')),
'$allowed_sites' => array('allowed_sites', t("Allowed friend domains"), get_config('system','allowed_sites'), t("Comma separated list of domains which are allowed to establish friendships with this site. Wildcards are accepted. Empty to allow any domains")),

View File

@ -96,9 +96,9 @@ function invite_content(&$a) {
$dirloc = get_config('system','directory_submit_url');
if(strlen($dirloc)) {
if($a->config['register_policy'] == REGISTER_CLOSED)
if($a->config['system']['register_policy'] == REGISTER_CLOSED)
$linktxt = sprintf( 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.'), dirname($dirloc) . '/siteinfo');
elseif($a->config['register_policy'] != REGISTER_CLOSED)
elseif($a->config['system']['register_policy'] != REGISTER_CLOSED)
$linktxt = sprintf( t('To accept this invitation, please visit and register at %s or any other public Friendica website.'), $a->get_baseurl())
. "\r\n" . "\r\n" . sprintf( 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.'),dirname($dirloc) . '/siteinfo');
}

View File

@ -202,7 +202,7 @@ function ping_init(&$a) {
if($mails)
$result['mail'] = intval($mails[0]['total']);
if ($a->config['register_policy'] == REGISTER_APPROVE && is_site_admin()){
if ($a->config['system']['register_policy'] == REGISTER_APPROVE && is_site_admin()){
$regs = q("SELECT `contact`.`name`, `contact`.`url`, `contact`.`micro`, `register`.`created`, COUNT(*) as `total` FROM `contact` RIGHT JOIN `register` ON `register`.`uid`=`contact`.`uid` WHERE `contact`.`self`=1");
if($regs)
$result['register'] = intval($regs[0]['total']);

View File

@ -42,7 +42,7 @@ function register_post(&$a) {
return;
}
$policy = get_config('config','register_policy');
$policy = get_config('system','register_policy');
switch($policy) {

View File

@ -108,7 +108,7 @@ function regmod_content(&$a) {
if(! local_user()) {
info( t('Please login.') . EOL);
$o .= '<br /><br />' . login(($a->config['register_policy'] == REGISTER_CLOSED) ? 0 : 1);
$o .= '<br /><br />' . login(($a->config['system']['register_policy'] == REGISTER_CLOSED) ? 0 : 1);
return $o;
}

View File

@ -519,7 +519,7 @@ function settings_post(&$a) {
// }
//$_SESSION['theme'] = $theme;
if($email_changed && $a->config['register_policy'] == REGISTER_VERIFY) {
if($email_changed && $a->config['system']['register_policy'] == REGISTER_VERIFY) {
// FIXME - set to un-verified, blocked and redirect to logout
// Why? Are we verifying people or email addresses?

View File

@ -31,7 +31,7 @@ function siteinfo_init(&$a) {
'version' => FRIENDICA_VERSION,
'url' => z_root(),
'plugins' => $visible_plugins,
'register_policy' => $register_policy[$a->config['register_policy']],
'register_policy' => $register_policy[$a->config['system']['register_policy']],
'admin' => $admin,
'site_name' => $a->config['sitename'],
'platform' => FRIENDICA_PLATFORM,