/** * Destroy session data and remove cookie */ public function kill_session() { $this->plugins->exec_hook('session_destroy'); $this->session->remove(); $_SESSION = array('language' => $this->user->language, 'auth_time' => time(), 'temp' => true); rcmail::setcookie('sessauth', '-del-', time() - 60); $this->user->reset(); }
/** * Initial startup function * to register session, create database and imap connections * * @todo Remove global vars $DB, $USER */ private function startup() { // initialize syslog if ($this->config->get('log_driver') == 'syslog') { $syslog_id = $this->config->get('syslog_id', 'roundcube'); $syslog_facility = $this->config->get('syslog_facility', LOG_USER); openlog($syslog_id, LOG_ODELAY, $syslog_facility); } // connect to database $GLOBALS['DB'] = $this->get_dbh(); // start session $this->session_init(); // create user object $this->set_user(new rcube_user($_SESSION['user_id'])); // configure session (after user config merge!) $this->session_configure(); // set task and action properties $this->set_task(get_input_value('_task', RCUBE_INPUT_GPC)); $this->action = asciiwords(get_input_value('_action', RCUBE_INPUT_GPC)); // reset some session parameters when changing task if ($this->task != 'utils') { if ($this->session && $_SESSION['task'] != $this->task) { $this->session->remove('page'); } // set current task to session $_SESSION['task'] = $this->task; } // init output class if (!empty($_REQUEST['_remote'])) { $GLOBALS['OUTPUT'] = $this->json_init(); } else { $GLOBALS['OUTPUT'] = $this->load_gui(!empty($_REQUEST['_framed'])); } // create plugin API and load plugins $this->plugins = rcube_plugin_api::get_instance(); // init plugins $this->plugins->init(); }