Minahito
minah****@users*****
2006年 3月 28日 (火) 22:31:02 JST
Index: xoops2jp/html/modules/user/actions/UserRegisterAction.class.php diff -u xoops2jp/html/modules/user/actions/UserRegisterAction.class.php:1.1.2.6 xoops2jp/html/modules/user/actions/UserRegisterAction.class.php:1.1.2.7 --- xoops2jp/html/modules/user/actions/UserRegisterAction.class.php:1.1.2.6 Sun Feb 5 19:33:39 2006 +++ xoops2jp/html/modules/user/actions/UserRegisterAction.class.php Tue Mar 28 22:31:02 2006 @@ -1,72 +1,74 @@ -<?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']); - } - } -} - +<?php + +if (!defined('XOOPS_ROOT_PATH')) exit(); + +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/AvatarEditAction.class.php diff -u xoops2jp/html/modules/user/actions/AvatarEditAction.class.php:1.1.2.3 xoops2jp/html/modules/user/actions/AvatarEditAction.class.php:1.1.2.4 --- xoops2jp/html/modules/user/actions/AvatarEditAction.class.php:1.1.2.3 Wed Mar 8 19:19:20 2006 +++ xoops2jp/html/modules/user/actions/AvatarEditAction.class.php Tue Mar 28 22:31:02 2006 @@ -1,5 +1,7 @@ <?php +if (!defined('XOOPS_ROOT_PATH')) exit(); + require_once XOOPS_MODULE_PATH . "/user/class/AbstractEditAction.class.php"; require_once XOOPS_MODULE_PATH . "/user/forms/AvatarEditForm.class.php"; require_once XOOPS_MODULE_PATH . "/user/forms/AvatarSelectForm.class.php"; Index: xoops2jp/html/modules/user/actions/UserActivateAction.class.php diff -u xoops2jp/html/modules/user/actions/UserActivateAction.class.php:1.1.2.1 xoops2jp/html/modules/user/actions/UserActivateAction.class.php:1.1.2.2 --- xoops2jp/html/modules/user/actions/UserActivateAction.class.php:1.1.2.1 Sun Feb 5 22:09:03 2006 +++ xoops2jp/html/modules/user/actions/UserActivateAction.class.php Tue Mar 28 22:31:02 2006 @@ -1,9 +1,12 @@ -<?php +<?php + +if (!defined('XOOPS_ROOT_PATH')) exit(); + require_once XOOPS_MODULE_PATH."/user/class/AbstractEditAction.class.php"; -require_once XOOPS_MODULE_PATH."/user/class/RegistMailBuilder.class.php"; - -class User_UserActivateAction extends User_AbstractEditAction -{ +require_once XOOPS_MODULE_PATH."/user/class/RegistMailBuilder.class.php"; + +class User_UserActivateAction extends User_AbstractEditAction +{ function _getId() { return isset($_REQUEST['uid']) ? intval($_REQUEST['uid']) : 0; @@ -30,40 +33,40 @@ function isSecure() { return false; - } + } function getDefaultView(&$controller, &$xoopsUser) - { - if ((!isset($_REQUEST['actkey'])) || (!$this->mObject)) { + { + if ((!isset($_REQUEST['actkey'])) || (!$this->mObject)) { $controller->executeForward(XOOPS_URL.'/'); - exit(); - } - if ($this->mObject->get('actkey') != $_REQUEST['actkey']) { + exit(); + } + if ($this->mObject->get('actkey') != $_REQUEST['actkey']) { redirect_header(XOOPS_URL, 3, _US_ACTKEYNOT); - exit(); - } - if ($this->mObject->get('level') > 1) { + exit(); + } + if ($this->mObject->get('level') > 1) { redirect_header(XOOPS_URL.'/user.php', 3, _US_ACONTACT); - exit(); - } - - $this->mObject->setVar('level','1'); - // Force update with GET request - $this->mObjectHandler->insert($this->mObject,true); - - if ($this->mConfig['activation_type'] == 2) { - $builder = new RegistAdminCommitMailBuilder(); - $director=new UserRegistMailDirector($this->mObject,$controller->getConfig(),$this->mConfig); - $director->contruct($builder); - $mailer=&$builder->getResult(); - if ($mailer->send()) { - redirect_header(XOOPS_URL.'/' ,5, sprintf(_US_ACTVMAILOK, $this->mObject->getVar('uname'))); - } else { - redirect_header(XOOPS_URL.'/' ,5, sprintf(_US_ACTVMAILNG, $this->mObject->getVar('uname'))); - } - } else { - redirect_header(XOOPS_URL.'/user.php' ,5,_US_ACTLOGIN); - } - } -} + exit(); + } + + $this->mObject->setVar('level','1'); + // Force update with GET request + $this->mObjectHandler->insert($this->mObject,true); + + if ($this->mConfig['activation_type'] == 2) { + $builder = new RegistAdminCommitMailBuilder(); + $director=new UserRegistMailDirector($this->mObject,$controller->getConfig(),$this->mConfig); + $director->contruct($builder); + $mailer=&$builder->getResult(); + if ($mailer->send()) { + redirect_header(XOOPS_URL.'/' ,5, sprintf(_US_ACTVMAILOK, $this->mObject->getVar('uname'))); + } else { + redirect_header(XOOPS_URL.'/' ,5, sprintf(_US_ACTVMAILNG, $this->mObject->getVar('uname'))); + } + } else { + redirect_header(XOOPS_URL.'/user.php' ,5,_US_ACTLOGIN); + } + } +} ?> Index: xoops2jp/html/modules/user/actions/EditUserAction.class.php diff -u xoops2jp/html/modules/user/actions/EditUserAction.class.php:1.1.2.6 xoops2jp/html/modules/user/actions/EditUserAction.class.php:1.1.2.7 --- xoops2jp/html/modules/user/actions/EditUserAction.class.php:1.1.2.6 Sat Feb 4 03:13:10 2006 +++ xoops2jp/html/modules/user/actions/EditUserAction.class.php Tue Mar 28 22:31:02 2006 @@ -1,5 +1,7 @@ <?php +if (!defined('XOOPS_ROOT_PATH')) exit(); + require_once XOOPS_MODULE_PATH . "/user/class/AbstractEditAction.class.php"; require_once XOOPS_MODULE_PATH . "/user/forms/EditUserForm.class.php"; Index: xoops2jp/html/modules/user/actions/DefaultAction.class.php diff -u xoops2jp/html/modules/user/actions/DefaultAction.class.php:1.1.2.1 xoops2jp/html/modules/user/actions/DefaultAction.class.php:1.1.2.2 --- xoops2jp/html/modules/user/actions/DefaultAction.class.php:1.1.2.1 Tue Jan 17 19:34:23 2006 +++ xoops2jp/html/modules/user/actions/DefaultAction.class.php Tue Mar 28 22:31:02 2006 @@ -1,5 +1,7 @@ <?php +if (!defined('XOOPS_ROOT_PATH')) exit(); + /** * Receive $_GET['uid'] */ Index: xoops2jp/html/modules/user/actions/AvatarSelectAction.class.php diff -u xoops2jp/html/modules/user/actions/AvatarSelectAction.class.php:1.1.2.3 xoops2jp/html/modules/user/actions/AvatarSelectAction.class.php:1.1.2.4 --- xoops2jp/html/modules/user/actions/AvatarSelectAction.class.php:1.1.2.3 Wed Mar 8 19:20:22 2006 +++ xoops2jp/html/modules/user/actions/AvatarSelectAction.class.php Tue Mar 28 22:31:02 2006 @@ -1,5 +1,7 @@ <?php +if (!defined('XOOPS_ROOT_PATH')) exit(); + require_once XOOPS_MODULE_PATH . "/user/class/AbstractEditAction.class.php"; require_once XOOPS_MODULE_PATH . "/user/forms/AvatarSelectForm.class.php"; Index: xoops2jp/html/modules/user/actions/UserRegister_confirmAction.class.php diff -u 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.7 --- xoops2jp/html/modules/user/actions/UserRegister_confirmAction.class.php:1.1.2.6 Sun Feb 5 19:33:39 2006 +++ xoops2jp/html/modules/user/actions/UserRegister_confirmAction.class.php Tue Mar 28 22:31:02 2006 @@ -1,144 +1,148 @@ -<?php -require_once XOOPS_MODULE_PATH."/user/forms/UserConfirmForm.class.php"; -require_once XOOPS_MODULE_PATH."/user/forms/UserRegisterEditForm.class.php"; -require_once XOOPS_MODULE_PATH."/user/class/RegistMailBuilder.class.php"; -class User_UserRegister_confirmAction extends User_Action -{ - var $mActionForm=null; - var $mRegistForm=null; - var $mConfig=array(); - - var $mNewUser=null; - - var $mRedirectMessage=null; - - function prepare(&$controller, &$xoopsUser, &$moduleConfig) - { - $this->mConfig=&$moduleConfig; - - $controller->mRoot->mEventManager->add("Module.User.Regist.Success", - new XCube_InstanceDelegate($this,"eventNotifyMail")); - } - - function execute(&$controller,&$xoopsUser) - { - // confirmForm - $this->_getRegistForm($controller); - $this->_processActionForm($controller); - - $memberHandler=&xoops_gethandler('member'); - $this->mNewUser=&$memberHandler->createUser(); - $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->mConfig['activation_type'] == 1) { - $this->mNewUser->setVar('level',1,true); - } - - if(!$memberHandler->insertUser($this->mNewUser)) { - $this->mRedirectMessage=_US_REGISTERNG; - return USER_FRAME_VIEW_ERROR; - } - - if(!$memberHandler->addUserToGroup(XOOPS_GROUP_USERS,$this->mNewUser->getVar('uid'))) { - $this->mRedirectMessage=_US_REGISTERNG; - return USER_FRAME_VIEW_ERROR; - } - - $this->_clearRegistForm($controller); - - $this->_processMail($controller); - $eventArgs = array(); - $controller->mRoot->mEventManager->raiseEvent("Module.User.Regist.Success",$controller,$eventArgs); - - return USER_FRAME_VIEW_SUCCESS; - } - - function getDefaultView(&$controller,&$xoopsUser) - { - $this->_getRegistForm($controller); - $this->_processActionForm($controller); - - return USER_FRAME_VIEW_INPUT; - } - - /** - * Get regist actionform from Session and set it to the member property. - */ - function _getRegistForm(&$controller) - { - $this->mRegistForm=& unserialize($_SESSION['user_register_actionform']); - if(!is_object($this->mRegistForm)) { - $controller->executeForward('./index.php?action=UserRegister'); - } - } - - /** - * clear session - */ - function _clearRegistForm(&$controller) - { - unset($_SESSION['user_register_actionform']); - } - - function _processMail(&$controller) - { - $activationType=$this->mConfig['activation_type']; - - if($activationType==1) - return; - - // Wmm.. - $builder = ($activationType==0) ? new RegistUserActivateMailBuilder() - : new RegistUserAdminActivateMailBuilder(); - - $director=new UserRegistMailDirector($this->mNewUser,$controller->getConfig(),$this->mConfig); - $director->contruct($builder); - $mailer=&$builder->getResult(); - - $mailer->send(); // CHECKS - } - - function eventNotifyMail(&$controller,&$eventArgs) - { - 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(); - $mailer->send(); - } - } - - function _processActionForm(&$controller) - { - $this->mActionForm=new UserConfirmForm(); - } - - function executeViewError(&$controller,&$xoopsUser,&$renderSystem) - { - XCube_Utils::redirectHeader(XOOPS_URL,1,$this->mRedirectMessage); - } - - function executeViewInput(&$controller,&$xoopsUser,&$renderSystem) - { - $renderSystem->setTemplateName("user_register_confirm.html"); - $renderSystem->setAttribute("actionForm",$this->mActionForm); - $renderSystem->setAttribute("registForm",$this->mRegistForm); - } - function executeViewSuccess(&$controller,&$xoopsUser,&$renderSystem) - { - $activationType=$this->mConfig['activation_type']; - - if($activationType==0) { - $renderSystem->setTemplateName("user_register_finish.html"); - $renderSystem->setAttribute("complete_message",_US_YOURREGISTERED); - } else if($activationType==1) { - XCube_Utils::redirectHeader(XOOPS_URL,4,_US_ACTLOGIN); - } else if($activationType==2) { - $renderSystem->setTemplateName("user_register_finish.html"); - $renderSystem->setAttribute("complete_message",_US_YOURREGISTERED2); - } - } -} +<?php + +if (!defined('XOOPS_ROOT_PATH')) exit(); + +require_once XOOPS_MODULE_PATH."/user/forms/UserConfirmForm.class.php"; +require_once XOOPS_MODULE_PATH."/user/forms/UserRegisterEditForm.class.php"; +require_once XOOPS_MODULE_PATH."/user/class/RegistMailBuilder.class.php"; + +class User_UserRegister_confirmAction extends User_Action +{ + var $mActionForm=null; + var $mRegistForm=null; + var $mConfig=array(); + + var $mNewUser=null; + + var $mRedirectMessage=null; + + function prepare(&$controller, &$xoopsUser, &$moduleConfig) + { + $this->mConfig=&$moduleConfig; + + $controller->mRoot->mEventManager->add("Module.User.Regist.Success", + new XCube_InstanceDelegate($this,"eventNotifyMail")); + } + + function execute(&$controller,&$xoopsUser) + { + // confirmForm + $this->_getRegistForm($controller); + $this->_processActionForm($controller); + + $memberHandler=&xoops_gethandler('member'); + $this->mNewUser=&$memberHandler->createUser(); + $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->mConfig['activation_type'] == 1) { + $this->mNewUser->setVar('level',1,true); + } + + if(!$memberHandler->insertUser($this->mNewUser)) { + $this->mRedirectMessage=_US_REGISTERNG; + return USER_FRAME_VIEW_ERROR; + } + + if(!$memberHandler->addUserToGroup(XOOPS_GROUP_USERS,$this->mNewUser->getVar('uid'))) { + $this->mRedirectMessage=_US_REGISTERNG; + return USER_FRAME_VIEW_ERROR; + } + + $this->_clearRegistForm($controller); + + $this->_processMail($controller); + $eventArgs = array(); + $controller->mRoot->mEventManager->raiseEvent("Module.User.Regist.Success",$controller,$eventArgs); + + return USER_FRAME_VIEW_SUCCESS; + } + + function getDefaultView(&$controller,&$xoopsUser) + { + $this->_getRegistForm($controller); + $this->_processActionForm($controller); + + return USER_FRAME_VIEW_INPUT; + } + + /** + * Get regist actionform from Session and set it to the member property. + */ + function _getRegistForm(&$controller) + { + $this->mRegistForm=& unserialize($_SESSION['user_register_actionform']); + if(!is_object($this->mRegistForm)) { + $controller->executeForward('./index.php?action=UserRegister'); + } + } + + /** + * clear session + */ + function _clearRegistForm(&$controller) + { + unset($_SESSION['user_register_actionform']); + } + + function _processMail(&$controller) + { + $activationType=$this->mConfig['activation_type']; + + if($activationType==1) + return; + + // Wmm.. + $builder = ($activationType==0) ? new RegistUserActivateMailBuilder() + : new RegistUserAdminActivateMailBuilder(); + + $director=new UserRegistMailDirector($this->mNewUser,$controller->getConfig(),$this->mConfig); + $director->contruct($builder); + $mailer=&$builder->getResult(); + + $mailer->send(); // CHECKS + } + + function eventNotifyMail(&$controller,&$eventArgs) + { + 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(); + $mailer->send(); + } + } + + function _processActionForm(&$controller) + { + $this->mActionForm=new UserConfirmForm(); + } + + function executeViewError(&$controller,&$xoopsUser,&$renderSystem) + { + XCube_Utils::redirectHeader(XOOPS_URL,1,$this->mRedirectMessage); + } + + function executeViewInput(&$controller,&$xoopsUser,&$renderSystem) + { + $renderSystem->setTemplateName("user_register_confirm.html"); + $renderSystem->setAttribute("actionForm",$this->mActionForm); + $renderSystem->setAttribute("registForm",$this->mRegistForm); + } + function executeViewSuccess(&$controller,&$xoopsUser,&$renderSystem) + { + $activationType=$this->mConfig['activation_type']; + + if($activationType==0) { + $renderSystem->setTemplateName("user_register_finish.html"); + $renderSystem->setAttribute("complete_message",_US_YOURREGISTERED); + } else if($activationType==1) { + XCube_Utils::redirectHeader(XOOPS_URL,4,_US_ACTLOGIN); + } else if($activationType==2) { + $renderSystem->setTemplateName("user_register_finish.html"); + $renderSystem->setAttribute("complete_message",_US_YOURREGISTERED2); + } + } +} ?> \ No newline at end of file Index: xoops2jp/html/modules/user/actions/LostPassAction.class.php diff -u xoops2jp/html/modules/user/actions/LostPassAction.class.php:1.1.2.1 xoops2jp/html/modules/user/actions/LostPassAction.class.php:1.1.2.2 --- xoops2jp/html/modules/user/actions/LostPassAction.class.php:1.1.2.1 Sun Feb 5 22:14:25 2006 +++ xoops2jp/html/modules/user/actions/LostPassAction.class.php Tue Mar 28 22:31:02 2006 @@ -1,5 +1,7 @@ <?php +if (!defined('XOOPS_ROOT_PATH')) exit(); + require_once XOOPS_MODULE_PATH . "/user/forms/LostPassEditForm.class.php"; require_once XOOPS_MODULE_PATH . "/user/class/LostPassMailBuilder.class.php"; Index: xoops2jp/html/modules/user/actions/UserInfoAction.class.php diff -u xoops2jp/html/modules/user/actions/UserInfoAction.class.php:1.1.2.2 xoops2jp/html/modules/user/actions/UserInfoAction.class.php:1.1.2.3 --- xoops2jp/html/modules/user/actions/UserInfoAction.class.php:1.1.2.2 Thu Jan 26 20:10:09 2006 +++ xoops2jp/html/modules/user/actions/UserInfoAction.class.php Tue Mar 28 22:31:02 2006 @@ -1,5 +1,7 @@ <?php +if (!defined('XOOPS_ROOT_PATH')) exit(); + /** * Receive $_GET['uid'] */