/**
* 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);
$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);