Index: trunk/core/units/users/users_event_handler.php =================================================================== diff -u -N -r5194 -r5431 --- trunk/core/units/users/users_event_handler.php (.../users_event_handler.php) (revision 5194) +++ trunk/core/units/users/users_event_handler.php (.../users_event_handler.php) (revision 5431) @@ -10,6 +10,9 @@ { parent::mapPermissions(); $permissions = Array( + // admin + 'OnSetPersistantVariable' => Array('self' => 'view'), // because setting to logged in user only + // front 'OnRefreshForm' => Array('self' => true), @@ -101,8 +104,7 @@ */ function OnLogin(&$event) { - $this->Application->setUnitOption($event->Prefix, 'AutoLoad', false); - $object =& $this->Application->recallObject('u'); + $object =& $this->Application->recallObject('u', null, Array('skip_autoload' => true)); $password = $this->Application->GetVar('password'); if(!$password) @@ -260,6 +262,11 @@ { $sync_manager =& $this->Application->recallObjectP('UsersSyncronizeManager', null, Array(), 'InPortalSyncronize'); $sync_manager->performAction('LoginUser', $event->getEventParam('user'), $event->getEventParam('pass') ); + + if ($event->redirect && is_string($event->redirect)) { + // some real template specified instead of true + $this->Application->Redirect($event->redirect, $event->redirect_params); + } } /** @@ -443,7 +450,6 @@ $object =& $event->getObject( Array('skip_autoload' => true) ); $this->Application->SetVar('u_id', $object->getID() ); - $this->Application->setUnitOption('u', 'AutoLoad', true); $this->setNextTemplate($event); @@ -462,8 +468,7 @@ */ function setUserStatus(&$event) { - $this->Application->setUnitOption($event->Prefix,'AutoLoad',false); - $object =& $event->getObject(); + $object =& $event->getObject( Array('skip_autoload' => true) ); $new_users_allowed = $this->Application->ConfigValue('User_Allow_New'); // 1 - Instant, 2 - Not Allowed, 3 - Pending @@ -579,8 +584,7 @@ */ function OnUpdateAddress(&$event) { - $this->Application->setUnitOption($event->Prefix,'AutoLoad',false); - $object =& $event->getObject(); + $object =& $event->getObject( Array('skip_autoload' => true) ); $items_info = $this->Application->GetVar( $event->getPrefixSpecial(true) ); if($items_info) @@ -599,10 +603,9 @@ $user_email = $this->Application->GetVar('subscriber_email'); if ( preg_match("/^[_a-zA-Z0-9-\.]+@[a-zA-Z0-9-\.]+\.[a-z]{2,4}$/", $user_email) ){ + + $object = &$this->Application->recallObject($this->Prefix.'.subscriber', null, Array('skip_autoload' => true)); - $this->Application->setUnitOption($event->Prefix,'AutoLoad',false); - $object = &$this->Application->recallObject($this->Prefix.'.subscriber'); - $this->Application->StoreVar('SubscriberEmail', $user_email); if( $object->Load(array('Email'=>$user_email)) ){ @@ -635,8 +638,7 @@ function OnSubscribeUser(&$event){ - $this->Application->setUnitOption($event->Prefix,'AutoLoad',false); - $object = &$this->Application->recallObject($this->Prefix.'.subscriber'); + $object = &$this->Application->recallObject($this->Prefix.'.subscriber', Array('skip_autoload' => true)); $user_email = $this->Application->RecallVar('SubscriberEmail'); @@ -727,8 +729,7 @@ function OnForgotPassword(&$event){ - $this->Application->setUnitOption('u', 'AutoLoad', false); - $user_object = &$this->Application->recallObject('u.forgot'); + $user_object = &$this->Application->recallObject('u.forgot', null, Array('skip_autoload' => true)); $user_current_object = &$this->Application->recallObject('u'); $username = $this->Application->GetVar('username');