| 12
 3
 4
 5
 6
 7
 8
 9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
 100
 101
 102
 103
 104
 105
 106
 107
 108
 109
 110
 111
 112
 113
 114
 115
 116
 117
 118
 119
 120
 121
 122
 123
 124
 125
 126
 127
 128
 129
 130
 131
 132
 133
 134
 135
 136
 137
 138
 
 | --- a/plugins/personal/generic/class_user.inc
+++ b/plugins/personal/generic/class_user.inc
@@ -347,7 +347,7 @@
 
     /* Get random number for pictures */
     srand((double)microtime()*1000000); 
-    $smarty->assign("rand", rand(0, 10000));
+    $smarty->assign("rand", round(rand(0, 10000)));
 
 
     /* Do we represent a valid gosaAccount? */
@@ -1592,7 +1592,7 @@
 
     /* Get random number for pictures */
     srand((double)microtime()*1000000); 
-    $rand = rand(0, 10000);
+    $rand = round(rand(0, 10000));
 
     $smarty = get_smarty();
 
--- a/include/functions.inc
+++ b/include/functions.inc
@@ -2883,9 +2883,6 @@
     global $config;
     $newpass= "";
 
-    // Not sure, why this is here, but maybe some encryption methods require it.
-    mt_srand((double) microtime()*1000000);
-
     // Get a list of all available password encryption methods.
     $methods = new passwordMethod(session::get('config'),$dn);
     $available = $methods->get_available_methods();
@@ -3400,7 +3397,7 @@
 
 /*! \brief Returns a random char */
 function get_random_char () {
-     $randno = rand (0, 63);
+     $randno = round (rand (0, 63) );
      if ($randno < 12) {
          return (chr ($randno + 46)); // Digits, '/' and '.'
      } else if ($randno < 38) {
@@ -3988,7 +3985,7 @@
         // Generate random number
         if($match[1] == '#'){
             foreach($rules as $id => $ruleStr){
-                $genID = rand(pow(10,$match[2] -1),pow(10, ($match[2])) - 1);
+                $genID = round(rand(pow(10,$match[2] -1),pow(10, ($match[2])) - 1));
                 $rules[$id] = preg_replace("/".preg_quote($match[0],'/')."/", $genID,$ruleStr);
             }
         }
--- a/plugins/generic/statistics/chartClasses/class_memoryUsageChart.inc
+++ b/plugins/generic/statistics/chartClasses/class_memoryUsageChart.inc
@@ -52,7 +52,7 @@
             $filename =  $pCache->GetHash(get_class(),$dataSet->GetData());
             $filename = '/var/spool/gosa/'.$filename;    
             if(file_exists($filename) && is_readable($filename)){
-                $this->graphID = preg_replace("/[^0-9]/","",microtime(TRUE)).rand(0,99999);
+                $this->graphID = preg_replace("/[^0-9]/","",microtime(TRUE)).round(rand(0,99999));
                 session::set('statistics::graphFile'.$this->graphID,$filename);
                 return;
             }
--- a/plugins/generic/statistics/chartClasses/class_objectCountChart.inc
+++ b/plugins/generic/statistics/chartClasses/class_objectCountChart.inc
@@ -53,7 +53,7 @@
             $filename =  $pCache->GetHash(get_class(),$dataSet->GetData());
             $filename = '/var/spool/gosa/'.$filename;    
             if(file_exists($filename) && is_readable($filename)){
-                $this->graphID = preg_replace("/[^0-9]/","",microtime(TRUE)).rand(0,99999);
+                $this->graphID = preg_replace("/[^0-9]/","",microtime(TRUE)).round(rand(0,99999));
                 session::set('statistics::graphFile'.$this->graphID,$filename);
                 return;
             }
--- a/setup/class_setupStep_Migrate.inc
+++ b/setup/class_setupStep_Migrate.inc
@@ -106,7 +106,7 @@
 
         /* Create dummy entry
          */
-        $name     = "GOsa_setup_text_entry_".session_id().rand(0,999999);
+        $name     = "GOsa_setup_text_entry_".session_id().round(rand(0,999999));
         $dn       = "ou=".$name.",".$cv['base'];
         $testEntry= array();
         $testEntry['objectClass'][]= "top";
--- a/plugins/generic/infoPage/class_infoPage.inc
+++ b/plugins/generic/infoPage/class_infoPage.inc
@@ -162,7 +162,7 @@
             $smarty->assign("dateOfBirth","");
         }
 
-        $smarty->assign("rand", rand(0, 99999999));
+        $smarty->assign("rand", round(rand(0, 99999999)));
         $smarty->assign("personalInfoAllowed", $personalInfoAllowed);
         $smarty->assign("managers", $this->managers);
         $smarty->assign("plugins", $this->plugins);
--- a/plugins/generic/statistics/chartClasses/class_actionSelectChart.inc
+++ b/plugins/generic/statistics/chartClasses/class_actionSelectChart.inc
@@ -65,7 +65,7 @@
             $filename =  $pCache->GetHash(get_class(),$dataSet->GetData());
             $filename = '/var/spool/gosa/'.$filename;    
             if(file_exists($filename) && is_readable($filename)){
-                $this->graphID = preg_replace("/[^0-9]/","",microtime(TRUE)).rand(0,99999);
+                $this->graphID = preg_replace("/[^0-9]/","",microtime(TRUE)).round(rand(0,99999));
                 session::set('statistics::graphFile'.$this->graphID,$filename);
                 return;
             }
--- a/plugins/generic/statistics/chartClasses/class_categoryActionOverTime.inc
+++ b/plugins/generic/statistics/chartClasses/class_categoryActionOverTime.inc
@@ -61,7 +61,7 @@
             $filename =  $pCache->GetHash(get_class(),$allSeriesDataSet->GetData());
             $filename = '/var/spool/gosa/'.$filename;    
             if(file_exists($filename) && is_readable($filename)){
-                $this->graphID = preg_replace("/[^0-9]/","",microtime(TRUE)).rand(0,99999);
+                $this->graphID = preg_replace("/[^0-9]/","",microtime(TRUE)).round(rand(0,99999));
                 session::set('statistics::graphFile'.$this->graphID,$filename);
                 return;
             }
--- a/plugins/generic/statistics/chartClasses/class_passwordChangeChart.inc
+++ b/plugins/generic/statistics/chartClasses/class_passwordChangeChart.inc
@@ -55,7 +55,7 @@
             $filename =  $pCache->GetHash(get_class(),$dataSet->GetData());
             $filename = '/var/spool/gosa/'.$filename;    
             if(file_exists($filename) && is_readable($filename)){
-                $this->graphID = preg_replace("/[^0-9]/","",microtime(TRUE)).rand(0,99999);
+                $this->graphID = preg_replace("/[^0-9]/","",microtime(TRUE)).round(rand(0,99999));
                 session::set('statistics::graphFile'.$this->graphID,$filename);
                 return;
             }
--- a/plugins/generic/statistics/chartClasses/class_pieChart1.inc
+++ b/plugins/generic/statistics/chartClasses/class_pieChart1.inc
@@ -67,7 +67,7 @@
             $filename =  $pCache->GetHash(get_class(),$dataSet->GetData());
             $filename = '/var/spool/gosa/'.$filename;    
             if(file_exists($filename) && is_readable($filename)){
-                $this->graphID = preg_replace("/[^0-9]/","",microtime(TRUE)).rand(0,99999);
+                $this->graphID = preg_replace("/[^0-9]/","",microtime(TRUE)).round(rand(0,99999));
                 session::set('statistics::graphFile'.$this->graphID,$filename);
                 return;
             }
 |