<?php
+/**
+ * @file mod/openid.php
+ */
use Friendica\App;
use Friendica\Core\Config;
+use Friendica\Core\L10n;
use Friendica\Core\System;
use Friendica\Database\DBM;
-require_once('library/openid.php');
-
function openid_content(App $a) {
$noid = Config::get('system','no_openid');
if((x($_GET,'openid_mode')) && (x($_SESSION,'openid'))) {
- $openid = new LightOpenID;
+ $openid = new LightOpenID($a->get_hostname());
if($openid->validate()) {
$authid = $_REQUEST['openid_identity'];
if(! strlen($authid)) {
- logger( t('OpenID protocol error. No ID returned.') . EOL);
+ logger(L10n::t('OpenID protocol error. No ID returned.') . EOL);
goaway(System::baseUrl());
}
// Successful OpenID login - but we can't match it to an existing account.
// New registration?
- if ($a->config['register_policy'] == REGISTER_CLOSED) {
- notice( t('Account not found and OpenID registration is not permitted on this site.') . EOL);
+ if (intval(Config::get('config', 'register_policy')) === REGISTER_CLOSED) {
+ notice(L10n::t('Account not found and OpenID registration is not permitted on this site.') . EOL);
goaway(System::baseUrl());
}
// NOTREACHED
}
}
- notice( t('Login failed.') . EOL);
+ notice(L10n::t('Login failed.') . EOL);
goaway(System::baseUrl());
// NOTREACHED
}