Passed
Push — developer ( 50c5ac...5ec5f7 )
by Radosław
20:06 queued 02:30
created
modules/Calendar/crons/CalDav.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -16,7 +16,7 @@
 block discarded – undo
16 16
 	public function process()
17 17
 	{
18 18
 		\App\Log::trace('Start cron CalDAV');
19
-		if(!\App\YetiForce\Shop::check('YetiForceDav')){
19
+		if (!\App\YetiForce\Shop::check('YetiForceDav')) {
20 20
 			$this->logs = \App\YetiForce\Shop::checkAlert('YetiForceDav');
21 21
 			return;
22 22
 		}
Please login to merge, or discard this patch.
modules/OpenStreetMap/files/TileLayer.php 1 patch
Indentation   +82 added lines, -82 removed lines patch added patch discarded remove patch
@@ -12,88 +12,88 @@
 block discarded – undo
12 12
  */
13 13
 class OpenStreetMap_TileLayer_File extends Vtiger_Basic_File
14 14
 {
15
-    /** {@inheritdoc} */
16
-    public function getCheckPermission(App\Request $request)
17
-    {
18
-        if (!\App\Privilege::isPermitted('OpenStreetMap')) {
19
-            throw new \App\Exceptions\NoPermitted('LBL_PERMISSION_DENIED', 406);
20
-        }
21
-        return true;
22
-    }
15
+	/** {@inheritdoc} */
16
+	public function getCheckPermission(App\Request $request)
17
+	{
18
+		if (!\App\Privilege::isPermitted('OpenStreetMap')) {
19
+			throw new \App\Exceptions\NoPermitted('LBL_PERMISSION_DENIED', 406);
20
+		}
21
+		return true;
22
+	}
23 23
 
24
-    /**
25
-     * Download layer and show.
26
-     *
27
-     * @param \App\Request $request
28
-     *
29
-     * @return bool
30
-     */
31
-    public function get(App\Request $request)
32
-    {
33
-        if (!\App\RequestUtil::isNetConnection()) {
34
-            $this->error();
35
-            return false;
36
-        }
37
-        $product = \App\YetiForce\Register::getProduct('YetiForceMap');
38
-        if ((empty($product['params']['login']) || empty($product['params']['pass'])) && empty($product['params']['token'])) {
39
-            $this->error('map_server_not_purchased');
40
-            return false;
41
-        }
42
-        $url = str_replace(['{z}', '{x}', '{y}'], [
43
-            $request->getByType('z', 'Integer'),
44
-            $request->getByType('x', 'Integer'),
45
-            $request->getByType('y', 'Integer'),
46
-        ], 'https://osm-tile.yetiforce.eu/tile/{z}/{x}/{y}.png');
47
-        $options = [
48
-            'timeout' => 60,
49
-            'headers' => [
50
-                'InsKey' => \App\YetiForce\Register::getInstanceKey()
51
-            ]
52
-        ];
53
-        if (isset($product['params']['token'])) {
54
-            $url += '?yf_token=' . $product['params']['token'];
55
-        } else {
56
-            $options['auth'] = [$product['params']['login'], $product['params']['pass']];
57
-        }
58
-        try {
59
-            \App\Log::beginProfile("GET|TileLayer::get|{$url}", __NAMESPACE__);
60
-            $response = (new \GuzzleHttp\Client(\App\RequestHttp::getOptions()))->request('GET', $url, $options);
61
-            \App\Log::endProfile("GET|TileLayer::get|{$url}", __NAMESPACE__);
62
-            if (200 !== $response->getStatusCode()) {
63
-                \App\Log::error($url . ' | Error: ' . $response->getReasonPhrase(), __CLASS__);
64
-                $this->error();
65
-                return false;
66
-            }
67
-            $body = $response->getBody();
68
-            header('pragma: public');
69
-            header('cache-control: max-age=86400, public');
70
-            header('expires: ' . gmdate('D, d M Y H:i:s \G\M\T', time() + 86400));
71
-            header('content-type: image/png');
72
-            header('content-transfer-encoding: binary');
73
-            header('content-length: ' . $body->getSize());
74
-            echo $body->getContents();
75
-        } catch (\Throwable $ex) {
76
-            \App\Log::error($url . ' | Error: ' . $ex->getMessage(), __CLASS__);
77
-            $this->error();
78
-        }
79
-    }
24
+	/**
25
+	 * Download layer and show.
26
+	 *
27
+	 * @param \App\Request $request
28
+	 *
29
+	 * @return bool
30
+	 */
31
+	public function get(App\Request $request)
32
+	{
33
+		if (!\App\RequestUtil::isNetConnection()) {
34
+			$this->error();
35
+			return false;
36
+		}
37
+		$product = \App\YetiForce\Register::getProduct('YetiForceMap');
38
+		if ((empty($product['params']['login']) || empty($product['params']['pass'])) && empty($product['params']['token'])) {
39
+			$this->error('map_server_not_purchased');
40
+			return false;
41
+		}
42
+		$url = str_replace(['{z}', '{x}', '{y}'], [
43
+			$request->getByType('z', 'Integer'),
44
+			$request->getByType('x', 'Integer'),
45
+			$request->getByType('y', 'Integer'),
46
+		], 'https://osm-tile.yetiforce.eu/tile/{z}/{x}/{y}.png');
47
+		$options = [
48
+			'timeout' => 60,
49
+			'headers' => [
50
+				'InsKey' => \App\YetiForce\Register::getInstanceKey()
51
+			]
52
+		];
53
+		if (isset($product['params']['token'])) {
54
+			$url += '?yf_token=' . $product['params']['token'];
55
+		} else {
56
+			$options['auth'] = [$product['params']['login'], $product['params']['pass']];
57
+		}
58
+		try {
59
+			\App\Log::beginProfile("GET|TileLayer::get|{$url}", __NAMESPACE__);
60
+			$response = (new \GuzzleHttp\Client(\App\RequestHttp::getOptions()))->request('GET', $url, $options);
61
+			\App\Log::endProfile("GET|TileLayer::get|{$url}", __NAMESPACE__);
62
+			if (200 !== $response->getStatusCode()) {
63
+				\App\Log::error($url . ' | Error: ' . $response->getReasonPhrase(), __CLASS__);
64
+				$this->error();
65
+				return false;
66
+			}
67
+			$body = $response->getBody();
68
+			header('pragma: public');
69
+			header('cache-control: max-age=86400, public');
70
+			header('expires: ' . gmdate('D, d M Y H:i:s \G\M\T', time() + 86400));
71
+			header('content-type: image/png');
72
+			header('content-transfer-encoding: binary');
73
+			header('content-length: ' . $body->getSize());
74
+			echo $body->getContents();
75
+		} catch (\Throwable $ex) {
76
+			\App\Log::error($url . ' | Error: ' . $ex->getMessage(), __CLASS__);
77
+			$this->error();
78
+		}
79
+	}
80 80
 
81
-    /**
82
-     * Error function.
83
-     *
84
-     * @param string $type
85
-     *
86
-     * @return void
87
-     */
88
-    public function error(string $type = 'map_server_unavailable'): void
89
-    {
90
-        $fileName = ROOT_DIRECTORY . "/public_html/layouts/basic/images/{$type}.png";
91
-        header('pragma: public');
92
-        header('cache-control: max-age=86400, public');
93
-        header('expires: ' . gmdate('D, d M Y H:i:s \G\M\T', time() + 86400));
94
-        header('content-type: ' . \App\Fields\File::getMimeContentType($fileName));
95
-        header('content-transfer-encoding: binary');
96
-        header('content-length: ' . filesize($fileName));
97
-        readfile($fileName);
98
-    }
81
+	/**
82
+	 * Error function.
83
+	 *
84
+	 * @param string $type
85
+	 *
86
+	 * @return void
87
+	 */
88
+	public function error(string $type = 'map_server_unavailable'): void
89
+	{
90
+		$fileName = ROOT_DIRECTORY . "/public_html/layouts/basic/images/{$type}.png";
91
+		header('pragma: public');
92
+		header('cache-control: max-age=86400, public');
93
+		header('expires: ' . gmdate('D, d M Y H:i:s \G\M\T', time() + 86400));
94
+		header('content-type: ' . \App\Fields\File::getMimeContentType($fileName));
95
+		header('content-transfer-encoding: binary');
96
+		header('content-length: ' . filesize($fileName));
97
+		readfile($fileName);
98
+	}
99 99
 }
Please login to merge, or discard this patch.