aboutsummaryrefslogtreecommitdiff
path: root/h-source/Application/Controllers/UsersController.php
diff options
context:
space:
mode:
Diffstat (limited to 'h-source/Application/Controllers/UsersController.php')
-rw-r--r--h-source/Application/Controllers/UsersController.php32
1 files changed, 15 insertions, 17 deletions
diff --git a/h-source/Application/Controllers/UsersController.php b/h-source/Application/Controllers/UsersController.php
index 1249647..7f42a2a 100644
--- a/h-source/Application/Controllers/UsersController.php
+++ b/h-source/Application/Controllers/UsersController.php
@@ -42,28 +42,20 @@ class UsersController extends BaseController
$this->append($data);
}
- public function login($lang = 'en', $type = null,$the_action = null,$the_id = null)
+ public function login($lang = 'en')
{
$data = array();
if ( strcmp($this->_updating,'no') === 0 )
{
$data['flag'] = isset($type) ? 'setted' : null;
- $html['type'] = in_array($type,Hardware::$controllers) ? sanitizeAll($type) : 'notebooks';
- $html['the_action'] = sanitizeAlphanum($the_action);
- $html['the_id'] = (int)$the_id;
$html['lang'] = Lang::sanitize($lang);
$data['title'] = 'Login - '.Website::$generalName;
+
+ $redirect = $this->request->get('redirect','','sanitizeAll');
- if (isset($type))
- {
- $data['action'] = Url::getRoot("users/login/".$html['lang']."/".$html['type']."/".$html['the_action']."/".$html['the_id']);
- }
- else
- {
- $data['action'] = Url::getRoot("users/login/".$html['lang']);
- }
+ $data['action'] = Url::getRoot("users/login/".$this->lang."?redirect=$redirect");
$data['notice'] = null;
@@ -82,11 +74,9 @@ class UsersController extends BaseController
$this->redirect('home/index/'.Lang::$current,3,'You are already logged...');
break;
case 'accepted':
- if (isset($type))
+ if (strcmp($redirect,'') !== 0)
{
- $address = strcmp($html['the_action'],'view') === 0 ? $html['type']."/view/".$html['lang']."/".$html['the_id'] : $html['type']."/catalogue/".$html['lang'];
-
- $this->redirect($address,0);
+ $this->redirect($redirect,0);
}
else
{
@@ -117,7 +107,15 @@ class UsersController extends BaseController
}
else if ($res === 'was-logged')
{
- $this->redirect('home/index/'.Lang::$current,0);
+ $redirect = $this->request->get('redirect','','sanitizeAll');
+ if (strcmp($redirect,'') !== 0)
+ {
+ $this->redirect($redirect,0);
+ }
+ else
+ {
+ $this->redirect('home/index/'.Lang::$current,0);
+ }
}
else if ($res === 'error')
{