25 public $mActionForm =
null;
27 public $mEnableAgreeFlag =
false;
29 public function prepare(&$controller, &$xoopsUser, $moduleConfig)
31 $this->mConfig = $moduleConfig;
33 if (is_object($xoopsUser)) {
37 $controller->executeForward(XOOPS_URL .
'/user.php');
39 if (empty($this->mConfig[
'allow_register'])) {
40 $controller->executeRedirect(XOOPS_URL .
'/', 6, _MD_USER_LANG_NOREGISTER);
44 public function execute(&$controller, &$xoopsUser)
46 $this->_processActionForm();
47 $this->mActionForm->fetch();
48 $this->mActionForm->validate();
50 XCube_DelegateUtils::call(
'Legacy.Event.RegistUser.Validate',
new XCube_Ref($this->mActionForm));
52 if ($this->mActionForm->hasError()) {
53 return USER_FRAME_VIEW_INPUT;
55 $_SESSION[
'user_register_actionform'] = serialize($this->mActionForm);
56 $controller->executeForward(
'./register.php?action=confirm');
60 public function getDefaultView(&$controller, &$xoopsUser)
62 $this->_processActionForm();
63 return USER_FRAME_VIEW_INPUT;
66 public function _processActionForm()
68 if (isset($_SESSION[
'user_register_actionform'])) {
69 $this->mActionForm = unserialize($_SESSION[
'user_register_actionform']);
70 unset($_SESSION[
'user_register_actionform']);
74 if (0 != $this->mConfig[
'reg_dispdsclmr'] &&
null != $this->mConfig[
'reg_disclaimer']) {
75 $this->mEnableAgreeFlag =
true;
81 $this->mActionForm->prepare();
83 $root =& XCube_Root::getSingleton();
84 $this->mActionForm->set(
'timezone_offset', $root->mContext->getXoopsConfig(
'default_TZ'));
94 $renderSystem->setTemplateName(
'user_register_form.html');
98 $tzoneHandler =& xoops_gethandler(
'timezone');
99 $timezones =& $tzoneHandler->getObjects();
100 $renderSystem->setAttribute(
'timezones', $timezones);
101 $renderSystem->setAttribute(
'actionForm', $this->mActionForm);
102 $renderSystem->setAttribute(
'enableAgree', $this->mEnableAgreeFlag);
103 if ($this->mEnableAgreeFlag) {
104 $renderSystem->setAttribute(
'disclaimer', $this->mConfig[
'reg_disclaimer']);
111 XCube_DelegateUtils::call(
'Legacy.Event.RegistUser.SetValidators',
new XCube_Ref($validators));
112 $renderSystem->setAttribute(
'validators', $validators);