Vtiger_BrowsingHistory_Action   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 27
Duplicated Lines 0 %

Test Coverage

Coverage 0%

Importance

Changes 0
Metric Value
wmc 3
eloc 7
dl 0
loc 27
ccs 0
cts 10
cp 0
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A process() 0 6 1
A checkPermission() 0 4 2
1
<?php
2
3
/**
4
 * Browsing History Action Class.
5
 *
6
 * @package Action
7
 *
8
 * @copyright YetiForce S.A.
9
 * @license   YetiForce Public License 6.5 (licenses/LicenseEN.txt or yetiforce.com)
10
 * @author    Michał Lorencik <[email protected]>
11
 */
12
class Vtiger_BrowsingHistory_Action extends \App\Controller\Action
13
{
14
	/**
15
	 * Checking permission.
16
	 *
17
	 * @param \App\Request $request
18
	 *
19
	 * @throws \App\Exceptions\NoPermitted
20
	 */
21
	public function checkPermission(App\Request $request)
22
	{
23
		if (!App\Config::performance('BROWSING_HISTORY_WORKING')) {
24
			throw new \App\Exceptions\NoPermitted('LBL_PERMISSION_DENIED', 406);
25
		}
26
	}
27
28
	/**
29
	 * Clear user browsing history process.
30
	 *
31
	 * @param \App\Request $request
32
	 */
33
	public function process(App\Request $request)
34
	{
35
		Vtiger_BrowsingHistory_Helper::deleteHistory();
36
		$response = new Vtiger_Response();
37
		$response->setResult(['success' => true]);
38
		$response->emit();
39
	}
40
}
41