require_once "mainfile.php";
//security patch
if ( !$xoopsUser )
{
redirect_header(XOOPS_URL."/",3,_NOPERM); exit();
}
XCube_DelegateUtils::call("Legacypage.Userinfo.Access");
?>
<?php
if (!defined('XOOPS_ROOT_PATH')) exit();
class UserinfoGuard extends XCube_ActionFilter
{
function preFilter()
{
$root =& XCube_Root::getSingleton();
$root->mDelegateManager->add('Legacypage.Userinfo.Access', 'UserinfoGuard::myfunc',
XCUBE_DELEGATE_PRIORITY_FIRST);
}
function myfunc()
{
$root =& XCube_Root::getSingleton();
$user =& $root->mContext->mUser;
if ($user->isInRole('Site.GuestUser')) {
$root->mController->executeRedirect(XOOPS_URL, 1, "アクセス拒否!");
}
}
}
?>
|
備忘録 |
BBコード一覧 |