function onStartPrimaryNav($action)
{
- if ($this->openidOnly && !common_logged_in()) {
+ if (common_config('site', 'openidonly') && !common_logged_in()) {
// TRANS: Tooltip for main menu option "Login"
$tooltip = _m('TOOLTIP', 'Login to the site');
- // TRANS: Main menu option when not logged in to log in
$action->menuItem(common_local_url('openidlogin'),
+ // TRANS: Main menu option when not logged in to log in
_m('MENU', 'Login'),
$tooltip,
false,
{
parent::handle($args);
if (common_is_real_login()) {
+ // TRANS: Client error message trying to log on with OpenID while already logged on.
$this->clientError(_m('Already logged in.'));
} else if ($_SERVER['REQUEST_METHOD'] == 'POST') {
- $openid_url = $this->trimmed('openid_url');
+ $provider = common_config('openid', 'trusted_provider');
+ if ($provider) {
+ $openid_url = $provider;
+ } else {
+ $openid_url = $this->trimmed('openid_url');
+ }
oid_assert_allowed($openid_url);
$this->elementStart('ul', 'form_data');
$this->elementStart('li');
- // TRANS: OpenID plugin logon form field label.
- $this->input('openid_url', _m('OpenID URL'),
- $this->openid_url,
- // TRANS: OpenID plugin logon form field instructions.
- _m('Your OpenID URL'));
+ $provider = common_config('openid', 'trusted_provider');
+ if ($provider) {
+ $this->element('label', array(), _m('OpenID provider'));
+ $this->element('span', array(), $provider);
+ $this->element('p', 'form_guide',
+ _m('You will be sent to the provider\'s site for authentication.'));
+ $this->hidden('openid_url', $provider);
+ } else {
++ // TRANS: OpenID plugin logon form field label.
+ $this->input('openid_url', _m('OpenID URL'),
+ $this->openid_url,
++ // TRANS: OpenID plugin logon form field instructions.
+ _m('Your OpenID URL'));
+ }
$this->elementEnd('li');
$this->elementStart('li', array('id' => 'settings_rememberme'));
+ // TRANS: OpenID plugin logon form checkbox label for setting to put the OpenID information in a cookie.
$this->checkbox('rememberme', _m('Remember me'), false,
+ // TRANS: OpenID plugin logon form field instructions.
_m('Automatically login in the future; ' .
'not for shared computers!'));
$this->elementEnd('li');