//====================================================================================
// OCS INVENTORY REPORTS
// Copyleft Pierre LEMMET 2005
// Web: http://ocsinventory.sourceforge.net
//
// This code is open source and may be copied and modified as long as the source
// code is always made freely available.
// Please refer to the General Public Licence http://www.gnu.org/ or Licence.txt
//====================================================================================
//Modified on 07/05/2005
set_time_limit(0);
error_reporting(E_ALL & ~E_NOTICE);
?>
WARNING: GD for PHP is not properly installed. You will not be able to see any graphical display Try uncommenting \";extension=php_gd2.dll\" (windows) by removing the semicolon in file php.ini, or try installing the php4-gd package (Linux).
WARNING: OpenSSL for PHP is not properly installed. Some automatic deployment features won't be available Try uncommenting \";extension=php_openssl.dll\" (windows) by removing the semicolon in file php.ini, or try installing the php4-openssl package (Linux).
WARNING: You will not be able to build any auto deployment package with size
greater than $MaxAvail. You must raise both post_max_size and upload_max_filesize in your php.ini to correct this.
";
include ('fichierConf.class.php');
$l = new FichierConf("english"); // on cr�e l'instance pour avoir les mots dans la langue choisie
if( isset($_POST["name"])) {
if( (!$link=@mysql_connect($_POST["host"],$_POST["name"],$_POST["pass"]))) {
$firstAttempt=false;
echo "
ERROR: ".$l->g(249)." (host=".$_POST["host"]." name=".$_POST["name"]." pass=".$_POST["pass"].")
Mysql error: ".mysql_error()."
WARNING: your the default root password is set on your mysql server. Change it asap. (using root password=blank)
";
}
if(!mysql_query("set global max_allowed_packet=2097152;")) {
echo "
WARNING: The user you typed does not seem to be root If you encounter any problem with files insertion, try setting the global max_allowed_packet mysql value to at least 2M in your server config file.
";
}
mysql_select_db("ocsweb");
if(isset($_POST["label"])) {
if($_POST["label"]!="") {
@mysql_query( "DELETE FROM deploy WHERE NAME='label'");
$query = "INSERT INTO deploy VALUES('label','".$_POST["label"]."');";
mysql_query($query) or die(mysql_error());
echo "
Label added
";
}
else {
echo "
Label NOT added (not tag will be asked on client launch)
ERROR: MySql authentication problem. You must add the 'old-passwords' in your mysql configuration file (my.ini). Then restart mysql, and relaunch install.php
";
die();
}
else
echo "
ERROR: MySql authentication problem. (using host=".$_POST["host"]." login=ocs pass=ocs).
";
echo "
ERROR: The installer ended unsuccessfully, rerun install.php once problems are corrected
";
unlink("dbconfig.inc.php");
}
else {
echo "
Installation finished you can log in index.php with login=admin and pass=admin
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)
ERROR: line $li: query:[$sql_line] failed, KEY was too long You need to redo this query later or you will experience severe performance issues. ";
continue;
}
if(mysql_errno()==1007 || mysql_errno()==1050) {
$dejaLance = 1;
continue;
}
echo "
ERROR: InnoDB conversion failed, install InnoDB mysql engine support on your server or you will experience severe performance issues.
(Try to uncomment \"#skip-innodb\" in your mysql config file.) Reinstall when corrected. ";
$oneFailed = true;
}
if ( (strcasecmp($val["Engine"],$eng)!=0) && (strcasecmp($eng,"HEAP")) && (strcasecmp($val["Engine"],"MEMORY")!=0) ) {
echo "
ERROR: HEAP conversion failed, install HEAP mysql engine support on your server or you will experience severe performance issues. ";
}
}
else {
echo "
ERROR: Show table status query failed ";
echo "mysql error: ".mysql_error()." (err:".mysql_errno().")