1
|
|
|
<?php |
2
|
|
|
/** |
3
|
|
|
* ModConfirm |
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\GroupMng; |
17
|
|
|
|
18
|
|
|
//------------------------------------------------------// |
19
|
|
|
// クラス定義 |
20
|
|
|
//------------------------------------------------------// |
21
|
|
|
class ModConfirm 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
|
|
|
// 共通処理クラスを呼び出し |
44
|
|
|
$common = new \RisolutoApps\Admin\AdminCommon; |
45
|
|
|
$detail = $common->loginCheck( $sess, true ); |
46
|
|
|
$entered = $common->checkEnteredGroupData( $_POST, $sess->load( 'csrf_token' ), |
47
|
|
|
htmlentities( $_POST[ 'no' ], ENT_QUOTES, 'UTF-8' ) ); |
48
|
|
|
|
49
|
|
|
// 入力情報はセッションに保存 |
50
|
|
|
$sess->store( 'form', $entered ); |
51
|
|
|
|
52
|
|
|
// エラー情報があった場合は入力画面に戻る |
53
|
|
View Code Duplication |
if (!empty( $entered[ 'error' ][ 'msg' ] ) or !empty( $entered[ 'error' ][ 'form_crit' ] )) { |
|
|
|
|
54
|
|
|
\Risoluto\Url::redirectTo( 'Admin_GroupMng_ModEntry' ); |
55
|
|
|
exit; |
56
|
|
|
} |
57
|
|
|
|
58
|
|
|
// ヘッダ情報のセット |
59
|
|
|
$header = $this->getDefaultHeader(); |
60
|
|
|
$header = $this->replaceHeader( $header, 'robots', 'NOINDEX,NOFOLLOW' ); |
61
|
|
|
|
62
|
|
|
// テンプレートエンジン関連の処理 |
63
|
|
|
$assign_value = [ |
64
|
|
|
'header' => $header, |
65
|
|
|
'detail' => $detail, |
66
|
|
|
'entered' => $entered, |
67
|
|
|
'csrf_token' => $sess->load( 'csrf_token' ) |
68
|
|
|
]; |
69
|
|
|
$this->risolutoView( $assign_value ); |
70
|
|
|
} |
71
|
|
|
} |
Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.
You can also find more detailed suggestions in the “Code” section of your repository.