diff options
| author | Michael Save <savetheinternet@tinyboard.org> | 2012-05-07 14:08:40 +1000 |
|---|---|---|
| committer | Michael Save <savetheinternet@tinyboard.org> | 2012-05-07 14:08:40 +1000 |
| commit | e132e4c2b3dc62c2ddb6bdbcc562e67fa61c9fa8 (patch) | |
| tree | 166609239b13a39305de03f2dbacbdff6bfcb978 /inc | |
| parent | 8ea20109fe9f4f971ebf2c54b6a4f5ac4d9dd663 (diff) | |
a few permissions-related bugs
Diffstat (limited to 'inc')
| -rw-r--r-- | inc/mod/pages.php | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/inc/mod/pages.php b/inc/mod/pages.php index c56570a5..11e89b9a 100644 --- a/inc/mod/pages.php +++ b/inc/mod/pages.php @@ -969,6 +969,11 @@ function mod_user($uid) { } function mod_user_new() { + global $pdo; + + if (!hasPermission($config['mod']['createusers'])) + error($config['error']['noaccess']); + if (isset($_POST['username'], $_POST['password'], $_POST['type'])) { if ($_POST['username'] == '') error(sprintf($config['error']['required'], 'username')); @@ -1001,6 +1006,10 @@ function mod_user_new() { $query->bindValue(':boards', implode(',', $boards)); $query->execute() or error(db_error($query)); + $uid = $pdo->lastInsertId(); + + modLog('Created a new user: ' . utf8tohtml($_POST['username']) . ' <small>(#' . $userID . ')</small>'); + header('Location: ?/users', true, $config['redirect_http']); return; } @@ -1040,6 +1049,9 @@ function mod_user_promote($uid, $action) { function mod_pm($id, $reply = false) { global $mod, $config; + if ($reply && !hasPermission($config['mod']['create_pm'])) + error($config['error']['noaccess']); + $query = prepare("SELECT `mods`.`username`, `mods_to`.`username` AS `to_username`, `pms`.* FROM `pms` LEFT JOIN `mods` ON `mods`.`id` = `sender` LEFT JOIN `mods` AS `mods_to` ON `mods_to`.`id` = `to` WHERE `pms`.`id` = :id"); $query->bindValue(':id', $id); $query->execute() or error(db_error($query)); |
