]> git.mxchange.org Git - friendica.git/blobdiff - mod/openid.php
Uncommon logger levels in Friendica (#5453)
[friendica.git] / mod / openid.php
index 613cd222f605e962301492f73f4a8d033fb9c7a7..3baeec28d04feab6ed8d06ff1439b7e38131121b 100644 (file)
@@ -1,12 +1,14 @@
 <?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');
@@ -17,14 +19,14 @@ function openid_content(App $a) {
 
        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());
                        }
 
@@ -60,8 +62,8 @@ function openid_content(App $a) {
                        // 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());
                        }
 
@@ -111,7 +113,7 @@ function openid_content(App $a) {
                        // NOTREACHED
                }
        }
-       notice( t('Login failed.') . EOL);
+       notice(L10n::t('Login failed.') . EOL);
        goaway(System::baseUrl());
        // NOTREACHED
 }