<?php
/**
- * Laconica, the distributed open-source microblogging tool
+ * StatusNet, the distributed open-source microblogging tool
*
* Settings for OpenID
*
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
* @category Settings
- * @package Laconica
- * @author Evan Prodromou <evan@controlyourself.ca>
- * @copyright 2008-2009 Control Yourself, Inc.
+ * @package StatusNet
+ * @author Evan Prodromou <evan@status.net>
+ * @copyright 2008-2009 StatusNet, Inc.
* @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0
- * @link http://laconi.ca/
+ * @link http://status.net/
*/
-if (!defined('LACONICA')) {
+if (!defined('STATUSNET') && !defined('LACONICA')) {
exit(1);
}
-require_once INSTALLDIR.'/lib/settingsaction.php';
+require_once INSTALLDIR.'/lib/accountsettingsaction.php';
require_once INSTALLDIR.'/lib/openid.php';
/**
* Lets users add, edit and delete OpenIDs from their account
*
* @category Settings
- * @package Laconica
- * @author Evan Prodromou <evan@controlyourself.ca>
+ * @package StatusNet
+ * @author Evan Prodromou <evan@status.net>
* @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0
- * @link http://laconi.ca/
+ * @link http://status.net/
*/
-class OpenidsettingsAction extends SettingsAction
+class OpenidsettingsAction extends AccountSettingsAction
{
/**
* Title of the page
function getInstructions()
{
- return _('[OpenID](%%doc.openid%%) lets you log into many sites ' .
- ' with the same user account. '.
+ return _('[OpenID](%%doc.openid%%) lets you log into many sites' .
+ ' with the same user account.'.
' Manage your associated OpenIDs from here.');
}
+ function showScripts()
+ {
+ parent::showScripts();
+ $this->autofocus('openid_url');
+ }
+
/**
* Show the form for OpenID management
*
function showContent()
{
+ if (!common_config('openid', 'enabled')) {
+ $this->element('div', array('class' => 'error'),
+ _('OpenID is not available.'));
+ return;
+ }
+
$user = common_current_user();
$this->elementStart('form', array('method' => 'post',
$this->element('p', 'form_guide',
_('If you want to add an OpenID to your account, ' .
'enter it in the box below and click "Add".'));
- $this->elementStart('ul', 'form_datas');
+ $this->elementStart('ul', 'form_data');
$this->elementStart('li');
$this->element('label', array('for' => 'openid_url'),
_('OpenID URL'));
if ($cnt == 1 && !$user->password) {
- $this->element('p', null,
+ $this->element('p', 'form_guide',
_('Removing your only OpenID '.
'would make it impossible to log in! ' .
'If you need to remove it, '.
$this->element('input', array('type' => 'submit',
'id' => 'remove'.$idx,
'name' => 'remove',
- 'class' => 'submit',
+ 'class' => 'submit remove',
'value' => _('Remove')));
$this->elementEnd('fieldset');
$this->elementEnd('form');