Skip to content

Commit

Permalink
Fix error if startpage is not a module
Browse files Browse the repository at this point in the history
  • Loading branch information
blackcoder87 committed Mar 26, 2017
1 parent b7b9bb5 commit cc4ba6b
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions application/modules/user/controllers/Regist.php
Expand Up @@ -154,7 +154,6 @@ public function confirmAction()
$selector = $this->getRequest()->getParam('selector');
$confirmedCode = $this->getRequest()->getParam('code');
$user = $userMapper->getUserBySelector($selector);
$startPage = str_replace('module_', '', $this->getConfig()->get('start_page'));

if (!empty($confirmedCode) and !empty($selector)) {
if (!empty($user) and hash_equals($user->getConfirmedCode(), $confirmedCode)) {
Expand All @@ -167,16 +166,16 @@ public function confirmAction()

$this->redirect()
->withMessage('accountApproved', 'success')
->to(['module' => $startPage, 'controller' => 'index', 'action' => 'index']);
->to(['controller' => 'index', 'action' => 'index']);
} else {
$this->redirect()
->withMessage('confirmedCodeWrong', 'warning')
->to(['module' => $startPage, 'controller' => 'index', 'action' => 'index']);
->to(['controller' => 'index', 'action' => 'index']);
}
} else {
$this->redirect()
->withMessage('incompleteActivationUrl', 'warning')
->to(['module' => $startPage, 'controller' => 'index', 'action' => 'index']);
->to(['controller' => 'index', 'action' => 'index']);
}
}
}
Expand Down

0 comments on commit cc4ba6b

Please sign in to comment.