Passed
Push — developer ( ac75b2...f4c496 )
by Mariusz
30:53
created

Logout::validateRequest()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 4
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 0
1
<?php
2
/**
3
 * User action logout file.
4
 *
5
 * @package Action
6
 *
7
 * @copyright YetiForce Sp. z o.o.
8
 * @license   YetiForce Public License 3.0 (licenses/LicenseEN.txt or yetiforce.com)
9
 * @author    Mariusz Krzaczkowski <[email protected]>
10
 */
11
12
namespace YF\Modules\Users\Action;
13
14
/**
15
 * User action logout class.
16
 */
17
class Logout extends \App\Controller\Action
18
{
19
	/** {@inheritdoc} */
20
	public function checkPermission(): void
21
	{
22
	}
23
24
	/** {@inheritdoc} */
25
	public function process()
26
	{
27
		\App\Api::getInstance()->call('Users/Logout', [], 'put');
28
		session_destroy();
29
		header('Location: ' . \App\Config::$portalUrl);
30
	}
31
32
	/** {@inheritdoc} */
33
	public function validateRequest()
34
	{
35
		$this->request->validateReadAccess();
36
	}
37
}
38