From: Thomas Citharel Date: Fri, 13 Feb 2015 18:15:31 +0000 (+0100) Subject: Merge branch 'dev' into register X-Git-Tag: 1.9beta~6^2~3 X-Git-Url: https://git.immae.eu/?a=commitdiff_plain;h=0eae6d14b8858005919cc3069799f77008a81d29;p=github%2Fwallabag%2Fwallabag.git Merge branch 'dev' into register --- 0eae6d14b8858005919cc3069799f77008a81d29 diff --cc inc/poche/Poche.class.php index 36c8693c,8ade91b4..cd7578e3 --- a/inc/poche/Poche.class.php +++ b/inc/poche/Poche.class.php @@@ -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); diff --cc inc/poche/Routing.class.php index 8d6abefd,82ff20d6..e9b67771 --- a/inc/poche/Routing.class.php +++ b/inc/poche/Routing.class.php @@@ -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);