[icinga-checkins] icinga.org: icinga-web/mhein/default: Changed paramete

git at icinga.org git at icinga.org
Tue May 25 11:59:21 CEST 2010


Module: icinga-web
Branch: mhein/default
Commit: 8b84d8200e65dbd7b49594a461a19fd3ff19af39
URL:    https://git.icinga.org/?p=icinga-web.git;a=commit;h=8b84d8200e65dbd7b49594a461a19fd3ff19af39

Author: jmosshammer <jannis.mosshammer at netways.de>
Date:   Wed May 19 15:47:19 2010 +0200

Changed paramete

---

 .../Web/actions/Icinga/ApiSearchAction.class.php   |    4 +-
 app/modules/Web/validate/Icinga/ApiSearch.xml      |   24 +++++++++++++++----
 2 files changed, 21 insertions(+), 7 deletions(-)

diff --git a/app/modules/Web/actions/Icinga/ApiSearchAction.class.php b/app/modules/Web/actions/Icinga/ApiSearchAction.class.php
index 3490b4c..0b7b68d 100644
--- a/app/modules/Web/actions/Icinga/ApiSearchAction.class.php
+++ b/app/modules/Web/actions/Icinga/ApiSearchAction.class.php
@@ -88,8 +88,8 @@ class Web_Icinga_ApiSearchAction extends IcingaWebBaseAction
 		$advFilter = $rd->getParameter("filters",array());
 				
 		foreach($advFilter as $fl) {
-			$fl["filter"] = str_replace("*","%",$fl["filter"]);
-			$search->setSearchFilter($fl["field"],$fl["filter"],$fl["method"]);	
+			$fl["value"] = str_replace("*","%",$fl["value"]);
+			$search->setSearchFilter($fl["column"],$fl["value"],$fl["relation"]);	
 		}
 	}
 	
diff --git a/app/modules/Web/validate/Icinga/ApiSearch.xml b/app/modules/Web/validate/Icinga/ApiSearch.xml
index 2ce0a71..987aae6 100644
--- a/app/modules/Web/validate/Icinga/ApiSearch.xml
+++ b/app/modules/Web/validate/Icinga/ApiSearch.xml
@@ -89,9 +89,9 @@
 		<validators method="write">
 			<validator name="filters" class="string">
 				<arguments base="filters[]">
-					<argument>field</argument>
-					<argument>method</argument>
-					<argument>filter</argument>
+					<argument>column</argument>
+					<argument>relation</argument>
+					<argument>value</argument>
 				</arguments>
 				<errors>
 					<error>Validation of adv_filter failed</error>
@@ -100,10 +100,10 @@
 			
 			<validator class="inarray" name="validate_method" required="false">
 				<arguments base="filters[]">
-					<argument>method</argument>
+					<argument>relation</argument>
 				</arguments>
 				<errors>
-					<error>Only '>','<','>=','<=','!=','=' and 'like' are allowed as methods</error>
+					<error>Only '>','<','>=','<=','!=','=' and 'like' are allowed as relations</error>
 				</errors>
 				<ae:parameters>
 					<ae:parameter name="type">string</ae:parameter>
@@ -154,6 +154,20 @@
 					<error>Validation of columns failed</error>
 				</errors>
 			</validator>
+			
+			<validator name="limit_start" class="number" required="false">
+				<argument>limit_start</argument>
+				<ae:parameter>
+					<ae:parameter name="min">0</ae:parameter>
+				</ae:parameter>
+			</validator>
+			
+			<validator name="limit" class="number" required="false">
+				<argument>limit</argument>
+				<ae:parameter>
+					<ae:parameter name="min">1</ae:parameter>
+				</ae:parameter>
+			</validator>			
 		</validators>
 		
 	</ae:configuration>





More information about the icinga-checkins mailing list