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); } /** Index: trunk/core/kernel/db/db_event_handler.php =================================================================== diff -u -r3084 -r3103 --- trunk/core/kernel/db/db_event_handler.php (.../db_event_handler.php) (revision 3084) +++ trunk/core/kernel/db/db_event_handler.php (.../db_event_handler.php) (revision 3103) @@ -298,6 +298,10 @@ $actions =& $this->Application->recallObject('kActions'); $actions->Set($event->Prefix_Special.'_id', $object->GetId() ); } + else + { + $object->setID($id); + } } /** Index: trunk/core/units/general/my_application.php =================================================================== diff -u -r2893 -r3103 --- trunk/core/units/general/my_application.php (.../my_application.php) (revision 2893) +++ trunk/core/units/general/my_application.php (.../my_application.php) (revision 3103) @@ -23,23 +23,6 @@ $this->registerClass('kCountryStatesHelper',MODULES_PATH.'/kernel/units/general/country_states.php','CountryStatesHelper'); $this->registerClass('kBracketsHelper',MODULES_PATH.'/kernel/units/general/brackets.php','BracketsHelper'); } - - /** - * 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() - { - $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); - } function getUserGroups($user_id) { Index: trunk/kernel/units/general/my_application.php =================================================================== diff -u -r2893 -r3103 --- trunk/kernel/units/general/my_application.php (.../my_application.php) (revision 2893) +++ trunk/kernel/units/general/my_application.php (.../my_application.php) (revision 3103) @@ -23,23 +23,6 @@ $this->registerClass('kCountryStatesHelper',MODULES_PATH.'/kernel/units/general/country_states.php','CountryStatesHelper'); $this->registerClass('kBracketsHelper',MODULES_PATH.'/kernel/units/general/brackets.php','BracketsHelper'); } - - /** - * 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() - { - $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); - } function getUserGroups($user_id) {