1
0
mirror of https://github.com/Foltik/Shimapan synced 2024-11-13 00:26:55 -05:00

Fix bug with registration

This commit is contained in:
Foltik 2016-11-17 23:03:29 -05:00
parent cd19d485c4
commit 58e1a9c8c9
2 changed files with 1 additions and 2 deletions

View File

@ -16,7 +16,7 @@ function register($user, $pass, $code)
$q = $db->prepare("SELECT user FROM accounts WHERE user = (:user)");
$q->bindParam(':user', $user);
$q->execute();
if ($q->fetchColumn() == 0) {
if (!($result = $q->fetch())) {
// Add new account
$q = $db->prepare("INSERT INTO accounts (user, pass, level, apikey) VALUES (:user, :pass, :level, :apikey)");
$q->bindParam(':user', $user);

View File

@ -11,7 +11,6 @@
<form action="/includes/api.php?do=register" method="post">
<input type="text" name="user" placeholder="Username" required>
<input type="password" name="pass" placeholder="Password" required>
<input type="password" name="confirmpass" placeholder="Confirm Password" required>
<input type="text" name="code" placeholder="Invite Code" required>
<input type="submit" value="Register">
<footer class="clearfix">