summaryrefslogtreecommitdiffstats
path: root/cron.php
diff options
context:
space:
mode:
authorJakob Sack <mail@jakobsack.de>2012-08-11 17:18:49 +0200
committerJakob Sack <mail@jakobsack.de>2012-08-11 17:18:49 +0200
commitbf7afa28d5f8321552352e7b07563251852645f5 (patch)
tree6722cbf50f92ac1b545d7eb742f2a06e06a0b060 /cron.php
parent0d8df3f55cfeda735e561409405060934240e4fe (diff)
downloadnextcloud-server-bf7afa28d5f8321552352e7b07563251852645f5.tar.gz
nextcloud-server-bf7afa28d5f8321552352e7b07563251852645f5.zip
Backgroundjobs: cron.php now checks for mode=="none"
Diffstat (limited to 'cron.php')
-rw-r--r--cron.php12
1 files changed, 12 insertions, 0 deletions
diff --git a/cron.php b/cron.php
index 1e0bb5f6dcd..83285e8a47c 100644
--- a/cron.php
+++ b/cron.php
@@ -47,7 +47,19 @@ if( !OC_Config::getValue( 'installed', false )){
// Handle unexpected errors
register_shutdown_function('handleUnexpectedShutdown');
+// Exit if background jobs are disabled!
$appmode = OC_Appconfig::getValue( 'core', 'backgroundjobs_mode', 'ajax' );
+if( $appmode == 'none' ){
+ my_temporary_cron_class::$sent = true;
+ if( OC::$CLI ){
+ echo 'Background Jobs are disabled!'.PHP_EOL;
+ }
+ else{
+ OC_JSON::error( array( 'data' => array( 'message' => 'Background jobs disabled!')));
+ }
+ exit( 1 );
+}
+
if( OC::$CLI ){
if( $appmode != 'cron' ){
OC_Appconfig::setValue( 'core', 'backgroundjobs_mode', 'cron' );