diff --git a/lam/tests/ldap-test.php b/lam/tests/ldap-test.php
new file mode 100644
index 00000000..36356e89
--- /dev/null
+++ b/lam/tests/ldap-test.php
@@ -0,0 +1,68 @@
+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 anny error messages all should be ok.";
+ exit;
+}
+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, "/");
+}
+
+?>
+
+
+