Try to connect to a ldap server
static public tryToConnectToServer ( $ldap_method, $login, $password ) : link | ||
$ldap_method | ldap_method array to use | |
$login | User Login | |
$password | User Password | |
return | link | to the LDAP server : false if connection failed |
// Check session dir (usefull when NFS mounted)) if (is_dir(GLPI_SESSION_DIR) && is_writable(GLPI_SESSION_DIR)) { echo "GLPI_SESSION_DIR_OK\n"; } else { echo "GLPI_SESSION_DIR_PROBLEM\n"; $ok = false; } // Reestablished DB connection if (($ok_master || $ok_slave) && DBConnection::establishDBConnection(false, false, false)) { // Check LDAP Auth connections $ldap_methods = getAllDatasFromTable('glpi_authldaps', '`is_active`=1'); if (count($ldap_methods)) { echo "Check LDAP servers:"; foreach ($ldap_methods as $method) { echo " " . $method['name']; if (AuthLDAP::tryToConnectToServer($method, $method["rootdn"], Toolbox::decrypt($method["rootdn_passwd"], GLPIKEY))) { echo "_OK"; } else { echo "_PROBLEM"; $ok = false; } echo "\n"; } } else { echo "No LDAP server\n"; } // Check IMAP Auth connections $imap_methods = getAllDatasFromTable('glpi_authmails', '`is_active`=1'); if (count($imap_methods)) { echo "Check IMAP servers:"; foreach ($imap_methods as $method) {