mirror of
https://github.com/wallabag/wallabag.git
synced 2025-09-15 18:57:05 +00:00
added email field
This commit is contained in:
parent
2b58426b2d
commit
046b931624
6 changed files with 16 additions and 9 deletions
|
@ -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 = '';
|
||||
|
|
|
@ -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 <a href="?logout">logout ?</a>'), $newUsername));
|
||||
Tools::redirect();
|
||||
|
|
|
@ -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'])) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue