diff options
author | Philip Häusler <msquare@notrademark.de> | 2015-12-29 21:50:09 +0100 |
---|---|---|
committer | Philip Häusler <msquare@notrademark.de> | 2015-12-29 21:50:09 +0100 |
commit | 1983db901b9b7ea9b87a66ed38f030369dc3a0a4 (patch) | |
tree | 3394ff6fb7b5636eb407af149dbf3c4670e4ec2f /includes/pages | |
parent | 2af1fd582e08b2cffcfebe0b88713b7a15fb5de6 (diff) |
better error message for creating room with name that is already used
Diffstat (limited to 'includes/pages')
-rw-r--r-- | includes/pages/admin_rooms.php | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/includes/pages/admin_rooms.php b/includes/pages/admin_rooms.php index 38a8c302..5287191c 100644 --- a/includes/pages/admin_rooms.php +++ b/includes/pages/admin_rooms.php @@ -54,9 +54,13 @@ function admin_rooms() { if (isset($_REQUEST['submit'])) { $ok = true; - if (isset($_REQUEST['name']) && strlen(strip_request_item('name')) > 0) + if (isset($_REQUEST['name']) && strlen(strip_request_item('name')) > 0) { $name = strip_request_item('name'); - else { + if (isset($room) && sql_num_query("SELECT * FROM `Room` WHERE `Name`='" . sql_escape($name) . "'") > 0) { + $ok = false; + $msg .= error(_("This name is already in use."), true); + } + } else { $ok = false; $msg .= error(_("Please enter a name."), true); } |