Browse Source

Fix bug with registration

pull/1/head
Foltik 7 years ago
parent
commit
58e1a9c8c9
2 changed files with 1 additions and 2 deletions
  1. +1
    -1
      includes/core.php
  2. +0
    -1
      templates/register/index.swig

+ 1
- 1
includes/core.php 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);


+ 0
- 1
templates/register/index.swig 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">


Loading…
Cancel
Save