summaryrefslogtreecommitdiffstats
path: root/settings
diff options
context:
space:
mode:
authorJakob Sack <mail@jakobsack.de>2012-08-09 10:41:10 +0200
committerJakob Sack <mail@jakobsack.de>2012-08-09 10:41:10 +0200
commit1ce2cd73ffd9c76912f8ba03809a5b347cec38a9 (patch)
tree62c4462c94de94965be7f6def7f350404608998f /settings
parent889f0a1c6df51c5b6495445809143940ad17c327 (diff)
downloadnextcloud-server-1ce2cd73ffd9c76912f8ba03809a5b347cec38a9.tar.gz
nextcloud-server-1ce2cd73ffd9c76912f8ba03809a5b347cec38a9.zip
Add first version of backgroundjobs settings
Diffstat (limited to 'settings')
-rw-r--r--settings/ajax/setbackgroundjobsmode.php28
-rw-r--r--settings/js/admin.js8
-rwxr-xr-xsettings/templates/admin.php13
3 files changed, 48 insertions, 1 deletions
diff --git a/settings/ajax/setbackgroundjobsmode.php b/settings/ajax/setbackgroundjobsmode.php
new file mode 100644
index 00000000000..454b3caa5bf
--- /dev/null
+++ b/settings/ajax/setbackgroundjobsmode.php
@@ -0,0 +1,28 @@
+<?php
+/**
+* ownCloud
+*
+* @author Jakob Sack
+* @copyright 2012 Jakob Sack owncloud@jakobsack.de
+*
+* This library is free software; you can redistribute it and/or
+* modify it under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE
+* License as published by the Free Software Foundation; either
+* version 3 of the License, or any later version.
+*
+* This library is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+* GNU AFFERO GENERAL PUBLIC LICENSE for more details.
+*
+* You should have received a copy of the GNU Affero General Public
+* License along with this library. If not, see <http://www.gnu.org/licenses/>.
+*
+*/
+
+OC_Util::checkAdminUser();
+OCP\JSON::callCheck();
+
+OC_Appconfig::setValue( 'core', 'backgroundjob_mode', $_POST['mode'] );
+
+echo 'true';
diff --git a/settings/js/admin.js b/settings/js/admin.js
index 4f295ab6f5d..409594a4b94 100644
--- a/settings/js/admin.js
+++ b/settings/js/admin.js
@@ -3,5 +3,11 @@ $(document).ready(function(){
$.post(OC.filePath('settings','ajax','setloglevel.php'), { level: $(this).val() },function(){
OC.Log.reload();
} );
- })
+ });
+
+ $('#backgroundjobs input').change(function(){
+ if($(this).attr('checked')){
+ $.post(OC.filePath('settings','ajax','setbackgroundjobsmode.php'), { mode: $(this).val() });
+ }
+ });
}); \ No newline at end of file
diff --git a/settings/templates/admin.php b/settings/templates/admin.php
index 60b9732d7f4..318bfbbe196 100755
--- a/settings/templates/admin.php
+++ b/settings/templates/admin.php
@@ -24,6 +24,19 @@ if(!$_['htaccessworking']) {
<?php foreach($_['forms'] as $form){
echo $form;
};?>
+
+<fieldset class="personalblock" id="backgroundjobs">
+ <legend><strong><?php echo $l->t('Cron');?></strong></legend>
+ <input type="radio" name="mode" value="none" id="backgroundjobs_none">
+ <label for="backgroundjobs_none">None</label><br />
+ <input type="radio" name="mode" value="ajax" id="backgroundjobs_ajax">
+ <label for="backgroundjobs_ajax">AJAX</label><br />
+ <input type="radio" name="mode" value="webcron" id="backgroundjobs_webcron">
+ <label for="backgroundjobs_webcron">Webcron</label><br />
+ <input type="radio" name="mode" value="cron" id="backgroundjobs_cron">
+ <label for="backgroundjobs_cron">Cron</label><br />
+</fieldset>
+
<fieldset class="personalblock">
<legend><strong><?php echo $l->t('Log');?></strong></legend>
Log level: <select name='loglevel' id='loglevel'>