更新しました
$mypage = MyPageLogic::getMyPage(); //ログインチェック if(!$mypage->getIsLoggedin()){ //ログイン後のリダイレクト用に今見ているページのURLを取得する $url = rawurldecode($_SERVER["REQUEST_URI"]); soyshop_redirect_login_form("r=" . $url); } |
//ログインしているアカウントのログインIDを取得する $session = SOY2ActionSession::getUserSession(); $loginId = $session->getAttribute("loginid"); //ルートアカウントであるか調べる //$isRoot = $session->getAttribute("isdefault"); //ログインしているアカウントがadminでない場合はトップページに遷移する if($loginId != "admin"){ header("Location:/"); exit; } |
//IPアドレスを調べる $ipAddress = $_SERVER["REMOTE_ADDR"]; //閲覧を許可するIPアドレスリスト $allows = array("127.0.0.1", "127.0.0.2"); if(!in_array($ipAddress, $allows)){ //トップページに飛ばす header("Location:/"); exit; } |