[icinga-checkins] icinga.org: icinga-core/master: classic ui: remove php dependency by dropping extended live search

git at icinga.org git at icinga.org
Mon Sep 20 10:59:37 CEST 2010


Module: icinga-core
Branch: master
Commit: 0dfc70e607329bd18e46dc8969c3ea0e788190dd
URL:    https://git.icinga.org/?p=icinga-core.git;a=commit;h=0dfc70e607329bd18e46dc8969c3ea0e788190dd

Author: Michael Friedrich <michael.friedrich at univie.ac.at>
Date:   Mon Sep 20 10:32:11 2010 +0200

classic ui: remove php dependency by dropping extended live search

fixes #800

---

 Changelog           |    1 +
 configure           |    1 -
 configure.in        |    1 -
 html/Makefile.in    |    4 --
 html/getList.php    |   99 ---------------------------------------------------
 html/menu.html.in   |    2 -
 html/search.html.in |   73 -------------------------------------
 7 files changed, 1 insertions(+), 180 deletions(-)

diff --git a/Changelog b/Changelog
index 999165a..791e357 100644
--- a/Changelog
+++ b/Changelog
@@ -16,6 +16,7 @@ ENHANCEMENTS
 * classic ui: change menu, add unhandled host/service problems
 * classic ui: allow searching for host without service attached to it
 * classic ui: added tooltip for comments in status.cgi
+* classic ui: remove php dependency by dropping extended live search
 
 
 FIXES
diff --git a/configure b/configure
index 2bb9406..3503d2f 100755
--- a/configure
+++ b/configure
@@ -8121,7 +8121,6 @@ perl subst $srcdir/include/locations.h
 perl subst $srcdir/html/index.html
 perl subst $srcdir/html/menu.html
 perl subst $srcdir/html/top.html
-perl subst $srcdir/html/search.html
 
 echo ""
 echo "Creating sample config files in sample-config/ ..."
diff --git a/configure.in b/configure.in
index 45c7a30..cd3294a 100644
--- a/configure.in
+++ b/configure.in
@@ -1105,7 +1105,6 @@ perl subst $srcdir/include/locations.h
 perl subst $srcdir/html/index.html
 perl subst $srcdir/html/menu.html
 perl subst $srcdir/html/top.html
-perl subst $srcdir/html/search.html
 
 echo ""
 echo "Creating sample config files in sample-config/ ..."
diff --git a/html/Makefile.in b/html/Makefile.in
index 1bd0e15..b9474e9 100644
--- a/html/Makefile.in
+++ b/html/Makefile.in
@@ -53,10 +53,6 @@ install:
 	$(INSTALL) -m 664 $(INSTALL_OPTS) docs/robots.txt $(DESTDIR)$(HTMLDIR)/docs
 	for file in *.html; \
 	do $(INSTALL) -m 664 $(INSTALL_OPTS) $$file $(DESTDIR)$(HTMLDIR); done
-	for file in *.php; \
-	do $(INSTALL) -m 664 $(INSTALL_OPTS) $$file $(DESTDIR)$(HTMLDIR); done
-#	for file in media/*.wav; \
-#	do $(INSTALL) -m 664 $(INSTALL_OPTS) $$file $(DESTDIR)$(HTMLDIR)/media; done
 	for file in stylesheets/*.css; \
 	do $(INSTALL) -m 664 $(INSTALL_OPTS) $$file $(DESTDIR)$(HTMLDIR)/stylesheets; done
 	for file in stylesheets/interface/*.css; \
diff --git a/html/getList.php b/html/getList.php
deleted file mode 100755
index 330f4b3..0000000
--- a/html/getList.php
+++ /dev/null
@@ -1,99 +0,0 @@
-<?
-/**
- * getList - Get list from host, host- and servicegroups via API
- * 
- * @author	Michael Luebben	<michael_luebben at web.de>
- */
- 
-/**
- * securePostVar -  Cleanup variable from tags etc.
- * 
- * @param string $var
- * @author Michael Luebben	<michael_luebben at web.de>
- */
-function secureVar($var) {
-	$tmpVar=strip_tags($var);
-	$tmpVar=htmlentities($tmpVar);
-	$tmpVar=addslashes($tmpVar);
-	return $tmpVar;
-}	
-
-// Array contains state codes for host state
-$hostStateCode = array (
-	'0' => 'UP',
-	'1' => 'DOWN',
-	'2' => 'UNREACHABLE'
-);
-
-// Load required files
-require_once('icinga-api/IcingaApi.php');
-require_once('icinga-api/contrib/ido2dbparser/Ido2dbParser.php');
-
-// Instance ido2db parser
-$ido2dbCfg = new Ido2dbParser();
-
-// Array contians connections data for the IDO
-$idoConfig = array (
-					'type'			=> $ido2dbCfg->getConfigParameter('db_servertype'),
-					'host'			=> $ido2dbCfg->getConfigParameter('db_host'),
-					'database'		=> $ido2dbCfg->getConfigParameter('db_name'),
-					'user'			=> $ido2dbCfg->getConfigParameter('db_user'),
-					'password'		=> $ido2dbCfg->getConfigParameter('db_pass'),
-					'table_prefix'	=> $ido2dbCfg->getConfigParameter('db_prefix'),
-					'persistent'	=> true
-					);
-
-// Instance api object from class
-$api = IcingaApi::getConnection(IcingaApi::CONNECTION_IDO, $idoConfig);
-
-// Get type
-$secureType=secureVar($_GET['type']);
-
-// Seach host
-if ($secureType == "host") {
-	$secureHost=secureVar($_POST['host']);
-	$apiRes = $api->createSearch()
-		->setSearchTarget(IcingaApi::TARGET_HOST)
-		->setResultColumns(array('HOST_NAME', 'HOST_CURRENT_STATE'))
-		->setSearchFilter(HOST_NAME, '%'.$secureHost.'%', IcingaApi::MATCH_LIKE)
-		->fetch();
-
-	echo '<ul>';
-		foreach($apiRes as $apiHandle){
-			echo '<li><b>'.$apiHandle->HOST_NAME.'</b><span class="informal" id="listHOST'.$hostStateCode[$apiHandle->HOST_CURRENT_STATE].'"> ('.$hostStateCode[$apiHandle->HOST_CURRENT_STATE].')</span></li>';
-		}
-	echo '</ul>';
-// Seach hostgroup
-} elseif ($secureType == "hostgroup") {
-	$secureHostgroup=secureVar($_POST['hostgroup']);
-	$apiRes = $api->createSearch()
-		->setSearchTarget(IcingaApi::TARGET_HOSTGROUP)
-		->setResultColumns(array('HOSTGROUP_NAME','HOSTGROUP_ALIAS'))
-		->setSearchFilter(HOSTGROUP_ALIAS, '%'.$secureHostgroup.'%', IcingaApi::MATCH_LIKE)
-		->fetch();
-
-	echo '<ul>';
-		foreach($apiRes as $apiHandle){
-			echo '<li><span class="informal" id="searchSelected"><b>'.$apiHandle->HOSTGROUP_ALIAS.'</b> (</span>'.$apiHandle->HOSTGROUP_NAME.'<span class="informal" id="searchSelected">)</span></li>';
-		}
-	echo '</ul>';
-// Seach servicegroup
-} elseif ($secureType == "servicegroup") {
-	$secureServicegroup=secureVar($_POST['servicegroup']);
-	$apiRes = $api->createSearch()
-		->setSearchTarget(IcingaApi::TARGET_SERVICEGROUP)
-		->setResultColumns(array('SERVICEGROUP_NAME','SERVICEGROUP_ALIAS'))
-		->setSearchFilter(SERVICEGROUP_ALIAS, '%'.$secureServicegroup.'%', IcingaApi::MATCH_LIKE)
-		->fetch();
-
-	echo '<ul>';
-		foreach($apiRes as $apiHandle){
-			echo '<li><span class="informal" id="searchSelected"><b>'.$apiHandle->SERVICEGROUP_ALIAS.'</b> (</span>'.$apiHandle->SERVICEGROUP_NAME.'<span class="informal" id="searchSelected">)</span></li>';
-		}
-	echo '</ul>';
-} else {
-	echo '<ul>';
-		echo '<li>Undefined type!</li>';
-	echo '</ul>';
-}
-?>
diff --git a/html/menu.html.in b/html/menu.html.in
index 8c80f9e..83c3b1a 100644
--- a/html/menu.html.in
+++ b/html/menu.html.in
@@ -20,8 +20,6 @@
 					<a class="flag" href="docs/de/index.html" target="main"><img src="docs/images/flags/de.png" /></a><a class="flag" href="docs/en/index.html" target="main"><img src="docs/images/flags/um_gb.png" /></a>
 				</div>
 			</li>
-			<!-- extended search based on idoutils and icinga api -->
-			<li class="menuli_style2"><a href="search.html" target="main">Extended Search</a></li>
 			<!-- classic search -->
 			<li class="menuli_style2">
 			<div class="navbarsearch">
diff --git a/html/search.html.in b/html/search.html.in
deleted file mode 100755
index 49755df..0000000
--- a/html/search.html.in
+++ /dev/null
@@ -1,73 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="fr" lang="fr">
-<head>
-        <title>Icinga</title>
-        <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
-        <meta http-equiv="Content-Language" content="fr" />
-        <meta name="robots" content="noindex, nofollow" />
-        <link rel="stylesheet" type="text/css" href="stylesheets/interface/search.css" media="screen, projection" />
-        <link rel="shortcut icon" type="image/x-icon" href="images/favicon.ico" />
-        <script type="text/javascript" src="js/prototype.js"></script>
-        <script type="text/javascript" src="js/scriptaculous.js"></script>
-</head>
-<body>
-	<table border="0" width="100%">
-		<tr>
-			<td width="35%"></td>
-			<td align="center">
-				<div id="searchType">
-					<p id="searchTitle">Select search type:</p>
-					<form action="select.html">
-						<select name="searchType" size="1" onchange="Effect.toggle('searchType', 'appear'); Effect.toggle('type_'+this.form.searchType.options[this.form.searchType.selectedIndex].value, 'appear'); return false;">
-							<option selected>Select...</option>
-							<option value="host">Host</option>
-							<option value='hostgroup'>Hostgroup</option>
-							<option value='servicegroup'>Servicegroup</option>
-				    	</select>
-					</form>
-				</div>
-			</td>
-			<td width="35%"></td>
-		</tr>
-		<tr>
-			<td width="35%"></td>
-			<td align="center">
-				<div id="type_host" style="display:none;">
-					<p id="searchTitle">Search host</p>
-					<form method="get" action="@cgiurl@/status.cgi" target="main">
-						<input type='hidden' name='navbarsearch' value='1'>
-						<input type='text' class="searchInput" id="hostname" name='host' size='30' class="NavBarSearchItem">
-						<div id="AutocompleteChoicesHost" class="autocomplete"></div>
-						<script type="text/javascript">
-							new Ajax.Autocompleter("hostname", "AutocompleteChoicesHost", "getList.php?type=host", {minChars: 3});
-						</script>
-					</form>
-				</div>
-				<div id="type_hostgroup" style="display:none;">
-					<p id="searchTitle">Search hostgroup</p>
-					<form method="get" action="@cgiurl@/status.cgi" target="main">
-						<input type='hidden' name='style' value='detail'>
-						<input type='text' class="searchInput" id="hostgroup" name='hostgroup' size='30' class="NavBarSearchItem">
-						<div id="AutocompleteChoicesHostgroup" class="autocomplete"></div>
-						<script type="text/javascript">
-							new Ajax.Autocompleter("hostgroup", "AutocompleteChoicesHostgroup", "getList.php?type=hostgroup", {minChars: 3});
-						</script>
-					</form>
-				</div>
-				<div id="type_servicegroup" style="display:none;">
-					<p id="searchTitle">Search servicegroup</p>
-					<form method="get" action="@cgiurl@/status.cgi" target="main">
-						<input type='hidden' name='style' value='detail'>
-						<input type='text' class="searchInput" id="servicegroup" name='servicegroup' size='30' class="NavBarSearchItem">
-						<div id="AutocompleteChoicesServicegroup" class="autocomplete"></div>
-						<script type="text/javascript">
-							new Ajax.Autocompleter("servicegroup", "AutocompleteChoicesServicegroup", "getList.php?type=servicegroup", {minChars: 3});
-						</script>
-					</form>
-				</div>				
-			</td>
-			<td width="35%"></td>
-		</tr>
-	</table>
-</body>
-</html>





More information about the icinga-checkins mailing list