diff options
author | Ermal Luçi <eri@pfsense.org> | 2013-06-22 03:55:15 -0700 |
---|---|---|
committer | Ermal Luçi <eri@pfsense.org> | 2013-06-22 03:55:15 -0700 |
commit | e06263e11269f15010e5a76ff5334b37c94be0ef (patch) | |
tree | e0ef425b3da209930aaf1a1faf55b6e6121e28a4 | |
parent | b6aecb2798235c86c6378041b37a7580c2c7cc6a (diff) | |
parent | 3db408b30388f1bade99c65629bbe74310e69de4 (diff) | |
download | pfsense-e06263e11269f15010e5a76ff5334b37c94be0ef.zip pfsense-e06263e11269f15010e5a76ff5334b37c94be0ef.tar.gz |
Merge pull request #674 from PiBa-NL/SystemGroupmanager_16charName
System: Group manager, set max length for groupname to 16 characters
-rw-r--r-- | usr/local/www/system_groupmanager.php | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/usr/local/www/system_groupmanager.php b/usr/local/www/system_groupmanager.php index ed2cd31..27cd2f2 100644 --- a/usr/local/www/system_groupmanager.php +++ b/usr/local/www/system_groupmanager.php @@ -120,7 +120,10 @@ if ($_POST) { if (preg_match("/[^a-zA-Z0-9\.\-_ ]/", $_POST['groupname'])) $input_errors[] = gettext("The group name contains invalid characters."); - + + if (strlen($_POST['groupname']) > 16) + $input_errors[] = gettext("The group name is longer than 16 characters."); + if (!$input_errors && !(isset($id) && $a_group[$id])) { /* make sure there are no dupes */ foreach ($a_group as $group) { @@ -268,7 +271,7 @@ function presubmit() { <tr> <td width="22%" valign="top" class="vncellreq"><?=gettext("Group name");?></td> <td width="78%" class="vtable"> - <input name="groupname" type="text" class="formfld group" id="groupname" size="20" value="<?=htmlspecialchars($pconfig['name']);?>" <?=$ro;?> /> + <input name="groupname" type="text" class="formfld group" id="groupname" size="20" maxlength="16" value="<?=htmlspecialchars($pconfig['name']);?>" <?=$ro;?> /> </td> </tr> <tr> |