LDAP Lookup Issue
Submitted by jwheat on Thu, 02/12/2015 - 15:01
I just posted this to support, so they're aware of this potential issue, although it could just be us.
We have a handful of 3 character usernames here - SAB (Student Activities Board), SGA (for the student government as an example), etc and our CMS is hooked to LDAP.
The username LDAP lookup on the New Administrator page only triggers at 4 characters, so it never gets a chance to find these short usernames in LDAP.
I've fixed this by editing two core files, and just wanted to let everyone know in the event other colleges are having this issue. One is a javacript function that triggers on keyUp, the other is PHP code that actually validates the input coming in.
/public_html/jadu/utils/access_admin.php : edited findADUser function (now triggers at 2 characters)
findADUser = function (username)
{
if (username.length > 1) {
new Ajax.Updater('ldapSearchResults', '<?php print $SECURE_JADU_PATH.'/utils/ldap_functions.php?'; ?>', {
parameters: { accessUsername: username}});
}
}/public_html/jadu/utils/ldap_functions.php : changed line 41 (now triggers at 2 characters as well)
if (isset($_POST['accessUsername'])) {
if (mb_strlen(trim($_POST['accessUsername'])) > 1) {
I realize its a performance hit when it generates on 2 characters, but it immediately found the users.
-Jon
General Concept:
Jadu Product:
Jadu Version:
