diff options
Diffstat (limited to 'inc/config.php')
-rw-r--r-- | inc/config.php | 25 |
1 files changed, 22 insertions, 3 deletions
diff --git a/inc/config.php b/inc/config.php index 737f5215..2de725f4 100644 --- a/inc/config.php +++ b/inc/config.php | |||
@@ -18,6 +18,7 @@ define ('ABS_PATH', 'assets/'); | |||
18 | define ('CONVERT_LINKS_FOOTNOTES', TRUE); | 18 | define ('CONVERT_LINKS_FOOTNOTES', TRUE); |
19 | define ('REVERT_FORCED_PARAGRAPH_ELEMENTS',FALSE); | 19 | define ('REVERT_FORCED_PARAGRAPH_ELEMENTS',FALSE); |
20 | define ('DOWNLOAD_PICTURES', TRUE); | 20 | define ('DOWNLOAD_PICTURES', TRUE); |
21 | define ('SALT', '464v54gLLw928uz4zUBqkRJeiPY68zCX'); | ||
21 | $storage_type = 'sqlite'; # sqlite or file | 22 | $storage_type = 'sqlite'; # sqlite or file |
22 | 23 | ||
23 | include 'functions.php'; | 24 | include 'functions.php'; |
@@ -33,9 +34,7 @@ require_once 'class.messages.php'; | |||
33 | 34 | ||
34 | Session::init(); | 35 | Session::init(); |
35 | 36 | ||
36 | $store = new $storage_type(); | 37 | $store = new $storage_type(); |
37 | $msg = new Messages(); | ||
38 | |||
39 | # initialisation de RainTPL | 38 | # initialisation de RainTPL |
40 | raintpl::$tpl_dir = './tpl/'; | 39 | raintpl::$tpl_dir = './tpl/'; |
41 | raintpl::$cache_dir = './cache/'; | 40 | raintpl::$cache_dir = './cache/'; |
@@ -43,4 +42,24 @@ raintpl::$base_url = get_poche_url(); | |||
43 | raintpl::configure('path_replace', false); | 42 | raintpl::configure('path_replace', false); |
44 | raintpl::configure('debug', false); | 43 | raintpl::configure('debug', false); |
45 | $tpl = new raintpl(); | 44 | $tpl = new raintpl(); |
45 | |||
46 | if(!$store->isInstalled()) | ||
47 | { | ||
48 | logm('poche still not installed'); | ||
49 | $tpl->draw('install'); | ||
50 | if (isset($_GET['install'])) { | ||
51 | if (($_POST['password'] == $_POST['password_repeat']) | ||
52 | && $_POST['password'] != "" && $_POST['login'] != "") { | ||
53 | $store->install($_POST['login'], encode_string($_POST['password'] . $_POST['login'])); | ||
54 | Session::logout(); | ||
55 | MyTool::redirect(); | ||
56 | } | ||
57 | } | ||
58 | exit(); | ||
59 | } | ||
60 | |||
61 | $_SESSION['login'] = (isset ($_SESSION['login'])) ? $_SESSION['login'] : $store->getLogin(); | ||
62 | $_SESSION['pass'] = (isset ($_SESSION['pass'])) ? $_SESSION['pass'] : $store->getPassword(); | ||
63 | |||
64 | $msg = new Messages(); | ||
46 | $tpl->assign('msg', $msg); \ No newline at end of file | 65 | $tpl->assign('msg', $msg); \ No newline at end of file |