コード例 #1
0
ファイル: rcmail.php プロジェクト: shishenkov/zpanel
 /**
  * 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();
 }