From 083f85e9cfe020a74cb57f6b2b09870d54e8591e Mon Sep 17 00:00:00 2001 From: ojullien <3778194+ojullien@users.noreply.github.com> Date: Tue, 16 Mar 2021 16:50:46 +0100 Subject: [PATCH] Fixed application version Signed-off-by: ojullien <3778194+ojullien@users.noreply.github.com> --- src/install.php | 151 ++++++++++++++++++++++++------------------------ 1 file changed, 74 insertions(+), 77 deletions(-) diff --git a/src/install.php b/src/install.php index 7b776f8..ecb7ff2 100644 --- a/src/install.php +++ b/src/install.php @@ -1,4 +1,5 @@ =') - && !version_compare( $sMYSQLVersion, $sMYSQLVersionRequired, '>=') ) - { - $sTitle='fichier: '.basename(__FILE__).', ligne:'.__LINE__; - ErrorLog( CAuth::GetInstance()->GetUsername(), $sTitle, 'les versions ne sont pas valides', E_USER_ERROR, FALSE); - $tMessageCode[] = 3; - }//if( !version_compare( $sPHPVersion, $sPHPVersionRequired, '>=') ) +/** Prerequiste test + ******************/ +if ( + !version_compare($sPHPVersion, $sPHPVersionRequired, '>=') + && !version_compare($sMYSQLVersion, $sMYSQLVersionRequired, '>=') +) { + $sTitle = 'fichier: ' . basename(__FILE__) . ', ligne:' . __LINE__; + ErrorLog(CAuth::GetInstance()->GetUsername(), $sTitle, 'les versions ne sont pas valides', E_USER_ERROR, FALSE); + $tMessageCode[] = 3; +} //if( !version_compare( $sPHPVersion, $sPHPVersionRequired, '>=') ) - /** Read input parameters - ************************/ - if( filter_has_var( INPUT_POST, 'install') ) - { - $pUser->ReadInput(INPUT_POST); - if( $pUser->IsValidNew()===FALSE ) - { - // Parameters are not valid - $sTitle='fichier: '.basename(__FILE__).', ligne:'.__LINE__; - ErrorLog( CAuth::GetInstance()->GetUsername(), $sTitle, 'les paramètres ne sont pas valides', E_USER_ERROR, FALSE); - $tMessageCode[] = 4; - }//if( $pUser->IsValidNew()===FALSE ) - }//if( ($iMessageCode==0) && filter_has_var( INPUT_POST, 'install') ) +/** Read input parameters + ************************/ +if (filter_has_var(INPUT_POST, 'install')) { + $pUser->ReadInput(INPUT_POST); + if ($pUser->IsValidNew() === FALSE) { + // Parameters are not valid + $sTitle = 'fichier: ' . basename(__FILE__) . ', ligne:' . __LINE__; + ErrorLog(CAuth::GetInstance()->GetUsername(), $sTitle, 'les paramètres ne sont pas valides', E_USER_ERROR, FALSE); + $tMessageCode[] = 4; + } //if( $pUser->IsValidNew()===FALSE ) +} //if( ($iMessageCode==0) && filter_has_var( INPUT_POST, 'install') ) - /** Build header - ***************/ - require(PBR_PATH.'/includes/class/cheader.php'); - $pHeader = new CHeader(); - $pHeader->SetNoCache(); - $pHeader->SetTitle('Installation de PBRaiders '.PBR_VERSION); - $pHeader->SetDescription('Installation de PBRaiders '.PBR_VERSION); - $pHeader->SetKeywords('install,installation,installer'); +/** Build header + ***************/ +require(PBR_PATH . '/includes/class/cheader.php'); +$pHeader = new CHeader(); +$pHeader->SetNoCache(); +$pHeader->SetTitle('Installation de PBRaiders ' . PBR_VERSION); +$pHeader->SetDescription('Installation de PBRaiders ' . PBR_VERSION); +$pHeader->SetKeywords('install,installation,installer'); - /** Display or install - *********************/ - require(PBR_PATH.'/includes/display/header.php'); - if( (count($tMessageCode)==0) && ($pUser->IsValidNew()===TRUE) ) - { - // Install - require(PBR_PATH.'/includes-install/install.php'); - } - else - { - // Display - require(PBR_PATH.'/includes-install/welcome.php'); - }//if( (... - require(PBR_PATH.'/includes/display/footer.php'); +/** Display or install + *********************/ +require(PBR_PATH . '/includes/display/header.php'); +if ((count($tMessageCode) == 0) && ($pUser->IsValidNew() === TRUE)) { + // Install + require(PBR_PATH . '/includes-install/install.php'); +} else { + // Display + require(PBR_PATH . '/includes-install/welcome.php'); +} //if( (... +require(PBR_PATH . '/includes/display/footer.php'); - /** Delete objects - *****************/ - unset($pUser,$pHeader); - include(PBR_PATH.'/includes/init/clean.php'); +/** Delete objects + *****************/ +unset($pUser, $pHeader); +include(PBR_PATH . '/includes/init/clean.php');