Index: branches/5.2.x/core/units/users/users_event_handler.php =================================================================== diff -u -N -r14758 -r14765 --- branches/5.2.x/core/units/users/users_event_handler.php (.../users_event_handler.php) (revision 14758) +++ branches/5.2.x/core/units/users/users_event_handler.php (.../users_event_handler.php) (revision 14765) @@ -1,6 +1,6 @@ Name == 'OnLogin' || $event->Name == 'OnLogout' ) { + if ( $event->Name == 'OnLogin' || $event->Name == 'OnLoginAjax' || $event->Name == 'OnLogout' ) { // permission is checked in OnLogin event directly return true; } @@ -275,6 +275,21 @@ } /** + * Performs user login from ajax request + * + * @param kEvent $event + * @return void + * @access protected + */ + protected function OnLoginAjax(&$event) + { + $ajax_form_helper =& $this->Application->recallObject('AjaxFormHelper'); + /* @var $ajax_form_helper AjaxFormHelper */ + + $ajax_form_helper->transitEvent($event, 'OnLogin', Array ('do_refresh' => 1)); + } + + /** * [HOOK] Auto-Logins Front-End user when "Remember Login" cookie is found * * @param kEvent $event @@ -415,7 +430,7 @@ $ajax_form_helper =& $this->Application->recallObject('AjaxFormHelper'); /* @var $ajax_form_helper AjaxFormHelper */ - $ajax_form_helper->transitEvent($event, 'OnCreate'); + $ajax_form_helper->transitEvent($event, 'OnCreate', Array ('do_refresh' => 1)); } /** @@ -477,11 +492,13 @@ /* @var $object UsersItem */ if ( !$object->isSubscriberOnly() ) { - // don't checck state-to-country relations for subscribers + // don't check state-to-country relations for subscribers $cs_helper->CheckStateField($event, 'State', 'Country'); } - $this->_makePasswordRequired($event); + if ( $object->getFormName() != 'login' ) { + $this->_makePasswordRequired($event); + } $cs_helper->PopulateStates($event, 'State', 'Country'); Index: branches/5.2.x/core/units/users/users_config.php =================================================================== diff -u -N -r14758 -r14765 --- branches/5.2.x/core/units/users/users_config.php (.../users_config.php) (revision 14758) +++ branches/5.2.x/core/units/users/users_config.php (.../users_config.php) (revision 14765) @@ -1,6 +1,6 @@ Array ( + 'Fields' => Array ( + // make sure all fields, required by default are not required on this form + 'Email' => Array ('required' => 0), + ), 'VirtualFields' => Array ( 'UserLogin' => Array ( 'type' => 'string',