connect($user, $pass)) echo "ok";
echo "
Check if __sleep/__wakeup works";
$ldap->__sleep();
$ldap->__wakeup();
echo "
Closing connection";
$ldap->destroy();
echo "
If you do not see any error messages all should be ok.";
exit;
}
// display login page
else {
// generate 256 bit key and initialization vector for user/passwd-encryption
$key = mcrypt_create_iv(32, MCRYPT_DEV_RANDOM);
$iv = mcrypt_create_iv(32, MCRYPT_DEV_RANDOM);
// save both in cookie
setcookie("Key", base64_encode($key), 0, "/");
setcookie("IV", base64_encode($iv), 0, "/");
}
?>