]> 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 5acd08ba608d0704b8d6a76e2152363ba4afe808..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);
@@ -102,7 +110,8 @@ class Routing
                $this->wallabag->login($this->referer);
         } elseif (isset($_GET['feed']) && isset($_GET['user_id'])) {
             $tag_id = (isset($_GET['tag_id']) ? intval($_GET['tag_id']) : 0);
-            $this->wallabag->generateFeeds($_GET['token'], filter_var($_GET['user_id'],FILTER_SANITIZE_NUMBER_INT), $tag_id, $_GET['type']);
+            $limit = (isset($_GET['limit']) ? intval($_GET['limit']) : 0);
+            $this->wallabag->generateFeeds($_GET['token'], filter_var($_GET['user_id'],FILTER_SANITIZE_NUMBER_INT), $tag_id, $_GET['type'], $limit);
         }
         
         //allowed ONLY to logged in user
@@ -115,7 +124,7 @@ class Routing
                 // update password
                 $this->wallabag->updatePassword($_POST['password'], $_POST['password_repeat']);
             } elseif (isset($_GET['newuser'])) {
-                $this->wallabag->createNewUser($_POST['newusername'], $_POST['password4newuser']);
+                $this->wallabag->createNewUser($_POST['newusername'], $_POST['password4newuser'], $_POST['newuseremail'], true);
             } elseif (isset($_GET['deluser'])) {
                 $this->wallabag->deleteUser($_POST['password4deletinguser']);
             } elseif (isset($_GET['epub'])) {