summaryrefslogtreecommitdiff
path: root/plugins/OpenID/openidsettings.php
diff options
context:
space:
mode:
authorBrion Vibber <brion@pobox.com>2010-05-18 13:37:46 -0700
committerBrion Vibber <brion@pobox.com>2010-05-18 13:37:46 -0700
commitd0ba34e0f32ac71b552302ec875943e0e9236720 (patch)
tree832455e96f8a6b81dd6279f20ae7f38b7bc60a8b /plugins/OpenID/openidsettings.php
parentd5b4df4097c2d64e52f249042038ddbf99769b6c (diff)
parent7c828ae5f8ab20f0daa8a1482fadce9b3e858975 (diff)
Merge branch 'openid-teams' into testing
Diffstat (limited to 'plugins/OpenID/openidsettings.php')
-rw-r--r--plugins/OpenID/openidsettings.php70
1 files changed, 38 insertions, 32 deletions
diff --git a/plugins/OpenID/openidsettings.php b/plugins/OpenID/openidsettings.php
index 16142cf48..505e7d0ee 100644
--- a/plugins/OpenID/openidsettings.php
+++ b/plugins/OpenID/openidsettings.php
@@ -90,34 +90,36 @@ class OpenidsettingsAction extends AccountSettingsAction
{
$user = common_current_user();
- $this->elementStart('form', array('method' => 'post',
- 'id' => 'form_settings_openid_add',
- 'class' => 'form_settings',
- 'action' =>
- common_local_url('openidsettings')));
- $this->elementStart('fieldset', array('id' => 'settings_openid_add'));
- $this->element('legend', null, _m('Add OpenID'));
- $this->hidden('token', common_session_token());
- $this->element('p', 'form_guide',
- _m('If you want to add an OpenID to your account, ' .
- 'enter it in the box below and click "Add".'));
- $this->elementStart('ul', 'form_data');
- $this->elementStart('li');
- $this->element('label', array('for' => 'openid_url'),
- _m('OpenID URL'));
- $this->element('input', array('name' => 'openid_url',
- 'type' => 'text',
- 'id' => 'openid_url'));
- $this->elementEnd('li');
- $this->elementEnd('ul');
- $this->element('input', array('type' => 'submit',
- 'id' => 'settings_openid_add_action-submit',
- 'name' => 'add',
- 'class' => 'submit',
- 'value' => _m('Add')));
- $this->elementEnd('fieldset');
- $this->elementEnd('form');
-
+ if (!common_config('openid', 'trusted_provider')) {
+ $this->elementStart('form', array('method' => 'post',
+ 'id' => 'form_settings_openid_add',
+ 'class' => 'form_settings',
+ 'action' =>
+ common_local_url('openidsettings')));
+ $this->elementStart('fieldset', array('id' => 'settings_openid_add'));
+
+ $this->element('legend', null, _m('Add OpenID'));
+ $this->hidden('token', common_session_token());
+ $this->element('p', 'form_guide',
+ _m('If you want to add an OpenID to your account, ' .
+ 'enter it in the box below and click "Add".'));
+ $this->elementStart('ul', 'form_data');
+ $this->elementStart('li');
+ $this->element('label', array('for' => 'openid_url'),
+ _m('OpenID URL'));
+ $this->element('input', array('name' => 'openid_url',
+ 'type' => 'text',
+ 'id' => 'openid_url'));
+ $this->elementEnd('li');
+ $this->elementEnd('ul');
+ $this->element('input', array('type' => 'submit',
+ 'id' => 'settings_openid_add_action-submit',
+ 'name' => 'add',
+ 'class' => 'submit',
+ 'value' => _m('Add')));
+ $this->elementEnd('fieldset');
+ $this->elementEnd('form');
+ }
$oid = new User_openid();
$oid->user_id = $user->id;
@@ -234,10 +236,14 @@ class OpenidsettingsAction extends AccountSettingsAction
}
if ($this->arg('add')) {
- $result = oid_authenticate($this->trimmed('openid_url'),
- 'finishaddopenid');
- if (is_string($result)) { // error message
- $this->showForm($result);
+ if (common_config('openid', 'trusted_provider')) {
+ $this->showForm(_m("Can't add new providers."));
+ } else {
+ $result = oid_authenticate($this->trimmed('openid_url'),
+ 'finishaddopenid');
+ if (is_string($result)) { // error message
+ $this->showForm($result);
+ }
}
} else if ($this->arg('remove')) {
$this->removeOpenid();