]> git.immae.eu Git - github/wallabag/wallabag.git/blame - inc/config.php
update password in config screen
[github/wallabag/wallabag.git] / inc / config.php
CommitLineData
e46efced 1<?php
2/**
3 * poche, a read it later open source system
4 *
5 * @category poche
6 * @author Nicolas Lœuillet <nicolas@loeuillet.org>
7 * @copyright 2013
8 * @license http://www.wtfpl.net/ see COPYING file
9 */
1c182b6c 10
69ca1455 11define ('POCHE_VERSION', '0.2.1');
bf18db78 12
d178419c 13if (!is_dir('db/')) {
14 @mkdir('db/',0705);
15}
16
d178419c 17define ('ABS_PATH', 'assets/');
d06f30ef 18define ('CONVERT_LINKS_FOOTNOTES', TRUE);
2987031b 19define ('REVERT_FORCED_PARAGRAPH_ELEMENTS',FALSE);
64458521 20define ('DOWNLOAD_PICTURES', TRUE);
aa8c9f2a 21define ('SALT', '464v54gLLw928uz4zUBqkRJeiPY68zCX');
14890de3 22$storage_type = 'sqlite'; # sqlite or file
e46efced 23
e46efced 24include 'functions.php';
25require_once 'Readability.php';
26require_once 'Encoding.php';
8046748b 27require_once 'rain.tpl.class.php';
e4d2565e 28require_once 'MyTool.class.php';
29require_once 'Session.class.php';
14890de3 30require_once 'store/store.class.php';
31require_once 'store/sqlite.class.php';
32require_once 'store/file.class.php';
f0070a15 33require_once 'class.messages.php';
8046748b 34
f0070a15 35Session::init();
36
aa8c9f2a 37$store = new $storage_type();
e4d2565e 38# initialisation de RainTPL
8046748b 39raintpl::$tpl_dir = './tpl/';
40raintpl::$cache_dir = './cache/';
41raintpl::$base_url = get_poche_url();
42raintpl::configure('path_replace', false);
43raintpl::configure('debug', false);
f0070a15 44$tpl = new raintpl();
aa8c9f2a
NL
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();
f0070a15 65$tpl->assign('msg', $msg);