From: hickert Date: Tue, 7 Jul 2009 12:48:34 +0000 (+0000) Subject: Do not decrypt passwords multiple times. X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=7bbd7aa8f40e2936d800a3d006960d2af0f08f9a;p=gosa.git Do not decrypt passwords multiple times. git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@13901 594d385d-05f5-0310-b6e9-bd551577e9d8 --- diff --git a/gosa-core/include/class_config.inc b/gosa-core/include/class_config.inc index 65a2b460d..67b91314c 100644 --- a/gosa-core/include/class_config.inc +++ b/gosa-core/include/class_config.inc @@ -238,7 +238,14 @@ class config { function get_credentials($creds) { if (isset($_SERVER['HTTP_GOSA_KEY'])){ - return (cred_decrypt($creds, $_SERVER['HTTP_GOSA_KEY'])); + if (!session::global_is_set('HTTP_GOSA_KEY_CACHE')){ + session::global_set('HTTP_GOSA_KEY_CACHE',array()); + } + $cache = session::global_get('HTTP_GOSA_KEY_CACHE'); + if(!isset($cache[$creds])){ + $cache[$creds] = cred_decrypt($creds, $_SERVER['HTTP_GOSA_KEY']); + } + return ($cache[$creds]); } return ($creds); }