From 2c566fe8da9b2463c3376bafb24bc7428ab341a3 Mon Sep 17 00:00:00 2001 From: Florian Pritz Date: Fri, 22 May 2015 10:44:18 +0200 Subject: Forbid cli requests until database is updated This mainly tries to prevent problems when file cron is run with an old database. Tools is whitelisted for the future, if there are cron jobs in tools they will need to check the migrations themselves. Signed-off-by: Florian Pritz --- application/core/MY_Controller.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/application/core/MY_Controller.php b/application/core/MY_Controller.php index a58d03563..5181c2904 100644 --- a/application/core/MY_Controller.php +++ b/application/core/MY_Controller.php @@ -21,7 +21,7 @@ class MY_Controller extends CI_Controller { $this->load->library('customautoloader'); // check if DB is up to date - if (!$this->input->is_cli_request()) { + if (!($this->input->is_cli_request() && $this->uri->segment(1) === "tools")) { if (!$this->db->table_exists('migrations')){ throw new \exceptions\PublicApiException("general/db/not-initialized", "Database not initialized. Can't find migrations table. Please run the migration script. (php index.php tools update_database)"); } else { -- cgit v1.2.3-24-g4f1b