XCL Web Application Platform 2.5.0
The XoopsCube Legacy Project
Loading...
Searching...
No Matches
DefaultAction.class.php
1<?php
6
7if (!defined('XOOPS_ROOT_PATH')) {
8 exit();
9}
10
11/***
12 * @internal
13 * @public
14 * This action shows two forms for login and lostpass. If the current user is
15 * logined, forward to the userinfo page.
16 */
17class User_DefaultAction extends User_Action
18{
19 public $_mAllowRegister = false;
20
21 public function isSecure()
22 {
23 return false;
24 }
25
26 public function prepare(&$controller, &$xoopsUser, $moduleConfig)
27 {
28 parent::prepare($controller, $xoopsUser, $moduleConfig);
29 $this->_mAllowRegister = $moduleConfig['allow_register'];
30 // Load the message for the block. Because the template uses the _MB_USER_* message for the block.
31 XCube_Root::getSingleton()->mLanguageManager->loadBlockMessageCatalog('user');
32 }
33
34 public function getDefaultView(&$controller, &$xoopsUser)
35 {
36 return is_object($xoopsUser) ? USER_FRAME_VIEW_ERROR : USER_FRAME_VIEW_INPUT;
37 }
38
39 public function executeViewInput(&$controller, &$xoopsUser, &$render)
40 {
41 $render->setTemplateName('user_default.html');
42 $render->setAttribute('allowRegister', $this->_mAllowRegister);
43 if (!empty($_GET['xoops_redirect'])) {
44 $root =& $controller->mRoot;
45 $textFilter =& $root->getTextFilter();
46 $render->setAttribute('redirect_page', xoops_getrequest('xoops_redirect'));
47 }
48 }
49
50 public function executeViewError(&$controller, &$xoopsUser, &$render)
51 {
52 $controller->executeForward('index.php?action=UserInfo&uid=' . $xoopsUser->get('uid'));
53 }
54}