summaryrefslogtreecommitdiffstats
path: root/application
diff options
context:
space:
mode:
authorFlorian Pritz <bluewind@xinu.at>2015-05-22 10:44:18 +0200
committerFlorian Pritz <bluewind@xinu.at>2015-05-22 10:45:35 +0200
commit2c566fe8da9b2463c3376bafb24bc7428ab341a3 (patch)
treea7fccb9b05179bb990dd766df694daabdf2bbba0 /application
parent141d541d4cc8abb10f164f58c3e106c198713f25 (diff)
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 <bluewind@xinu.at>
Diffstat (limited to 'application')
-rw-r--r--application/core/MY_Controller.php2
1 files changed, 1 insertions, 1 deletions
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 {