function actionRegister($params = '') { $errorMsg = false; $returnUrl = !empty($params['returnUrlRequest']) ? $params['returnUrlRequest'] : false; if (!empty($params['doregister'])) { $params['active'] = 1; // by default user is active $params['activateString'] = md5(time()); $user_id = $this->saveUser($params); if (!$user_id) { $errorMsg = $this->errorMsg; } else { // success $this->objAuthentication->login($params['user_email'], $params['user_password']); // send new user registration email $objEmailer = new EmailSender(); $objEmailer->sendUserRegisterAdmin($user_id); if (!empty($returnUrl) && $returnUrl != 'User/register') { header("Location: http://" . URL . '/' . $returnUrl); } else { header("Location: http://" . URL . '/User/profile'); } return; } } $objLayout = new LayoutModel(); $objTemplate = new TemplatesModel(); $layoutInfo = $objLayout->loadLayout(); $template = $objTemplate->loadTemplateFromKeyname('user-register'); $this->view->assign('urlrequest', $returnUrl); $this->view->assign('errorMsg', $errorMsg); $this->view->assign('content', $this->view->fetch('fromstring:' . $template['content'])); $this->view->assign('sidebar_left', $this->view->fetch('fromstring:' . $template['left_sidebar'])); $this->view->assign('sidebar_right', $this->view->fetch('fromstring:' . $template['right_sidebar'])); $this->view->assign('layout', $this->view->fetch('fromstring:' . $layoutInfo['code'])); $this->finish(); }