From 606a0c42f34b8e7f3f0e79e08d46cecb0cd80e67 Mon Sep 17 00:00:00 2001 From: Roland Gruber Date: Mon, 2 Jul 2007 18:55:59 +0000 Subject: [PATCH] added fix for MCrypt activation in a running LAM session --- lam/lib/ldap.inc | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lam/lib/ldap.inc b/lam/lib/ldap.inc index 9c587a0e..6629a7bc 100644 --- a/lam/lib/ldap.inc +++ b/lam/lib/ldap.inc @@ -350,6 +350,8 @@ class Ldap{ function encrypt($data) { // use MCrypt if available if (function_exists('mcrypt_create_iv')) { + // MCrypt may have been enabled in a running session + if (!isset($_COOKIE["IV"]) || ($_COOKIE["IV"] == '')) return $data; // read key and iv from cookie $iv = base64_decode($_COOKIE["IV"]); $key = base64_decode($_COOKIE["Key"]); @@ -371,6 +373,8 @@ class Ldap{ function decrypt($data) { // use MCrypt if available if (function_exists('mcrypt_create_iv')) { + // MCrypt may have been enabled in a running session + if (!isset($_COOKIE["IV"]) || ($_COOKIE["IV"] == '')) return $data; // read key and iv from cookie $iv = base64_decode($_COOKIE["IV"]); $key = base64_decode($_COOKIE["Key"]);