diff --git a/apps/files_external/css/settings.css b/apps/files_external/css/settings.css index 11aeb10184ba246384f159fc2d03db620ae01d15..1d3489f7f57a84021704631a94fc36598808bd7d 100644 --- a/apps/files_external/css/settings.css +++ b/apps/files_external/css/settings.css @@ -4,13 +4,6 @@ td.status > span { width: 16px; vertical-align: text-bottom; } -span.success { - background: #37ce02; - border-radius: 8px; -} -span.error { - background: #ce3702; -} td.mountPoint, td.backend { width:160px; } td.remove>img { visibility:hidden; padding-top:13px; } diff --git a/config/config.sample.php b/config/config.sample.php index 987a866e49beeb906ab2df44e2ee5d2dbcf296b9..891c2eb5fa1fe92afe0539239abb8f964379e7ac 100755 --- a/config/config.sample.php +++ b/config/config.sample.php @@ -178,6 +178,9 @@ $CONFIG = array( /* Enable or disable the logging of IP addresses in case of webform auth failures */ "log_authfailip" => false, +/* Whether ownCloud should log the last successfull cron exec */ +"cron_log" => true, + /* Whether http-basic username must equal username to login */ "basic_auth" => true, diff --git a/cron.php b/cron.php index a0447f97f190bb54795203e14f49a5f10fd25a12..05d47124da062764b0681b7c5622085df00ef3dc 100644 --- a/cron.php +++ b/cron.php @@ -119,6 +119,10 @@ try { // done! TemporaryCronClass::$sent = true; + // Log the successfull cron exec + if (OC_Config::getValue('cron_log', true)) { + OC_Appconfig::setValue('core', 'lastcron', time()); + } exit(); } catch (Exception $ex) { diff --git a/settings/admin.php b/settings/admin.php index 80b038d2ef61c2c964d18e7cc4cafb118f7061c8..23b3a2d5a0e765dab5f1fc86b1a2394d0b7e506c 100755 --- a/settings/admin.php +++ b/settings/admin.php @@ -45,6 +45,8 @@ $tmpl->assign('isWebDavWorking', OC_Util::isWebDAVWorking()); $tmpl->assign('has_fileinfo', OC_Util::fileInfoLoaded()); $tmpl->assign('old_php', OC_Util::isPHPoutdated()); $tmpl->assign('backgroundjobs_mode', OC_Appconfig::getValue('core', 'backgroundjobs_mode', 'ajax')); +$tmpl->assign('cron_log', OC_Config::getValue('cron_log', true)); +$tmpl->assign('lastcron', OC_Appconfig::getValue('core', 'lastcron', false)); $tmpl->assign('shareAPIEnabled', OC_Appconfig::getValue('core', 'shareapi_enabled', 'yes')); // Check if connected using HTTPS diff --git a/settings/css/settings.css b/settings/css/settings.css index a47e7bf6563e9cde389b48d9a48fddbdfe9b899b..280d022af4eaa840a54976144b7048e79c01142d 100644 --- a/settings/css/settings.css +++ b/settings/css/settings.css @@ -167,6 +167,26 @@ table.shareAPI td { padding-bottom: 0.8em; } width: 40px; } +.cronlog { + margin-left: 10px; +} + +.cronstatus { + display: inline-block; + height: 16px; + width: 16px; + vertical-align: text-bottom; +} + +span.success { + background: #37ce02; + border-radius: 8px; +} + +span.error { + background: #ce3702; +} + /* HELP */ .pressed {background-color:#DDD;} diff --git a/settings/templates/admin.php b/settings/templates/admin.php index 6e816c1fff6472b818fbc82b23d71095e5ea9374..9092d2833fd38c7f68190afabf37a816ff00a303 100644 --- a/settings/templates/admin.php +++ b/settings/templates/admin.php @@ -157,7 +157,24 @@ if (!$_['internetconnectionworking']) { ;?> <fieldset class="personalblock" id="backgroundjobs"> - <h2><?php p($l->t('Cron'));?></h2> + <h2 class="inlineblock"><?php p($l->t('Cron'));?></h2> + <?php if ($_['cron_log']): ?> + <p class="cronlog inlineblock"> + <?php if ($_['lastcron'] !== false): + $human_time = OC_Util::formatDate($_['lastcron']) . " UTC"; + if (time() - $_['lastcron'] <= 3600): ?> + <span class="cronstatus success"></span> + <?php p($l->t("Last cron was executed at %s.", array($human_time))); + else: ?> + <span class="cronstatus error"></span> + <?php p($l->t("Last cron was executed at %s. This is more than an hour ago, something seems wrong.", array($human_time))); + endif; + else: ?> + <span class="cronstatus error"></span> + <?php p($l->t("Cron was not executed yet!")); + endif; ?> + </p> + <?php endif; ?> <p> <input type="radio" name="mode" value="ajax" id="backgroundjobs_ajax" <?php if ($_['backgroundjobs_mode'] === "ajax") {