blob: 71d5071a45afd6537e08e57a3832cfed2d41b093 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
|
<?php
class Page_Main extends Page
{
private $sysconfig;
private $minilinux;
private $vmstore;
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);
}
protected function doRender()
{
// Render::setTitle('abc');
if (!User::isLoggedIn()) {
Render::addTemplate('page-main-guest', array(
'register' => (Database::queryFirst('SELECT userid FROM user LIMIT 1') === false)
));
return;
}
// Logged in here
Render::addTemplate('page-main', array(
'user' => User::getName(),
'sysconfig' => $this->sysconfig,
'minilinux' => $this->minilinux,
'vmstore' => $this->vmstore
));
}
}
|