NobuNobu
nobun****@users*****
2006年 2月 5日 (日) 19:33:39 JST
Index: xoops2jp/html/modules/user/actions/UserRegisterAction.class.php diff -u xoops2jp/html/modules/user/actions/UserRegisterAction.class.php:1.1.2.5 xoops2jp/html/modules/user/actions/UserRegisterAction.class.php:1.1.2.6 --- xoops2jp/html/modules/user/actions/UserRegisterAction.class.php:1.1.2.5 Sat Feb 4 16:52:47 2006 +++ xoops2jp/html/modules/user/actions/UserRegisterAction.class.php Sun Feb 5 19:33:39 2006 @@ -1,75 +1,72 @@ -<?php - -require_once XOOPS_MODULE_PATH."/user/forms/UserRegisterEditForm.class.php"; - -class User_UserRegisterAction extends User_Action -{ - var $mActionForm=null; - var $mConfig; - var $mEnableAgreeFlag=false; - - function prepare(&$controller,&$xoopsUser) - { - $this->mConfig=$controller->mModuleController->getConfig(); - - // - // If user is registered, kick to his information page. - // - if(is_object($xoopsUser)) - $controller->executeForward(XOOPS_URL."/user.php"); - } - - function execute(&$controller,&$xoopsUser) - { - $this->_processActionForm(); - $this->mActionForm->fetch(); - $this->mActionForm->validate(); - - if($this->mActionForm->hasError()) { - return USER_FRAME_VIEW_INPUT; - } - else { - $_SESSION['user_register_actionform']=serialize(&$this->mActionForm); - $controller->executeForward('./index.php?action=UserRegister_confirm'); - } - } - - function getDefaultView(&$controller,&$xoopsUser) - { - $this->_processActionForm(); - - return USER_FRAME_VIEW_INPUT; - } - - function _processActionForm() - { - if($this->mConfig['reg_dispdsclmr']!=0 && $this->mConfig['reg_disclaimer']!=null) { - $this->mEnableAgreeFlag=true; - $this->mActionForm=new UserRegisterAgreeEditForm(); - } - else { - $this->mActionForm=new UserRegisterEditForm(); - } - - $this->mActionForm->prepare($this->mConfig); - } - - function executeViewInput(&$controller,&$xoopsUser,&$renderSystem) - { - // - // Get some objects for input form. - // - $tzoneHandler =& xoops_gethandler('timezone'); - $timezones =& $tzoneHandler->getObjects(); - - $renderSystem->setAttribute('timezones', $timezones); - - $renderSystem->setTemplateName("user_register_form.html"); - $renderSystem->setAttribute("actionForm",$this->mActionForm); - $renderSystem->setAttribute("enableAgree",$this->mEnableAgreeFlag); - if($this->mEnableAgreeFlag) - $renderSystem->setAttribute("disclaimer",$this->mConfig['reg_disclaimer']); - } -} - +<?php + +require_once XOOPS_MODULE_PATH."/user/forms/UserRegisterEditForm.class.php"; + +class User_UserRegisterAction extends User_Action +{ + var $mActionForm=null; + var $mConfig; + var $mEnableAgreeFlag=false; + + function prepare(&$controller, &$xoopsUser, &$moduleConfig) + { + $this->mConfig=&$moduleConfig; + + if(is_object($xoopsUser)) { + // If user is registered, kick to his information page. + $controller->executeForward(XOOPS_URL."/user.php"); + } + if (empty($this->mConfig['allow_register'])) { + redirect_header(XOOPS_URL.'/', 6, _US_NOREGISTER); + exit(); + } + } + + function execute(&$controller,&$xoopsUser) + { + $this->_processActionForm(); + $this->mActionForm->fetch(); + $this->mActionForm->validate(); + + if($this->mActionForm->hasError()) { + return USER_FRAME_VIEW_INPUT; + } else { + $_SESSION['user_register_actionform']=serialize(&$this->mActionForm); + $controller->executeForward('./index.php?action=UserRegister_confirm'); + } + } + + function getDefaultView(&$controller,&$xoopsUser) + { + $this->_processActionForm(); + return USER_FRAME_VIEW_INPUT; + } + + function _processActionForm() + { + if($this->mConfig['reg_dispdsclmr']!=0 && $this->mConfig['reg_disclaimer']!=null) { + $this->mEnableAgreeFlag=true; + $this->mActionForm=new UserRegisterAgreeEditForm(); + } else { + $this->mActionForm=new UserRegisterEditForm(); + } + + $this->mActionForm->prepare($this->mConfig); + } + + function executeViewInput(&$controller,&$xoopsUser,&$renderSystem) + { + $renderSystem->setTemplateName("user_register_form.html"); + // Get some objects for input form. + $tzoneHandler =& xoops_gethandler('timezone'); + $timezones =& $tzoneHandler->getObjects(); + $renderSystem->setAttribute('timezones', $timezones); + $renderSystem->setAttribute("actionForm",$this->mActionForm); + $renderSystem->setAttribute("enableAgree",$this->mEnableAgreeFlag); + if($this->mEnableAgreeFlag) { + $renderSystem->setAttribute("disclaimer",$this->mConfig['reg_disclaimer']); + } + } +} + ?> \ No newline at end of file Index: xoops2jp/html/modules/user/actions/UserRegister_confirmAction.class.php diff -u xoops2jp/html/modules/user/actions/UserRegister_confirmAction.class.php:1.1.2.5 xoops2jp/html/modules/user/actions/UserRegister_confirmAction.class.php:1.1.2.6 --- xoops2jp/html/modules/user/actions/UserRegister_confirmAction.class.php:1.1.2.5 Sat Feb 4 22:35:31 2006 +++ xoops2jp/html/modules/user/actions/UserRegister_confirmAction.class.php Sun Feb 5 19:33:39 2006 @@ -6,18 +6,18 @@ { var $mActionForm=null; var $mRegistForm=null; - var $mUserConfig=array(); + var $mConfig=array(); var $mNewUser=null; var $mRedirectMessage=null; - function prepare(&$controller,&$xoopsUser) + function prepare(&$controller, &$xoopsUser, &$moduleConfig) { - $confingHandler=&xoops_gethandler('config'); - $this->mUserConfig=&$confingHandler->getConfigsByCat(XOOPS_CONF_USER); + $this->mConfig=&$moduleConfig; - $controller->mRoot->mEventManager->add("Module.User.Regist.Success",new XCube_InstanceDelegate($this,"eventNotifyMail")); + $controller->mRoot->mEventManager->add("Module.User.Regist.Success", + new XCube_InstanceDelegate($this,"eventNotifyMail")); } function execute(&$controller,&$xoopsUser) @@ -31,8 +31,8 @@ $this->mRegistForm->update($this->mNewUser); $this->mNewUser->setVar('uorder',$controller->getConfig('com_order'),true); $this->mNewUser->setVar('umode',$controller->getConfig('com_mode'),true); - if($this->mUserConfig['activation_type'] == 1) { - $this->mNewUsersetVar('level',1,true); + if($this->mConfig['activation_type'] == 1) { + $this->mNewUser->setVar('level',1,true); } if(!$memberHandler->insertUser($this->mNewUser)) { @@ -51,7 +51,7 @@ $eventArgs = array(); $controller->mRoot->mEventManager->raiseEvent("Module.User.Regist.Success",$controller,$eventArgs); - return true; + return USER_FRAME_VIEW_SUCCESS; } function getDefaultView(&$controller,&$xoopsUser) @@ -83,7 +83,7 @@ function _processMail(&$controller) { - $activationType=$this->mUserConfig['activation_type']; + $activationType=$this->mConfig['activation_type']; if($activationType==1) return; @@ -92,7 +92,7 @@ $builder = ($activationType==0) ? new RegistUserActivateMailBuilder() : new RegistUserAdminActivateMailBuilder(); - $director=new UserRegistMailDirector($this->mNewUser,$controller->getConfig(),$this->mUserConfig); + $director=new UserRegistMailDirector($this->mNewUser,$controller->getConfig(),$this->mConfig); $director->contruct($builder); $mailer=&$builder->getResult(); @@ -101,8 +101,8 @@ function eventNotifyMail(&$controller,&$eventArgs) { - if($this->mUserConfig['new_user_notify'] == 1 && !empty($this->mUserConfig['new_user_notify_group'])) { - $director=new UserRegistMailDirector($this->mNewUser,$controller->getConfig(),$this->mUserConfig); + if($this->mConfig['new_user_notify'] == 1 && !empty($this->mConfig['new_user_notify_group'])) { + $director=new UserRegistMailDirector($this->mNewUser,$controller->getConfig(),$this->mConfig); $builder = new RegistUserNotifyMailBuilder(); $director->contruct($builder); $mailer=&$builder->getResult(); @@ -128,7 +128,7 @@ } function executeViewSuccess(&$controller,&$xoopsUser,&$renderSystem) { - $activationType=$this->mUserConfig['activation_type']; + $activationType=$this->mConfig['activation_type']; if($activationType==0) { $renderSystem->setTemplateName("user_register_finish.html"); @@ -141,5 +141,4 @@ } } } - ?> \ No newline at end of file