<?php
/*
- * Laconica - a distributed open-source microblogging tool
- * Copyright (C) 2008, 2009, Control Yourself, Inc.
+ * 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
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-if (!defined('LACONICA')) { exit(1); }
+if (!defined('STATUSNET') && !defined('LACONICA')) { exit(1); }
require_once(INSTALLDIR.'/plugins/OpenID/User_openid.php');
require_once('Auth/OpenID.php');
require_once('Auth/OpenID/Consumer.php');
+require_once('Auth/OpenID/Server.php');
require_once('Auth/OpenID/SReg.php');
require_once('Auth/OpenID/MySQLStore.php');
{
static $store = null;
if (!$store) {
- # Can't be called statically
+ # Cannot be called statically
$user = new User();
$conn = $user->getDatabaseConnection();
$store = new Auth_OpenID_MySQLStore($conn);
return $consumer;
}
+function oid_server()
+{
+ $store = oid_store();
+ $server = new Auth_OpenID_Server($store, common_local_url('openidserver'));
+ return $server;
+}
+
function oid_clear_last()
{
oid_set_last('');
$form_html = $auth_request->formMarkup($trust_root, $process_url,
$immediate, array('id' => $form_id));
- # XXX: This is cheap, but things choke if we don't escape ampersands
+ # XXX: This is cheap, but things choke if we do not escape ampersands
# in the HTML attributes
$form_html = preg_replace('/&/', '&', $form_html);
- // Display an error if the form markup couldn't be generated;
+ // Display an error if the form markup could not be generated;
// otherwise, render the HTML.
if (Auth_OpenID::isFailure($form_html)) {
common_server_error(sprintf(_('Could not create OpenID form: %s'), $form_html->message));
$orig_user = clone($user);
- if ($sreg['email'] && Validate::email($sreg['email'], true)) {
+ if ($sreg['email'] && Validate::email($sreg['email'], common_config('email', 'check_domain'))) {
$user->email = $sreg['email'];
}