mirror of
https://git.friendi.ca/friendica/friendica-addons.git
synced 2024-11-28 16:53:16 +00:00
Merge pull request #1203 from annando/deprecated
Replaced deprecated functionalities
This commit is contained in:
commit
2ac5662ab2
2 changed files with 11 additions and 6 deletions
|
@ -24,13 +24,13 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
use Friendica\App;
|
use Friendica\App;
|
||||||
use Friendica\Core\Addon;
|
use Friendica\Core\Hook;
|
||||||
use Friendica\Core\Renderer;
|
use Friendica\Core\Renderer;
|
||||||
use Friendica\DI;
|
use Friendica\DI;
|
||||||
|
|
||||||
function nitter_install()
|
function nitter_install()
|
||||||
{
|
{
|
||||||
Addon::registerHook ('prepare_body_final', 'addon/nitter/nitter.php', 'nitter_render');
|
Hook::register('prepare_body_final', 'addon/nitter/nitter.php', 'nitter_render');
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Handle the send data from the admin settings
|
/* Handle the send data from the admin settings
|
||||||
|
|
|
@ -440,11 +440,16 @@ function windowsphonepush_login(App $a)
|
||||||
throw new UnauthorizedException('This api requires login');
|
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) {
|
if ($user_id) {
|
||||||
$record = DBA::selectFirst('user', [], ['uid' => $user_id]);
|
$record = DBA::selectFirst('user', [], ['uid' => $user_id]);
|
||||||
} else {
|
}
|
||||||
|
} catch (Exception $ex) {
|
||||||
|
$record = [];
|
||||||
|
}
|
||||||
|
|
||||||
|
if (empty($record)) {
|
||||||
Logger::info('API_login failure: ' . print_r($_SERVER, true));
|
Logger::info('API_login failure: ' . print_r($_SERVER, true));
|
||||||
header('WWW-Authenticate: Basic realm="Friendica"');
|
header('WWW-Authenticate: Basic realm="Friendica"');
|
||||||
throw new UnauthorizedException('This api requires login');
|
throw new UnauthorizedException('This api requires login');
|
||||||
|
|
Loading…
Reference in a new issue