Index: kernel/event_manager.php =================================================================== --- kernel/event_manager.php (revision 14318) +++ kernel/event_manager.php (working copy) @@ -734,13 +734,13 @@ * * @param int $event_type */ - function RunRegularEvents($event_type = reBEFORE, $from_cron=false) + function RunRegularEvents($event_type = reBEFORE, $from_cron = false) { - if (defined('IS_INSTALL')) { + if ( defined('IS_INSTALL') ) { return ; } - if (!$from_cron && $this->Application->ConfigValue('UseCronForRegularEvent')) { + if ( !$from_cron && $this->Application->ConfigValue('UseCronForRegularEvent') ) { // if RegularEvents are set to run from cron return ; } @@ -762,7 +762,7 @@ $this->runAgent($event_data); } - $this->Application->StoreVar('user_id', $user_id, true); // true for optional + $this->Application->StoreVar('user_id', $user_id, $user_id == USER_GUEST); } function runAgent($agent_data) Index: units/users/users_tag_processor.php =================================================================== --- units/users/users_tag_processor.php (revision 14318) +++ units/users/users_tag_processor.php (working copy) @@ -315,11 +315,13 @@ { $passed_key = trim($this->Application->GetVar('user_key')); - $user =& $this->Application->recallObject('u', null, Array('skip_autoload' => true)); - /* @var $user UsersItem */ + $user_helper =& $this->Application->recallObject('UserHelper'); + /* @var $user_helper UserHelper */ + $user =& $user_helper->getUserObject(); $user->Load($passed_key, 'PwResetConfirm'); - if (!$user->isLoaded()) { + + if ( !$user->isLoaded() ) { return ; } @@ -328,10 +330,9 @@ $user->SetDBField('PwRequestTime', 0); $user->Update(); - $user_helper =& $this->Application->recallObject('UserHelper'); - /* @var $user_helper UserHelper */ - - $user_helper->loginUserById( $user->GetID() ); + if ( $user_helper->checkLoginPermission() ) { + $user_helper->loginUserById( $user->GetID() ); + } } } \ No newline at end of file