aboutsummaryrefslogtreecommitdiffhomepage
path: root/inc/config.php
diff options
context:
space:
mode:
Diffstat (limited to 'inc/config.php')
-rw-r--r--inc/config.php25
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/');
18define ('CONVERT_LINKS_FOOTNOTES', TRUE); 18define ('CONVERT_LINKS_FOOTNOTES', TRUE);
19define ('REVERT_FORCED_PARAGRAPH_ELEMENTS',FALSE); 19define ('REVERT_FORCED_PARAGRAPH_ELEMENTS',FALSE);
20define ('DOWNLOAD_PICTURES', TRUE); 20define ('DOWNLOAD_PICTURES', TRUE);
21define ('SALT', '464v54gLLw928uz4zUBqkRJeiPY68zCX');
21$storage_type = 'sqlite'; # sqlite or file 22$storage_type = 'sqlite'; # sqlite or file
22 23
23include 'functions.php'; 24include 'functions.php';
@@ -33,9 +34,7 @@ require_once 'class.messages.php';
33 34
34Session::init(); 35Session::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
40raintpl::$tpl_dir = './tpl/'; 39raintpl::$tpl_dir = './tpl/';
41raintpl::$cache_dir = './cache/'; 40raintpl::$cache_dir = './cache/';
@@ -43,4 +42,24 @@ raintpl::$base_url = get_poche_url();
43raintpl::configure('path_replace', false); 42raintpl::configure('path_replace', false);
44raintpl::configure('debug', false); 43raintpl::configure('debug', false);
45$tpl = new raintpl(); 44$tpl = new raintpl();
45
46if(!$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