summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 39d956a)
raw | patch | inline | side by side (parent: 39d956a)
author | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Wed, 20 Oct 2010 15:24:46 +0000 (15:24 +0000) | ||
committer | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Wed, 20 Oct 2010 15:24:46 +0000 (15:24 +0000) |
-We can now have two widgets on a single site.
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@20108 594d385d-05f5-0310-b6e9-bd551577e9d8
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@20108 594d385d-05f5-0310-b6e9-bd551577e9d8
gosa-core/include/class_releaseSelector.inc | patch | blob | history |
diff --git a/gosa-core/include/class_releaseSelector.inc b/gosa-core/include/class_releaseSelector.inc
index 1f4f2e2db4115060ac841b0948ada7af09c0a523..5e8d934f211c34e08c2ccef9ce4f35c9ba773f31 100644 (file)
// Initialize pid
$this->pid= preg_replace("/[^0-9]/", "", microtime(TRUE));
+ // Get list of used IDs
+ if(!session::is_set('releaseSelector_USED_IDS')){
+ session::set('releaseSelector_USED_IDS',array());
+ }
+ $usedIds = session::get('releaseSelector_USED_IDS');
+
+ // Generate instance wide unique ID
+ $pid = "";
+ while($pid == "" || in_array($pid, $usedIds)){
+
+ // Wait 1 msec to ensure that we definately get a new id
+ if($pid != "") usleep(1);
+ $tmp= gettimeofday();
+ $pid = 'l'.md5(microtime().$tmp['sec']);
+ }
+
+ // Only keep the last 10 list IDsi
+ $usedIds = array_slice($usedIds, count($usedIds) -10, 10);
+ $usedIds[] = $pid;
+ session::set('releaseSelector_USED_IDS',$usedIds);
+ $this->pid = $pid;
+
// Transfer data
$this->releaseBase = $releaseBase;
$this->setBases($bases);