Index: branches/unlabeled/unlabeled-1.166.4/core/kernel/application.php =================================================================== diff -u -r6687 -r6842 --- branches/unlabeled/unlabeled-1.166.4/core/kernel/application.php (.../application.php) (revision 6687) +++ branches/unlabeled/unlabeled-1.166.4/core/kernel/application.php (.../application.php) (revision 6842) @@ -1535,8 +1535,8 @@ /** * Checks if user is logged in, and creates * user object if so. User object can be recalled - * later using "u" prefix. Also you may - * get user id by getting "u_id" variable. + * later using "u.current" prefix_special. Also you may + * get user id by getting "u.current_id" variable. * * @access private */ @@ -1545,11 +1545,18 @@ $session =& $this->recallObject('Session'); $user_id = $session->GetField('PortalUserId'); if (!$user_id && $user_id != -1) $user_id = -2; + $this->SetVar('u.current_id', $user_id); + + if (!$this->IsAdmin()) { + // needed for "profile edit", "registration" forms ON FRONT ONLY $this->SetVar('u_id', $user_id); + } + $this->StoreVar('user_id', $user_id); if ($this->GetVar('expired') == 1) { - $user =& $this->recallObject('u'); + // this parameter is set only from admin + $user =& $this->recallObject('u.current'); $user->SetError('ValidateLogin', 'session_expired', 'la_text_sess_expired'); } @@ -2088,8 +2095,6 @@ function LoggedIn() { $user_id = $this->Application->RecallVar('user_id'); -// $user =& $this->recallObject('u'); -// $user_id = $user->GetID(); $ret = $user_id > 0; if ($this->IsAdmin() && ($user_id == -1)) {