]> git.immae.eu Git - github/wallabag/wallabag.git/commitdiff
Merge branch 'dev' into register
authorThomas Citharel <tcit@tcit.fr>
Fri, 13 Feb 2015 18:15:31 +0000 (19:15 +0100)
committerThomas Citharel <tcit@tcit.fr>
Fri, 13 Feb 2015 18:15:31 +0000 (19:15 +0100)
1  2 
inc/poche/Poche.class.php
inc/poche/Routing.class.php
inc/poche/config.inc.default.php

index 36c8693c15380d75940d6e2485682e4cbcfd548b,8ade91b4852900e8b20da18666d02bfb60d2a1d8..cd7578e3401ad4966e6f74ac013b9714c8717f5b
@@@ -74,9 -74,8 +74,9 @@@ class Poch
      /**
       * Creates a new user
       */
-     public function createNewUser($username, $password, $email = "")
+     public function createNewUser($username, $password, $email = "", $internalRegistration = false)
      {
 +        Tools::logm('Trying to create a new user...');
          if (!empty($username) && !empty($password)){
              $newUsername = filter_var($username, FILTER_SANITIZE_STRING);
              $email = filter_var($email, FILTER_SANITIZE_STRING);
index 8d6abefde615b931e7cde4a351095653286f9542,82ff20d67b3ff2318638dd25e768c0c8a373fb87..e9b67771791c59ce1ffd0f4616da489b491a8e13
@@@ -64,15 -65,9 +65,15 @@@ class Routin
          $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']);
 +            Tools::redirect();
          } elseif(isset($_SERVER['PHP_AUTH_USER'])) {
              if($this->wallabag->store->userExists($_SERVER['PHP_AUTH_USER'])) {
                  $this->wallabag->login($this->referer);
Simple merge