You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@vcl.apache.org by jf...@apache.org on 2019/07/19 14:13:55 UTC

[vcl] 08/13: VCL-1114 - miscellaneous small web updates

This is an automated email from the ASF dual-hosted git repository.

jfthomps pushed a commit to branch VCL-1114_misc_small_web_updates
in repository https://gitbox.apache.org/repos/asf/vcl.git

commit b624b1a9d2f051884fcc08cc4f6aba8ee91c3cd9
Author: Josh Thompson <jf...@ncsu.edu>
AuthorDate: Thu Jun 13 14:11:05 2019 -0400

    VCL-1114 - miscellaneous small web updates
    
    computer.php: modified validateResourceData: added check for $return['name'] containing a % when adding multiple computers
---
 web/.ht-inc/computer.php | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/web/.ht-inc/computer.php b/web/.ht-inc/computer.php
index b67a75a..d1f6ca6 100644
--- a/web/.ht-inc/computer.php
+++ b/web/.ht-inc/computer.php
@@ -1757,6 +1757,11 @@ class Computer extends Resource {
 		}
 		# add multiple
 		if($return['mode'] == 'add' && $addmode == 'multiple') {
+			# ensure % in hostname
+			if(! preg_match('/%/', $return['name'])) {
+				$return['error'] = 1;
+				$errormsg[] = "Name must contain % when adding multiple computers";
+			}
 			# startnum/endnum
 			if($return['startnum'] < 0 || $return['startnum'] > 255) {
 				$return['error'] = 1;