Skip to content

Commit

Permalink
Dev: secure beforeLogin too (uneeded, but better)
Browse files Browse the repository at this point in the history
  • Loading branch information
Shnoulle committed Jul 29, 2022
1 parent c0e25d4 commit eead6f5
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion application/core/plugins/Authwebserver/Authwebserver.php
Expand Up @@ -78,13 +78,14 @@ public function beforeLogin()
if (isset($aUserMappings[$sUser])) {
$sUser = $aUserMappings[$sUser];
}
$authEvent = $this->getEvent();
$oUser = $this->api->getUserByName($sUser);
if (
($oUser && Permission::model()->hasGlobalPermission('auth_webserver', 'read', $oUser->uid))
|| (!$oUser && $this->api->getConfigKey('auth_webserver_autocreate_user'))
) {
$this->setUsername($sUser);
$this->setAuthPlugin(); // This plugin handles authentication, halt further execution of auth plugins
$this->setAuthPlugin($beforeLoginEvent); // This plugin handles authentication, halt further execution of auth plugins
return;
}
}
Expand Down

0 comments on commit eead6f5

Please sign in to comment.