/** called before any actions **/ public function onBefore() { global $MONGO; //exception handler set_exception_handler(array($this, "exceptionHandler")); $this->_admin = MUser::userInSession(); if (!$this->_admin) { //if user is loged in? $server = MServer::serverWithIndex(xi("host")); //filter server plugins if (class_exists("RFilter")) { RFilter::apply("SERVER_FILTER", $server); } //if auth is disabled if ($server && !$server->mongoAuth() && !$server->controlAuth()) { MUser::login("rockmongo_memo", "rockmongo_memo", xi("host"), "admin", 10800); $this->_admin = MUser::userInSession(); } else { $this->redirect("login.index", array("host" => xi("host"))); } } if (!$this->_admin->validate()) { $this->redirect("login.index", array("host" => $this->_admin->hostIndex())); } $this->_server = MServer::serverWithIndex($this->_admin->hostIndex()); $this->_mongo = $this->_server->mongo(); //log query if (isset($MONGO["features"]["log_query"]) && $MONGO["features"]["log_query"] == "on") { $this->_logQuery = true; } //render header if (!$this->isAjax()) { render_view("header"); } }