Minahito
minah****@users*****
2006年 7月 25日 (火) 19:22:47 JST
Index: xoops2jp/html/modules/base/preload/Primary/SiteClose.class.php diff -u xoops2jp/html/modules/base/preload/Primary/SiteClose.class.php:1.1.2.1 xoops2jp/html/modules/base/preload/Primary/SiteClose.class.php:1.1.2.2 --- xoops2jp/html/modules/base/preload/Primary/SiteClose.class.php:1.1.2.1 Tue Jun 27 18:11:38 2006 +++ xoops2jp/html/modules/base/preload/Primary/SiteClose.class.php Tue Jul 25 19:22:47 2006 @@ -8,7 +8,7 @@ { if(($this->mController->mConfig['closesite']==1)||is_array(XCube_Utils::checkSystemModules())) { $this->mController->mRoot->mDelegateManager->add("Site.Login", array(&$this, "callbackSiteLogin"), XCUBE_DELEGATE_PRIORITY_FINAL); - $this->mController->mRoot->mEventManager->add("Site.CheckLogin.Success",new XCube_InstanceDelegate($this,"callbackCheckLoginSuccess")); + $this->mController->mRoot->mDelegateManager->add("Site.CheckLogin.Success",array(&$this,"callbackCheckLoginSuccess")); } } @@ -21,7 +21,8 @@ if (is_array($retArray)) { define('XOOPS_CPFUNC_LOADED',1); } - require_once XOOPS_ROOT_PATH.'/include/checklogin.php'; + + $this->mController->checkLogin(); return; } elseif(is_object($this->mController->mXoopsUser)) { foreach ($this->mController->mXoopsUser->getGroups() as $group) { @@ -155,29 +156,30 @@ } } - function callbackCheckLoginSuccess(&$controller,&$eventArgs) + function callbackCheckLoginSuccess(&$xoopsUser) { // // This check is not needed. :) // - if(!is_object($eventArgs['xoopsUser'])) + if(!is_object($xoopsUser)) { return; + } $user=&$eventArgs['xoopsUser']; // Site close - if($controller->getConfig('closesite')) { + if($this->mController->getConfig('closesite')) { $accessAllowed=false; foreach($user->getGroups() as $group) { - if(in_array($group,$controller->getConfig('closesite_okgrp')) || ($group==XOOPS_GROUP_ADMIN)) { + if(in_array($group,$this->mController->getConfig('closesite_okgrp')) || ($group==XOOPS_GROUP_ADMIN)) { $accessAllowed=true; break; } } if(!$accessAllowed) { - XCube_Utils::redirectHeader(XOOPS_URL,1,_NOPERM); + $this->mController->redirectHeader(XOOPS_URL,1,_NOPERM); } } }