code:
<?php
/*
 * StatusNet - the distributed open-source microblogging tool
 * Copyright (C) 2008, 2009, StatusNet, Inc.
 *
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU Affero General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU Affero General Public License for more details.
 *
 * You should have received a copy of the GNU Affero General Public License
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */

if (!defined('STATUSNET')) {
    exit(1);
}

require_once INSTALLDIR.'/plugins/OpenID/openid.php';

class FinishopenidloginAction extends Action
{
    var $error = null;
    var $username = null;
    var $message = null;

    function handle($args)
    {
        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') {
            $token = $this->trimmed('token');
            if (!$token || $token != common_session_token()) {
                // TRANS: Message given when there is a problem with the user's session token.
                $this->showForm(_m('There was a problem with your session token. Try again, please.'));
                return;
            }
            if ($this->arg('create')) {
                if (!$this->boolean('license')) {
                    // TRANS: Message given if user does not agree with the site's license.
                    $this->showForm(_m('You cannot register if you do not agree to the license.'),
                                    $this->trimmed('newname'));
                    return;
                }
                $this->createNewUser();
            } else if ($this->arg('connect')) {
                $this->connectUser();
            } else {
                // TRANS: Messag given on an unknown error.
                $this->showForm(_m('An unknown error has occured.'),
                                $this->trimmed('newname'));
            }
        } else {
            $this->tryLogin();
        }
    }

    function showPageNotice()
    {
        if ($this->error) {
            $this->element('div', array('class' => 'error'), $this->error);
        } else {
            $this->element('div', 'instructions',
                           // TRANS: Instructions given after a first successful logon using OpenID.
                           // TRANS: %s is the site name.
                           sprintf(_m('This is the first time you have logged into %s so we must connect your OpenID to a local account. You can either create a new account, or connect with your existing account, if you have one.'), common_config('site', 'name')));
        }
    }

    function title()
    {
        // TRANS: Title
        return _m('TITLE','OpenID Account Setup');
    }

    function showForm($error=null, $username=null)
    {
        $this->error = $error;
        $this->username = $username;

        $this->showPage();
    }

    /**
     * @fixme much of this duplicates core code, which is very fragile.
     * Should probably be replaced with an extensible mini version of
     * the core registration form.
     */
    function showContent()
    {
        if (!empty($this->message_text)) {
            $this->element('div', array('class' => 'error'), $this->message_text);
            return;
        }

        // We don't recognize this OpenID, so we're going to give the user
        // two options, each in its own mini-form.
        //
        // First, they can create a new account using their OpenID auth
        // info. The profile will be pre-populated with whatever name,
        // email, and location we can get from the OpenID provider, so
        // all we ask for is the license confirmation.
        $this->elementStart('form', array('method' => 'post',
                                          'id' => 'account_create',
                                          'class' => 'form_settings',
                                          'action' => common_local_url('finishopenidlogin')));
        $this->hidden('token', common_session_token());
        $this->elementStart('fieldset', array('id' => 'form_openid_createaccount'));
        $this->element('legend', null,
                       // TRANS: Fieldset legend.
                       _m('Create new account'));
        $this->element('p', null,
                       // TRANS: Form guide.
                       _m('Create a new user with this nickname.'));
        $this->elementStart('ul', 'form_data');

        // Hook point for captcha etc
        Event::handle('StartRegistrationFormData', array($this));

        $this->elementStart('li');
        // TRANS: Field label.
        $this->input('newname', _m('New nickname'),
                     ($this->username) ? $this->username : '',
                     // TRANS: Field title.
                     _m('1-64 lowercase letters or numbers, no punctuation or spaces.'));
        $this->elementEnd('li');
        $this->elementStart('li');
        // TRANS: Field label.
        $this->input('email', _m('Email'), $this->getEmail(),
                     // TRANS: Field title.
                     _m('Used only for updates, announcements, '.
                       'and password recovery.'));
        $this->elementEnd('li');

        // Hook point for captcha etc
        Event::handle('EndRegistrationFormData', array($this));

        $this->elementStart('li');
        $this->element('input', array('type' => 'checkbox',
                                      'id' => 'license',
                                      'class' => 'checkbox',
                                      'name' => 'license',
                                      'value' => 'true'));
        $this->elementStart('label', array('for' => 'license',
                                          'class' => 'checkbox'));
        // TRANS: OpenID plugin link text.
        // TRANS: %s is a link to a license with the license name as link text.
        $message = _m('My text and files are available under %s ' .
                     'except this private data: password, ' .
                     'email address, IM address, and phone number.');
        $link = '' .
                htmlspecialchars(common_config('license', 'title')) .
                '';
        $this->raw(sprintf(htmlspecialchars($message), $link));
        $this->elementEnd('label');
        $this->elementEnd('li');
        $this->elementEnd('ul');
        // TRANS: Button label in form in which to create a new user on the site for an OpenID.
        $this->submit('create', _m('BUTTON', 'Create'));
        $this->elementEnd('fieldset');
        $this->elementEnd('form');

        // The second option is to attach this OpenID to an existing account
        // on the local system, which they need to provide a password for.
        $this->elementStart('form', array('method' => 'post',
                                          'id' => 'account_connect',
                                          'class' => 'form_settings',
                                          'action' => common_local_url('finishopenidlogin')));
        $this->hidden('token', common_session_token());
        $this->elementStart('fieldset', array('id' => 'form_openid_createaccount'));
        $this->element('legend', null,
                       // TRANS: Used as form legend for form in which to connect an OpenID to an existing user on the site.
                       _m('Connect existing account'));
        $this->element('p', null,
                       // TRANS: User instructions for form in which to connect an OpenID to an existing user on the site.
                       _m('If you already have an account, login with your username and password to connect it to your OpenID.'));
        $this->elementStart('ul', 'form_data');
        $this->elementStart('li');
        // TRANS: Field label in form in which to connect an OpenID to an existing user on the site.
        $this->input('nickname', _m('Existing nickname'));
        $this->elementEnd('li');
        $this->elementStart('li');
        // TRANS: Field label in form in which to connect an OpenID to an existing user on the site.
        $this->password('password', _m('Password'));
        $this->elementEnd('li');
        $this->elementEnd('ul');
        // TRANS: Button text in form in which to connect an OpenID to an existing user on the site.
        $this->submit('connect', _m('BUTTON', 'Connect'));
        $this->elementEnd('fieldset');
        $this->elementEnd('form');
    }

    /**
     * Get specified e-mail from the form, or the OpenID sreg info, or the
     * invite code.
     *
     * @return string
     */
    function getEmail()
    {
        $email = $this->trimmed('email');
        if (!empty($email)) {
            return $email;
        }

        // Pull from openid thingy
        list($display, $canonical, $sreg) = $this->getSavedValues();
        if (!empty($sreg['email'])) {
            return $sreg['email'];
        }

        // Terrible hack for invites...
        if (common_config('site', 'inviteonly')) {
            $code = $_SESSION['invitecode'];
            if ($code) {
                $invite = Invitation::getKV($code);

                if ($invite && $invite->address_type == 'email') {
                    return $invite->address;
                }
            }
        }
        return '';
    }

    function tryLogin()
    {
        $consumer = oid_consumer();

        $response = $consumer->complete(common_local_url('finishopenidlogin'));

        if ($response->status == Auth_OpenID_CANCEL) {
            // TRANS: Status message in case the response from the OpenID provider is that the logon attempt was cancelled.
            $this->message(_m('OpenID authentication cancelled.'));
            return;
        } else if ($response->status == Auth_OpenID_FAILURE) {
            // TRANS: OpenID authentication failed; display the error message. %s is the error message.
            $this->message(sprintf(_m('OpenID authentication failed: %s.'), $response->message));
        } else if ($response->status == Auth_OpenID_SUCCESS) {
            // This means the authentication succeeded; extract the
            // identity URL and Simple Registration data (if it was
            // returned).
            $display = $response->getDisplayIdentifier();
            $canonical = ($response->endpoint->canonicalID) ?
              $response->endpoint->canonicalID : $response->getDisplayIdentifier();

            oid_assert_allowed($display);
            oid_assert_allowed($canonical);

            $sreg_resp = Auth_OpenID_SRegResponse::fromSuccessResponse($response);

            if ($sreg_resp) {
                $sreg = $sreg_resp->contents();
            }

            // Launchpad teams extension
            if (!oid_check_teams($response)) {
                // TRANS: Message displayed when OpenID authentication is aborted.
                $this->message(_m('OpenID authentication aborted: You are not allowed to login to this site.'));
                return;
            }

            $user = oid_get_user($canonical);

            if ($user) {
                oid_set_last($display);
                // XXX: commented out at @edd's request until better
                // control over how data flows from OpenID provider.
                // oid_update_user($user, $sreg);
                common_set_user($user);
                common_real_login(true);
                if (isset($_SESSION['openid_rememberme']) && $_SESSION['openid_rememberme']) {
                    common_rememberme($user);
                }
                unset($_SESSION['openid_rememberme']);
                $this->goHome($user->nickname);
            } else {
                $this->saveValues($display, $canonical, $sreg);
                $this->showForm(null, $this->bestNewNickname($display, $sreg));
            }
        }
    }

    function message($msg)
    {
        $this->message_text = $msg;
        $this->showPage();
    }

    function saveValues($display, $canonical, $sreg)
    {
        common_ensure_session();
        $_SESSION['openid_display'] = $display;
        $_SESSION['openid_canonical'] = $canonical;
        $_SESSION['openid_sreg'] = $sreg;
    }

    function getSavedValues()
    {
        return array($_SESSION['openid_display'],
                     $_SESSION['openid_canonical'],
                     $_SESSION['openid_sreg']);
    }

    function createNewUser()
    {
        // FIXME: save invite code before redirect, and check here

        if (!Event::handle('StartRegistrationTry', array($this))) {
            return;
        }

        if (common_config('site', 'closed')) {
            // TRANS: OpenID plugin message. No new user registration is allowed on the site.
            $this->clientError(_m('Registration not allowed.'));
        }

        $invite = null;

        if (common_config('site', 'inviteonly')) {
            $code = $_SESSION['invitecode'];
            if (empty($code)) {
                // TRANS: OpenID plugin message. No new user registration is allowed on the site without an invitation code, and none was provided.
                $this->clientError(_m('Registration not allowed.'));
            }

            $invite = Invitation::getKV($code);

            if (empty($invite)) {
                // TRANS: OpenID plugin message. No new user registration is allowed on the site without an invitation code, and the one provided was not valid.
                $this->clientError(_m('Not a valid invitation code.'));
            }
        }

        try {
            $nickname = Nickname::normalize($this->trimmed('newname'), true);
        } catch (NicknameException $e) {
            $this->showForm($e->getMessage());
            return;
        }

        list($display, $canonical, $sreg) = $this->getSavedValues();

        if (!$display || !$canonical) {
            // TRANS: OpenID plugin server error. A stored OpenID cannot be retrieved.
            $this->serverError(_m('Stored OpenID not found.'));
        }

        // Possible race condition... let's be paranoid

        $other = oid_get_user($canonical);

        if ($other) {
            // TRANS: OpenID plugin server error.
            $this->serverError(_m('Creating new account for OpenID that already has a user.'));
        }

        Event::handle('StartOpenIDCreateNewUser', array($canonical, &$sreg));

        $location = '';
        if (!empty($sreg['country'])) {
            if ($sreg['postcode']) {
                // XXX: use postcode to get city and region
                // XXX: also, store postcode somewhere -- it's valuable!
                $location = $sreg['postcode'] . ', ' . $sreg['country'];
            } else {
                $location = $sreg['country'];
            }
        }

        if (!empty($sreg['fullname']) && mb_strlen($sreg['fullname']) <= 255) {
            $fullname = $sreg['fullname'];
        } else {
            $fullname = '';
        }

        $email = $this->getEmail();

        // XXX: add language
        // XXX: add timezone

        $args = array('nickname' => $nickname,
                      'email' => $email,
                      'fullname' => $fullname,
                      'location' => $location);

        if (!empty($invite)) {
            $args['code'] = $invite->code;
        }

        $user = User::register($args);

        $result = oid_link_user($user->id, $canonical, $display);

        Event::handle('EndOpenIDCreateNewUser', array($user, $canonical, $sreg));

        oid_set_last($display);
        common_set_user($user);
        common_real_login(true);
        if (isset($_SESSION['openid_rememberme']) && $_SESSION['openid_rememberme']) {
            common_rememberme($user);
        }
        unset($_SESSION['openid_rememberme']);

        Event::handle('EndRegistrationTry', array($this));

        common_redirect(common_local_url('showstream', array('nickname' => $user->nickname)), 303);
    }

    function connectUser()
    {
        $nickname = $this->trimmed('nickname');
        $password = $this->trimmed('password');

        if (!common_check_user($nickname, $password)) {
            // TRANS: OpenID plugin message.
            $this->showForm(_m('Invalid username or password.'));
            return;
        }

        // They're legit!

        $user = User::getKV('nickname', $nickname);

        list($display, $canonical, $sreg) = $this->getSavedValues();

        if (!$display || !$canonical) {
            // TRANS: OpenID plugin server error. A stored OpenID cannot be found.
            $this->serverError(_m('Stored OpenID not found.'));
        }

        $result = oid_link_user($user->id, $canonical, $display);

        if (!$result) {
            // TRANS: OpenID plugin server error. The user or user profile could not be saved.
            $this->serverError(_m('Error connecting user to OpenID.'));
        }

        if (Event::handle('StartOpenIDUpdateUser', array($user, $canonical, &$sreg))) {
            oid_update_user($user, $sreg);
        }
        Event::handle('EndOpenIDUpdateUser', array($user, $canonical, $sreg));

        oid_set_last($display);
        common_set_user($user);
        common_real_login(true);
        if (isset($_SESSION['openid_rememberme']) && $_SESSION['openid_rememberme']) {
            common_rememberme($user);
        }
        unset($_SESSION['openid_rememberme']);
        $this->goHome($user->nickname);
    }

    function goHome($nickname)
    {
        $url = common_get_returnto();
        if ($url) {
            // We don't have to return to it again
            common_set_returnto(null);
	    $url = common_inject_session($url);
        } else {
            $url = common_local_url('all',
                                    array('nickname' =>
                                          $nickname));
        }
        common_redirect($url, 303);
    }

    function bestNewNickname($display, $sreg)
    {
        // Try the passed-in nickname

        if (!empty($sreg['nickname'])) {
            $nickname = common_nicknamize($sreg['nickname']);
            if (Nickname::isValid($nickname, true)) {
                return $nickname;
            }
        }

        // Try the full name

        if (!empty($sreg['fullname'])) {
            $fullname = common_nicknamize($sreg['fullname']);
            if (Nickname::isValid($fullname, true)) {
                return $fullname;
            }
        }

        // Try the URL

        $from_url = $this->openidToNickname($display);

        if ($from_url && Nickname::isValid($from_url, true)) {
            return $from_url;
        }

        // XXX: others?

        return null;
    }

    function openidToNickname($openid)
    {
        if (Auth_Yadis_identifierScheme($openid) == 'XRI') {
            return $this->xriToNickname($openid);
        } else {
            return $this->urlToNickname($openid);
        }
    }

    // We try to use an OpenID URL as a legal StatusNet user name in this order
    // 1. Plain hostname, like http://evanp.myopenid.com/
    // 2. One element in path, like http://profile.typekey.com/EvanProdromou/
    //    or http://getopenid.com/evanprodromou
    function urlToNickname($openid)
    {
        return common_url_to_nickname($openid);
    }

    function xriToNickname($xri)
    {
        $base = $this->xriBase($xri);

        if (!$base) {
            return null;
        } else {
            // =evan.prodromou
            // or @gratis*evan.prodromou
            $parts = explode('*', substr($base, 1));
            return common_nicknamize(array_pop($parts));
        }
    }

    function xriBase($xri)
    {
        if (substr($xri, 0, 6) == 'xri://') {
            return substr($xri, 6);
        } else {
            return $xri;
        }
    }
}


code:
<?php
/**
 * StatusNet, the distributed open-source microblogging tool
 *
 * OpenID bridge administration panel
 *
 * PHP version 5
 *
 * LICENCE: This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU Affero General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU Affero General Public License for more details.
 *
 * You should have received a copy of the GNU Affero General Public License
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 *
 * @category  Settings
 * @package   StatusNet
 * @author    Zach Copley <zach@status.net>
 * @copyright 2010 StatusNet, Inc.
 * @license   http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0
 * @link      http://status.net/
 */

if (!defined('STATUSNET')) {
    exit(1);
}

/**
 * Administer global OpenID settings
 *
 * @category Admin
 * @package  StatusNet
 * @author   Zach Copley <zach@status.net>
 * @license  http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0
 * @link     http://status.net/
 */
class OpenidadminpanelAction extends AdminPanelAction
{
    /**
     * Returns the page title
     *
     * @return string page title
     */
    function title()
    {
        // TRANS: Title for OpenID bridge administration page.
        return _m('TITLE','OpenID Settings');
    }

    /**
     * Instructions for using this form.
     *
     * @return string instructions
     */
    function getInstructions()
    {
        // TRANS: Page instructions.
        return _m('OpenID settings');
    }

    /**
     * Show the OpenID admin panel form
     *
     * @return void
     */
    function showForm()
    {
        $form = new OpenIDAdminPanelForm($this);
        $form->show();
        return;
    }

    /**
     * Save settings from the form
     *
     * @return void
     */
    function saveSettings()
    {
        static $settings = array(
            'openid' => array('trusted_provider', 'required_team')
        );

        static $booleans = array(
            'openid' => array('append_username'),
            'site' => array('openidonly')
        );

        $values = array();

        foreach ($settings as $section => $parts) {
            foreach ($parts as $setting) {
                $values[$section][$setting]
                    = $this->trimmed($setting);
            }
        }

        foreach ($booleans as $section => $parts) {
            foreach ($parts as $setting) {
                $values[$section][$setting]
                    = ($this->boolean($setting)) ? 1 : 0;
            }
        }

        // This throws an exception on validation errors

        $this->validate($values);

        // assert(all values are valid);

        $config = new Config();

        $config->query('BEGIN');

        foreach ($settings as $section => $parts) {
            foreach ($parts as $setting) {
                Config::save($section, $setting, $values[$section][$setting]);
            }
        }

        foreach ($booleans as $section => $parts) {
            foreach ($parts as $setting) {
                Config::save($section, $setting, $values[$section][$setting]);
            }
        }

        $config->query('COMMIT');

        return;
    }

    function validate(&$values)
    {
        // Validate consumer key and secret (can't be too long)

        if (mb_strlen($values['openid']['trusted_provider']) > 255) {
            $this->clientError(
                // TRANS: Client error displayed when OpenID provider URL is too long.
                _m('Invalid provider URL. Maximum length is 255 characters.')
            );
        }

        if (mb_strlen($values['openid']['required_team']) > 255) {
            $this->clientError(
                // TRANS: Client error displayed when Launchpad team name is too long.
                _m('Invalid team name. Maximum length is 255 characters.')
            );
        }
    }
}

class OpenIDAdminPanelForm extends AdminForm
{
    /**
     * ID of the form
     *
     * @return int ID of the form
     */
    function id()
    {
        return 'openidadminpanel';
    }

    /**
     * class of the form
     *
     * @return string class of the form
     */
    function formClass()
    {
        return 'form_settings';
    }

    /**
     * Action of the form
     *
     * @return string URL of the action
     */
    function action()
    {
        return common_local_url('openidadminpanel');
    }

    /**
     * Data elements of the form
     *
     * @return void
     *
     * @todo Some of the options could prevent users from logging in again.
     *       Make sure that the acting administrator has a valid OpenID matching,
     *       or more carefully warn folks.
     */
    function formData()
    {
        $this->out->elementStart(
            'fieldset',
            array('id' => 'settings_openid')
        );
        // TRANS: Fieldset legend.
        $this->out->element('legend', null, _m('LEGEND','Trusted provider'));
        $this->out->element('p', 'form_guide',
            // TRANS: Form guide.
            _m('By default, users are allowed to authenticate with any OpenID provider. ' .
               'If you are using your own OpenID service for shared sign-in, ' .
               'you can restrict access to only your own users here.'));
        $this->out->elementStart('ul', 'form_data');

        $this->li();
        $this->input(
            'trusted_provider',
            // TRANS: Field label.
            _m('Provider URL'),
            // TRANS: Field title.
            _m('All OpenID logins will be sent to this URL; other providers may not be used.'),
            'openid'
        );
        $this->unli();

        $this->li();
        $this->out->checkbox(
            // TRANS: Checkbox label.
            'append_username', _m('Append a username to base URL'),
            (bool) $this->value('append_username', 'openid'),
            // TRANS: Checkbox title.
            _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',
            // TRANS: Field label.
            _m('Required team'),
            // TRANS: Field title.
            _m('Only allow logins from users in the given team (Launchpad extension).'),
            'openid'
        );
        $this->unli();

        $this->out->elementEnd('ul');
        $this->out->elementEnd('fieldset');

        $this->out->elementStart(
            'fieldset',
            array('id' => 'settings_openid-options')
        );
        // TRANS: Fieldset legend.
        $this->out->element('legend', null, _m('LEGEND','Options'));

        $this->out->elementStart('ul', 'form_data');

        $this->li();

        $this->out->checkbox(
            // TRANS: Checkbox label.
            'openidonly', _m('Enable OpenID-only mode'),
            (bool) $this->value('openidonly', 'site'),
            // TRANS: Checkbox title.
            _m('Require all users to login via OpenID. Warning: disables password authentication for all users!'),
            'true'
        );
        $this->unli();

        $this->out->elementEnd('ul');

        $this->out->elementEnd('fieldset');
    }

    /**
     * Action elements
     *
     * @return void
     */
    function formActions()
    {
        // TRANS: Button text to save OpenID settings.
        $this->out->submit('submit', _m('BUTTON','Save'), 'submit', null,
                           // TRANS: Button title to save OpenID settings.
                           _m('Save OpenID settings.'));
    }
}

repo_name: piratas/tortuga

license: mit


code:
<?php
/*
 * StatusNet - the distributed open-source microblogging tool
 * Copyright (C) 2008, 2009, StatusNet, Inc.
 *
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU Affero General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU Affero General Public License for more details.
 *
 * You should have received a copy of the GNU Affero General Public License
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */

if (!defined('STATUSNET')) {
    exit(1);
}

require_once INSTALLDIR.'/plugins/OpenID/openid.php';

class OpenidloginAction extends Action
{
    function handle($args)
    {
        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') {
            $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');
            }

            oid_assert_allowed($openid_url);

            $rememberme = $this->boolean('rememberme');

            common_ensure_session();

            $_SESSION['openid_rememberme'] = $rememberme;

            $result = oid_authenticate($openid_url,
                                       'finishopenidlogin');

            if (is_string($result)) { # error message
                unset($_SESSION['openid_rememberme']);
                $this->showForm($result, $openid_url);
            }
        } else {
            $openid_url = oid_get_last();
            $this->showForm(null, $openid_url);
        }
    }

    function getInstructions()
    {
        if (common_logged_in() && !common_is_real_login() &&
            common_get_returnto()) {
            // rememberme logins have to reauthenticate before
            // changing any profile settings (cookie-stealing protection)
            // TRANS: OpenID plugin message. Rememberme logins have to reauthenticate before changing any profile settings.
            // TRANS: "OpenID" is the display text for a link with URL "(%%doc.openid%%)".
            return _m('For security reasons, please re-login with your ' .
                     '[OpenID](%%doc.openid%%) ' .
                     'before changing your settings.');
        } else {
            // TRANS: OpenID plugin message.
            // TRANS: "OpenID" is the display text for a link with URL "(%%doc.openid%%)".
            return _m('Login with an [OpenID](%%doc.openid%%) account.');
        }
    }

    function showPageNotice()
    {
        if ($this->error) {
            $this->element('div', array('class' => 'error'), $this->error);
        } else {
            $instr = $this->getInstructions();
            $output = common_markup_to_html($instr);
            $this->elementStart('div', 'instructions');
            $this->raw($output);
            $this->elementEnd('div');
        }
    }

    function showScripts()
    {
        parent::showScripts();
        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()
    {
        // TRANS: OpenID plugin message. Title.
        return _m('TITLE','OpenID Login');
    }

    function showForm($error=null, $openid_url)
    {
        $this->error = $error;
        $this->openid_url = $openid_url;
        $this->showPage();
    }

    function showContent() {
        $formaction = common_local_url('openidlogin');
        $this->elementStart('form', array('method' => 'post',
                                           'id' => 'form_openid_login',
                                           'class' => 'form_settings',
                                           'action' => $formaction));
        $this->elementStart('fieldset');
        // TRANS: OpenID plugin logon form legend.
        $this->element('legend', null, _m('LEGEND','OpenID login'));

        $this->elementStart('ul', 'form_data');
        $this->elementStart('li');
        $provider = common_config('openid', 'trusted_provider');
        $appendUsername = common_config('openid', 'append_username');
        if ($provider) {
            // TRANS: Field label.
            $this->element('label', array(), _m('LABEL','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',
                           // TRANS: Form guide.
                           ($appendUsername ? _m('Enter your username.') . ' ' : '') .
                           // TRANS: 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 title.
                         _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 title.
                        _m('Automatically login in the future; ' .
                           'not for shared computers!'));
        $this->elementEnd('li');
        $this->elementEnd('ul');
        // TRANS: OpenID plugin logon form button label to start logon with the data provided in the logon form.
        $this->submit('submit', _m('BUTTON', 'Login'));
        $this->elementEnd('fieldset');
        $this->elementEnd('form');
    }

    function showLocalNav()
    {
        $nav = new LoginGroupNav($this);
        $nav->show();
    }

    function showNoticeForm()
    {
    }

    function showProfileBlock()
    {
    }
}


code:
<?php
/**
 * StatusNet, the distributed open-source microblogging tool
 *
 * Settings for OpenID
 *
 * PHP version 5
 *
 * LICENCE: This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU Affero General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU Affero General Public License for more details.
 *
 * You should have received a copy of the GNU Affero General Public License
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 *
 * @category  Settings
 * @package   StatusNet
 * @author   Craig Andrews <candrews@integralblue.com>
 * @copyright 2008-2009 StatusNet, Inc.
 * @copyright 2009 Free Software Foundation, Inc http://www.fsf.org
 * @license   http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0
 * @link      http://status.net/
 */

if (!defined('STATUSNET')) {
    exit(1);
}

require_once INSTALLDIR.'/plugins/OpenID/openid.php';

/**
 * Settings for OpenID
 *
 * Lets users add, edit and delete OpenIDs from their account
 *
 * @category Settings
 * @package  StatusNet
 * @author   Craig Andrews <candrews@integralblue.com>
 * @copyright 2009 Free Software Foundation, Inc http://www.fsf.org
 * @license  http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0
 * @link     http://status.net/
 */
class OpenidserverAction extends Action
{
    var $oserver;

    function prepare($args)
    {
        parent::prepare($args);
        $this->oserver = oid_server();
        return true;
    }

    function handle($args)
    {
        parent::handle($args);
        $request = $this->oserver->decodeRequest();
        if (in_array($request->mode, array('checkid_immediate',
            'checkid_setup'))) {
            $user = common_current_user();
            if(!$user){
                if($request->immediate){
                    //cannot prompt the user to login in immediate mode, so answer false
                    $response = $this->generateDenyResponse($request);
                }else{
                    // Go log in, and then come back.
                    //
                    // Note: 303 redirect rather than 307 to avoid
                    // prompting user for form resubmission if we
                    // were POSTed here.
                    common_set_returnto($_SERVER['REQUEST_URI']);
                    common_redirect(common_local_url('login'), 303);
                }
            }else if(common_profile_url($user->nickname) == $request->identity || $request->idSelect()){
                $user_openid_trustroot = User_openid_trustroot::pkeyGet(
                                                array('user_id'=>$user->id, 'trustroot'=>$request->trust_root));
                if(empty($user_openid_trustroot)){
                    if($request->immediate){
                        //cannot prompt the user to trust this trust root in immediate mode, so answer false
                        $response = $this->generateDenyResponse($request);
                    }else{
                        common_ensure_session();
                        $_SESSION['openid_trust_root'] = $request->trust_root;
                        $allowResponse = $this->generateAllowResponse($request, $user);
                        $this->oserver->encodeResponse($allowResponse); //sign the response
                        $denyResponse = $this->generateDenyResponse($request);
                        $this->oserver->encodeResponse($denyResponse); //sign the response
                        $_SESSION['openid_allow_url'] = $allowResponse->encodeToUrl();
                        $_SESSION['openid_deny_url'] = $denyResponse->encodeToUrl();

                        // Ask the user to trust this trust root...
                        //
                        // Note: 303 redirect rather than 307 to avoid
                        // prompting user for form resubmission if we
                        // were POSTed here.
                        common_redirect(common_local_url('openidtrust'), 303);
                    }
                }else{
                    //user has previously authorized this trust root
                    $response = $this->generateAllowResponse($request, $user);
                    //$response = $request->answer(true, null, common_profile_url($user->nickname));
                }
            } else if ($request->immediate) {
                $response = $this->generateDenyResponse($request);
            } else {
                //invalid
                // TRANS: OpenID plugin client error given trying to add an unauthorised OpenID to a user (403).
                // TRANS: %s is a request identity.
                $this->clientError(sprintf(_m('You are not authorized to use the identity %s.'),$request->identity),$code=403);
            }
        } else {
            $response = $this->oserver->handleRequest($request);
        }

        if($response){
            $response = $this->oserver->encodeResponse($response);
            if ($response->code != AUTH_OPENID_HTTP_OK) {
                header(sprintf("HTTP/1.1 %d ", $response->code),
                       true, $response->code);
            }

            if($response->headers){
                foreach ($response->headers as $k => $v) {
                    header("$k: $v");
                }
            }
            $this->raw($response->body);
        }else{
            // TRANS: OpenID plugin client error given when not getting a response for a given OpenID provider (500).
            $this->clientError(_m('Just an OpenID provider. Nothing to see here, move along...'),$code=500);
        }
    }

    function generateAllowResponse($request, $user){
        $response = $request->answer(true, null, common_profile_url($user->nickname));

        $profile = $user->getProfile();
        $sreg_data = array(
            'fullname' => $profile->fullname,
            'nickname' => $user->nickname,
            'email' => $user->email,
            'language' => $user->language,
            'timezone' => $user->timezone);
        $sreg_request = Auth_OpenID_SRegRequest::fromOpenIDRequest($request);
        $sreg_response = Auth_OpenID_SRegResponse::extractResponse(
                              $sreg_request, $sreg_data);
        $sreg_response->toMessage($response->fields);
        return $response;
    }

    function generateDenyResponse($request){
        $response = $request->answer(false);
        return $response;
    }
}


code:
<?php
/**
 * StatusNet, the distributed open-source microblogging tool
 *
 * Settings for OpenID
 *
 * PHP version 5
 *
 * LICENCE: This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU Affero General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU Affero General Public License for more details.
 *
 * You should have received a copy of the GNU Affero General Public License
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 *
 * @category  Settings
 * @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://status.net/
 */

if (!defined('STATUSNET')) {
    exit(1);
}

require_once INSTALLDIR.'/plugins/OpenID/openid.php';

/**
 * Settings for OpenID
 *
 * Lets users add, edit and delete OpenIDs from their account
 *
 * @category Settings
 * @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://status.net/
 */
class OpenidsettingsAction extends SettingsAction
{
    /**
     * Title of the page
     *
     * @return string Page title
     */
    function title()
    {
        // TRANS: Title of OpenID settings page for a user.
        return _m('TITLE','OpenID settings');
    }

    /**
     * Instructions for use
     *
     * @return string Instructions for use
     */
    function getInstructions()
    {
        // TRANS: Form instructions for OpenID settings.
        // TRANS: This message contains Markdown links in the form [description](link).
        return _m('[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
     *
     * We have one form with a few different submit buttons to do different things.
     *
     * @return void
     */
    function showContent()
    {
        $user = common_current_user();

        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'));

            // TRANS: Fieldset legend.
            $this->element('legend', null, _m('LEGEND','Add OpenID'));
            $this->hidden('token', common_session_token());
            $this->elementStart('ul', 'form_data');
            $this->elementStart('li');
            // TRANS: Field label.
            $this->input('openid_url', _m('OpenID URL'), null,
                        // TRANS: Form guide.
                        _m('An OpenID URL which identifies you.'), null, true,
                        array('placeholder'=>'https://example.com/you'));
            $this->elementEnd('li');
            $this->elementEnd('ul');
            // TRANS: Button text for adding an OpenID URL.
            $this->submit('settings_openid_add_action-submit', _m('BUTTON','Add'), 'submit', 'add');
            $this->elementEnd('fieldset');
            $this->elementEnd('form');
        }
        $oid = new User_openid();

        $oid->user_id = $user->id;

        $cnt = $oid->find();

        if ($cnt > 0) {
            // TRANS: Header on OpenID settings page.
            $this->element('h2', null, _m('HEADER','Remove OpenID'));

            if ($cnt == 1 && !$user->password) {

                $this->element('p', 'form_guide',
                               // TRANS: Form guide.
                               _m('Removing your only OpenID '.
                                 'would make it impossible to log in! ' .
                                 'If you need to remove it, '.
                                 'add another OpenID first.'));

                if ($oid->fetch()) {
                    $this->elementStart('p');
                    $this->element('a', array('href' => $oid->canonical),
                                   $oid->display);
                    $this->elementEnd('p');
                }

            } else {

                $this->element('p', 'form_guide',
                               // TRANS: Form guide.
                               _m('You can remove an OpenID from your account '.
                                 'by clicking the button marked "Remove".'));
                $idx = 0;

                while ($oid->fetch()) {
                    $this->elementStart('form',
                                        array('method' => 'POST',
                                              'id' => 'form_settings_openid_delete' . $idx,
                                              'class' => 'form_settings',
                                              'action' =>
                                              common_local_url('openidsettings')));
                    $this->elementStart('fieldset');
                    $this->hidden('token', common_session_token());
                    $this->element('a', array('href' => $oid->canonical),
                                   $oid->display);
                    $this->hidden("openid_url{$idx}", $oid->canonical, 'openid_url');
                    // TRANS: Button text to remove an OpenID.
                    $this->submit("remove{$idx}", _m('BUTTON','Remove'), 'submit remove', 'remove');
                    $this->elementEnd('fieldset');
                    $this->elementEnd('form');
                    $idx++;
                }
            }
        }

        $this->elementStart('form', array('method' => 'post',
                                          'id' => 'form_settings_openid_trustroots',
                                          'class' => 'form_settings',
                                          'action' =>
                                          common_local_url('openidsettings')));
        $this->elementStart('fieldset', array('id' => 'settings_openid_trustroots'));
        // TRANS: Fieldset legend.
        $this->element('legend', null, _m('OpenID Trusted Sites'));
        $this->hidden('token', common_session_token());
        $this->element('p', 'form_guide',
                       // TRANS: Form guide.
                       _m('The following sites are allowed to access your ' .
                       'identity and log you in. You can remove a site from ' .
                       'this list to deny it access to your OpenID.'));
        $this->elementStart('ul', 'form_data');
        $user_openid_trustroot = new User_openid_trustroot();
        $user_openid_trustroot->user_id=$user->id;
        if($user_openid_trustroot->find()) {
            while($user_openid_trustroot->fetch()) {
                $this->elementStart('li');
                $this->element('input', array('name' => 'openid_trustroot[]',
                                              'type' => 'checkbox',
                                              'class' => 'checkbox',
                                              'value' => $user_openid_trustroot->trustroot,
                                              'id' => 'openid_trustroot_' . crc32($user_openid_trustroot->trustroot)));
                $this->element('label', array('class'=>'checkbox', 'for' => 'openid_trustroot_' . crc32($user_openid_trustroot->trustroot)),
                               $user_openid_trustroot->trustroot);
                $this->elementEnd('li');
            }
        }
        $this->elementEnd('ul');
        // TRANS: Button text to remove an OpenID trustroot.
        $this->submit('settings_openid_trustroots_action-submit', _m('BUTTON','Remove'), 'submit', 'remove_trustroots');
        $this->elementEnd('fieldset');

        $prefs = User_openid_prefs::getKV('user_id', $user->id);

        $this->elementStart('fieldset');
        $this->element('legend', null, _m('LEGEND','Preferences'));
        $this->elementStart('ul', 'form_data');
        $this->checkbox('hide_profile_link', "Hide OpenID links from my profile", !empty($prefs) && $prefs->hide_profile_link);
        // TRANS: Button text to save OpenID prefs
        $this->submit('settings_openid_prefs_save', _m('BUTTON','Save'), 'submit', 'save_prefs');
        $this->elementEnd('ul');
        $this->elementEnd('fieldset');

        $this->elementEnd('form');
    }

    /**
     * Handle a POST request
     *
     * Muxes to different sub-functions based on which button was pushed
     *
     * @return void
     */
    function handlePost()
    {
        // CSRF protection
        $token = $this->trimmed('token');
        if (!$token || $token != common_session_token()) {
            // TRANS: Client error displayed when the session token does not match or is not given.
            $this->showForm(_m('There was a problem with your session token. '.
                              'Try again, please.'));
            return;
        }

        if ($this->arg('add')) {
            if (common_config('openid', 'trusted_provider')) {
                // TRANS: Form validation error if no OpenID providers can be added.
                $this->showForm(_m('Cannot 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();
        } else if($this->arg('remove_trustroots')) {
            $this->removeTrustroots();
        } else if($this->arg('save_prefs')) {
            $this->savePrefs();
        } else {
            // TRANS: Unexpected form validation error.
            $this->showForm(_m('Something weird happened.'));
        }
    }

    /**
     * Handles a request to remove OpenID trustroots from the user's account
     *
     * Validates input and, if everything is OK, deletes the trustroots.
     * Reloads the form with a success or error notification.
     *
     * @return void
     */
    function removeTrustroots()
    {
        $user = common_current_user();
        $trustroots = $this->arg('openid_trustroot');
        if($trustroots) {
            foreach($trustroots as $trustroot) {
                $user_openid_trustroot = User_openid_trustroot::pkeyGet(
                                                array('user_id'=>$user->id, 'trustroot'=>$trustroot));
                if($user_openid_trustroot) {
                    $user_openid_trustroot->delete();
                } else {
                    // TRANS: Form validation error when trying to remove a non-existing trustroot.
                    $this->showForm(_m('No such OpenID trustroot.'));
                    return;
                }
            }
            // TRANS: Success message after removing trustroots.
            $this->showForm(_m('Trustroots removed.'), true);
        } else {
            $this->showForm();
        }
        return;
    }

    /**
     * Handles a request to remove an OpenID from the user's account
     *
     * Validates input and, if everything is OK, deletes the OpenID.
     * Reloads the form with a success or error notification.
     *
     * @return void
     */
    function removeOpenid()
    {
        $openid_url = $this->trimmed('openid_url');

        $oid = User_openid::getKV('canonical', $openid_url);

        if (!$oid) {
            // TRANS: Form validation error for a non-existing OpenID.
            $this->showForm(_m('No such OpenID.'));
            return;
        }
        $cur = common_current_user();
        if (!$cur || $oid->user_id != $cur->id) {
            // TRANS: Form validation error if OpenID is connected to another user.
            $this->showForm(_m('That OpenID does not belong to you.'));
            return;
        }
        $oid->delete();
        // TRANS: Success message after removing an OpenID.
        $this->showForm(_m('OpenID removed.'), true);
        return;
    }

    /**
     * Handles a request to save preferences
     *
     * Validates input and, if everything is OK, deletes the OpenID.
     * Reloads the form with a success or error notification.
     *
     * @return void
     */
    function savePrefs()
    {
        $cur = common_current_user();

        if (empty($cur)) {
            throw new ClientException(_("Not logged in."));
        }

        $orig  = null;
        $prefs = User_openid_prefs::getKV('user_id', $cur->id);

        if (empty($prefs)) {
            $prefs          = new User_openid_prefs();
            $prefs->user_id = $cur->id;
            $prefs->created = common_sql_now();
        } else {
            $orig = clone($prefs);
        }

        $prefs->hide_profile_link = $this->booleanintstring('hide_profile_link');

        if (empty($orig)) {
            $prefs->insert();
        } else {
            $prefs->update($orig);
        }

        $this->showForm(_m('OpenID preferences saved.'), true);
        return;
    }
}


code:
<?php
/*
 * StatusNet - the distributed open-source microblogging tool
 * Copyright (C) 2008, 2009, StatusNet, Inc.
 *
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU Affero General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU Affero General Public License for more details.
 *
 * You should have received a copy of the GNU Affero General Public License
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */

if (!defined('STATUSNET')) {
    exit(1);
}

require_once INSTALLDIR.'/plugins/OpenID/openid.php';

class OpenidtrustAction extends Action
{
    var $trust_root;
    var $allowUrl;
    var $denyUrl;
    var $user;

    /**
     * Is this a read-only action?
     *
     * @return boolean false
     */
    function isReadOnly($args)
    {
        return false;
    }

    /**
     * Title of the page
     *
     * @return string title of the page
     */
    function title()
    {
        // TRANS: Title for identity verification page.
        return _m('OpenID Identity Verification');
    }

    function prepare($args)
    {
        parent::prepare($args);
        common_ensure_session();
        $this->user = common_current_user();
        if(empty($this->user)){
            /* Go log in, and then come back. */
            common_set_returnto($_SERVER['REQUEST_URI']);
            common_redirect(common_local_url('login'));
        }
        $this->trust_root = $_SESSION['openid_trust_root'];
        $this->allowUrl = $_SESSION['openid_allow_url'];
        $this->denyUrl = $_SESSION['openid_deny_url'];
        if(empty($this->trust_root) || empty($this->allowUrl) || empty($this->denyUrl)){
            // TRANS: Client error when visiting page directly.
            $this->clientError(_m('This page should only be reached during OpenID processing, not directly.'));
        }
        return true;
    }

    function handle($args)
    {
        parent::handle($args);
        if($_SERVER['REQUEST_METHOD'] == 'POST'){
            $this->handleSubmit();
        }else{
            $this->showPage();
        }
    }

    function handleSubmit()
    {
        global $_PEAR;

        unset($_SESSION['openid_trust_root']);
        unset($_SESSION['openid_allow_url']);
        unset($_SESSION['openid_deny_url']);
        if($this->arg('allow'))
        {
            //save to database
            $user_openid_trustroot = new User_openid_trustroot();
            $user_openid_trustroot->user_id = $this->user->id;
            $user_openid_trustroot->trustroot = $this->trust_root;
            $user_openid_trustroot->created = common_sql_now();
            if (!$user_openid_trustroot->insert()) {
                $err = &$_PEAR->getStaticProperty('DB_DataObject','lastError');
            }
            common_redirect($this->allowUrl, $code=302);
        }else{
            common_redirect($this->denyUrl, $code=302);
        }
    }

    /**
     * Show page notice
     *
     * Display a notice for how to use the page, or the
     * error if it exists.
     *
     * @return void
     */
    function showPageNotice()
    {
        // TRANS: Page notice. %s is a trustroot name.
        $this->element('p',null,sprintf(_m('%s has asked to verify your identity. Click Continue to verify your identity and login without creating a new password.'),$this->trust_root));
    }

    /**
     * Core of the display code
     *
     * Shows the login form.
     *
     * @return void
     */
    function showContent()
    {
        $this->elementStart('form', array('method' => 'post',
                                   'id' => 'form_openidtrust',
                                   'class' => 'form_settings',
                                   'action' => common_local_url('openidtrust')));
        $this->elementStart('fieldset');
        // TRANS: Button text to continue OpenID identity verification.
        $this->submit('allow', _m('BUTTON','Continue'));
        // TRANS: Button text to cancel OpenID identity verification.
        $this->submit('deny', _m('BUTTON','Cancel'));

        $this->elementEnd('fieldset');
        $this->elementEnd('form');
    }
}


code:
<?php
/**
 * Table Definition for user_openid
 */

if (!defined('STATUSNET')) {
    exit(1);
}

class User_openid extends Managed_DataObject
{
    ###START_AUTOCODE
    /* the code below is auto generated do not remove the above tag */

    public $__table = 'user_openid';                     // table name
    public $canonical;                       // varchar(191)  primary_key not_null
    public $display;                         // varchar(191)  unique_key not_null
    public $user_id;                         // int(4)   not_null
    public $created;                         // datetime()   not_null
    public $modified;                        // timestamp()   not_null default_CURRENT_TIMESTAMP

    /* the code above is auto generated do not remove the tag below */
    ###END_AUTOCODE

    public static function schemaDef()
    {
        return array(
            'fields' => array(
                'canonical' => array('type' => 'varchar', 'not null' => true, 'length' => 191, 'description' => 'OpenID canonical string'),
                'display' => array('type' => 'varchar', 'not null' => true, 'length' => 191, 'description' => 'OpenID display string'),
                'user_id' => array('type' => 'int', 'not null' => true, 'description' => 'User ID for OpenID owner'),
                'created' => array('type' => 'datetime', 'not null' => true, 'description' => 'date this record was created'),
                'modified' => array('type' => 'timestamp', 'not null' => true, 'description' => 'date this record was modified'),
            ),
            'primary key' => array('canonical'),
            'unique keys' => array(
                'user_openid_display_key' => array('display'),
            ),
            'indexes' => array(
                'user_openid_user_id_idx' => array('user_id'),
            ),
            'foreign keys' => array(
                'user_openid_user_id_fkey' => array('user', array('user_id' => 'id')),
            ),
        );
    }

    static function hasOpenID($user_id)
    {
        $oid = new User_openid();

        $oid->user_id = $user_id;

        $cnt = $oid->find();

        return ($cnt > 0);
    }
}


code:
<?php
/**
 * StatusNet - the distributed open-source microblogging tool
 * Copyright (C) 2012, StatusNet, Inc.
 *
 * User_openid_prefs.php
 *
 * PHP version 5
 *
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU Affero General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU Affero General Public License for more details.
 *
 * You should have received a copy of the GNU Affero General Public License
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 *
 * @category  OpenID
 * @package   StatusNet
 * @author    Evan Prodromou <evan@status.net>
 * @copyright 2012 StatusNet, Inc.
 * @license   http://www.fsf.org/licensing/licenses/agpl-3.0.html AGPL 3.0
 * @link      http://status.net/
 */

if (!defined('STATUSNET')) {
    exit(1);
}

/**
 * Store preferences for OpenID use in StatusNet
 *
 * @category OpenID
 * @package  StatusNet
 * @author   Evan Prodromou <evan@status.net>
 * @license  http://www.fsf.org/licensing/licenses/agpl.html AGPLv3
 * @link     http://status.net/
 *
 * @see      DB_DataObject
 */

class User_openid_prefs extends Managed_DataObject
{
    public $__table = 'user_openid_prefs'; // table name

    public $user_id;            // The User with the prefs
    public $hide_profile_link;  // Hide the link on the profile block?
    public $created;            // datetime
    public $modified;           // datetime

    /**
     * The One True Thingy that must be defined and declared.
     */

    public static function schemaDef()
    {
        return array(
                     'description' => 'Per-user preferences for OpenID display',
                     'fields' => array('user_id' => array('type' => 'integer',
                                                          'not null' => true,
                                                          'description' => 'User whose prefs we are saving'),
                                       'hide_profile_link' => array('type' => 'int',
                                                                    'not null' => true,
                                                                    'default' => 0,
                                                                    'description' => 'Whether to hide profile links from profile block'),
                                       'created' => array('type' => 'datetime',
                                                          'not null' => true,
                                                          'description' => 'date this record was created'),
                                       'modified' => array('type' => 'datetime',
                                                           'not null' => true,
                                                           'description' => 'date this record was modified'),
                                       ),
                     'primary key' => array('user_id'),
                     'foreign keys' => array('user_openid_prefs_user_id_fkey' => array('user', array('user_id' => 'id')),
                                             ),
                     'indexes' => array(),
                     );
    }
}


code:
<?php
/**
 * Table Definition for user_openid_trustroot
 */

if (!defined('STATUSNET')) {
    exit(1);
}

class User_openid_trustroot extends Managed_DataObject
{
    ###START_AUTOCODE
    /* the code below is auto generated do not remove the above tag */

    public $__table = 'user_openid_trustroot';                     // table name
    public $trustroot;                         // varchar(191) primary_key not_null   not 255 because utf8mb4 takes more space
    public $user_id;                         // int(4)  primary_key not_null
    public $created;                         // datetime()   not_null
    public $modified;                        // timestamp()   not_null default_CURRENT_TIMESTAMP

    /* the code above is auto generated do not remove the tag below */
    ###END_AUTOCODE

    public static function schemaDef()
    {
        return array(
            'fields' => array(
                'trustroot' => array('type' => 'varchar', 'not null' => true, 'length' => 191, 'description' => 'OpenID trustroot string'),
                'user_id' => array('type' => 'int', 'not null' => true, 'description' => 'User ID for OpenID trustroot owner'),
                'created' => array('type' => 'datetime', 'not null' => true, 'description' => 'date this record was created'),
                'modified' => array('type' => 'timestamp', 'not null' => true, 'description' => 'date this record was modified'),
            ),
            'primary key' => array('trustroot', 'user_id'),
        );
    }
}


code:
%%site.name%% supports the [OpenID](http://openid.net/) standard for single signon between Web sites. OpenID lets you log into many different Web sites without using a different password for each. (See [Wikipedia's OpenID article](http://en.wikipedia.org/wiki/OpenID) for more information.)

If you already have an account on %%site.name%%, you can [login](%%action.login%%) with your username and password as usual.
To use OpenID in the future, you can [add an OpenID to your account](%%action.openidsettings%%) after you have logged in normally.

There are many [Public OpenID providers](http://wiki.openid.net/OpenID-Providers), and you may already have an OpenID-enabled account on another service.

* On wikis: If you have an account on an OpenID-enabled wiki, like [Wikitravel](http://wikitravel.org/), [wikiHow](http://www.wikihow.com/), [Vinismo](http://vinismo.com/), [AboutUs](http://aboutus.org/) or [Keiki](http://kei.ki/), you can log in to %%site.name%% by entering the **full URL** of your user page on that other wiki in the box above. For example, *http://kei.ki/en/User:Evan*.
* [Yahoo!](http://openid.yahoo.com/) : If you have an account with Yahoo!, you can log in to this site by entering your Yahoo!-provided OpenID in the box above. Yahoo! OpenID URLs have the form *https://me.yahoo.com/yourusername*.
* [AOL](http://dev.aol.com/aol-and-63-million-openids) : If you have an account with [AOL](http://www.aol.com/), like an [AIM](http://www.aim.com/) account, you can log in to %%site.name%% by entering your AOL-provided OpenID in the box above. AOL OpenID URLs have the form *http://openid.aol.com/yourusername*. Your username should be all lowercase, no spaces.
* [Blogger](http://bloggerindraft.blogspot.com/2008/01/new-feature-blogger-as-openid-provider.html), [Wordpress.com](http://faq.wordpress.com/2007/03/06/what-is-openid/), [LiveJournal](http://www.livejournal.com/openid/about.bml), [Vox](http://bradfitz.vox.com/library/post/openid-for-vox.html) : If you have a blog on any of these services, enter your blog URL in the box above. For example, *http://yourusername.blogspot.com/*, *http://yourusername.wordpress.com/*, *http://yourusername.livejournal.com/*, or *http://yourusername.vox.com/*.

Additionally, once you have an account on %%site.name%%, you can use your profile's URL (https://%%site.server%%/yourusername) as an OpenID elsewhere as well.

path: plugins/OpenID/doc-src/openid


code:
team-extension.php
    Support for Launchpad's OpenID Teams extension
    Maintainer: Canonical
    Source: https://code.edge.launchpad.net/wordpress-teams-integration
            r27 2010-04-27
    License: AGPLv3

path: plugins/OpenID/extlib/README


code:
<?php
/*
 *  Wordpress Teams plugin
 *  Copyright (C) 2009-2010 Canonical Ltd.
 *
 *  This program is free software: you can redistribute it and/or modify
 *  it under the terms of the GNU Affero General Public License as published by
 *  the Free Software Foundation, either version 3 of the License, or
 *  (at your option) any later version.
 *
 *  This program is distributed in the hope that it will be useful,
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *  GNU Affero General Public License for more details.
 *
 *  You should have received a copy of the GNU Affero General Public License
 *  along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */

/**
 * Provides an example OpenID extension to query user team/group membership
 *
 * This code is based on code supplied with the openid library for simple
 * registration data.
 */

/**
 * Require the Message implementation.
 */
require_once 'Auth/OpenID/Message.php';
require_once 'Auth/OpenID/Extension.php';

/**
 * The team/group extension base class
 */
class Auth_OpenID_TeamsExtension extends Auth_OpenID_Extension {
  var $ns_uri = 'http://ns.launchpad.net/2007/openid-teams';
  var $ns_alias = 'lp';
  var $request_field = 'query_membership';
  var $response_field = 'is_member';

  /**
   * Get the string arguments that should be added to an OpenID
   * message for this extension.
   */
  function getExtensionArgs() {
    $args = array();

    if ($this->_teams) {
      $args[$this->request_field] = implode(',', $this->_teams);
    }

    return $args;
  }

  /**
   * Add the arguments from this extension to the provided message.
   *
   * Returns the message with the extension arguments added.
   */
  function toMessage(&$message) {
    if ($message->namespaces->addAlias($this->ns_uri, $this->ns_alias) === null) {
      if ($message->namespaces->getAlias($this->ns_uri) != $this->ns_alias) {
        return null;
      }
    }

    $message->updateArgs($this->ns_uri, $this->getExtensionArgs());
    return $message;
  }

  /**
   * Extract the team/group namespace URI from the given OpenID message.
   * Handles OpenID 1 and 2.
   *
   * $message: The OpenID message from which to parse team/group data.
   * This may be a request or response message.
   *
   * Returns the sreg namespace URI for the supplied message.
   *
   * @access private
   */
  function _getExtensionNS(&$message) {
    $alias = null;
    $found_ns_uri = null;

    // See if there exists an alias for the namespace
    $alias = $message->namespaces->getAlias($this->ns_uri);

    if ($alias !== null) {
      $found_ns_uri = $this->ns_uri;
    }

    if ($alias === null) {
      // There is no alias for this extension, so try to add one.
      $found_ns_uri = Auth_OpenID_TYPE_1_0;

      if ($message->namespaces->addAlias($this->ns_uri, $this->ns_alias) === null) {
        // An alias for the string 'lp' already exists, but
        // it's defined for something other than team/group membership
        return null;
      }
    }

    return $found_ns_uri;
  }
}

/**
 * The team/group extension request class
 */
class Auth_OpenID_TeamsRequest extends Auth_OpenID_TeamsExtension {
  function __init($teams) {
    if (!is_array($teams)) {
      if (!empty($teams)) {
        $teams = explode(',', $teams);
      } else {
        $teams = Array();
      }
    }

    $this->_teams = $teams;
  }

  function Auth_OpenID_TeamsRequest($teams) {
    $this->__init($teams);
  }
}

/**
 * The team/group extension response class
 */
class Auth_OpenID_TeamsResponse extends Auth_OpenID_TeamsExtension {
  var $_teams = array();

  function __init(&$resp, $signed_only=true) {
    $this->ns_uri = $this->_getExtensionNS($resp->message);

    if ($signed_only) {
      $args = $resp->getSignedNS($this->ns_uri);
    } else {
      $args = $resp->message->getArgs($this->ns_uri);
    }

    if ($args === null) {
      return null;
    }

    // An OpenID 2.0 response will handle the namespaces
    if (in_array($this->response_field, array_keys($args)) && !empty($args[$this->response_field])) {
      $this->_teams = explode(',', $args[$this->response_field]);
    }

    // Piggybacking on a 1.x request, however, won't so the field name will
    // be different
    elseif (in_array($this->ns_alias.'.'.$this->response_field, array_keys($args)) && !empty($args[$this->ns_alias.'.'.$this->response_field])) {
      $this->_teams = explode(',', $args[$this->ns_alias.'.'.$this->response_field]);
    }
  }

  function Auth_OpenID_TeamsResponse(&$resp, $signed_only=true) {
    $this->__init($resp, $signed_only);
  }

  /**
   * Get the array of teams the user is a member of
   *
   * @return array
   */
  function getTeams() {
    return $this->_teams;
  }
}

?>


code:
# SOME DESCRIPTIVE TITLE.
# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
# This file is distributed under the same license as the PACKAGE package.
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
#
#, fuzzy
msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2015-02-27 16:31+0100\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
"Language: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=CHARSET\n"
"Content-Transfer-Encoding: 8bit\n"

#. TRANS: OpenID plugin server error.
#: openid.php:139
msgid "Cannot instantiate OpenID consumer object."
msgstr ""

#. TRANS: OpenID plugin message. Given when an OpenID is not valid.
#: openid.php:151
msgid "Not a valid OpenID."
msgstr ""

#. TRANS: OpenID plugin server error. Given when the OpenID authentication request fails.
#. TRANS: %s is the failure message.
#: openid.php:156
#, php-format
msgid "OpenID failure: %s."
msgstr ""

#. TRANS: OpenID plugin server error. Given when the OpenID authentication request cannot be redirected.
#. TRANS: %s is the failure message.
#: openid.php:206
#, php-format
msgid "Could not redirect to server: %s."
msgstr ""

#. TRANS: OpenID plugin user instructions.
#: openid.php:245
msgid ""
"This form should automatically submit itself. If not, click the submit "
"button to go to your OpenID provider."
msgstr ""

#. TRANS: OpenID plugin server error.
#: openid.php:281
msgid "Error saving the profile."
msgstr ""

#. TRANS: OpenID plugin server error.
#: openid.php:293
msgid "Error saving the user."
msgstr ""

#. TRANS: OpenID plugin client exception (403).
#: openid.php:323
msgid "Unauthorized URL used for OpenID login."
msgstr ""

#. TRANS: Title
#: openid.php:371
msgid "OpenID Login Submission"
msgstr ""

#. TRANS: OpenID plugin message used while requesting authorization user's OpenID login provider.
#: openid.php:382
msgid "Requesting authorization from your login provider..."
msgstr ""

#. TRANS: OpenID plugin message. User instruction while requesting authorization user's OpenID login provider.
#: openid.php:386
msgid ""
"If you are not redirected to your login provider in a few seconds, try "
"pushing the button below."
msgstr ""

#. TRANS: Error message displayed when trying to perform an action that requires a logged in user.
#: actions/finishaddopenid.php:66
msgid "Not logged in."
msgstr ""

#. TRANS: Status message in case the response from the OpenID provider is that the logon attempt was cancelled.
#: actions/finishaddopenid.php:87 actions/finishopenidlogin.php:243
msgid "OpenID authentication cancelled."
msgstr ""

#. TRANS: OpenID authentication failed; display the error message.
#. TRANS: %s is the error message.
#. TRANS: OpenID authentication failed; display the error message. %s is the error message.
#: actions/finishaddopenid.php:92 actions/finishopenidlogin.php:247
#, php-format
msgid "OpenID authentication failed: %s."
msgstr ""

#. TRANS: OpenID authentication error.
#. TRANS: Message displayed when OpenID authentication is aborted.
#: actions/finishaddopenid.php:109 actions/finishopenidlogin.php:268
msgid ""
"OpenID authentication aborted: You are not allowed to login to this site."
msgstr ""

#. TRANS: Message in case a user tries to add an OpenID that is already connected to them.
#: actions/finishaddopenid.php:120
msgid "You already have this OpenID!"
msgstr ""

#. TRANS: Message in case a user tries to add an OpenID that is already used by another user.
#: actions/finishaddopenid.php:123
msgid "Someone else already has this OpenID."
msgstr ""

#. TRANS: Message in case the OpenID object cannot be connected to the user.
#: actions/finishaddopenid.php:136
msgid "Error connecting user."
msgstr ""

#. TRANS: Message in case the user or the user profile cannot be saved in StatusNet.
#: actions/finishaddopenid.php:143
msgid "Error updating profile."
msgstr ""

#. TRANS: Title after getting the status of the OpenID authorisation request.
#: actions/finishaddopenid.php:183
msgid "OpenID Login"
msgstr ""

#. TRANS: OpenID plugin client error given trying to add an unauthorised OpenID to a user (403).
#. TRANS: %s is a request identity.
#: actions/openidserver.php:115
#, php-format
msgid "You are not authorized to use the identity %s."
msgstr ""

#. TRANS: OpenID plugin client error given when not getting a response for a given OpenID provider (500).
#: actions/openidserver.php:136
msgid "Just an OpenID provider. Nothing to see here, move along..."
msgstr ""

#. TRANS: Title of OpenID settings page for a user.
#: actions/openidsettings.php:57
msgctxt "TITLE"
msgid "OpenID settings"
msgstr ""

#. TRANS: Form instructions for OpenID settings.
#. TRANS: This message contains Markdown links in the form [description](link).
#: actions/openidsettings.php:69
#, php-format
msgid ""
"[OpenID](%%doc.openid%%) lets you log into many sites with the same user "
"account. Manage your associated OpenIDs from here."
msgstr ""

#. TRANS: Fieldset legend.
#: actions/openidsettings.php:100
msgctxt "LEGEND"
msgid "Add OpenID"
msgstr ""

#. TRANS: Form guide.
#: actions/openidsettings.php:104
msgid ""
"If you want to add an OpenID to your account, enter it in the box below and "
"click \"Add\"."
msgstr ""

#. TRANS: Field label.
#. TRANS: OpenID plugin logon form field label.
#: actions/openidsettings.php:110 actions/openidlogin.php:155
#: OpenIDPlugin.php:702
msgid "OpenID URL"
msgstr ""

#. TRANS: Button text for adding an OpenID URL.
#: actions/openidsettings.php:121
msgctxt "BUTTON"
msgid "Add"
msgstr ""

#. TRANS: Header on OpenID settings page.
#: actions/openidsettings.php:133
msgctxt "HEADER"
msgid "Remove OpenID"
msgstr ""

#. TRANS: Form guide.
#: actions/openidsettings.php:139
msgid ""
"Removing your only OpenID would make it impossible to log in! If you need to "
"remove it, add another OpenID first."
msgstr ""

#. TRANS: Form guide.
#: actions/openidsettings.php:155
msgid ""
"You can remove an OpenID from your account by clicking the button marked "
"\"Remove\"."
msgstr ""

#. TRANS: Button text to remove an OpenID.
#. TRANS: Button text to remove an OpenID trustroot.
#: actions/openidsettings.php:179 actions/openidsettings.php:223
msgctxt "BUTTON"
msgid "Remove"
msgstr ""

#. TRANS: Fieldset legend.
#: actions/openidsettings.php:194
msgid "OpenID Trusted Sites"
msgstr ""

#. TRANS: Form guide.
#: actions/openidsettings.php:198
msgid ""
"The following sites are allowed to access your identity and log you in. You "
"can remove a site from this list to deny it access to your OpenID."
msgstr ""

#: actions/openidsettings.php:229
msgctxt "LEGEND"
msgid "Preferences"
msgstr ""

#. TRANS: Button text to save OpenID prefs
#. TRANS: Button text to save OpenID settings.
#: actions/openidsettings.php:237 actions/openidadminpanel.php:284
msgctxt "BUTTON"
msgid "Save"
msgstr ""

#. TRANS: Client error displayed when the session token does not match or is not given.
#. TRANS: Message given when there is a problem with the user's session token.
#: actions/openidsettings.php:257 actions/finishopenidlogin.php:42
msgid "There was a problem with your session token. Try again, please."
msgstr ""

#. TRANS: Form validation error if no OpenID providers can be added.
#: actions/openidsettings.php:265
msgid "Cannot add new providers."
msgstr ""

#. TRANS: Unexpected form validation error.
#: actions/openidsettings.php:281
msgid "Something weird happened."
msgstr ""

#. TRANS: Form validation error when trying to remove a non-existing trustroot.
#: actions/openidsettings.php:305
msgid "No such OpenID trustroot."
msgstr ""

#. TRANS: Success message after removing trustroots.
#: actions/openidsettings.php:310
msgid "Trustroots removed."
msgstr ""

#. TRANS: Form validation error for a non-existing OpenID.
#: actions/openidsettings.php:333
msgid "No such OpenID."
msgstr ""

#. TRANS: Form validation error if OpenID is connected to another user.
#: actions/openidsettings.php:339
msgid "That OpenID does not belong to you."
msgstr ""

#. TRANS: Success message after removing an OpenID.
#: actions/openidsettings.php:344
msgid "OpenID removed."
msgstr ""

#: actions/openidsettings.php:383
msgid "OpenID preferences saved."
msgstr ""

#. TRANS: Client error message trying to log on with OpenID while already logged on.
#: actions/finishopenidlogin.php:37 actions/openidlogin.php:33
msgid "Already logged in."
msgstr ""

#. TRANS: Message given if user does not agree with the site's license.
#: actions/finishopenidlogin.php:48
msgid "You cannot register if you do not agree to the license."
msgstr ""

#. TRANS: Messag given on an unknown error.
#: actions/finishopenidlogin.php:57
msgid "An unknown error has occured."
msgstr ""

#. TRANS: Instructions given after a first successful logon using OpenID.
#. TRANS: %s is the site name.
#: actions/finishopenidlogin.php:73
#, php-format
msgid ""
"This is the first time you have logged into %s so we must connect your "
"OpenID to a local account. You can either create a new account, or connect "
"with your existing account, if you have one."
msgstr ""

#. TRANS: Title
#: actions/finishopenidlogin.php:80
msgctxt "TITLE"
msgid "OpenID Account Setup"
msgstr ""

#. TRANS: Fieldset legend.
#: actions/finishopenidlogin.php:118
msgid "Create new account"
msgstr ""

#. TRANS: Form guide.
#: actions/finishopenidlogin.php:121
msgid "Create a new user with this nickname."
msgstr ""

#. TRANS: Field label.
#: actions/finishopenidlogin.php:129
msgid "New nickname"
msgstr ""

#. TRANS: Field title.
#: actions/finishopenidlogin.php:132
msgid "1-64 lowercase letters or numbers, no punctuation or spaces."
msgstr ""

#. TRANS: Field label.
#: actions/finishopenidlogin.php:136
msgid "Email"
msgstr ""

#. TRANS: Field title.
#: actions/finishopenidlogin.php:138
msgid "Used only for updates, announcements, and password recovery."
msgstr ""

#. TRANS: OpenID plugin link text.
#. TRANS: %s is a link to a license with the license name as link text.
#: actions/finishopenidlogin.php:155
#, php-format
msgid ""
"My text and files are available under %s except this private data: password, "
"email address, IM address, and phone number."
msgstr ""

#. TRANS: Button label in form in which to create a new user on the site for an OpenID.
#: actions/finishopenidlogin.php:168
msgctxt "BUTTON"
msgid "Create"
msgstr ""

#. TRANS: Used as form legend for form in which to connect an OpenID to an existing user on the site.
#: actions/finishopenidlogin.php:182
msgid "Connect existing account"
msgstr ""

#. TRANS: User instructions for form in which to connect an OpenID to an existing user on the site.
#: actions/finishopenidlogin.php:185
msgid ""
"If you already have an account, login with your username and password to "
"connect it to your OpenID."
msgstr ""

#. TRANS: Field label in form in which to connect an OpenID to an existing user on the site.
#: actions/finishopenidlogin.php:189
msgid "Existing nickname"
msgstr ""

#. TRANS: Field label in form in which to connect an OpenID to an existing user on the site.
#: actions/finishopenidlogin.php:193
msgid "Password"
msgstr ""

#. TRANS: Button text in form in which to connect an OpenID to an existing user on the site.
#: actions/finishopenidlogin.php:197
msgctxt "BUTTON"
msgid "Connect"
msgstr ""

#. TRANS: OpenID plugin message. No new user registration is allowed on the site.
#. TRANS: OpenID plugin message. No new user registration is allowed on the site without an invitation code, and none was provided.
#: actions/finishopenidlogin.php:324 actions/finishopenidlogin.php:333
msgid "Registration not allowed."
msgstr ""

#. TRANS: OpenID plugin message. No new user registration is allowed on the site without an invitation code, and the one provided was not valid.
#: actions/finishopenidlogin.php:340
msgid "Not a valid invitation code."
msgstr ""

#. TRANS: OpenID plugin server error. A stored OpenID cannot be retrieved.
#. TRANS: OpenID plugin server error. A stored OpenID cannot be found.
#: actions/finishopenidlogin.php:355 actions/finishopenidlogin.php:438
msgid "Stored OpenID not found."
msgstr ""

#. TRANS: OpenID plugin server error.
#: actions/finishopenidlogin.php:364
msgid "Creating new account for OpenID that already has a user."
msgstr ""

#. TRANS: OpenID plugin message.
#: actions/finishopenidlogin.php:426
msgid "Invalid username or password."
msgstr ""

#. TRANS: OpenID plugin server error. The user or user profile could not be saved.
#: actions/finishopenidlogin.php:445
msgid "Error connecting user to OpenID."
msgstr ""

#. TRANS: OpenID plugin message. Rememberme logins have to reauthenticate before changing any profile settings.
#. TRANS: "OpenID" is the display text for a link with URL "(%%doc.openid%%)".
#: actions/openidlogin.php:74
#, php-format
msgid ""
"For security reasons, please re-login with your [OpenID](%%doc.openid%%) "
"before changing your settings."
msgstr ""

#. TRANS: OpenID plugin message.
#. TRANS: "OpenID" is the display text for a link with URL "(%%doc.openid%%)".
#: actions/openidlogin.php:80
#, php-format
msgid "Login with an [OpenID](%%doc.openid%%) account."
msgstr ""

#. TRANS: OpenID plugin message. Title.
#: actions/openidlogin.php:114
msgctxt "TITLE"
msgid "OpenID Login"
msgstr ""

#. TRANS: OpenID plugin logon form legend.
#: actions/openidlogin.php:132 OpenIDPlugin.php:679
msgctxt "LEGEND"
msgid "OpenID login"
msgstr ""

#. TRANS: Field label.
#: actions/openidlogin.php:140
msgctxt "LABEL"
msgid "OpenID provider"
msgstr ""

#. TRANS: Form guide.
#: actions/openidlogin.php:149 OpenIDPlugin.php:696
msgid "Enter your username."
msgstr ""

#. TRANS: Form guide.
#: actions/openidlogin.php:151 OpenIDPlugin.php:698
msgid "You will be sent to the provider's site for authentication."
msgstr ""

#. TRANS: OpenID plugin logon form field title.
#. TRANS: OpenID plugin logon form field instructions.
#: actions/openidlogin.php:158 OpenIDPlugin.php:705
msgid "Your OpenID URL."
msgstr ""

#. TRANS: OpenID plugin logon form checkbox label for setting to put the OpenID information in a cookie.
#: actions/openidlogin.php:163
msgid "Remember me"
msgstr ""

#. TRANS: OpenID plugin logon form field title.
#: actions/openidlogin.php:165
msgid "Automatically login in the future; not for shared computers!"
msgstr ""

#. TRANS: OpenID plugin logon form button label to start logon with the data provided in the logon form.
#: actions/openidlogin.php:170
msgctxt "BUTTON"
msgid "Login"
msgstr ""

#. TRANS: Title for OpenID bridge administration page.
#: actions/openidadminpanel.php:53
msgctxt "TITLE"
msgid "OpenID Settings"
msgstr ""

#. TRANS: Page instructions.
#: actions/openidadminpanel.php:64
msgid "OpenID settings"
msgstr ""

#. TRANS: Client error displayed when OpenID provider URL is too long.
#: actions/openidadminpanel.php:145
msgid "Invalid provider URL. Maximum length is 255 characters."
msgstr ""

#. TRANS: Client error displayed when Launchpad team name is too long.
#: actions/openidadminpanel.php:152
msgid "Invalid team name. Maximum length is 255 characters."
msgstr ""

#. TRANS: Fieldset legend.
#: actions/openidadminpanel.php:206
msgctxt "LEGEND"
msgid "Trusted provider"
msgstr ""

#. TRANS: Form guide.
#: actions/openidadminpanel.php:209
msgid ""
"By default, users are allowed to authenticate with any OpenID provider. If "
"you are using your own OpenID service for shared sign-in, you can restrict "
"access to only your own users here."
msgstr ""

#. TRANS: Field label.
#: actions/openidadminpanel.php:218
msgid "Provider URL"
msgstr ""

#. TRANS: Field title.
#: actions/openidadminpanel.php:220
msgid ""
"All OpenID logins will be sent to this URL; other providers may not be used."
msgstr ""

#. TRANS: Checkbox label.
#: actions/openidadminpanel.php:228
msgid "Append a username to base URL"
msgstr ""

#. TRANS: Checkbox title.
#: actions/openidadminpanel.php:231
msgid ""
"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."
msgstr ""

#. TRANS: Field label.
#: actions/openidadminpanel.php:240
msgid "Required team"
msgstr ""

#. TRANS: Field title.
#: actions/openidadminpanel.php:242
msgid "Only allow logins from users in the given team (Launchpad extension)."
msgstr ""

#. TRANS: Fieldset legend.
#: actions/openidadminpanel.php:255
msgctxt "LEGEND"
msgid "Options"
msgstr ""

#. TRANS: Checkbox label.
#: actions/openidadminpanel.php:263
msgid "Enable OpenID-only mode"
msgstr ""

#. TRANS: Checkbox title.
#: actions/openidadminpanel.php:266
msgid ""
"Require all users to login via OpenID. Warning: disables password "
"authentication for all users!"
msgstr ""

#. TRANS: Button title to save OpenID settings.
#: actions/openidadminpanel.php:286
msgid "Save OpenID settings."
msgstr ""

#. TRANS: Title for identity verification page.
#: actions/openidtrust.php:51
msgid "OpenID Identity Verification"
msgstr ""

#. TRANS: Client error when visiting page directly.
#: actions/openidtrust.php:69
msgid ""
"This page should only be reached during OpenID processing, not directly."
msgstr ""

#. TRANS: Page notice. %s is a trustroot name.
#: actions/openidtrust.php:118
#, php-format
msgid ""
"%s has asked to verify your identity. Click Continue to verify your identity "
"and login without creating a new password."
msgstr ""

#. TRANS: Button text to continue OpenID identity verification.
#. TRANS: button label for OAuth authorization page when needing OpenID authentication first.
#: actions/openidtrust.php:136 OpenIDPlugin.php:662
msgctxt "BUTTON"
msgid "Continue"
msgstr ""

#. TRANS: Button text to cancel OpenID identity verification.
#: actions/openidtrust.php:138
msgctxt "BUTTON"
msgid "Cancel"
msgstr ""

#. TRANS: Client exception thrown when an action is not available.
#: OpenIDPlugin.php:139
msgid "Unavailable action."
msgstr ""

#. TRANS: Tooltip for main menu option "Login"
#: OpenIDPlugin.php:219
msgctxt "TOOLTIP"
msgid "Login to the site."
msgstr ""

#. TRANS: Main menu option when not logged in to log in
#: OpenIDPlugin.php:222
msgctxt "MENU"
msgid "Login"
msgstr ""

#. TRANS: Tooltip for main menu option "Help"
#: OpenIDPlugin.php:227
msgctxt "TOOLTIP"
msgid "Help me!"
msgstr ""

#. TRANS: Main menu option for help on the StatusNet site
#: OpenIDPlugin.php:230
msgctxt "MENU"
msgid "Help"
msgstr ""

#. TRANS: Tooltip for main menu option "Search"
#: OpenIDPlugin.php:236
msgctxt "TOOLTIP"
msgid "Search for people or text."
msgstr ""

#. TRANS: Main menu option when logged in or when the StatusNet instance is not private
#: OpenIDPlugin.php:239
msgctxt "MENU"
msgid "Search"
msgstr ""

#. TRANS: OpenID plugin menu item on site logon page.
#. TRANS: OpenID plugin menu item on user settings page.
#. TRANS: OpenID configuration menu item.
#: OpenIDPlugin.php:296 OpenIDPlugin.php:332 OpenIDPlugin.php:524
#: OpenIDPlugin.php:604
msgctxt "MENU"
msgid "OpenID"
msgstr ""

#. TRANS: OpenID plugin tooltip for logon menu item.
#: OpenIDPlugin.php:298
msgid "Login or register with OpenID."
msgstr ""

#. TRANS: OpenID plugin tooltip for user settings menu item.
#: OpenIDPlugin.php:334
msgid "Add or remove OpenIDs."
msgstr ""

#. TRANS: Page notice for logged in users to try and get them to add an OpenID account to their StatusNet account.
#. TRANS: This message contains Markdown links in the form (description)[link].
#: OpenIDPlugin.php:466
#, php-format
msgid ""
"(Have an [OpenID](http://openid.net/)? [Add an OpenID to your account]"
"(%%action.openidsettings%%)!"
msgstr ""

#. TRANS: Page notice for anonymous users to try and get them to register with an OpenID account.
#. TRANS: This message contains Markdown links in the form (description)[link].
#: OpenIDPlugin.php:471
#, php-format
msgid ""
"(Have an [OpenID](http://openid.net/)? Try our [OpenID registration]"
"(%%action.openidlogin%%)!)"
msgstr ""

#. TRANS: Page notice on the login page to try and get them to log on with an OpenID account.
#. TRANS: This message contains Markdown links in the form (description)[link].
#: OpenIDPlugin.php:479
#, php-format
msgid ""
"(Have an [OpenID](http://openid.net/)? Try our [OpenID login](%%action."
"openidlogin%%)!)"
msgstr ""

#. TRANS: Tooltip for OpenID configuration menu item.
#: OpenIDPlugin.php:606
msgid "OpenID configuration."
msgstr ""

#. TRANS: Plugin description.
#: OpenIDPlugin.php:652
msgid "Use <a href=\"http://openid.net/\">OpenID</a> to login to the site."
msgstr ""

#. TRANS: Field label.
#: OpenIDPlugin.php:687
msgid "OpenID provider"
msgstr ""