Index: trunk/core/kernel/application.php =================================================================== diff -u -r3075 -r3103 --- trunk/core/kernel/application.php (.../application.php) (revision 3075) +++ trunk/core/kernel/application.php (.../application.php) (revision 3103) @@ -161,7 +161,7 @@ $this->VerifyThemeId(); if( $this->GetVar('m_cat_id') === false ) $this->SetVar('m_cat_id', 0); - + $this->Phrases = new PhrasesCache( $this->GetVar('m_lang') ); $this->SetVar('lang.current_id', $this->GetVar('m_lang') ); @@ -922,23 +922,22 @@ { return $this->Phrases->ReplaceLanguageTags($text,$force_escape); } - + /** - * Validtates user in session if required + * 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. * + * @access private */ function ValidateLogin() { - if (defined('LOGIN_REQUIRED')) - { - // Original Kostja call - //$login_controller =& $this->Factory->MakeClass(LOGIN_CONTROLLER, Array('model' => USER_MODEL, 'prefix' => 'login')); - - // Call proposed by Alex - //$login_controller =& $this->RecallObject(LOGIN_CONTROLLER, Array('model' => USER_MODEL, 'prefix' => 'login')); - - //$login_controller->CheckLogin(); - } + $session =& $this->recallObject('Session'); + $user_id = $session->GetField('PortalUserId'); + if (!$user_id) $user_id = -2; + $this->SetVar('u_id', $user_id); + $this->StoreVar('user_id', $user_id); } /**