From cc37d79c0dea9921a89968e4f5a36241d282d869 Mon Sep 17 00:00:00 2001 From: Michael Foster Date: Mon, 9 Sep 2013 01:38:32 +1000 Subject: [PATCH] Fix last commit. --- inc/mod/pages.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/inc/mod/pages.php b/inc/mod/pages.php index af8f7466..5af6dc10 100644 --- a/inc/mod/pages.php +++ b/inc/mod/pages.php @@ -1629,8 +1629,8 @@ function mod_user_new() { } } - $_POST['type'] = (int) $_POST['type']; - if ($_POST['type'] !== JANITOR && $_POST['type'] !== MOD && $_POST['type'] !== ADMIN) + $type = (int)$_POST['type']; + if (!isset($config['mod']['groups'][$type]) || $type == DISABLED) error(sprintf($config['error']['invalidfield'], 'type')); $salt = generate_salt(); @@ -1640,7 +1640,7 @@ function mod_user_new() { $query->bindValue(':username', $_POST['username']); $query->bindValue(':password', $password); $query->bindValue(':salt', $salt); - $query->bindValue(':type', $_POST['type']); + $query->bindValue(':type', $type); $query->bindValue(':boards', implode(',', $boards)); $query->execute() or error(db_error($query));