From 046b9316244c7a3a19446b2425d2370a26246af0 Mon Sep 17 00:00:00 2001 From: tcit Date: Fri, 25 Jul 2014 08:42:03 +0200 Subject: [PATCH] added email field --- inc/poche/Database.class.php | 4 ++-- inc/poche/Poche.class.php | 5 +++-- inc/poche/Routing.class.php | 2 +- install/index.php | 4 +++- themes/baggy/config.twig | 8 ++++++-- themes/baggy/css/main.css | 2 +- 6 files changed, 16 insertions(+), 9 deletions(-) diff --git a/inc/poche/Database.class.php b/inc/poche/Database.class.php index 2c80b64b..8b52a9df 100755 --- a/inc/poche/Database.class.php +++ b/inc/poche/Database.class.php @@ -113,10 +113,10 @@ class Database { $query = $this->executeQuery($sql, array()); } - public function install($login, $password) + public function install($login, $password, $email = '') { $sql = 'INSERT INTO users ( username, password, name, email) VALUES (?, ?, ?, ?)'; - $params = array($login, $password, $login, ' '); + $params = array($login, $password, $login, $email); $query = $this->executeQuery($sql, $params); $sequence = ''; diff --git a/inc/poche/Poche.class.php b/inc/poche/Poche.class.php index a49413f2..c8a09f30 100755 --- a/inc/poche/Poche.class.php +++ b/inc/poche/Poche.class.php @@ -74,12 +74,13 @@ class Poche /** * Creates a new user */ - public function createNewUser($username, $password) + public function createNewUser($username, $password, $email = "") { if (!empty($username) && !empty($password)){ $newUsername = filter_var($username, FILTER_SANITIZE_STRING); + $email = filter_var($email, FILTER_SANITIZE_STRING); if (!$this->store->userExists($newUsername)){ - if ($this->store->install($newUsername, Tools::encodeString($password . $newUsername))) { + if ($this->store->install($newUsername, Tools::encodeString($password . $newUsername), $email)) { Tools::logm('The new user ' . $newUsername . ' has been installed'); $this->messages->add('s', sprintf(_('The new user %s has been installed. Do you want to logout ?'), $newUsername)); Tools::redirect(); diff --git a/inc/poche/Routing.class.php b/inc/poche/Routing.class.php index 2db57d12..6643397a 100644 --- a/inc/poche/Routing.class.php +++ b/inc/poche/Routing.class.php @@ -107,7 +107,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']); } elseif (isset($_GET['deluser'])) { $this->wallabag->deleteUser($_POST['password4deletinguser']); } elseif (isset($_GET['epub'])) { diff --git a/install/index.php b/install/index.php index 1ae782a2..9ed62de1 100755 --- a/install/index.php +++ b/install/index.php @@ -292,9 +292,11 @@ php composer.phar install

+

- + +

diff --git a/themes/baggy/config.twig b/themes/baggy/config.twig index 46735f07..ccdd2273 100755 --- a/themes/baggy/config.twig +++ b/themes/baggy/config.twig @@ -138,11 +138,15 @@
- +
- + +
+
+ +
diff --git a/themes/baggy/css/main.css b/themes/baggy/css/main.css index 6d320cd2..ad68c7b5 100755 --- a/themes/baggy/css/main.css +++ b/themes/baggy/css/main.css @@ -89,7 +89,7 @@ form fieldset { margin: 0; } -form input[type="text"], select, form input[type="password"], form input[type="url"] { +form input[type="text"], select, form input[type="password"], form input[type="url"], form input[type="email"] { border: 1px solid #999; padding: 0.5em 1em; min-width: 12em; -- 2.41.0