<?php
/**
- * @copyright Copyright (C) 2010-2022, the Friendica project
+ * @copyright Copyright (C) 2010-2023, the Friendica project
*
* @license GNU AGPL version 3 or any later version
*
use Friendica\DI;
use Friendica\Model\User;
use Friendica\Network\HTTPClient\Client\HttpClientAccept;
-use Friendica\Network\HTTPClient\Client\HttpClientOptions;
use Friendica\Network\HTTPException;
use Friendica\Util\PidFile;
$sUser = str_replace(['%20', '(a)'], [' ', '@'], $aCommand[1]);
// Does the hostname match? So we try directly
- if ($this->baseURL->getHostname() == $aCommand[2]) {
+ if ($this->baseURL->getHost() == $aCommand[2]) {
$this->writeLog(LOG_INFO, 'internal user check for ' . $sUser . '@' . $aCommand[2]);
$found = $this->dba->exists('user', ['nickname' => $sUser]);
} else {
$url = ($ssl ? 'https' : 'http') . '://' . $host . '/noscrape/' . $user;
- $curlResult = DI::httpClient()->get($url, [HttpClientOptions::ACCEPT_CONTENT => HttpClientAccept::JSON]);
+ $curlResult = DI::httpClient()->get($url, HttpClientAccept::JSON);
if (!$curlResult->isSuccess()) {
return false;
$Error = false;
// Does the hostname match? So we try directly
- if ($this->baseURL->getHostname() == $aCommand[2]) {
+ if ($this->baseURL->getHost() == $aCommand[2]) {
try {
$this->writeLog(LOG_INFO, 'internal auth for ' . $sUser . '@' . $aCommand[2]);
User::getIdFromPasswordAuthentication($sUser, $aCommand[3], true);
$this->writeLog(LOG_WARNING, 'authentification failed for user ' . $sUser . '@' . $aCommand[2]);
fwrite(STDOUT, pack('nn', 2, 0));
} else {
- $this->writeLog(LOG_NOTICE, 'authentificated user ' . $sUser . '@' . $aCommand[2]);
+ $this->writeLog(LOG_NOTICE, 'authenticated user ' . $sUser . '@' . $aCommand[2]);
fwrite(STDOUT, pack('nn', 2, 1));
}
}