Sophie

Sophie

distrib > Mandriva > 2010.2 > x86_64 > by-pkgid > bdc3a9aac224f3f2467d8d1a1f7330e0 > files > 3

centreon-2.0-4mdv2010.1.src.rpm

diff -Naur centreon-2.0/www/index.php centreon-2.0-better-installation-procedure/www/index.php
--- centreon-2.0/www/index.php	2008-12-15 18:27:24.000000000 +0100
+++ centreon-2.0-better-installation-procedure/www/index.php	2008-12-26 23:12:27.000000000 +0100
@@ -35,20 +35,24 @@
  * SVN : $Id: index.php 7247 2008-12-12 10:56:23Z jmathis $
  * 
  */
-  
-	if (!file_exists("@CENTREON_ETC@/centreon.conf.php") && is_dir('./install'))
+
+        // check configuration status
+	$freeze = 1;
+	if (!file_exists("@CENTREON_ETC@/centreon.conf.php")) {
+	    // non existing
+	    header("Location: ./install/setup.php");
+	} else {
+	    require_once ("@CENTREON_ETC@/centreon.conf.php");
+	    if ($centreon_version == "") {
+		// unfinished
 		header("Location: ./install/setup.php");
-	else if (file_exists("@CENTREON_ETC@/centreon.conf.php") && is_dir('install'))
+	    } else if ($centreon_version != "2.0") {
+		// outdated
 		header("Location: ./install/upgrade.php");
-	else {
-		if (file_exists("@CENTREON_ETC@/centreon.conf.php")){
-			require_once ("@CENTREON_ETC@/centreon.conf.php");
-			$freeze = 0;
-		} else {
-			$freeze = 1;
-			require_once ("../centreon.conf.php");
-			$msg = _("You have to move centreon configuration file from temporary directory to final directory");
-		}
+	    } else {
+		// OK
+		$freeze = 0;
+	    }
 	}
 
 	require_once ("$classdir/Session.class.php");
@@ -63,13 +67,6 @@
     $cas = $DBRESULT->fetchRow();
 	$DBRESULT->free();
 
-	// detect installation dir
-	$file_install_acces = 0;
-	if (file_exists("./install/setup.php")){
-		$error_msg = "Installation Directory '". getcwd() ."/install/' is accessible. Delete this directory to prevent security problem.";
-		$file_install_acces = 1;
-	}
-
 	ini_set("session.gc_maxlifetime", "31536000");
 	
 	if (!isset($cas) || !isset($cas["auth_cas_enable"])){	
@@ -298,4 +295,4 @@
 	}
 ?>
 </body>
-</html>
\ Pas de fin de ligne à la fin du fichier.
+</html>
diff -Naur centreon-2.0/www/install/steps/step10.php centreon-2.0-better-installation-procedure/www/install/steps/step10.php
--- centreon-2.0/www/install/steps/step10.php	2008-12-15 18:27:24.000000000 +0100
+++ centreon-2.0-better-installation-procedure/www/install/steps/step10.php	2008-12-26 23:14:42.000000000 +0100
@@ -54,11 +54,11 @@
   	<tr>
 		<td><b>Writable Centreon Configuration File (centreon.conf.php)</b></td>
 		<td align="right"><?php
-       	$uid = posix_getpwuid (fileowner($conf_centreon["centreon_etc"]));
+		$uid = posix_getpwuid (fileowner($conf_centreon["centreon_etc"]));
 		$gid = posix_getgrgid (filegroup($conf_centreon["centreon_etc"]));
-       	$perms = substr(sprintf('%o', fileperms($conf_centreon["centreon_etc"])), -3) ;
+		$perms = substr(sprintf('%o', fileperms($conf_centreon["centreon_etc"])), -3) ;
 		///print $uid['name'] . " " . $gid['name'] . " : ".$perms;
-		if((strcmp($perms,'755') == 0 )  && (!strcmp($_SESSION['apache_user'], $uid['name'])) && (!strcmp($_SESSION['apache_group'], $gid['name'])) ){
+		if(1) {
           	echo '<b><span class="go">OK</font></b>';
         	 $msg =  '';
 		} else {
@@ -109,7 +109,8 @@
 			$file[26] = "\$classdir='./class';\n";
 			$file[27] = "/* Centreon Path */\n";
 			$file[28] = "\$centreon_path='".$conf_centreon["centreon_dir"]."';\n";
-			$file[29] = "?>";
+			$file[29] = "\$centreon_version='2.0';\n";
+			$file[30] = "?>";
 			
 			if ($fd = fopen($conf_centreon["centreon_etc"]."centreon.conf.php", "w"))	{
 				for ($i = 0; $i <= 29; $i++)
@@ -164,4 +165,4 @@
 	$str .= " />";
 	print $str;
 	aff_footer();
-?>
\ Pas de fin de ligne à la fin du fichier.
+?>
diff -Naur centreon-2.0/www/install/steps/step13.php centreon-2.0-better-installation-procedure/www/install/steps/step13.php
--- centreon-2.0/www/install/steps/step13.php	2008-12-15 18:27:24.000000000 +0100
+++ centreon-2.0-better-installation-procedure/www/install/steps/step13.php	2008-12-26 23:12:27.000000000 +0100
@@ -37,9 +37,6 @@
  */
  
 	session_destroy();
-	$tmpfname = tempnam("", "");
-	@unlink($tmpfname);
-	@rename(getcwd(), realpath("..")."/".basename($tmpfname) );
 	header("Location: ../index.php");
 	
-?>
\ Pas de fin de ligne à la fin du fichier.
+?>