]> git.mxchange.org Git - friendica.git/blobdiff - mod/openid.php
mod/message return to conversation if message deleted
[friendica.git] / mod / openid.php
index 5af209c13e072fb838358e8e4cd0dccb1e0d1686..41d45c1f608a887889abc087baa6119f40b67113 100644 (file)
@@ -2,13 +2,12 @@
 /**
  * @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');
+use Friendica\Database\DBA;
 
 function openid_content(App $a) {
 
@@ -20,7 +19,7 @@ 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()) {
 
@@ -42,10 +41,10 @@ function openid_content(App $a) {
                                AND `blocked` = 0 AND `account_expired` = 0
                                AND `account_removed` = 0 AND `verified` = 1
                                LIMIT 1",
-                               dbesc($authid), dbesc(normalise_openid($authid))
+                               DBA::escape($authid), DBA::escape(normalise_openid($authid))
                        );
 
-                       if (DBM::is_result($r)) {
+                       if (DBA::isResult($r)) {
 
                                // successful OpenID login
 
@@ -63,7 +62,7 @@ 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) {
+                       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());
                        }