diff options
Diffstat (limited to 'modules/main.inc.php')
-rw-r--r-- | modules/main.inc.php | 22 |
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'); + } + } |