]> _ Git - cubeextranet.git/commitdiff
wip #5220 @0.25
authorvincent@cubedesigners.com <vincent@cubedesigners.com@f5622870-0f3c-0410-866d-9cb505b7a8ef>
Tue, 19 Apr 2022 13:17:56 +0000 (13:17 +0000)
committervincent@cubedesigners.com <vincent@cubedesigners.com@f5622870-0f3c-0410-866d-9cb505b7a8ef>
Tue, 19 Apr 2022 13:17:56 +0000 (13:17 +0000)
inc/ws/Metier/class.ws.document.php

index cf9184e407ad90b5944cb50f7c092f7d64573bdb..81569f1d3922d7e314a16d5a8c570f13f6e7152b 100644 (file)
@@ -496,7 +496,7 @@ class wsDocument extends cubeMetier
             $res = false;
         }
         $time = round(microtime(true) - $start, 4);
-        $log = '[' . $farmer['name'] . ']' . "\t\t\t\t" . $time . "\t\t\t\t$page|$format|$resolution|$withText|$withGraphics|$version\t\t\t\t$res\t\t\t\t$cl->output\n";
+        $log = '[' . $farmer['name'] . ']' . "\t" . date('Y-m-d H:i:s') . "\t\t\t\t" . $time . "\t\t\t\t$page|$format|$resolution|$withText|$withGraphics|$version\t\t\t\t$res\t\t\t\t$cl->output\n";
 
         $fp = fopen(WS_DOCS . '/' . $this->document_id . '/farm.log', 'a+');
         fwrite($fp, $log);
@@ -505,7 +505,8 @@ class wsDocument extends cubeMetier
         return $res;
     }
 
-    public static function isFarmUser(){
+    public static function isFarmUser()
+    {
         global $core;
         $farmTesters = [3, 5];
         return in_array($core->user->utilisateur_id, $farmTesters);
@@ -515,10 +516,6 @@ class wsDocument extends cubeMetier
     {
         global $core;
 
-        if (self::isFarmUser()) {
-            return $this->_getFileFarm($page, $format, $resolution, $withText, $withGraphics, $version, $force);
-        }
-
         if ($format === 'jpeg') {
             $format = 'jpg';
         }
@@ -568,8 +565,13 @@ class wsDocument extends cubeMetier
             $do = $t < 1603181003 && $t > 1602662603;
         }
 
+
         if ($do || $force) {
-            $this->makeFile($file, $page, $format, $resolution, $withText, $withGraphics, $version);
+            if (self::isFarmUser()) {
+                return $this->_getFileFarm($page, $format, $resolution, $withText, $withGraphics, $version, $force);
+            } else {
+                $this->makeFile($file, $page, $format, $resolution, $withText, $withGraphics, $version);
+            }
         } else {
             touch($file);
         }