contributions/usermanagement.hijackaccount/behaviour/commands/users/logout.cmd.php
Go to the documentation of this file.00001 <?php 00002 /** 00003 * Created on 11.04.2007 00004 * 00005 * @author Gerd Riesselmann 00006 */ 00007 00008 Load::commands('base/logout'); 00009 00010 class LogoutUsersCommand extends LogoutUsersBaseCommand { 00011 // Overload logout, if account was hijacked 00012 protected function do_execute() { 00013 $ret = new Status(); 00014 00015 $old_session_id = Cookie::get_cookie_value(HijackAccount::COOKIE_NAME); 00016 $saved_session = DB::get_item('hijackaccountsavedsessions', 'id', $old_session_id); 00017 if ($saved_session) { 00018 Load::commands('users/loginknown', 'generics/cookie.delete'); 00019 $cmd = new LoginknownUsersCommand($saved_session->get_user()); 00020 $ret->merge($cmd->execute()); 00021 if ($ret->is_ok()) { 00022 $_SESSION = $saved_session->data; 00023 $cmd_del_cookie = new CookieDeleteCommand(HijackAccount::COOKIE_NAME); 00024 $cmd_del_cookie->execute(); 00025 } 00026 } 00027 else { 00028 $ret->merge(parent::do_execute()); 00029 } 00030 00031 return $ret; 00032 } 00033 }