aboutsummaryrefslogtreecommitdiffhomepage
path: root/inc
diff options
context:
space:
mode:
authortcit <tcit@tcit.fr>2014-09-28 17:31:02 +0200
committertcit <tcit@tcit.fr>2014-09-28 17:31:02 +0200
commitffcd442989d743e6e0c8e27a24ce9fdeefb277fc (patch)
treef8ff66aba36c3d6dcc570f75e7f08ce783d4709b /inc
parenta0822259e76fb5a52d268ba1671d13e0e512af94 (diff)
parent2e8625c25fa603d0d870bf2f90821e900be27fd0 (diff)
downloadwallabag-ffcd442989d743e6e0c8e27a24ce9fdeefb277fc.tar.gz
wallabag-ffcd442989d743e6e0c8e27a24ce9fdeefb277fc.tar.zst
wallabag-ffcd442989d743e6e0c8e27a24ce9fdeefb277fc.zip
get up to date for merge
Diffstat (limited to 'inc')
-rwxr-xr-xinc/poche/Database.class.php4
-rwxr-xr-xinc/poche/Poche.class.php5
2 files changed, 5 insertions, 4 deletions
diff --git a/inc/poche/Database.class.php b/inc/poche/Database.class.php
index dfd7ae34..b5dd2120 100755
--- a/inc/poche/Database.class.php
+++ b/inc/poche/Database.class.php
@@ -117,10 +117,10 @@ class Database {
117 $query = $this->executeQuery($sql, array()); 117 $query = $this->executeQuery($sql, array());
118 } 118 }
119 119
120 public function install($login, $password) 120 public function install($login, $password, $email = '')
121 { 121 {
122 $sql = 'INSERT INTO users ( username, password, name, email) VALUES (?, ?, ?, ?)'; 122 $sql = 'INSERT INTO users ( username, password, name, email) VALUES (?, ?, ?, ?)';
123 $params = array($login, $password, $login, ' '); 123 $params = array($login, $password, $login, $email);
124 $query = $this->executeQuery($sql, $params); 124 $query = $this->executeQuery($sql, $params);
125 125
126 $sequence = ''; 126 $sequence = '';
diff --git a/inc/poche/Poche.class.php b/inc/poche/Poche.class.php
index c80e5d2a..8cebafa3 100755
--- a/inc/poche/Poche.class.php
+++ b/inc/poche/Poche.class.php
@@ -74,12 +74,13 @@ class Poche
74 /** 74 /**
75 * Creates a new user 75 * Creates a new user
76 */ 76 */
77 public function createNewUser($username, $password) 77 public function createNewUser($username, $password, $email = "")
78 { 78 {
79 if (!empty($username) && !empty($password)){ 79 if (!empty($username) && !empty($password)){
80 $newUsername = filter_var($username, FILTER_SANITIZE_STRING); 80 $newUsername = filter_var($username, FILTER_SANITIZE_STRING);
81 $email = filter_var($email, FILTER_SANITIZE_STRING);
81 if (!$this->store->userExists($newUsername)){ 82 if (!$this->store->userExists($newUsername)){
82 if ($this->store->install($newUsername, Tools::encodeString($password . $newUsername))) { 83 if ($this->store->install($newUsername, Tools::encodeString($password . $newUsername), $email)) {
83 Tools::logm('The new user ' . $newUsername . ' has been installed'); 84 Tools::logm('The new user ' . $newUsername . ' has been installed');
84 $this->messages->add('s', sprintf(_('The new user %s has been installed. Do you want to <a href="?logout">logout ?</a>'), $newUsername)); 85 $this->messages->add('s', sprintf(_('The new user %s has been installed. Do you want to <a href="?logout">logout ?</a>'), $newUsername));
85 Tools::redirect(); 86 Tools::redirect();