+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', 'id');
+$url = new Url((isset ($_GET['url'])) ? $_GET['url'] : '');
+
+# poche actions
+if (isset($_GET['login'])) {
+ # hello you
+ $poche->login($referer);
+}
+elseif (isset($_GET['logout'])) {
+ # see you soon !
+ $poche->logout();
+}
+elseif (isset($_GET['config'])) {
+ # Update password
+ $poche->updatePassword();
+}
+elseif (isset($_GET['import'])) {
+ $import = $poche->import($_GET['from']);
+}
+elseif (isset($_GET['export'])) {
+ $poche->export();
+}