X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=index.php;h=7b775c41609868000250babef09c7e1cd77006ca;hb=d11e2bcf48badc1da0e3914eec49d9ab1d781f4d;hp=d0dd4ab5070da8150299509dedbe949423602965;hpb=6fb3a2a18591a4c79e91a90282d88cd84554f83c;p=github%2Fwallabag%2Fwallabag.git diff --git a/index.php b/index.php index d0dd4ab5..7b775c41 100644 --- a/index.php +++ b/index.php @@ -8,15 +8,23 @@ * @license http://www.wtfpl.net/ see COPYING file */ +if (file_exists(__DIR__ . '/inc/poche/myconfig.inc.php')) { + require_once __DIR__ . '/inc/poche/myconfig.inc.php'; +} +require_once './inc/poche/Tools.class.php'; +Tools::createMyConfig(); + include dirname(__FILE__).'/inc/poche/config.inc.php'; +# Parse GET & REFERER vars $referer = empty($_SERVER['HTTP_REFERER']) ? '' : $_SERVER['HTTP_REFERER']; $view = Tools::checkVar('view', 'home'); $action = Tools::checkVar('action'); $id = Tools::checkVar('id'); -$_SESSION['sort'] = Tools::checkVar('sort'); +$_SESSION['sort'] = Tools::checkVar('sort', 'id'); $url = new Url((isset ($_GET['url'])) ? $_GET['url'] : ''); +# poche actions if (isset($_GET['login'])) { # hello you $poche->login($referer); @@ -30,12 +38,17 @@ elseif (isset($_GET['config'])) { $poche->updatePassword(); } elseif (isset($_GET['import'])) { - $poche->import($_GET['from']); + $import = $poche->import($_GET['from']); } elseif (isset($_GET['export'])) { $poche->export(); } +elseif (isset($_GET['plainurl']) && !empty($_GET['plainurl'])) { + $plain_url = new Url(base64_encode($_GET['plainurl'])); + $poche->action('add', $plain_url); +} +# vars to send to templates $tpl_vars = array( 'referer' => $referer, 'view' => $view, @@ -57,5 +70,5 @@ else { $messages = $poche->messages->display('all', FALSE); $tpl_vars = array_merge($tpl_vars, array('messages' => $messages)); -# Aaaaaaand action ! +# display poche echo $poche->tpl->render($tpl_file, $tpl_vars); \ No newline at end of file