[prev in list] [next in list] [prev in thread] [next in thread] 

List:       helix-server-cvs
Subject:    [Server-cvs] admin/web/build/server config_drm.html, 1.4.2.11, 1.4.2.12
From:       packard () helixcommunity ! org
Date:       2012-10-19 10:05:04
[Download RAW message or body]

Update of /cvsroot/server/admin/web/build/server
In directory cvs01.internal.helixcommunity.org:/tmp/cvs-serv32740

Modified Files:
      Tag: SERVER_15_0
	config_drm.html 
Log Message:

synopsis: 
===============
fix 270790:     [Verimatrix DRM]Set Live Resource ID Range or On-demand Resource ID \
Range to invalid val

Branch: SERVER_15_0_RN, HEAD

Suggested Reviewers: Anyone

Description: 
===============
Version: 15.0.0.249
servproxyall-101712-18684
Platform: CentOS release 6.2
**********************************************
Reproduce step:
1. Open the admin UI page
2. Set Verimatrix DRM: Live Resource ID Range or On-demand Resource ID Range with \
                invalid value
like: 1000abc, p0000
3. Click 'Apply' button

Actually result:
It will set successfully, restart server, those invalid value can be set to \
rmserver.cfg file

Expected result
It will show one error message Like: The input value is invalid.

Solution
===============
Adding a numeric check before using these resource-ids.

Files affected:
===============
server/admin/web/src/srvprxy/config_drm.html.wasm
server/admin/web/build/server/config_drm.html
server/admin/web/build/mserver/config_drm.html

Testing Performed: 
===============
Integration Tests:
Use admin page, set some word but not numeric to resource-id, server will reject it, \
and pop up an alarm window.


Performance Tests: 
N/A

QA Hints
========
None.


Index: config_drm.html
===================================================================
RCS file: /cvsroot/server/admin/web/build/server/config_drm.html,v
retrieving revision 1.4.2.11
retrieving revision 1.4.2.12
diff -u -d -r1.4.2.11 -r1.4.2.12
--- config_drm.html	29 Sep 2012 05:28:08 -0000	1.4.2.11
+++ config_drm.html	19 Oct 2012 10:04:56 -0000	1.4.2.12
@@ -158,25 +158,48 @@
 	
 	return true;
 }
+function IsNumeric(num)
+{
+	var i,j;
+	var numbers = "1234567890";
+	if ( num.length== 0)
+		return false;
+	for (i=0; i<num.length; i++)
+	{
+		j=numbers.indexOf(num.charAt(i));  
+		if (j==-1)
+		{
+			return false;
+		}
+	}  
+	return true;
+}
 
 function checkLivePort ( port1, port2 )
 {
+	if( !IsNumeric(port1) || !IsNumeric(port2) )
+	{
+		return rejectInput( theForm.LRange0, "Only accept numeric for resource id." );
+	}
 	if ( ! (port1 && port2) )
-        return rejectInput( theForm.LRange0, "A Live Resource Range is required." );
+		return rejectInput( theForm.LRange0, "A Live Resource Range is required." );
 
 	if ( parseInt( port1 ) >= parseInt( port2 ) )
-        return rejectInput( theForm.LRange0, "Invalid Live Resource Range." );
+		return rejectInput( theForm.LRange0, "Invalid Live Resource Range." );
 
 	return true ;
 }
 
 function checkVodPort ( port1, port2 )
 {
-	if ( ! (port1 && port2) )
-        return rejectInput( theForm.VRange0, "A Ondemand Resource Range is \
required." ); +	if( !IsNumeric(port1) || !IsNumeric(port2) )
+		return rejectInput( theForm.LRange0, "Only accept numeric for resource id." );
+
+	if ( !(port1 && port2) )
+		return rejectInput( theForm.VRange0, "A Ondemand Resource Range is required." );
 
 	if ( parseInt( port1 ) >= parseInt( port2 ) )
-        return rejectInput( theForm.VRange0, "Invalid Ondemand Resource Range." );
+		return rejectInput( theForm.VRange0, "Invalid Ondemand Resource Range." );
 
 	return true ;
 }


_______________________________________________
Server-cvs mailing list
Server-cvs@helixcommunity.org
http://lists.helixcommunity.org/mailman/listinfo/server-cvs


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic