Index: branches/5.3.x/core/units/helpers/user_helper.php =================================================================== diff -u -N -r15698 -r15902 --- branches/5.3.x/core/units/helpers/user_helper.php (.../user_helper.php) (revision 15698) +++ branches/5.3.x/core/units/helpers/user_helper.php (.../user_helper.php) (revision 15902) @@ -1,6 +1,6 @@ getUserObject(); + $this->Application->removeObject($object->getPrefixSpecial()); $this->Application->StoreVar('user_id', $user_id); $this->Application->SetVar('u.current_id', $user_id); @@ -479,8 +480,7 @@ unset($vars['login'], $vars['logout']); // merge back url params, because they were ignored if this was "external:" url - $vars['pass'] = implode(',', $vars['pass']); - $vars = array_merge($vars, $this->event->getRedirectParams()); + $vars = array_merge($vars, $this->getRedirectParams($vars['pass'], 'pass')); $template = $vars['t']; unset($vars['is_virtual'], $vars['t']); @@ -490,6 +490,29 @@ } /** + * Returns current event redirect params with given $prefixes injected into 'pass'. + * + * @param array $prefixes List of prefixes to inject. + * @param string $pass_name Name of array key in redirect params, containing comma-separated prefixes list. + * + * @return string + * @access protected + */ + protected function getRedirectParams($prefixes, $pass_name = 'passed') + { + $redirect_params = $this->event->getRedirectParams(); + + if ( isset($redirect_params[$pass_name]) ) { + $redirect_prefixes = explode(',', $redirect_params[$pass_name]); + $prefixes = array_unique(array_merge($prefixes, $redirect_prefixes)); + } + + $redirect_params[$pass_name] = implode(',', $prefixes); + + return $redirect_params; + } + + /** * Checks that user is allowed to use super admin mode * * @return bool