summaryrefslogtreecommitdiffstats
path: root/modules/main.inc.php
diff options
context:
space:
mode:
authorSimon Rettberg2015-09-17 18:07:49 +0200
committerSimon Rettberg2015-09-17 18:07:49 +0200
commit910524758435c709ed656e5e496ec0e542de60f0 (patch)
treefebdd29ea602931149cb6e22538645be0fb7fff1 /modules/main.inc.php
parent[dozmod] Change deletestate name (diff)
downloadslx-admin-910524758435c709ed656e5e496ec0e542de60f0.tar.gz
slx-admin-910524758435c709ed656e5e496ec0e542de60f0.tar.xz
slx-admin-910524758435c709ed656e5e496ec0e542de60f0.zip
Change some wording, add deletion reminder to main page
Diffstat (limited to 'modules/main.inc.php')
-rw-r--r--modules/main.inc.php22
1 files changed, 17 insertions, 5 deletions
diff --git a/modules/main.inc.php b/modules/main.inc.php
index 71d5071a..edff14e0 100644
--- a/modules/main.inc.php
+++ b/modules/main.inc.php
@@ -6,14 +6,19 @@ class Page_Main extends Page
private $sysconfig;
private $minilinux;
private $vmstore;
+ private $delPending;
protected function doPreprocess()
{
User::load();
- $this->sysconfig = !file_exists(CONFIG_HTTP_DIR . '/default/config.tgz');
- $this->minilinux = !file_exists(CONFIG_HTTP_DIR . '/default/kernel') || !file_exists(CONFIG_HTTP_DIR . '/default/initramfs-stage31') || !file_exists(CONFIG_HTTP_DIR . '/default/stage32.sqfs');
- $this->vmstore = !is_array(Property::getVmStoreConfig());
- Property::setNeedsSetup(($this->sysconfig || $this->minilinux || $this->vmstore) ? 1 : 0);
+ if (User::isLoggedIn()) {
+ $this->sysconfig = !file_exists(CONFIG_HTTP_DIR . '/default/config.tgz');
+ $this->minilinux = !file_exists(CONFIG_HTTP_DIR . '/default/kernel') || !file_exists(CONFIG_HTTP_DIR . '/default/initramfs-stage31') || !file_exists(CONFIG_HTTP_DIR . '/default/stage32.sqfs');
+ $this->vmstore = !is_array(Property::getVmStoreConfig());
+ Property::setNeedsSetup(($this->sysconfig || $this->minilinux || $this->vmstore) ? 1 : 0);
+ $res = Database::queryFirst("SELECT Count(*) AS cnt FROM sat.imageversion WHERE deletestate = 'SHOULD_DELETE'");
+ $this->delPending = isset($res['cnt']) ? $res['cnt'] : 0;
+ }
}
protected function doRender()
@@ -32,8 +37,15 @@ class Page_Main extends Page
'user' => User::getName(),
'sysconfig' => $this->sysconfig,
'minilinux' => $this->minilinux,
- 'vmstore' => $this->vmstore
+ 'vmstore' => $this->vmstore,
+ 'delpending' => $this->delPending
));
}
+ protected function doAjax()
+ {
+ User::isLoggedIn();
+ die('Status: DB running');
+ }
+
}