diff --git a/configure.php b/configure.php index f810317..7e40ba0 100644 --- a/configure.php +++ b/configure.php @@ -43,7 +43,7 @@ $name = $_POST['author']; $pass = $_POST['pass']; $api_key = $_POST['api_key']; - $api_key_serverwide = isset($_POST['api_key_serverwide']) ? $_POST['api_key_serverwide'] : "off"; + $api_key_serverwide = isset($_POST['api_key_serverwide']) ? TRUE : FALSE; if (!preg_match('/^[\w\.\-\+]+@[a-zA-Z\d\.-]+\.[a-zA-Z]{2,}$/', $email)) { die('Bad input data; email'); @@ -99,7 +99,7 @@ 'configured'=>true, 'config_version'=>CONFIG_VERSION ]; - if ($api_key_serverwide=="on") { + if ($api_key_serverwide) { $config_contents['api_key'] = $api_key; } @@ -115,7 +115,7 @@ name TEXT PRIMARY KEY, time_stamp INTEGER, info TEXT - "; + )"; $db->execute($sql); $sql = "CREATE TABLE modpacks ( id INTEGER PRIMARY KEY AUTOINCREMENT, @@ -191,7 +191,7 @@ name VARCHAR(128) PRIMARY KEY, time_stamp BIGINT UNSIGNED, info TEXT - "; + )"; $db->execute($sql); $sql = "CREATE TABLE modpacks ( id INTEGER UNSIGNED AUTO_INCREMENT PRIMARY KEY, @@ -265,10 +265,10 @@ } // if user already exists, replace - $userexistsq = $db->query("SELECT 1 FORM users WHERE name='".$db->sanitize($email)."'"); + $userexistsq = $db->query("SELECT 1 FROM users WHERE name='".$db->sanitize($email)."'"); if ($userexistsq && sizeof($userexistsq)==1) { // `name` is unique if (OVERWRITE_USER) { - $db->execute("DELETE FORM users WHERE name='".$db->sanitize($email)."'"); + $db->execute("DELETE FROM users WHERE name='".$db->sanitize($email)."'"); } else { die("User with that email exists. Please go back and try again with different information."); } @@ -370,8 +370,8 @@