summaryrefslogtreecommitdiffstats
path: root/application/core/MY_Controller.php
diff options
context:
space:
mode:
Diffstat (limited to 'application/core/MY_Controller.php')
-rw-r--r--application/core/MY_Controller.php7
1 files changed, 7 insertions, 0 deletions
diff --git a/application/core/MY_Controller.php b/application/core/MY_Controller.php
index 79d258c37..ede6577da 100644
--- a/application/core/MY_Controller.php
+++ b/application/core/MY_Controller.php
@@ -105,4 +105,11 @@ class MY_Controller extends CI_Controller {
$this->data["user_logged_in"] = $this->muser->logged_in();
$this->data['redirect_uri'] = $this->uri->uri_string();
}
+
+ protected function _require_cli_request()
+ {
+ if (!$this->input->is_cli_request()) {
+ throw new \exceptions\PublicApiException("api/cli-only", "This function can only be accessed via the CLI interface");
+ }
+ }
}