[various] Remove App dependency from hook functions

This commit is contained in:
Hypolite Petovan 2023-01-13 21:16:09 -05:00
parent b53914ee11
commit 39c654da00
87 changed files with 419 additions and 451 deletions

View file

@ -43,12 +43,12 @@ function ldapauth_install()
Hook::register('authenticate', 'addon/ldapauth/ldapauth.php', 'ldapauth_hook_authenticate');
}
function ldapauth_load_config(App $a, ConfigFileManager $loader)
function ldapauth_load_config(ConfigFileManager $loader)
{
$a->getConfigCache()->load($loader->loadAddonConfig('ldapauth'), \Friendica\Core\Config\ValueObject\Cache::SOURCE_STATIC);
DI::app()->getConfigCache()->load($loader->loadAddonConfig('ldapauth'), \Friendica\Core\Config\ValueObject\Cache::SOURCE_STATIC);
}
function ldapauth_hook_authenticate(App $a, array &$b)
function ldapauth_hook_authenticate(array &$b)
{
$user = ldapauth_authenticate($b['username'], $b['password']);
if (!empty($user['uid'])) {