]> git.immae.eu Git - github/wallabag/wallabag.git/blobdiff - inc/poche/Routing.class.php
[1203] fixing tag export
[github/wallabag/wallabag.git] / inc / poche / Routing.class.php
index b8cab0ec339ce57f0147228c2e5f27da1baa344b..138da48d33032a6d8369e5063d135f3ab2a4f44e 100755 (executable)
@@ -15,6 +15,7 @@ class Routing
     protected $view;
     protected $action;
     protected $id;
+    protected $autoclose;
     protected $url;
     protected $file;
     protected $defaultVars = array();
@@ -33,6 +34,7 @@ class Routing
         $this->view         = Tools::checkVar('view', 'home');
         $this->action       = Tools::checkVar('action');
         $this->id           = Tools::checkVar('id');
+        $this->autoclose    = Tools::checkVar('autoclose',FALSE);
         $_SESSION['sort']   = Tools::checkVar('sort', 'id');
         $this->url          = new Url((isset ($_GET['url'])) ? $_GET['url'] : '');
     }
@@ -64,9 +66,15 @@ class Routing
         $tplVars = array();
 
         if (\Session::isLogged()) {
-            $this->wallabag->action($this->action, $this->url, $this->id);
+            $this->wallabag->action($this->action, $this->url, $this->id, FALSE, $this->autoclose);
             $tplFile = Tools::getTplFile($this->view);
             $tplVars = array_merge($this->vars, $this->wallabag->displayView($this->view, $this->id));
+        } elseif(ALLOW_REGISTER && isset($_GET['registerform'])) {
+            Tools::logm('register');
+            $tplFile = Tools::getTplFile('register');
+        } elseif (ALLOW_REGISTER && isset($_GET['register'])){
+            $this->wallabag->createNewUser($_POST['newusername'], $_POST['password4newuser'], $_POST['newuseremail']);
+            Tools::redirect();
         } elseif(isset($_SERVER['PHP_AUTH_USER'])) {
             if($this->wallabag->store->userExists($_SERVER['PHP_AUTH_USER'])) {
                 $this->wallabag->login($this->referer);