summaryrefslogtreecommitdiff
path: root/plugins/OpenID
diff options
context:
space:
mode:
authorBrion Vibber <brion@pobox.com>2010-06-07 10:19:40 -0700
committerBrion Vibber <brion@pobox.com>2010-06-07 10:19:40 -0700
commitd88b208edcb75ec864e09bb3ab29785b35064400 (patch)
tree6a3b2eb35fb792bffb7ebaf3b4f81fb1131466d1 /plugins/OpenID
parenta7e33ac89df9f05b7497bfb34c6e69b3329a87e5 (diff)
parent41e9dba7297d43b7de0cb7665901869910d1047a (diff)
Merge branch 'testing' of gitorious.org:statusnet/mainline into 0.9.x
Conflicts: plugins/OpenID/openid.php
Diffstat (limited to 'plugins/OpenID')
-rw-r--r--plugins/OpenID/openid.php2
-rw-r--r--plugins/OpenID/openidadminpanel.php10
-rw-r--r--plugins/OpenID/openidlogin.php20
3 files changed, 31 insertions, 1 deletions
diff --git a/plugins/OpenID/openid.php b/plugins/OpenID/openid.php
index 68851f4eb..4ce350f77 100644
--- a/plugins/OpenID/openid.php
+++ b/plugins/OpenID/openid.php
@@ -145,9 +145,11 @@ function oid_authenticate($openid_url, $returnto, $immediate=false)
// Handle failure status return values.
if (!$auth_request) {
+ common_log(LOG_ERR, __METHOD__ . ": mystery fail contacting $openid_url");
// TRANS: OpenID plugin message. Given when an OpenID is not valid.
return _m('Not a valid OpenID.');
} else if (Auth_OpenID::isFailure($auth_request)) {
+ common_log(LOG_ERR, __METHOD__ . ": OpenID fail to $openid_url: $auth_request->message");
// TRANS: OpenID plugin server error. Given when the OpenID authentication request fails.
// TRANS: %s is the failure message.
return sprintf(_m('OpenID failure: %s'), $auth_request->message);
diff --git a/plugins/OpenID/openidadminpanel.php b/plugins/OpenID/openidadminpanel.php
index 063306366..ce4806cc8 100644
--- a/plugins/OpenID/openidadminpanel.php
+++ b/plugins/OpenID/openidadminpanel.php
@@ -91,6 +91,7 @@ class OpenidadminpanelAction extends AdminPanelAction
);
static $booleans = array(
+ 'openid' => array('append_username'),
'site' => array('openidonly')
);
@@ -223,6 +224,15 @@ class OpenIDAdminPanelForm extends AdminForm
$this->unli();
$this->li();
+ $this->out->checkbox(
+ 'append_username', _m('Append a username to base URL'),
+ (bool) $this->value('append_username', 'openid'),
+ _m('Login form will show the base URL and prompt for a username to add at the end. Use when OpenID provider URL should be the profile page for individual users.'),
+ 'true'
+ );
+ $this->unli();
+
+ $this->li();
$this->input(
'required_team',
_m('Required team'),
diff --git a/plugins/OpenID/openidlogin.php b/plugins/OpenID/openidlogin.php
index 34e00ccce..20d6e070c 100644
--- a/plugins/OpenID/openidlogin.php
+++ b/plugins/OpenID/openidlogin.php
@@ -33,6 +33,9 @@ class OpenidloginAction extends Action
$provider = common_config('openid', 'trusted_provider');
if ($provider) {
$openid_url = $provider;
+ if (common_config('openid', 'append_username')) {
+ $openid_url .= $this->trimmed('openid_username');
+ }
} else {
$openid_url = $this->trimmed('openid_url');
}
@@ -100,7 +103,15 @@ class OpenidloginAction extends Action
function showScripts()
{
parent::showScripts();
- $this->autofocus('openid_url');
+ if (common_config('openid', 'trusted_provider')) {
+ if (common_config('openid', 'append_username')) {
+ $this->autofocus('openid_username');
+ } else {
+ $this->autofocus('rememberme');
+ }
+ } else {
+ $this->autofocus('openid_url');
+ }
}
function title()
@@ -130,10 +141,17 @@ class OpenidloginAction extends Action
$this->elementStart('ul', 'form_data');
$this->elementStart('li');
$provider = common_config('openid', 'trusted_provider');
+ $appendUsername = common_config('openid', 'append_username');
if ($provider) {
$this->element('label', array(), _m('OpenID provider'));
$this->element('span', array(), $provider);
+ if ($appendUsername) {
+ $this->element('input', array('id' => 'openid_username',
+ 'name' => 'openid_username',
+ 'style' => 'float: none'));
+ }
$this->element('p', 'form_guide',
+ ($appendUsername ? _m('Enter your username.') . ' ' : '') .
_m('You will be sent to the provider\'s site for authentication.'));
$this->hidden('openid_url', $provider);
} else {