Create your own plugin and in the start.php file use the following hook.
elgg_register_plugin_hook_handler('action', 'login', function ($hook, $entity_type, $returnvalue, $params){
$username = get_input('username');
// your php code here
// if all is ok return true
// if all is not ok return false
});
Register your own pam_handler http://learn.elgg.org/en/stable/guides/authentication.html#pluggable-authentication-modules
info@elgg.org
Security issues should be reported to security@elgg.org!
©2014 the Elgg Foundation
Elgg is a registered trademark of Thematic Networks.
Cover image by Raül Utrera is used under Creative Commons license.
Icons by Flaticon and FontAwesome.