Sophie

Sophie

distrib > Mageia > 6 > armv7hl > media > core-updates-src > by-pkgid > f019e505bd4545ee77c8d1f841ab0f29 > files > 1

cacti-1.1.16-1.mga6.src.rpm

diff --git a/cli/upgrade_database.php b/cli/upgrade_database.php
index ca3df58..3aa0fdb 100644
--- a/cli/upgrade_database.php
+++ b/cli/upgrade_database.php
@@ -99,7 +99,7 @@ if ($old_cacti_version == CACTI_VERSION) {
 	echo "Your Cacti is already up to date." . PHP_EOL;
 	exit;
 } elseif ($old_cacti_version < 0.7) {
-	echo 'You are attempting to install cacti ' . CACTI_VERSION . ' onto a 0.6.x database.' . PHP_EOL . "To continue, you must create a new database, import 'cacti.sql' into it," . PHP_EOL . "and\tupdate 'include/config.php' to point to the new database." . PHP_EOL;
+	echo 'You are attempting to install cacti ' . CACTI_VERSION . ' onto a 0.6.x database.' . PHP_EOL . "To continue, you must create a new database, import 'cacti.sql' into it," . PHP_EOL . "and\tupdate '/etc/cacti.conf' to point to the new database." . PHP_EOL;
 	exit;
 } elseif (empty($old_cacti_version)) {
 	echo "You have created a new database, but have not yet imported the 'cacti.sql' file." . PHP_EOL;
diff --git a/include/global.php b/include/global.php
index 4310fc3..3a294bc 100644
--- a/include/global.php
+++ b/include/global.php
@@ -26,7 +26,7 @@
    !!! IMPORTANT !!!
 
    The following defaults are not to be altered.  Please refer to
-   include/config.php for user configurable settings.
+   /etc/cacti.conf for user configurable settings.
 
 */
 
@@ -65,10 +65,10 @@ $url_path = '/cacti/';
 ini_set('max_input_vars', '5000');
 
 /* Include configuration */
-include(dirname(__FILE__) . '/config.php');
+include('/etc/cacti.conf');
 
 if (isset($config['cacti_version'])) {
-	die('Invalid include/config.php file detected.');
+	die('Invalid /etc/cacti.conf file detected.');
 	exit;
 }
 
@@ -214,7 +214,7 @@ if ($config['poller_id'] > 1 || isset($rdatabase_hostname)) {
 	}
 } elseif (!db_connect_real($database_hostname, $database_username, $database_password, $database_default, $database_type, $database_port, $database_ssl)) {
 	print $config['is_web'] ? '<p>':'';
-	print 'FATAL: Connection to Cacti database failed. Please ensure the database is running and your credentials in config.php are valid.';
+	rint 'FATAL: Connection to Cacti database failed. Please insure the database is running and your credentials in cacti.conf are valid.';
 	print $config['is_web'] ? '</p>':'';
 	exit;
 } else {
diff --git a/include/global_settings.php b/include/global_settings.php
index 92abe1f..23a7f96 100644
--- a/include/global_settings.php
+++ b/include/global_settings.php
@@ -144,9 +144,9 @@ $settings = array(
 			),
 		'path_cactilog' => array(
 			'friendly_name' => __('Cacti Log Path'),
-			'description' => __('The path to your Cacti log file (if blank, defaults to <path_cacti>/log/cacti.log)'),
+			'description' => __('The path to your Cacti log file (if blank, defaults to /var/log/cacti/cacti.log)'),
 			'method' => 'filepath',
-			'default' => $config['base_path'] . '/log/cacti.log',
+			'default' => '/var/log/cacti/cacti.log',
 			'max_length' => '255'
 			),
 		'logrotate_enabled' => array(
diff --git a/install/functions.php b/install/functions.php
index dd474ec..2a861b7 100644
--- a/install/functions.php
+++ b/install/functions.php
@@ -479,7 +479,7 @@ function remote_update_config_file() {
 
 	$written     = false;
 	$newfile     = array();
-	$config_file = $config['base_path'] . '/include/config.php';
+	$config_file = '/etc/cacti.conf';
 
 	$connection = db_connect_real($rdatabase_hostname, $rdatabase_username, $rdatabase_password, $rdatabase_default, $rdatabase_type, $rdatabase_port, $rdatabase_ssl);
 
diff --git a/install/index.php b/install/index.php
index 2dae118..5410d7c 100644
--- a/install/index.php
+++ b/install/index.php
@@ -55,7 +55,7 @@ if ($old_cacti_version == CACTI_VERSION) {
 } elseif (preg_match('/^0\.6/', $old_cacti_version)) {
 	print '<p style="font-family: Verdana, Arial; font-size: 16px; font-weight: bold; color: red;">' . __('Error') . '</p>
 		<p style="font-family: Verdana, Arial; font-size: 12px;">'
-		. __('You are attempting to install Cacti %s onto a 0.6.x database. To continue, you must create a new database, import "cacti.sql" into it, and update "include/config.php" to point to the new database.', CACTI_VERSION) . '</p>';
+               . __('You are attempting to install Cacti %s onto a 0.6.x database. To continue, you must create a new database, import "cacti.sql" into it, and update "/etc/config.conf" to point to the new database.', $config['cacti_version']) . '</p>';
 	exit;
 } elseif (empty($old_cacti_version)) {
 	print '<p style="font-family: Verdana, Arial; font-size: 16px; font-weight: bold; color: red;">' . __('Error') . '</p>
@@ -352,7 +352,7 @@ if (isset($rdatabase_default) &&
 	$remote_good = false;
 }
 
-if (is_writable($config['base_path'] . '/include/config.php')) {
+if (is_writable('/etc/cacti.conf')) {
 	$good_write = true;
 } else {
 	$good_write = false;
@@ -589,7 +589,7 @@ $enabled = '1';
 								</select>
 							</p>';
 
-							print '<p>' . __('The following information has been determined from Cacti\'s configuration file. If it is not correct, please edit "include/config.php" before continuing.') . '</p>';
+                                               print '<p>' . __('The following information has been determined from Cacti\'s configuration file. If it is not correct, please edit "/etc/cacti.conf" before continuing.') . '</p>';
 
 							print '<div id="local_database" style="display:none;">';
 
@@ -619,12 +619,12 @@ $enabled = '1';
 								print '<h4>' . __('Remote Poller Cacti database connection information') . '</h4>';
 
 								if (!$good_write) {
-									print '<p class="textError"><strong>' . __('ERROR:') . '</strong> ' . __('Your config.php file must be writable by the web server during install in order to configure the Remote poller.  Once installation is complete, you must set this file to Read Only to prevent possible security issues.');
+									print '<p class="textError"><strong>' . __('ERROR:') . '</strong> ' . __('Your cacti.conf file must be writable by the web server during install in order to configure the Remote poller.  Once installation is complete, you must set this file to Read Only to prevent possible security issues.');
 									print '</p>';
 								}
 
 								if (!$remote_good) {
-									print '<p class="textError">' . __('ERROR:') . '</strong> ' . __('Your Remote Cacti Poller information has not been included in your config.php file.  Please review the config.php.dist, and set the variables: <i>$rdatabase_default, $rdatabase_username</i>, etc.  These variables must be set and point back to your Primary Cacti database server.  Correct this and try again.') . '</p>';
+									print '<p class="textError">' . __('ERROR:') . '</strong> ' . __('Your Remote Cacti Poller information has not been included in your cacti.conf file.  Please review the cacti.conf.dist, and set the variables: <i>$rdatabase_default, $rdatabase_username</i>, etc.  These variables must be set and point back to your Primary Cacti database server.  Correct this and try again.') . '</p>';
 
 									print '<p>' . __('The variables that must be set include the following:') . '</p>';
 									print '<ul>';
@@ -637,9 +637,9 @@ $enabled = '1';
 									print '<li>$rdatabase_ssl      = false;</li>';
 									print '</ul>';
 
-									print '<p>' . __('You must also set the $poller_id variable in the config.php.') . '</p>';
+									print '<p>' . __('You must also set the $poller_id variable in the cacti.conf.') . '</p>';
 
-									print '<p>' . __('Once you have the variables set in the config.php file, you must also grant the $rdatabase_username access to the Cacti database.  Follow the same procedure you would with any other Cacti install.  You may then press the \'Test Connection\' button.  If the test is successful you will be able to proceed and complete the install.') . '</p>';
+									print '<p>' . __('Once you have the variables set in the cacti.conf file, you must also grant the $rdatabase_username access to the Cacti database.  Follow the same procedure you would with any other Cacti install.  You may then press the \'Test Connection\' button.  If the test is successful you will be able to proceed and complete the install.') . '</p>';
 								}
 							}
 						}
@@ -715,7 +715,7 @@ $enabled = '1';
 						print '<p>' . __('Make sure all of these values are correct before continuing.') . '</p>';
 						$i = 0;
 						$input = install_file_paths();
-						/* find the appropriate value for each 'config name' above by config.php, database,
+						/* find the appropriate value for each 'config name' above by cacti.conf, database,
 						 * or a default for fall back */
 						foreach ($input as $name => $array) {
 							if (isset($input[$name])) {
diff --git a/lib/database.php b/lib/database.php
index e2d2835..0d0c564 100644
--- a/lib/database.php
+++ b/lib/database.php
@@ -586,7 +586,7 @@ function db_cacti_initialized($is_web = true) {
 		print ($is_web ? '<p style="font-weight:bold;padding-left:25px;">':'') . '  mysql -uroot -p cacti < /pathcacti/cacti.sql' . ($is_web ? '</p>':"\n");
 		print ($is_web ? '<p>':'') . 'Where <b>/pathcacti/</b> is the path to your Cacti install location.' . ($is_web ? '</p>':"\n");
 		print ($is_web ? '<p>':'') . 'Change <b>someuser</b> and <b>somepassword</b> to match your site preferences.  The defaults are <b>cactiuser</b> for both user and password.' . ($is_web ? '</p>':"\n");
-		print ($is_web ? '<p>':'') . '<b>NOTE:</b> When installing a remote poller, the <b>config.php</b> file must be writable by the Web Server account, and must include valid connection information to the main Cacti server.  The file should be changed to read only after the install is completed.' . ($is_web ? '</p>':"\n");
+		print ($is_web ? '<p>':'') . '<b>NOTE:</b> When installing a remote poller, the <b>cacti.conf</b> file must be writable by the Web Server account, and must include valid connection information to the main Cacti server.  The file should be changed to read only after the install is completed.' . ($is_web ? '</p>':"\n");
 		print ($is_web ? '</td></tr></table>':'');
 		exit;
 	}
diff --git a/lib/functions.php b/lib/functions.php
index c8368c5..d659853 100644
--- a/lib/functions.php
+++ b/lib/functions.php
@@ -3474,7 +3474,7 @@ function send_mail($to, $from, $subject, $body, $attachments = '', $headers = ''
 function mailer($from, $to, $cc, $bcc, $replyto, $subject, $body, $body_text = '', $attachments = '', $headers = '', $html = true) {
 	global $config;
 
-	include_once($config['include_path'] . '/phpmailer/PHPMailerAutoload.php');
+	include_once('/usr/share/php/PHPMailer/PHPMailerAutoload.php');
 
 	// Set the to informaiotn
 	if ($to == '') {
diff --git a/lib/poller.php b/lib/poller.php
index 24544f3..ec1f705 100644
--- a/lib/poller.php
+++ b/lib/poller.php
@@ -698,7 +698,7 @@ function cache_in_path($path, $type, $recursive = true) {
 		}
 
 		/* exclude spurious extensions */
-		if (array_search($extension, $excluded_extensions, true) === false && basename($path) != 'config.php') {
+		if (array_search($extension, $excluded_extensions, true) === false && basename($path) != 'cacti.conf') {
 			$curr_md5 = md5_file($path);
 			$last_md5 = db_fetch_cell_prepared('SELECT md5sum FROM poller_resource_cache WHERE path = ?', array($spath));
 
@@ -711,7 +711,7 @@ function cache_in_path($path, $type, $recursive = true) {
 }
 
 /** update_db_from_path - store the actual file in the databases resource cache.
- *  Skip the include/config.php if it exists
+ *  Skip the /etc/cacti.conf if it exists
  *
  * @param string $path      - The path to look for changes
  * @param string $type      - The patch types being cached
@@ -733,7 +733,7 @@ function update_db_from_path($path, $type, $recursive = true) {
 					if ($recursive) {
 						update_db_from_path($path . DIRECTORY_SEPARATOR . $entry, $type, $recursive);
 					}
-				} elseif (basename($path) == 'config.php') {
+				} elseif (basename($path) == 'cacti.conf') {
 					continue;
 				} else {
 					$pathinfo = pathinfo($entry);
@@ -767,7 +767,7 @@ function update_db_from_path($path, $type, $recursive = true) {
 
 		$pobject->close();
 	} else {
-		if (basename($path) != 'config.php' && basename($path) != '.git' && $path != '') {
+		if (basename($path) != 'cacti.conf' && basename($path) != '.git' && $path != '') {
 			$pathinfo = pathinfo($path);
 			if (isset($pathinfo['extension'])) {
 				$extension = strtolower($pathinfo['extension']);
@@ -833,7 +833,7 @@ function resource_cache_out($type, $path) {
 				}
 
 				if (is_dir(dirname($mypath))) {
-					if ($md5sum != $e['md5sum'] && basename($e['path']) != 'config.php') {
+					if ($md5sum != $e['md5sum'] && basename($e['path']) != 'cacti.conf') {
 						$extension = substr(strrchr($e['path'], "."), 1);
 						$exit = -1;
 						$contents = base64_decode(db_fetch_cell_prepared('SELECT contents