Passed
Pull Request — master (#309)
by Jason
04:58
created

OrderHistoryPageController::checkMember()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 8
Code Lines 6

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 6

Importance

Changes 0
Metric Value
c 0
b 0
f 0
dl 0
loc 8
ccs 0
cts 6
cp 0
rs 9.4285
cc 2
eloc 6
nc 2
nop 0
crap 6
1
<?php
2
3
namespace Dynamic\FoxyStripe\Page;
4
5
use SilverStripe\Security\Security;
6
7
class OrderHistoryPageController extends \PageController
8
{
9
    /**
10
     * @var array
11
     */
12
    private static $allowed_actions = array(
0 ignored issues
show
introduced by
The private property $allowed_actions is not used, and could be removed.
Loading history...
13
        'index',
14
    );
15
16
    /**
17
     * @return bool|\SilverStripe\Control\HTTPResponse
18
     */
19
    public function checkMember()
20
    {
21
        if (Security::getCurrentUser()) {
22
            return true;
23
        } else {
24
            return Security::permissionFailure($this, _t(
25
                'AccountPage.CANNOTCONFIRMLOGGEDIN',
26
                'Please login to view this page.'
27
            ));
28
        }
29
    }
30
31
    /**
32
     * @return array
33
     */
34
    public function Index()
35
    {
36
        $this->checkMember();
37
38
        return array();
39
    }
40
}
41