* * * This software is protected by copyright, please * read the file COPYRIGHT. * This program is distributed in the hope that it * will be useful, but without any warranty; without * even the implied warranty of merchantability or * fitness for a particular purpose. Please * read the file LICENCE. * * Ce fichier contient la gestion de l'installation qware * * @author Initiance * @copyright Copyright © 2009-2018, Rooty * @since 2004/06/07 * @version 0.3 * @link www.rooty.me * @package install * @docreview Tristan | 30-10-2005 */ include_once($PATH_INSTALL."lib_install.php"); /** * Fonction d'exécution du processus passé en paramètre * * @author Initiance */ function main($step) { global $message, $on, $off, $stepimg, $etat, $CONF_LIB_PATH; $chaineprocess = "

".$message->getMessage("StepLabel")."

    "; $chaineentete = "

    ".$message->getMessage("TextInfo")."

    "; $chaine = ""; if (defined('QWARE_INSTALLED') && $step!=4) { $tableauprincipal = $chaineentete."
    ".$message->getMessage("installeffected")."".$message->getMessage("Clickhere")."
    "; return $tableauprincipal; } switch($step) { case 0 : $bool=true; $chainecontrol =""; if (version_compare(phpversion(),'7.2','>=')==1) { $chainecontrol .= ""; } else { $bool=false; $chainecontrol .= ""; } if (in_array("mysql", PDO::getAvailableDrivers(), TRUE)) { $mysqlversion = explode(" ", getModuleSetting('pdo_mysql','Client API version')); $chainecontrol .= ""; } else { $bool=false; $chainecontrol .= ""; } if(in_array("pgsql", PDO::getAvailableDrivers(), TRUE)) { $pgsqlversion = explode(" ", getModuleSetting('pdo_pgsql','PostgreSQL(libpq) Version')); $chainecontrol .= ""; } else { $bool=true; $chainecontrol .= ""; } if(getModuleSetting('ldap','LDAP Support')) { $ldapversion = getModuleSetting('ldap','API Version'); $chainecontrol .= ""; } else { $bool=true; $chainecontrol .= ""; } if(getModuleSetting('odbc','ODBC Support')) { $chainecontrol .= ""; } else { $bool=true; $chainecontrol .= ""; } if(getModuleSetting('hash','hash support')) { $chainecontrol .= ""; } else { $bool=false; $chainecontrol .= ""; } /* if(getModuleSetting('mcrypt','Version')) { $chainecontrol .= ""; } else { $bool=false; $chainecontrol .= ""; }*/ if(getModuleSetting('ftp','FTP support')) { $chainecontrol .= ""; } else { $bool=true; $chainecontrol .= ""; } clearstatcache(); if((!is_writable($CONF_LIB_PATH.'config')) || (!is_writable($CONF_LIB_PATH.'data')) || (!is_writable($CONF_LIB_PATH.'lib')) || (!is_writable($CONF_LIB_PATH.'log'))) { $bool=false; $chainecontrol .= ""; } else { $chainecontrol .= ""; } // if(!is_writable($CONF_LIB_PATH.'config')) // { // // Contrôle des droits d'écriture sur les fichiers de configuration // // if(!is_writable($CONF_LIB_PATH.'config') // // { // $bool=false; // $chainecontrol .= ""; // } else { // $chainecontrol .= ""; // // } // } // Contrôle des droits d'écriture sur les répertoires data/ et lib/ et affichage d'un message d'erreur spécifique if(is_writable($CONF_LIB_PATH.'data')) { //$chainecontrol .= ""; } if(is_writable($CONF_LIB_PATH.'lib')) { //$chainecontrol .= ""; } if (is_writable($CONF_LIB_PATH.'log')) { // Contrôle de l'existence des fichiers logs. Dans le cas échéant = création. if(!file_exists($CONF_LIB_PATH.'log/auth.alien.log')) { $bool=false; if (($isFileCreated = @fopen($CONF_LIB_PATH."log/auth.alien.log","w")) == true) { $bool=true; $boollog=true; //$chainecontrol .= ""; } else { $chainecontrol .= ""; } } else { $boollog=true; } if(!file_exists($CONF_LIB_PATH.'log/auth.log')) { $bool=false; if (($isFileCreated = @fopen($CONF_LIB_PATH."log/auth.log","w")) == true) { $bool=true; $boollog=true; //$chainecontrol .= ""; } else { $chainecontrol .= ""; } } else { $boollog=true; } if(!file_exists($CONF_LIB_PATH.'log/error.log')) { $bool=false; if (($isFileCreated = @fopen($CONF_LIB_PATH."log/error.log","w")) == true) { $bool=true; $boollog=true; //$chainecontrol .= ""; } else { $chainecontrol .= ""; } } else { $boollog=true; } if(!file_exists($CONF_LIB_PATH.'log/message.log')) { $bool=false; if (($isFileCreated = @fopen($CONF_LIB_PATH."log/message.log","w")) == true) { $bool=true; $boollog=true; //$chainecontrol .= ""; } else { $chainecontrol .= ""; } } else { $boollog=true; } if(!file_exists($CONF_LIB_PATH.'log/template.log')) { $bool=false; if (($isFileCreated = @fopen($CONF_LIB_PATH."log/template.log","w")) == true) { $bool=true; $boollog=true; //$chainecontrol .= ""; } else { $chainecontrol .= ""; } } else { $boollog=true; } if($boollog == true) { $chainecontrol .= ""; } else { $chainecontrol .= ""; } } // Contrôle des droits d'écriture sur les fichiers de logs et affichage d'un message d'erreur spécifique if(is_writable($CONF_LIB_PATH.'log/auth.alien.log') || is_writable($CONF_LIB_PATH.'log/auth.log') || is_writable($CONF_LIB_PATH.'log/error.log') || is_writable($CONF_LIB_PATH.'log/message.log') || is_writable($CONF_LIB_PATH.'log/template.log')) { $chainecontrol .= ""; } // Contrôle de l'inexistence du fichier de cache (data/upload/install/cache/cache.dat) et affichage d'un message d'erreur spécifique if(file_exists($CONF_LIB_PATH.'data/upload/install/cache/cache.dat')) { $bool=false; $chainecontrol .= ""; } $chaine .= "

    ".$message->getMessage("Step".$step)."

    "; $chaine .= "
    ".$chainecontrol."
    ".$message->getMessage("phpcorrect")."".phpversion()."
    ".$message->getMessage("phpincorrect")."".phpversion()."< 4.1
    ".$message->getMessage("mysqlon")."".$mysqlversion[1]."
    ".$message->getMessage("mysqloff")."
    ".$message->getMessage("pgsqlon")."".$pgsqlversion[0]."
    ".$message->getMessage("pgsqloff")."
    ".$message->getMessage("ldapon")."".$ldapversion."
    ".$message->getMessage("ldapoff")."
    ".$message->getMessage("odbcon")."OK
    ".$message->getMessage("odbcoff")."
    ".$message->getMessage("hashon")."OK
    ".$message->getMessage("hashoff")."
    ".$message->getMessage("mcrypton")."OK
    ".$message->getMessage("mcryptoff")."
    ".$message->getMessage("ftpon")."OK
    ".$message->getMessage("ftpoff")."
    ".$message->getMessage("writeerrorreps"); if(!is_writable($CONF_LIB_PATH.'config')) { $chainecontrol .= " config/"; } if(!is_writable($CONF_LIB_PATH.'data')) { $chainecontrol .= " data/"; } if(!is_writable($CONF_LIB_PATH.'lib')) { $chainecontrol .= " lib/"; } if(!is_writable($CONF_LIB_PATH.'log')) { $chainecontrol .= " log/"; } $chainecontrol .= $message->getMessage("writeerrorrepsend")."
    ".$message->getMessage("writeonreps")."OK
    ".$message->getMessage("writeerrorconf")."
    ".$message->getMessage("writeonconf")."OK
    ".$message->getMessage("writeonrepdata")."OK
    ".$message->getMessage("writeonreplib")."OK
    ".$message->getMessage("createlogfile")."auth.alien.logOK
    ".$message->getMessage("createerrorlogauthalien")."
    ".$message->getMessage("createlogfile")."auth.logOK
    ".$message->getMessage("createerrorlogauth")."
    ".$message->getMessage("createlogfile")."error.logOK
    ".$message->getMessage("createerrorlogerror")."
    ".$message->getMessage("createlogfile")."message.logOK
    ".$message->getMessage("createerrorlogmessage")."
    ".$message->getMessage("createlogfile")."template.logOK
    ".$message->getMessage("createerrorlogtemplate")."
    ".$message->getMessage("createlogfiles")."OK
    ".$message->getMessage("writeerrorlogs")."
    ".$message->getMessage("writeonlogs")."OK
    ".$message->getMessage("cacheerror")."
    "; if($bool) { $chaine .= "

    getMessage("Next")."\" class=\"button\"/>

    "; } $chaine .= "
"; $chaineprocess .= stepprocess($step,$etat); $chaineprocess .= stepprocess($step+1,0); $chaineprocess .= stepprocess($step+2,0); $chaineprocess .= stepprocess($step+3,0); break; case 1 : $chaine .= "

".$message->getMessage("Step".$step)."

"; if(isset($_POST['verif'])) { $chaine .= datasource(); } else { $chaine .= datasource($_POST); } $chaineprocess .= stepprocess($step-1,1); $chaineprocess .= stepprocess($step,$etat); $chaineprocess .= stepprocess($step+1,0); $chaineprocess .= stepprocess($step+2,0); break; case 2 : $chaine .= "

".$message->getMessage("Adapt")."

"; if(!$_POST) { $chaine .= adapt(); } else { $chaine .= adapt($_POST); } $chaineprocess .= stepprocess($step-2,1); $chaineprocess .= stepprocess($step-1,1); $chaineprocess .= stepprocess($step,$etat); $chaineprocess .= stepprocess($step+1,0); break; case 3 : $chaine .= "

".$message->getMessage("Rootuser")."

"; if(!$_POST) { $chaine .= admin(); } else { $chaine .= admin($_POST); } $chaineprocess .= stepprocess($step-3,1); $chaineprocess .= stepprocess($step-2,1); $chaineprocess .= stepprocess($step-1,1); $chaineprocess .= stepprocess($step,0); break; default : $chaine .="

".$message->getMessage("textinstalled")."

"; $chaine .= ""; $chaineprocess .= stepprocess($step-4,1); $chaineprocess .= stepprocess($step-3,1); $chaineprocess .= stepprocess($step-2,1); $chaineprocess .= stepprocess($step-1,1); $chaineprocess .= stepprocess($step,1); break; } $chaine .="
"; $chaineprocess .="
"; $tableauprincipal =$chaineentete.$chaineprocess.$chaine; return $tableauprincipal; } ?>