Logout   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 43
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 4

Importance

Changes 2
Bugs 1 Features 2
Metric Value
wmc 3
c 2
b 1
f 2
lcom 1
cbo 4
dl 0
loc 43
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
B play() 0 26 3
1
<?php
2
/**
3
 * Logout
4
 *
5
 * ログアウト画面を実現するためのクラス
6
 *
7
 * @package           risoluto
8
 * @author            Risoluto Developers
9
 * @license           http://opensource.org/licenses/bsd-license.php new BSD license
10
 * @copyright     (C) 2008-2015 Risoluto Developers / All Rights Reserved.
11
 */
12
13
//------------------------------------------------------//
14
// 名前空間の定義
15
//------------------------------------------------------//
16
namespace RisolutoApps\Admin;
17
18
//------------------------------------------------------//
19
// クラス定義
20
//------------------------------------------------------//
21
class Logout extends \Risoluto\RisolutoControllerBase implements \Risoluto\RisolutoControllerInterface
22
{
23
    // View関連の処理を使用する
24
    use \Risoluto\RisolutoViewTrait;
25
26
    /**
27
     * play()
28
     *
29
     * 主処理を行う
30
     *
31
     * @access    public
32
     *
33
     * @param     void
34
     *
35
     * @return    void    なし
36
     */
37
    public function play()
38
    {
39
        // セッションをスタート
40
        $sess = new \Risoluto\Session();
41
        $sess->start();
42
43
        if (!$sess->isThere( 'Auth' )) {
44
            // 認証情報がない場合は、ログイン画面へ遷移する
45
            $sess->store( 'AuthError', 'invalid_access' );
46
            \Risoluto\Url::redirectTo( 'Admin_Login' );
47
            exit;
48
        }
49
50
        if ($sess->isThere( 'Auth' )) {
51
            // セッション情報を破棄する
52
            $sess->revoke( 'Auth' );
53
        }
54
55
        // ヘッダ情報のセット
56
        $header = $this->getDefaultHeader();
57
        $header = $this->replaceHeader( $header, 'robots', 'NOINDEX,NOFOLLOW' );
58
59
        // テンプレートエンジン関連の処理
60
        $assign_value = [ 'header' => $header ];
61
        $this->risolutoView( $assign_value );
62
    }
63
}