Adapt BaseURL calls to new UriInterface

This commit is contained in:
Philipp 2023-02-18 20:57:30 +01:00
parent 9e6d95284b
commit f0c29edcde
No known key found for this signature in database
GPG key ID: 24A7501396EB5432
101 changed files with 218 additions and 241 deletions

View file

@ -230,11 +230,11 @@ class Authentication
// Otherwise it's probably an openid.
try {
$openid = new LightOpenID($this->baseUrl->getHostname());
$openid = new LightOpenID($this->baseUrl->getHost());
$openid->identity = $openid_url;
$this->session->set('openid', $openid_url);
$this->session->set('remember', $remember);
$openid->returnUrl = $this->baseUrl->get(true) . '/openid';
$openid->returnUrl = $this->baseUrl . '/openid';
$openid->optional = ['namePerson/friendly', 'contact/email', 'namePerson', 'namePerson/first', 'media/image/aspect11', 'media/image/default'];
System::externalRedirect($openid->authUrl());
} catch (Exception $e) {
@ -329,8 +329,8 @@ class Authentication
'mobile-theme' => $this->pConfig->get($user_record['uid'], 'system', 'mobile_theme'),
'authenticated' => 1,
'page_flags' => $user_record['page-flags'],
'my_url' => $this->baseUrl->get() . '/profile/' . $user_record['nickname'],
'my_address' => $user_record['nickname'] . '@' . substr($this->baseUrl->get(), strpos($this->baseUrl->get(), '://') + 3),
'my_url' => $this->baseUrl . '/profile/' . $user_record['nickname'],
'my_address' => $user_record['nickname'] . '@' . substr($this->baseUrl, strpos($this->baseUrl, '://') + 3),
'addr' => $this->remoteAddress,
'nickname' => $user_record['nickname'],
]);

View file

@ -201,7 +201,7 @@ class ExAuth
$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 {
@ -282,7 +282,7 @@ class ExAuth
$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);