1
0
Fork 0
mirror of https://github.com/wallabag/wallabag.git synced 2025-08-01 17:38:38 +00:00

Installation mode

This commit is contained in:
Nicolas Lœuillet 2013-05-31 22:55:52 +02:00
parent baa8617364
commit aa8c9f2a32
8 changed files with 124 additions and 10 deletions

View file

@ -18,6 +18,7 @@ define ('ABS_PATH', 'assets/');
define ('CONVERT_LINKS_FOOTNOTES', TRUE);
define ('REVERT_FORCED_PARAGRAPH_ELEMENTS',FALSE);
define ('DOWNLOAD_PICTURES', TRUE);
define ('SALT', '464v54gLLw928uz4zUBqkRJeiPY68zCX');
$storage_type = 'sqlite'; # sqlite or file
include 'functions.php';
@ -33,9 +34,7 @@ require_once 'class.messages.php';
Session::init();
$store = new $storage_type();
$msg = new Messages();
$store = new $storage_type();
# initialisation de RainTPL
raintpl::$tpl_dir = './tpl/';
raintpl::$cache_dir = './cache/';
@ -43,4 +42,24 @@ raintpl::$base_url = get_poche_url();
raintpl::configure('path_replace', false);
raintpl::configure('debug', false);
$tpl = new raintpl();
if(!$store->isInstalled())
{
logm('poche still not installed');
$tpl->draw('install');
if (isset($_GET['install'])) {
if (($_POST['password'] == $_POST['password_repeat'])
&& $_POST['password'] != "" && $_POST['login'] != "") {
$store->install($_POST['login'], encode_string($_POST['password'] . $_POST['login']));
Session::logout();
MyTool::redirect();
}
}
exit();
}
$_SESSION['login'] = (isset ($_SESSION['login'])) ? $_SESSION['login'] : $store->getLogin();
$_SESSION['pass'] = (isset ($_SESSION['pass'])) ? $_SESSION['pass'] : $store->getPassword();
$msg = new Messages();
$tpl->assign('msg', $msg);