<?php

/*
** DGS Search
** config.php written by James M. Sella
** Copyright (c) 2000-2001 Digital Genesis Software, LLC. All Rights Reserved.
** Released under the GPL Version 2 License.
** http://www.digitalgenesis.com
*/

/* Change options below as needed. */

/* General Options */

$config['script']            = 'sella_nms-browserbody.php';

$config['installBase']       = '.';
$config['searchModules']     = array('db');
$config['displayModules']    = array('head', 'nav', 'results', 'nav', 'hr', 'stats', 'foot');
$config['language']          = 'english';
$config['fileSeparator']     = '/';
$config['header']            = 'header.php';
$config['footer']            = 'footer.php';
$config['target']            = '_self';
$config['infoBar']           = false;
$config['infoBarFormat']     = '@URL@ @DASH-SIZE@ @DASH-LASTMOD@ @LASTMOD@';
$config['dateFormat']        = 'M j, Y H:i:s';
$config['results']           = 10;
$config['boldQuery']         = true;
$config['timed']             = true;
$config['maxSearchTime']     = 25;
$config['translate']         = false;
$config['translateFrom']     = 'en_de';
$config['verifyConfig']      = false;
$config['warn']              = false;
$config['debug']             = false;
$config['remoteDebug']       = false;

/* Database Options -- Search module 'db' */
$db_func['browse']['type']         = 'mysql';
$db_func['browse']['server']       = $config['databaseServer'];
$db_func['browse']['port']         = $config['databasePort'];
$db_func['browse']['username']     = $config['databaseUsername'];
$db_func['browse']['password']     = $config['databasePassword'];
$db_func['browse']['database']     = $config['databaseName'];
$db_func['browse']['persistent']   = true;
$db_func['browse']['table']        = array('element_data AS data1', 'element_data AS data2');
$db_func['browse']['tableAssoc']   = "data1.element = data2.element AND data1.variable = '.1.3.6.1.2.1.1.5.0' AND data2.variable = '.1.3.6.1.2.1.1.1.0'";
$db_func['browse']['browseField']  = array('data1.value', 'data2.value');
$db_func['browse']['returnField']  = array('data1.element', 'data1.value', 'data2.value');
$db_func['browse']['link']         = 'Network Element: @1@';
$db_func['browse']['url']          = 'sella_nms-browserbody.php?function=Display&router=@0@&rand=' . rand(1, getrandmax());
$db_func['browse']['desc']         = array('<B>Description:</B> @2@');
$db_func['browse']['descWidth']    = 80;
$db_func['browse']['wildcard']     = 'both';
$db_func['browse']['orderByDepth'] = -1;
$db_func['browse']['forceLower']   = false;

$db_func['search']['type']         = 'mysql';
$db_func['search']['server']       = $config['databaseServer'];
$db_func['search']['port']         = $config['databasePort'];
$db_func['search']['username']     = $config['databaseUsername'];
$db_func['search']['password']     = $config['databasePassword'];
$db_func['search']['database']     = $config['databaseName'];
$db_func['search']['persistent']   = true;
$db_func['search']['table']        = array("element_data ne_d1 LEFT JOIN element_data ne_d2 ON (ne_d1.element = ne_d2.element AND (ne_d2.variable = '.1.3.6.1.2.1.1.1.0' OR ne_d2.variable = '.1.3.6.1.2.1.1.5.0') AND (ne_d1.variable = '.1.3.6.1.2.1.1.1.0' OR ne_d1.variable = '.1.3.6.1.2.1.1.5.0') AND ne_d1.variable != ne_d2.variable) LEFT JOIN interface ON (interface.element = ne_d1.element), interface_data nei_d1 LEFT JOIN interface_data nei_d2 ON (nei_d1.interface = nei_d2.interface AND (nei_d1.variable = '.1.3.6.1.2.1.2.2.1.2' OR nei_d1.variable = '.1.3.6.1.2.1.31.1.1.1.18') AND (nei_d2.variable = '.1.3.6.1.2.1.2.2.1.2' OR nei_d2.variable = '.1.3.6.1.2.1.31.1.1.1.18') AND nei_d1.variable != nei_d2.variable), ip, ip_data");
$db_func['search']['tableAssoc']   = "((ip_data.ip = ip.id AND interface.id = ip.interface AND ip_data.variable = '.1.3.6.1.2.1.4.20.1.1' AND nei_d1.interface = interface.id) AND (nei_d1.variable = '.1.3.6.1.2.1.2.2.1.2' OR nei_d1.variable IS NULL) AND (nei_d2.variable = '.1.3.6.1.2.1.31.1.1.1.18' OR nei_d2.variable IS NULL) AND (ne_d1.variable = '.1.3.6.1.2.1.1.5.0' OR ne_d1.variable IS NULL) AND (ne_d2.variable = '.1.3.6.1.2.1.1.1.0' OR ne_d2.variable IS NULL) AND nei_d1.value NOT LIKE '%-cef layer')";
$db_func['search']['searchField']  = array('ne_d1.value', 'ne_d2.value', 'nei_d1.value', 'nei_d2.value', 'ip_data.value');
$db_func['search']['returnField']  = array('ne_d1.value', 'ne_d1.element', 'ne_d2.value', 'nei_d1.value', 'interface.id', 'nei_d2.value', 'ip_data.value');
$db_func['search']['link']         = 'Network Element: @0@ [SEARCH]';
$db_func['search']['url']          = 'sella_nms-browserbody.php?function=Display&router=@1@&interface=@4@&rand=' . rand(1, getrandmax());
$db_func['search']['desc']         = array('<B>Sys Desc:</B> @2@<BR><B>Interface:</B> @3@<BR><B>Int Desc:</B> @5@<BR><B>Address:</B> @6@');
$db_func['search']['descWidth']    = 320;
$db_func['search']['wildcard']     = 'both';
$db_func['search']['orderByDepth'] = -1;
$db_func['search']['forceLower']   = false;

/*

SELECT
	interface.id INT_ID, ne_d1.element AS id, ne_d1.value, ne_d2.value, nei_d1.variable, nei_d1.value, nei_d2.variable, nei_d2.value, ip_data.value
FROM
	element_data ne_d1 LEFT JOIN element_data ne_d2 ON (ne_d1.element = ne_d2.element AND (ne_d2.variable = '.1.3.6.1.2.1.1.1.0' OR ne_d2.variable = '.1.3.6.1.2.1.1.5.0') AND (ne_d1.variable = '.1.3.6.1.2.1.1.1.0' OR ne_d1.variable = '.1.3.6.1.2.1.1.5.0') AND ne_d1.variable != ne_d2.variable) LEFT JOIN interface ON (interface.element = ne_d1.element), interface_data nei_d1 LEFT JOIN interface_data nei_d2 ON (nei_d1.interface = nei_d2.interface AND (nei_d1.variable = '.1.3.6.1.2.1.2.2.1.2' OR nei_d1.variable = '.1.3.6.1.2.1.31.1.1.1.18') AND (nei_d2.variable = '.1.3.6.1.2.1.2.2.1.2' OR nei_d2.variable = '.1.3.6.1.2.1.31.1.1.1.18') AND nei_d1.variable != nei_d2.variable), ip, ip_data
WHERE
	ip_data.ip = ip.id AND interface.id = ip.interface AND ip_data.variable = '.1.3.6.1.2.1.4.20.1.1' AND nei_d1.interface = interface.id AND (nei_d1.variable = '.1.3.6.1.2.1.2.2.1.2' OR nei_d1.variable IS NULL) AND (nei_d2.variable = '.1.3.6.1.2.1.31.1.1.1.18' OR nei_d2.variable IS NULL) AND (ne_d1.variable = '.1.3.6.1.2.1.1.5.0' OR ne_d1.variable IS NULL) AND (ne_d2.variable = '.1.3.6.1.2.1.1.1.0' OR ne_d2.variable IS NULL)

AND (ne_d1.value LIKE '%border%' OR ne_d2.value LIKE '%border%');

*/

/* Stylesheet Options */

$css['title']                = 'title';
$css['nav']                  = 'nav';
$css['navLink']              = 'navLink';
$css['stats']                = 'stats';
$css['query']                = 'query';
$css['results']              = 'results';
$css['resultNum']            = 'resultNum';
$css['resultLink']           = 'resultLink';
$css['transLink']            = 'transLink';
$css['desc']                 = 'desc';
$css['infoBar']              = 'infoBar';

/* Constants - Usually no need to change options below.  */

/* Generic */
$config['program']           = 'DGS Search';
$config['version']           = 'v0.9.7pre2';
$config['maxResults']        = 65535;
$config['hideCredits']       = true;

/* FindExt() - utils.php */
$config['extSeparator']      = '.';
$config['thisDir']           = '.';
$config['parentDir']         = '..';

?>
