summaryrefslogtreecommitdiffstats
path: root/modules-available/backup/hooks/main-warning.inc.php
diff options
context:
space:
mode:
authorSimon Rettberg2017-11-14 15:22:20 +0100
committerSimon Rettberg2017-11-14 15:22:20 +0100
commit0069cd4feef49116af7819fcfc7fbc4aae9628f0 (patch)
treeaa6aabad821afa12cdfe8d32de8f709f0fc3ff0b /modules-available/backup/hooks/main-warning.inc.php
parent[exams/roomplanner] Smarter coordination of run mode (exam mode on/off etc) (diff)
downloadslx-admin-0069cd4feef49116af7819fcfc7fbc4aae9628f0.tar.gz
slx-admin-0069cd4feef49116af7819fcfc7fbc4aae9628f0.tar.xz
slx-admin-0069cd4feef49116af7819fcfc7fbc4aae9628f0.zip
[backup] Show warning on main page when last backup was more than 30 days ago
Diffstat (limited to 'modules-available/backup/hooks/main-warning.inc.php')
-rw-r--r--modules-available/backup/hooks/main-warning.inc.php8
1 files changed, 8 insertions, 0 deletions
diff --git a/modules-available/backup/hooks/main-warning.inc.php b/modules-available/backup/hooks/main-warning.inc.php
new file mode 100644
index 00000000..0a0be7cc
--- /dev/null
+++ b/modules-available/backup/hooks/main-warning.inc.php
@@ -0,0 +1,8 @@
+<?php
+
+$last = Property::get('backup.last-time', 0);
+if ($last === 0) {
+ Message::addWarning('backup.last-time-unknown', true);
+} elseif ($last + (30 * 86400) < time()) {
+ Message::addWarning('backup.last-time', true, date('d.m.Y', $last));
+}