Minahito
minah****@users*****
2006年 11月 10日 (金) 20:30:01 JST
Index: xoops2jp/html/modules/user/kernel/LegacypageFunctions.class.php diff -u xoops2jp/html/modules/user/kernel/LegacypageFunctions.class.php:1.1.2.11.2.4 xoops2jp/html/modules/user/kernel/LegacypageFunctions.class.php:1.1.2.11.2.5 --- xoops2jp/html/modules/user/kernel/LegacypageFunctions.class.php:1.1.2.11.2.4 Mon Oct 23 20:22:10 2006 +++ xoops2jp/html/modules/user/kernel/LegacypageFunctions.class.php Fri Nov 10 20:30:01 2006 @@ -1,7 +1,7 @@ <?php /** * @package user - * @version $Id: LegacypageFunctions.class.php,v 1.1.2.11.2.4 2006/10/23 11:22:10 minahito Exp $ + * @version $Id: LegacypageFunctions.class.php,v 1.1.2.11.2.5 2006/11/10 11:30:01 minahito Exp $ */ if (!defined('XOOPS_ROOT_PATH')) exit(); @@ -17,22 +17,25 @@ */ function userinfo() { + // + // Boot the action frame of the user module directly. + // $root =& XCube_Root::getSingleton(); + $root->mController->executeHeader(); - $uid = isset($_REQUEST['uid']) ? intval(xoops_getrequest('uid')) : 0; + $root->mController->setupModuleContext('user'); + $root->mLanguageManager->loadModuleMessageCatalog('user'); - $url = XOOPS_URL . '/'; - if ($uid > 0) { - $url = XOOPS_MODULE_URL . "/user/index.php?action=UserInfo&uid=" . $uid; - } - else { - $xoopsUser =& $root->mContext->mXoopsUser; - if (is_object($xoopsUser)) { - $url = XOOPS_MODULE_URL . "/user/index.php?action=UserInfo&uid=" . $xoopsUser->get('uid'); - } - } + require_once XOOPS_MODULE_PATH . "/user/class/ActionFrame.class.php"; + + $moduleRunner = new User_ActionFrame(false); + $moduleRunner->setActionName("UserInfo"); + + $root->mController->mExecute->add(array(&$moduleRunner, 'execute')); + + $root->mController->execute(); - $root->mController->executeForward($url); + $root->mController->executeView(); } /** @@ -41,21 +44,37 @@ */ function edituser() { + $actionName = "EditUser"; + switch (xoops_getrequest('op')) { + case 'avatarform': + case 'avatarupload': + $actionName = "AvatarEdit"; + break; + + case 'avatarchoose': + $actionName = "AvatarSelect"; + break; + } + + // + // Boot the action frame of the user module directly. + // $root =& XCube_Root::getSingleton(); - $uid = isset($_REQUEST['uid']) ? intval(xoops_getrequest('uid')) : 0; + $root->mController->executeHeader(); + + $root->mController->setupModuleContext('user'); + $root->mLanguageManager->loadModuleMessageCatalog('user'); + + require_once XOOPS_MODULE_PATH . "/user/class/ActionFrame.class.php"; - $url = XOOPS_URL . '/'; - if ($uid > 0) { - $url = XOOPS_MODULE_URL . "/user/index.php?action=EditUser&uid=" . $uid; - } - else { - $xoopsUser =& $root->mContext->mXoopsUser; - if (is_object($xoopsUser)) { - $url = XOOPS_MODULE_URL . "/user/index.php?action=EditUser&uid=" . $xoopsUser->get('uid'); - } - } + $moduleRunner = new User_ActionFrame(false); + $moduleRunner->setActionName($actionName); - $root->mController->executeForward($url); + $root->mController->mExecute->add(array(&$moduleRunner, 'execute')); + + $root->mController->execute(); + + $root->mController->executeView(); } /** @@ -70,9 +89,29 @@ if (is_object($xoopsUser)) { $root->mController->executeForward(XOOPS_URL); } - else { - $root->mController->executeForward(XOOPS_MODULE_URL . "/user/index.php?action=UserRegister"); - } + + // + // Boot the action frame of the user module directly. + // + $root->mController->executeHeader(); + + $root->mController->setupModuleContext('user'); + $root->mLanguageManager->loadModuleMessageCatalog('user'); + + require_once XOOPS_MODULE_PATH . "/user/class/ActionFrame.class.php"; + + $root =& XCube_Root::getSingleton(); + + $actionName = isset($_REQUEST['action']) ? "UserRegister_confirm" : "UserRegister"; + + $moduleRunner = new User_ActionFrame(false); + $moduleRunner->setActionName($actionName); + + $root->mController->mExecute->add(array(&$moduleRunner, 'execute')); + + $root->mController->execute(); + + $root->mController->executeView(); } /** @@ -88,9 +127,27 @@ if (is_object($xoopsUser)) { $root->mController->executeForward(XOOPS_URL); } - else { - $root->mController->executeForward(XOOPS_MODULE_URL . "/user/index.php?action=LostPass"); - } + + // + // Boot the action frame of the user module directly. + // + $root->mController->executeHeader(); + + $root->mController->setupModuleContext('user'); + $root->mLanguageManager->loadModuleMessageCatalog('user'); + + require_once XOOPS_MODULE_PATH . "/user/class/ActionFrame.class.php"; + + $root =& XCube_Root::getSingleton(); + + $moduleRunner = new User_ActionFrame(false); + $moduleRunner->setActionName("Lostpass"); + + $root->mController->mExecute->add(array(&$moduleRunner, 'execute')); + + $root->mController->execute(); + + $root->mController->executeView(); } /** @@ -103,25 +160,51 @@ $op = isset($_REQUEST['op']) ? trim(xoops_getrequest('op')) : "main"; $xoopsUser =& $root->mContext->mXoopsUser; + $actionName = "default"; + switch($op) { - case "main": - $url = is_object($xoopsUser) ? XOOPS_MODULE_URL . "/user/index.php?action=UserInfo&uid=".$xoopsUser->get('uid') - : XOOPS_MODULE_URL . "/user/index.php"; - $root->mController->executeForward($url); - break; - - case "delete": - $root->mController->executeForward(XOOPS_MODULE_URL . "/user/index.php?action=UserDelete"); - break; - case "login": $root->mController->checkLogin(); - break; + return; case "logout": $root->mController->logout(); + return; + + case "main": + if (is_object($xoopsUser)) { + $root->mController->executeForward(XOOPS_URL . "/userinfo.php?uid=" . $xoopsUser->get('uid')); + } + break; + + case "actv": + $actionName = "UserActivate"; + break; + + case "delete": + $actionName = "UserDelete"; break; } + + // + // Boot the action frame of the user module directly. + // + $root =& XCube_Root::getSingleton(); + $root->mController->executeHeader(); + + $root->mController->setupModuleContext('user'); + $root->mLanguageManager->loadModuleMessageCatalog('user'); + + require_once XOOPS_MODULE_PATH . "/user/class/ActionFrame.class.php"; + + $moduleRunner = new User_ActionFrame(false); + $moduleRunner->setActionName($actionName); + + $root->mController->mExecute->add(array(&$moduleRunner, 'execute')); + + $root->mController->execute(); + + $root->mController->executeView(); } function checkLogin(&$xoopsUser)