function TestConnectToLDAP() { ConnectToLDAP(); if (!$GLOBALS["BIND"]) { WLOG("[QUERY]: Error: BIND is broken -> reconnect"); ConnectToLDAP(); if (!$GLOBALS["BIND"]) { WLOG("[QUERY]: Error: BIND pointer is false"); return false; } } if (!$GLOBALS["CONNECTION"]) { WLOG("[QUERY]: Error: CONNECTION is broken -> reconnect"); ConnectToLDAP(); } if (!$GLOBALS["CONNECTION"]) { WLOG("[QUERY]: Error: CONNECTION is definitively broken aborting !!!..."); return false; } return true; }
function TestConnectToLDAP() { ConnectToLDAP(); if (!$GLOBALS["BIND"]) { WLOG("[QUERY]: <strong style='color:red'>Error: BIND is broken -> reconnect</strong>"); ConnectToLDAP(); if (!$GLOBALS["BIND"]) { WLOG("[QUERY]: <strong style='color:red'>Error: BIND pointer is false</strong>"); return false; } } if (!$GLOBALS["CONNECTION"]) { WLOG("[QUERY]: <strong style='color:red'>Error: CONNECTION is broken -> reconnect</strong>"); ConnectToLDAP(); } if (!$GLOBALS["CONNECTION"]) { WLOG("[QUERY]: <strong style='color:red'>Error: CONNECTION is definitively broken aborting !!!...</strong>"); return false; } return true; }