mirror of
https://git.friendi.ca/friendica/friendica-addons.git
synced 2025-07-09 18:08:49 +00:00
Replaced deprecated functionalities
This commit is contained in:
parent
cff3dd67b0
commit
25b267c6da
2 changed files with 11 additions and 6 deletions
|
@ -440,11 +440,16 @@ function windowsphonepush_login(App $a)
|
|||
throw new UnauthorizedException('This api requires login');
|
||||
}
|
||||
|
||||
$user_id = User::authenticate($_SERVER['PHP_AUTH_USER'], trim($_SERVER['PHP_AUTH_PW']));
|
||||
try {
|
||||
$user_id = User::getIdFromPasswordAuthentication($_SERVER['PHP_AUTH_USER'], trim($_SERVER['PHP_AUTH_PW']));
|
||||
if ($user_id) {
|
||||
$record = DBA::selectFirst('user', [], ['uid' => $user_id]);
|
||||
}
|
||||
} catch (Exception $ex) {
|
||||
$record = [];
|
||||
}
|
||||
|
||||
if ($user_id) {
|
||||
$record = DBA::selectFirst('user', [], ['uid' => $user_id]);
|
||||
} else {
|
||||
if (empty($record)) {
|
||||
Logger::info('API_login failure: ' . print_r($_SERVER, true));
|
||||
header('WWW-Authenticate: Basic realm="Friendica"');
|
||||
throw new UnauthorizedException('This api requires login');
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue