Location: PHPKode > projects > Cancerbero - The watchdog of the ports > cancerbero-0.6/site/include/read_config_class.php
<?php

class ReadConfig {

	var $database_version;

	var $general;
	var $sensor;
	var $ranges;
	
	var $num_rows;
	var $num_links;
	
	// constructor
	function ReadConfig() {
		$query = mysql_query("SELECT database_ver from configuration") or die (mysql_error());
		$query_database_version = mysql_fetch_assoc($query);
		$this->database_version = $query_database_version['database_ver'];
		return $this;
	}
	function ReadPage() {
		$query = mysql_query("SELECT num_rows,num_links from configuration") or die (mysql_error());
		$page_values = mysql_fetch_assoc($query);
		$this->num_rows = $page_values['num_rows'];
		$this->num_links = $page_values['num_links'];
	}
	function General ($field='*') {
		$query = mysql_query("SELECT $field FROM configuration") or die (mysql_error());
		$this->general = mysql_fetch_assoc($query);
		return $this->general;
	}

	function Sensor ($sensor_id,$field='*') {
		$query = mysql_query("SELECT sensor_id,sensor_name,sensor_delay_scan,sensor_sweep_time,sensor_max_num_scan,sensor_stored_scans,sensor_nmap_sweep_opts,sensor_nmap_opts,sensor_loop,sensor_debug,(select nmap_option_name from nmap_cfg where nmap_cfg_id = sensor_nmap_sweep_opts and sensor_id = '$sensor_id') as nmap_sweep,(select nmap_option_name from nmap_cfg where nmap_cfg_id = sensor_nmap_opts and sensor_id = '$sensor_id') as nmap_scan FROM sensors where  sensor_id = '$sensor_id'") or die (mysql_error());
		$this->sensor = mysql_fetch_assoc($query);
		return $this->sensor;
	}
	function Range ($range_id,$field='*') {
		$query = mysql_query("SELECT $field FROM ranges,nmap_cfg WHERE ranges.range_nmap_opts = nmap_cfg.nmap_cfg_id and range_id = '$range_id'") or die (mysql_error());
		$this->ranges = mysql_fetch_assoc($query);
		return $this->ranges;
	}
}
?>

<?php

define ("CANCERBERO_VER","0.6");
define("DATABASE_VER", 4);

/* Pagination system */
 
// modify these constants to fit your environment
if (!defined("DB_SERVER")) define("DB_SERVER",$host_db);
if (!defined("DB_NAME")) define("DB_NAME",$name_db);
if (!defined("DB_USER")) define ("DB_USER",$user_db);
if (!defined("DB_PASSWORD")) define ("DB_PASSWORD",$pass_db);


?>
Return current item: Cancerbero - The watchdog of the ports