Update 'plugin.php'

This commit is contained in:
Mario Voigt 2023-04-12 12:00:04 +02:00
parent bda3ae89e8
commit 9550a4fd2f

View File

@ -53,8 +53,7 @@ function ldapauth_environment_check() {
# Reroute login to yourls filter
# (see https://github.com/YOURLS/YOURLS/wiki/Advanced-Hook-Syntax)
//yourls_add_filter( 'is_valid_user', 'ldapauth_is_valid_user' );
yourls_add_filter( 'shunt_is_valid_user', 'ldapauth_is_valid_user' );
yourls_add_filter( 'is_valid_user', 'ldapauth_is_valid_user' );
function ldapauth_shuffle_assoc($list) {
if (!is_array($list)) return $list;
@ -104,8 +103,7 @@ function ldapauth_is_valid_user( $value ) {
$yourls_user_passwords[$username]='phpass:ThereIsNoPasswordButHey,WhoCares?';
}
yourls_set_user( $_SESSION['LDAPAUTH_AUTH_USER'] );
//return true; //modified 12.04.2023 by vmario. function must return null to match shunt_is_valid_user in functions-auth.php
return null;
return true;
} else {
ldapauth_debug($username . ' is not admin user.');