18 return isset($_REQUEST[
'uid']) ? (int)xoops_getrequest(
'uid') : 0;
23 $handler =& xoops_getmodulehandler(
'users',
'user');
45 public function getDefaultView(&$controller, &$xoopsUser)
47 if ((!isset($_REQUEST[
'actkey'])) || (!$this->mObject)) {
48 $controller->executeForward(XOOPS_URL .
'/');
51 if ($this->mObject->get(
'actkey') != xoops_getrequest(
'actkey')) {
52 $controller->executeRedirect(XOOPS_URL .
'/', 3, _MD_USER_MESSAGE_ACTKEYNOT);
55 if ($this->mObject->get(
'level') > 0) {
56 $controller->executeRedirect(XOOPS_URL .
'/user.php', 3, _MD_USER_MESSAGE_ACONTACT);
59 $this->mObject->set(
'level',
'1');
64 $this->mObjectHandler->insert($this->mObject,
true);
66 if (2 == $this->mConfig[
'activation_type']) {
67 $builder =
new User_RegistAdminCommitMailBuilder();
68 $director =
new User_UserRegistMailDirector($builder, $this->mObject, $controller->mRoot->mContext->getXoopsConfig(), $this->mConfig);
69 $director->contruct();
70 $mailer=&$builder->getResult();
71 XCube_DelegateUtils::call(
'Legacy.Event.RegistUser.SendMail',
new XCube_Ref($mailer),
'Activated');
72 if ($mailer->send()) {
73 $controller->executeRedirect(XOOPS_URL .
'/', 5, sprintf(_MD_USER_MESSAGE_ACTVMAILOK, $this->mObject->get(
'uname')));
75 $controller->executeRedirect(XOOPS_URL .
'/', 5, sprintf(_MD_USER_MESSAGE_ACTVMAILNG, $this->mObject->get(
'uname')));
78 $controller->executeRedirect(XOOPS_URL .
'/user.php', 5, _MD_USER_MESSAGE_ACTLOGIN);