Revert "Added configuration option to only allow OpenID logins."

This reverts commit 14b46e2183.

This functionality will need to be rewritten to work with the new
OpenIDPlugin.

Conflicts:

	index.php
	lib/logingroupnav.php
This commit is contained in:
Evan Prodromou 2009-08-21 16:45:42 -04:00
parent bacef32aac
commit 59beff6b46
20 changed files with 32 additions and 78 deletions

2
README
View File

@ -968,8 +968,6 @@ closed: If set to 'true', will disallow registration on your site.
the service, *then* set this variable to 'true'. the service, *then* set this variable to 'true'.
inviteonly: If set to 'true', will only allow registration if the user inviteonly: If set to 'true', will only allow registration if the user
was invited by an existing user. was invited by an existing user.
openidonly: If set to 'true', will only allow registrations and logins
through OpenID.
private: If set to 'true', anonymous users will be redirected to the private: If set to 'true', anonymous users will be redirected to the
'login' page. Also, API methods that normally require no 'login' page. Also, API methods that normally require no
authentication will require it. Note that this does not turn authentication will require it. Note that this does not turn

View File

@ -108,9 +108,7 @@ class AllAction extends ProfileAction
} }
} }
else { else {
$message .= sprintf(_('Why not [register an account](%%%%action.%s%%%%) and then nudge %s or post a notice to his or her attention.'), $message .= sprintf(_('Why not [register an account](%%%%action.register%%%%) and then nudge %s or post a notice to his or her attention.'), $this->user->nickname);
(!common_config('site','openidonly')) ? 'register' : 'openidlogin',
$this->user->nickname);
} }
$this->elementStart('div', 'guide'); $this->elementStart('div', 'guide');

View File

@ -67,11 +67,7 @@ class ConfirmaddressAction extends Action
parent::handle($args); parent::handle($args);
if (!common_logged_in()) { if (!common_logged_in()) {
common_set_returnto($this->selfUrl()); common_set_returnto($this->selfUrl());
if (!common_config('site', 'openidonly')) {
common_redirect(common_local_url('login')); common_redirect(common_local_url('login'));
} else {
common_redirect(common_local_url('openidlogin'));
}
return; return;
} }
$code = $this->trimmed('code'); $code = $this->trimmed('code');

View File

@ -153,8 +153,7 @@ class FavoritedAction extends Action
$message .= _('Be the first to add a notice to your favorites by clicking the fave button next to any notice you like.'); $message .= _('Be the first to add a notice to your favorites by clicking the fave button next to any notice you like.');
} }
else { else {
$message .= sprintf(_('Why not [register an account](%%%%action.%s%%%%) and be the first to add a notice to your favorites!'), $message .= _('Why not [register an account](%%action.register%%) and be the first to add a notice to your favorites!');
(!common_config('site','openidonly')) ? 'register' : 'openidlogin');
} }
$this->elementStart('div', 'guide'); $this->elementStart('div', 'guide');

View File

@ -82,8 +82,7 @@ class GroupsearchAction extends SearchAction
$message = _('If you can\'t find the group you\'re looking for, you can [create it](%%action.newgroup%%) yourself.'); $message = _('If you can\'t find the group you\'re looking for, you can [create it](%%action.newgroup%%) yourself.');
} }
else { else {
$message = sprintf(_('Why not [register an account](%%%%action.%s%%%%) and [create the group](%%%%action.newgroup%%%%) yourself!'), $message = _('Why not [register an account](%%action.register%%) and [create the group](%%action.newgroup%%) yourself!');
(!common_config('site','openidonly')) ? 'register' : 'openidlogin');
} }
$this->elementStart('div', 'guide'); $this->elementStart('div', 'guide');
$this->raw(common_markup_to_html($message)); $this->raw(common_markup_to_html($message));

View File

@ -235,7 +235,7 @@ class InviteAction extends CurrentUserDesignAction
common_root_url(), common_root_url(),
$personal, $personal,
common_local_url('showstream', array('nickname' => $user->nickname)), common_local_url('showstream', array('nickname' => $user->nickname)),
common_local_url((!common_config('site', 'openidonly')) ? 'register' : 'openidlogin', array('code' => $invite->code))); common_local_url('register', array('code' => $invite->code)));
mail_send($recipients, $headers, $body); mail_send($recipients, $headers, $body);
} }

View File

@ -121,9 +121,7 @@ class NoticesearchAction extends SearchAction
$message = sprintf(_('Be the first to [post on this topic](%%%%action.newnotice%%%%?status_textarea=%s)!'), urlencode($q)); $message = sprintf(_('Be the first to [post on this topic](%%%%action.newnotice%%%%?status_textarea=%s)!'), urlencode($q));
} }
else { else {
$message = sprintf(_('Why not [register an account](%%%%action.%s%%%%) and be the first to [post on this topic](%%%%action.newnotice%%%%?status_textarea=%s)!'), $message = sprintf(_('Why not [register an account](%%%%action.register%%%%) and be the first to [post on this topic](%%%%action.newnotice%%%%?status_textarea=%s)!'), urlencode($q));
(!common_config('site','openidonly')) ? 'register' : 'openidlogin',
urlencode($q));
} }
$this->elementStart('div', 'guide'); $this->elementStart('div', 'guide');

View File

@ -178,8 +178,7 @@ class PublicAction extends Action
} }
else { else {
if (! (common_config('site','closed') || common_config('site','inviteonly'))) { if (! (common_config('site','closed') || common_config('site','inviteonly'))) {
$message .= sprintf(_('Why not [register an account](%%%%action.%s%%%%) and be the first to post!'), $message .= _('Why not [register an account](%%action.register%%) and be the first to post!');
(!common_config('site','openidonly')) ? 'register' : 'openidlogin');
} }
} }
@ -226,11 +225,9 @@ class PublicAction extends Action
function showAnonymousMessage() function showAnonymousMessage()
{ {
if (! (common_config('site','closed') || common_config('site','inviteonly'))) { if (! (common_config('site','closed') || common_config('site','inviteonly'))) {
$m = sprintf(_('This is %%%%site.name%%%%, a [micro-blogging](http://en.wikipedia.org/wiki/Micro-blogging) service ' . $m = _('This is %%site.name%%, a [micro-blogging](http://en.wikipedia.org/wiki/Micro-blogging) service ' .
'based on the Free Software [Laconica](http://laconi.ca/) tool. ' . 'based on the Free Software [Laconica](http://laconi.ca/) tool. ' .
'[Join now](%%%%action.%s%%%%) to share notices about yourself with friends, family, and colleagues! ' . '[Join now](%%action.register%%) to share notices about yourself with friends, family, and colleagues! ([Read more](%%doc.help%%))');
'([Read more](%%%%doc.help%%%%))'),
(!common_config('site','openidonly')) ? 'register' : 'openidlogin');
} else { } else {
$m = _('This is %%site.name%%, a [micro-blogging](http://en.wikipedia.org/wiki/Micro-blogging) service ' . $m = _('This is %%site.name%%, a [micro-blogging](http://en.wikipedia.org/wiki/Micro-blogging) service ' .
'based on the Free Software [Laconica](http://laconi.ca/) tool.'); 'based on the Free Software [Laconica](http://laconi.ca/) tool.');

View File

@ -72,8 +72,7 @@ class PublictagcloudAction extends Action
$message .= _('Be the first to post one!'); $message .= _('Be the first to post one!');
} }
else { else {
$message .= sprintf(_('Why not [register an account](%%%%action.%s%%%%) and be the first to post one!'), $message .= _('Why not [register an account](%%action.register%%) and be the first to post one!');
(!common_config('site','openidonly')) ? 'register' : 'openidlogin');
} }
$this->elementStart('div', 'guide'); $this->elementStart('div', 'guide');

View File

@ -97,13 +97,11 @@ class RemotesubscribeAction extends Action
if ($this->err) { if ($this->err) {
$this->element('div', 'error', $this->err); $this->element('div', 'error', $this->err);
} else { } else {
$inst = sprintf(_('To subscribe, you can [login](%%%%action.%s%%%%),' . $inst = _('To subscribe, you can [login](%%action.login%%),' .
' or [register](%%%%action.%s%%%%) a new ' . ' or [register](%%action.register%%) a new ' .
' account. If you already have an account ' . ' account. If you already have an account ' .
' on a [compatible microblogging site](%%doc.openmublog%%), ' . ' on a [compatible microblogging site](%%doc.openmublog%%), ' .
' enter your profile URL below.'), ' enter your profile URL below.');
(!common_config('site','openidonly')) ? 'login' : 'openidlogin',
(!common_config('site','openidonly')) ? 'register' : 'openidlogin');
$output = common_markup_to_html($inst); $output = common_markup_to_html($inst);
$this->elementStart('div', 'instructions'); $this->elementStart('div', 'instructions');
$this->raw($output); $this->raw($output);

View File

@ -192,9 +192,7 @@ class RepliesAction extends OwnerDesignAction
} }
} }
else { else {
$message .= sprintf(_('Why not [register an account](%%%%action.%s%%%%) and then nudge %s or post a notice to his or her attention.'), $message .= sprintf(_('Why not [register an account](%%%%action.register%%%%) and then nudge %s or post a notice to his or her attention.'), $this->user->nickname);
(!common_config('site','openidonly')) ? 'register' : 'openidlogin',
$this->user->nickname);
} }
$this->elementStart('div', 'guide'); $this->elementStart('div', 'guide');

View File

@ -196,9 +196,7 @@ class ShowfavoritesAction extends OwnerDesignAction
} }
} }
else { else {
$message = sprintf(_('%s hasn\'t added any notices to his favorites yet. Why not [register an account](%%%%action.%s%%%%) and then post something interesting they would add to their favorites :)'), $message = sprintf(_('%s hasn\'t added any notices to his favorites yet. Why not [register an account](%%%%action.register%%%%) and then post something interesting they would add to their favorites :)'), $this->user->nickname);
$this->user->nickname,
(!common_config('site','openidonly')) ? 'register' : 'openidlogin');
} }
$this->elementStart('div', 'guide'); $this->elementStart('div', 'guide');

View File

@ -450,9 +450,8 @@ class ShowgroupAction extends GroupDesignAction
$m = sprintf(_('**%s** is a user group on %%%%site.name%%%%, a [micro-blogging](http://en.wikipedia.org/wiki/Micro-blogging) service ' . $m = sprintf(_('**%s** is a user group on %%%%site.name%%%%, a [micro-blogging](http://en.wikipedia.org/wiki/Micro-blogging) service ' .
'based on the Free Software [Laconica](http://laconi.ca/) tool. Its members share ' . 'based on the Free Software [Laconica](http://laconi.ca/) tool. Its members share ' .
'short messages about their life and interests. '. 'short messages about their life and interests. '.
'[Join now](%%%%action.%s%%%%) to become part of this group and many more! ([Read more](%%%%doc.help%%%%))'), '[Join now](%%%%action.register%%%%) to become part of this group and many more! ([Read more](%%%%doc.help%%%%))'),
$this->group->nickname, $this->group->nickname);
(!common_config('site','openidonly')) ? 'register' : 'openidlogin');
} else { } else {
$m = sprintf(_('**%s** is a user group on %%%%site.name%%%%, a [micro-blogging](http://en.wikipedia.org/wiki/Micro-blogging) service ' . $m = sprintf(_('**%s** is a user group on %%%%site.name%%%%, a [micro-blogging](http://en.wikipedia.org/wiki/Micro-blogging) service ' .
'based on the Free Software [Laconica](http://laconi.ca/) tool. Its members share ' . 'based on the Free Software [Laconica](http://laconi.ca/) tool. Its members share ' .

View File

@ -358,9 +358,7 @@ class ShowstreamAction extends ProfileAction
} }
} }
else { else {
$message .= sprintf(_('Why not [register an account](%%%%action.%s%%%%) and then nudge %s or post a notice to his or her attention.'), $message .= sprintf(_('Why not [register an account](%%%%action.register%%%%) and then nudge %s or post a notice to his or her attention.'), $this->user->nickname);
(!common_config('site','openidonly')) ? 'register' : 'openidlogin',
$this->user->nickname);
} }
$this->elementStart('div', 'guide'); $this->elementStart('div', 'guide');
@ -389,10 +387,8 @@ class ShowstreamAction extends ProfileAction
if (!(common_config('site','closed') || common_config('site','inviteonly'))) { if (!(common_config('site','closed') || common_config('site','inviteonly'))) {
$m = sprintf(_('**%s** has an account on %%%%site.name%%%%, a [micro-blogging](http://en.wikipedia.org/wiki/Micro-blogging) service ' . $m = sprintf(_('**%s** has an account on %%%%site.name%%%%, a [micro-blogging](http://en.wikipedia.org/wiki/Micro-blogging) service ' .
'based on the Free Software [Laconica](http://laconi.ca/) tool. ' . 'based on the Free Software [Laconica](http://laconi.ca/) tool. ' .
'[Join now](%%%%action.%s%%%%) to follow **%s**\'s notices and many more! ([Read more](%%%%doc.help%%%%))'), '[Join now](%%%%action.register%%%%) to follow **%s**\'s notices and many more! ([Read more](%%%%doc.help%%%%))'),
$this->user->nickname, $this->user->nickname, $this->user->nickname);
(!common_config('site','openidonly')) ? 'register' : 'openidlogin',
$this->user->nickname);
} else { } else {
$m = sprintf(_('**%s** has an account on %%%%site.name%%%%, a [micro-blogging](http://en.wikipedia.org/wiki/Micro-blogging) service ' . $m = sprintf(_('**%s** has an account on %%%%site.name%%%%, a [micro-blogging](http://en.wikipedia.org/wiki/Micro-blogging) service ' .
'based on the Free Software [Laconica](http://laconi.ca/) tool. '), 'based on the Free Software [Laconica](http://laconi.ca/) tool. '),

View File

@ -111,9 +111,7 @@ class SubscribersAction extends GalleryAction
} }
} }
else { else {
$message = sprintf(_('%s has no subscribers. Why not [register an account](%%%%action.%s%%%%) and be the first?'), $message = sprintf(_('%s has no subscribers. Why not [register an account](%%%%action.register%%%%) and be the first?'), $this->user->nickname);
$this->user->nickname,
(!common_config('site','openidonly')) ? 'register' : 'openidlogin');
} }
$this->elementStart('div', 'guide'); $this->elementStart('div', 'guide');

View File

@ -63,11 +63,7 @@ class UserauthorizationAction extends Action
/* Go log in, and then come back. */ /* Go log in, and then come back. */
common_set_returnto($_SERVER['REQUEST_URI']); common_set_returnto($_SERVER['REQUEST_URI']);
if (!common_config('site', 'openidonly')) {
common_redirect(common_local_url('login')); common_redirect(common_local_url('login'));
} else {
common_redirect(common_local_url('openidlogin'));
}
return; return;
} }

View File

@ -38,8 +38,6 @@ $config['site']['path'] = 'laconica';
// $config['site']['closed'] = true; // $config['site']['closed'] = true;
// Only allow registration for people invited by another user // Only allow registration for people invited by another user
// $config['site']['inviteonly'] = true; // $config['site']['inviteonly'] = true;
// Only allow registrations and logins through OpenID
// $config['site']['openidonly'] = true;
// Make the site invisible to non-logged-in users // Make the site invisible to non-logged-in users
// $config['site']['private'] = true; // $config['site']['private'] = true;

View File

@ -439,17 +439,12 @@ class Action extends HTMLOutputter // lawsuit
_('Logout'), _('Logout from the site'), false, 'nav_logout'); _('Logout'), _('Logout from the site'), false, 'nav_logout');
} }
else { else {
if (!common_config('site', 'openidonly')) {
if (!common_config('site', 'closed')) { if (!common_config('site', 'closed')) {
$this->menuItem(common_local_url('register'), $this->menuItem(common_local_url('register'),
_('Register'), _('Create an account'), false, 'nav_register'); _('Register'), _('Create an account'), false, 'nav_register');
} }
$this->menuItem(common_local_url('login'), $this->menuItem(common_local_url('login'),
_('Login'), _('Login to the site'), false, 'nav_login'); _('Login'), _('Login to the site'), false, 'nav_login');
} else {
$this->menuItem(common_local_url('openidlogin'),
_('OpenID'), _('Login with OpenID'), false, 'nav_openid');
}
} }
$this->menuItem(common_local_url('doc', array('title' => 'help')), $this->menuItem(common_local_url('doc', array('title' => 'help')),
_('Help'), _('Help me!'), false, 'nav_help'); _('Help'), _('Help me!'), false, 'nav_help');

View File

@ -111,7 +111,6 @@ $config =
'broughtbyurl' => null, 'broughtbyurl' => null,
'closed' => false, 'closed' => false,
'inviteonly' => false, 'inviteonly' => false,
'openidonly' => false,
'private' => false, 'private' => false,
'ssl' => 'never', 'ssl' => 'never',
'sslserver' => null, 'sslserver' => null,

View File

@ -253,13 +253,8 @@ class FacebookAction extends Action
$this->elementStart('dd'); $this->elementStart('dd');
$this->elementStart('p'); $this->elementStart('p');
$this->text(sprintf($loginmsg_part1, common_config('site', 'name'))); $this->text(sprintf($loginmsg_part1, common_config('site', 'name')));
if (!common_config('site', 'openidonly')) {
$this->element('a', $this->element('a',
array('href' => common_local_url('register')), _('Register')); array('href' => common_local_url('register')), _('Register'));
} else {
$this->element('a',
array('href' => common_local_url('openidlogin')), _('Register'));
}
$this->text($loginmsg_part2); $this->text($loginmsg_part2);
$this->elementEnd('p'); $this->elementEnd('p');
$this->elementEnd('dd'); $this->elementEnd('dd');