Code

Do not decrypt passwords multiple times.
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Tue, 7 Jul 2009 12:48:34 +0000 (12:48 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Tue, 7 Jul 2009 12:48:34 +0000 (12:48 +0000)
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@13901 594d385d-05f5-0310-b6e9-bd551577e9d8

gosa-core/include/class_config.inc

index 65a2b460d3e969d99e11ea2f13f10c5b8ba7c5a0..67b91314c67ac8eff7aa184b79e28ccbfb0c43d5 100644 (file)
@@ -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);
   }