From: vincent@cubedesigners.com Date: Tue, 19 Apr 2022 13:17:56 +0000 (+0000) Subject: wip #5220 @0.25 X-Git-Url: http://git.cubedesigners.com/?a=commitdiff_plain;h=c9ec7c0c29c9388a272ccd4c4422f6259d5e652e;p=cubeextranet.git wip #5220 @0.25 --- diff --git a/inc/ws/Metier/class.ws.document.php b/inc/ws/Metier/class.ws.document.php index cf9184e40..81569f1d3 100644 --- a/inc/ws/Metier/class.ws.document.php +++ b/inc/ws/Metier/class.ws.document.php @@ -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); }