Package: ocsinventory-server
Version: 1.02-1
Severity: important
Hello,
Trying the 1.02-1 from experimental I get the folloing error when
connecting to ocsreports/install.php:
--8<---------------cut here---------------start------------->8---
Parse error: syntax error, unexpected ',' in
/usr/share/ocsinventory-server/ocsreports/install.php on line 99
--8<---------------cut here---------------end--------------->8---
The problem comes from debian/patches/dbconfig.path line 23.
There is a comma problem on line 26 of the patch too.
I attach a corrected patch.
Regards.
-- System Information:
Debian Release: squeeze/sid
APT prefers unstable
APT policy: (500, 'unstable'), (90, 'experimental')
Architecture: amd64 (x86_64)
Kernel: Linux 2.6.30-rc6+hati.1 (SMP w/2 CPU cores; PREEMPT)
Locale: LANG=fr_FR.UTF-8, LC_CTYPE=fr_FR.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
Move dbconfig.inc.php from ocsreports to /var/lib/ocsinventory/config
where it can be easily deleted/created/modified by install.php
Index: ocsinventory-server/ocsreports/install.php
===================================================================
--- ocsinventory-server.orig/ocsreports/install.php 2009-05-08
22:14:03.000000000 +0200
+++ ocsinventory-server/ocsreports/install.php 2009-05-08 22:21:07.000000000
+0200
@@ -12,6 +12,8 @@
@set_time_limit(0);
error_reporting(E_ALL & ~E_NOTICE);
+
+define('DBCONFIG_INC', '/var/lib/ocsinventory-server/config/dbconfig.inc.php');
?>
<html>
<head>
@@ -94,9 +96,9 @@
else
$instOk = true;
}
-if( $hnd = @fopen("dbconfig.inc.php", "r") ) {
+if( $hnd = @fopen(DBCONFIG_INC, "r") ) {
fclose($hnd);
- require("dbconfig.inc.php");
+ require(DBCONFIG_INC);
$valNme = $_SESSION["COMPTE_BASE"];
$valPass = $_SESSION["PSWD_BASE"];
$valServ = $_SESSION["SERVEUR_SQL"];
@@ -172,7 +174,7 @@
echo "<br><center><font color=red><b>ERROR: MySql
authentication problem. (using host=".$_POST["host"]." login=ocs
pass=ocs).</b><br></font></center>";
echo "<br><center><font color=red><b>ERROR: The installer ended
unsuccessfully, rerun install.php once problems are
corrected</b></font></center>";
- unlink("dbconfig.inc.php");
+ unlink(DBCONFIG_INC);
}
else {
echo "<br><center><font color=green><b>Installation finished
you can log in index.php with login=admin and pass=admin</b><br><br><b><a
href='index.php'>Click here to enter OCS-NG GUI</a></b></font></center>";
@@ -181,7 +183,7 @@
}
-if(!$ch = @fopen("dbconfig.inc.php","w")) {
+if(!$ch = @fopen(DBCONFIG_INC,"w")) {
echo "<br><center><font color=red><b>ERROR: can't write in directory
(on dbconfig.inc.php), please set the required rights in order to install
ocsinventory (you should remove the write mode after the installation is
successfull)</b></font></center>";
die();
}
@@ -314,7 +316,7 @@
if($nberr) {
echo "<br><center><font color=red><b>ERROR: The installer ended
unsuccessfully, rerun install.php once problems are
corrected</b></font></center>";
- unlink("dbconfig.inc.php");
+ unlink(DBCONFIG_INC);
die();
}
$nberr=0;
@@ -354,7 +356,7 @@
if(mysql_errno()==2006) {
echo "<br><center><font color=red><b>ERROR:
$fil was not inserted. You need to set the max_allowed_packet mysql value to at
least 2M</b></font></center>";
echo "<br><center><font color=red><b>ERROR: The
installer ended unsuccessfully, rerun install.php once problems are
corrected</b></font></center>";
- unlink("dbconfig.inc.php");
+ unlink(DBCONFIG_INC);
die();
}
echo "<br><center><font color=red><b>ERROR: $fil not
inserted</b><br>";
@@ -383,7 +385,7 @@
if($nberr) {
echo "<br><center><font color=red><b>ERROR: The installer ended
unsuccessfully, rerun install.php once problems are
corrected</b></font></center>";
- unlink("dbconfig.inc.php");
+ unlink(DBCONFIG_INC);
die();
}
Index: ocsinventory-server/ocsreports/preferences.php
===================================================================
--- ocsinventory-server.orig/ocsreports/preferences.php 2009-05-08
22:14:03.000000000 +0200
+++ ocsinventory-server/ocsreports/preferences.php 2009-05-08
22:21:28.000000000 +0200
@@ -12,7 +12,7 @@
error_reporting(E_ALL & ~E_NOTICE);
@session_start();
-require('dbconfig.inc.php');
+require('/var/lib/ocsinventory-server/config/dbconfig.inc.php');
require ('fichierConf.class.php');
define("MAX_CACHED_SOFTS", 200 ); // Max number of softs that may
be returned by optimizations queries