diff --git a/includes/core.php b/includes/core.php index b07e439..7d94f25 100644 --- a/includes/core.php +++ b/includes/core.php @@ -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); diff --git a/templates/register/index.swig b/templates/register/index.swig index 5ee6f1d..745bb2d 100644 --- a/templates/register/index.swig +++ b/templates/register/index.swig @@ -11,7 +11,6 @@
-