1
0
mirror of https://github.com/vichan-devel/vichan.git synced 2025-01-31 12:23:48 +01:00

Fix some user adding errors

This commit is contained in:
8chan 2015-05-09 21:15:14 -07:00
parent d45852c3dd
commit 7cdd67068d
2 changed files with 3 additions and 2 deletions

View File

@ -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);

View File

@ -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();