Index: admin/system_presets/simple/users_u.php =================================================================== --- admin/system_presets/simple/users_u.php (revision 14656) +++ admin/system_presets/simple/users_u.php (working copy) @@ -25,7 +25,7 @@ // toolbar buttons $remove_buttons = Array ( // list of users; section: Users Management -> Users - 'users_list' => Array (/*'new_item', 'edit', 'delete', 'approve', 'decline', 'e-mail',*/ 'export', /*'view', 'dbl-click'*/), + 'users_list' => Array (/*'new_item', 'edit', 'delete', 'approve', 'decline', 'e-mail',*/ 'export', 'frontend_mail', /*'view', 'dbl-click'*/), // "General" tab during user adding/editing // 'users_edit' => Array ('select', 'cancel', 'reset_edit', 'prev', 'next'), Index: core/admin_templates/users/users_list.tpl =================================================================== --- core/admin_templates/users/users_list.tpl (revision 14656) +++ core/admin_templates/users/users_list.tpl (working copy) @@ -1,12 +1,12 @@ -
\ No newline at end of file Index: core/install/english.lang =================================================================== --- core/install/english.lang (revision 14656) +++ core/install/english.lang (working copy) @@ -257,6 +257,7 @@ VW5rbm93biBzZWN0aW9u VXNlciBCYW5uZWQ= dXNlciBub3QgZm91bmQ= + WW91IG11c3Qgc2VsZWN0IG9ubHkgb25lIHVzZXI= SW5jb3JyZWN0IGRhdGUgZm9ybWF0LCBwbGVhc2UgdXNlICglcykgZXguICglcyk= SW5jb3JyZWN0IGRhdGEgZm9ybWF0LCBwbGVhc2UgdXNlICVz SW52YWxpZCBGb3JtYXQ= @@ -1373,6 +1374,7 @@ SG9tZQ== SW1wb3J0 SW1wb3J0IExhbmd1YWdl + TG9naW4gQXM= TW92ZSBEb3du TW92ZSBVcA== TmV3IEFnZW50 Index: core/units/users/users_config.php =================================================================== --- core/units/users/users_config.php (revision 14656) +++ core/units/users/users_config.php (working copy) @@ -123,7 +123,7 @@ 'users_list' => Array ( 'prefixes' => Array ('u_List'), 'format' => "!la_title_Users!", - 'toolbar_buttons' => Array ('new_item', 'edit', 'delete', 'setprimary', 'approve', 'decline', 'e-mail', 'export', 'view', 'dbl-click'), + 'toolbar_buttons' => Array ('new_item', 'edit', 'delete', 'setprimary', 'approve', 'decline', 'e-mail', 'export', 'view', 'dbl-click', 'frontend_mail'), ), 'users_edit' => Array ( Index: core/units/users/users_event_handler.php =================================================================== --- core/units/users/users_event_handler.php (revision 14656) +++ core/units/users/users_event_handler.php (working copy) @@ -133,6 +133,14 @@ return defined('DBG_RESET_ROOT') && DBG_RESET_ROOT; } + if ( $event->Name == 'OnLoginAs' ) { + + $admin_session =& $this->Application->recallObject('Session.admin'); + /* @var $admin_session Session */ + + return $admin_session->LoggedIn(); + } + if ( !$this->Application->isAdminUser ) { $user_id = $this->Application->RecallVar('user_id'); $items_info = $this->Application->GetVar($event->getPrefixSpecial(true)); @@ -1761,4 +1769,30 @@ $event->SetRedirectParam('reset', 1); $event->SetRedirectParam('pass', 'm'); } + + + /** + * Login for front-end user when admin session is present + * + * @param kEvent $event + * @return void + * @access protected + */ + protected function OnLoginAs(&$event) + { + + $user_helper =& $this->Application->recallObject('UserHelper'); + /* @var $user_helper UserHelper */ + + $user =& $user_helper->getUserObject(); + $user->Load( $this->Application->GetVar('user') ); + + if ( !$user->isLoaded() ) { + return ; + } + + if ( $user_helper->checkLoginPermission() ) { + $user_helper->loginUserById( $user->GetID() ); + } + } }