From 7cdd67068d41d9ef51b50ea2230abb88f1c40c68 Mon Sep 17 00:00:00 2001 From: 8chan Date: Sat, 9 May 2015 21:15:14 -0700 Subject: [PATCH] Fix some user adding errors --- inc/8chan-mod-pages.php | 2 +- inc/mod/pages.php | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/inc/8chan-mod-pages.php b/inc/8chan-mod-pages.php index 8d4acb7d..7569b986 100644 --- a/inc/8chan-mod-pages.php +++ b/inc/8chan-mod-pages.php @@ -118,7 +118,7 @@ $salt = generate_salt(); $password = hash('sha256', $salt . sha1($_POST['password'])); - $query = prepare('INSERT INTO ``mods`` VALUES (NULL, :username, :password, :salt, 19, :board)'); + $query = prepare('INSERT INTO ``mods`` VALUES (NULL, :username, :password, :salt, 19, :board, "")'); $query->bindValue(':username', $_POST['username']); $query->bindValue(':password', $password); $query->bindValue(':salt', $salt); diff --git a/inc/mod/pages.php b/inc/mod/pages.php index c24312f8..54356489 100644 --- a/inc/mod/pages.php +++ b/inc/mod/pages.php @@ -2122,12 +2122,13 @@ function mod_user_new() { $salt = generate_salt(); $password = hash('sha256', $salt . sha1($_POST['password'])); - $query = prepare('INSERT INTO ``mods`` VALUES (NULL, :username, :password, :salt, :type, :boards)'); + $query = prepare('INSERT INTO ``mods`` VALUES (NULL, :username, :password, :salt, :type, :boards, :email)'); $query->bindValue(':username', $_POST['username']); $query->bindValue(':password', $password); $query->bindValue(':salt', $salt); $query->bindValue(':type', $type); $query->bindValue(':boards', implode(',', $boards)); + $query->bindValue(':email', (isset($_POST['email']) ? $_POST['email'] : '')); $query->execute() or error(db_error($query)); $userID = $pdo->lastInsertId();