Modification emplacement des variables et simplification des fichiers
This commit is contained in:
parent
709e164456
commit
c2afcadf0c
@ -5,21 +5,10 @@
|
||||
*
|
||||
*/
|
||||
|
||||
// MODIF
|
||||
global $fichierPdf;
|
||||
|
||||
require_once 'index.fct.php';
|
||||
require_once 'fwk.php';
|
||||
require_once 'default/_includes/mysql.php';
|
||||
|
||||
session_start();
|
||||
$cle_cookie='sdjglsdkhmsoL68';
|
||||
|
||||
$timeout=1800;
|
||||
if(ENVIRONNEMENT == 'DEV'){ $timeout=36000; }
|
||||
|
||||
$refresh=5;
|
||||
|
||||
if (ENV!='PRD') {
|
||||
// Pas de mise en cache WSDL pour SOAP
|
||||
ini_set('soap.wsdl_cache_enabled', 0);
|
||||
@ -245,8 +234,4 @@ switch ($page) {
|
||||
break;
|
||||
}
|
||||
logAction($tabInfo['login'], $page, $_REQUEST['siret'], $tabInfo['ip'], $tabInfo['host'], $tabInfo['resolution'], $tabInfo['nbcolors'], $tabInfo['user_agent'],$tabInfo['referer1'], gmdate('Y/m/d H:i:s',$tabInfo['date_login']+3600), gmdate('Y/m/d H:i:s',$tabInfo['date_last_action']+3600), implode(', ',$_REQUEST));
|
||||
if ($sortie=='pdf') {
|
||||
ob_end_flush();
|
||||
readfile($fichierPdf);
|
||||
}
|
||||
?>
|
@ -1,21 +1,26 @@
|
||||
<?php
|
||||
|
||||
$timeout=1800;
|
||||
if(ENVIRONNEMENT == 'DEV'){ $timeout=36000; }
|
||||
$cle_cookie = 'sdjglsdkhmsoL68';
|
||||
|
||||
//Vérification en session
|
||||
if ($_REQUEST['checkIp']=='only'){
|
||||
|
||||
|
||||
if (trim($_REQUEST['login'])=='') {
|
||||
$message="Erreur 10300 : Identifiant de connexion et/ou mot de passe incorrect !";
|
||||
include('./pages/logout.php');
|
||||
die();
|
||||
}
|
||||
|
||||
$login = $_REQUEST['login'];
|
||||
$hach = 'iponly:'.$_SERVER['REMOTE_ADDR'];
|
||||
|
||||
$login = $_REQUEST['login'];
|
||||
$hach = 'iponly:'.$_SERVER['REMOTE_ADDR'];
|
||||
|
||||
}elseif ($_SESSION['connected']==TRUE && $_REQUEST['action']!='logout' && $_REQUEST['action']!='logon' ) {
|
||||
// On vérifie la validité de la session
|
||||
$tabInfo=$_SESSION['tabInfo'];
|
||||
$firephp->log($tabInfo,'tabInfo');
|
||||
|
||||
|
||||
if ($tabInfo['date_last_action']+$timeout<time()) {
|
||||
$message="Vous avez été déconnecté de l'extranet suite à un délai d'inactivité trop long (1)";
|
||||
include('./pages/logout.php');
|
||||
@ -23,32 +28,32 @@ if ($_REQUEST['checkIp']=='only'){
|
||||
// On met à jour l'heure de la dernière action
|
||||
$tabInfo['date_last_action']=time();
|
||||
$_SESSION['tabInfo']=$tabInfo;
|
||||
|
||||
|
||||
//Affectation Login et pass
|
||||
$login = $_SESSION['tabInfo']['login'];
|
||||
($_REQUEST['checkIp']=='only' || strstr($hach, 'iponly:')!=FALSE ) ? ($hach = 'iponly:'.$_SERVER['REMOTE_ADDR']) : ($hach = $_SESSION['tabInfo']['password']);
|
||||
($_REQUEST['checkIp']=='only' || strstr($hach, 'iponly:')!=FALSE ) ? ($hach = 'iponly:'.$_SERVER['REMOTE_ADDR']) : ($hach = $_SESSION['tabInfo']['password']);
|
||||
|
||||
}elseif ($_REQUEST['action']=='logon' && ( trim($_REQUEST['login'])!='' && trim($_REQUEST['hach'])!='' ) ) {
|
||||
|
||||
|
||||
if (trim($_REQUEST['login'])=='') {
|
||||
$message="Erreur 10300 : Identifiant de connexion et/ou mot de passe incorrect !";
|
||||
include('./pages/logout.php');
|
||||
die();
|
||||
}
|
||||
|
||||
|
||||
if ($_REQUEST['pass']!='') afficheErreur('Erreur 10005 : Connexion impossible !');
|
||||
//if ($_REQUEST['lang']!='fr') afficheErreur('Erreur 10006 : Connexion impossible !');
|
||||
|
||||
|
||||
$login = $_REQUEST['login'];
|
||||
$hach = $_REQUEST['hach'];
|
||||
|
||||
$hach = $_REQUEST['hach'];
|
||||
|
||||
}elseif ($_REQUEST['action']=='logout') {
|
||||
include('./pages/logout.php');
|
||||
die();
|
||||
}elseif ($page!='main' && $_REQUEST['action']!='logon') {
|
||||
|
||||
$message="Vous avez été déconnecté de l'extranet suite à un délai d'inactivité trop long (2)";
|
||||
include('./pages/logout.php');
|
||||
include('./pages/logout.php');
|
||||
}
|
||||
|
||||
$firephp->log($login, 'login');
|
||||
@ -65,15 +70,15 @@ $client = new SoapClient(null, array( 'trace' => 1,
|
||||
|
||||
|
||||
if($_REQUEST['action']=='logon' || $_SESSION['connected']==FALSE)
|
||||
{
|
||||
{
|
||||
//unset($_SESSION);
|
||||
|
||||
|
||||
$secureLocal= md5(date('Ymd').$_SERVER['REMOTE_ADDR'].$_SERVER['HTTP_USER_AGENT']);
|
||||
$secureDist = $_REQUEST['secure'];
|
||||
|
||||
|
||||
$cookieSecure=$secureLocal.'/'.md5($cle_cookie);
|
||||
$tab=unserialize(@file_get_contents('/tmp/sd_'.$secureLocal.'.tmp'));
|
||||
|
||||
|
||||
$tabIpInterdites=array( '81.252.88.*',
|
||||
'195.200.187.163',
|
||||
'213.11.81.41',
|
||||
@ -89,16 +94,16 @@ if($_REQUEST['action']=='logon' || $_SESSION['connected']==FALSE)
|
||||
foreach ($tabIpInterdites as $ip) {
|
||||
if (preg_match('/^'.str_replace('*','.*',str_replace('.','\.',$ip)).'$/', $_SERVER['REMOTE_ADDR']) ){
|
||||
afficheErreur('Erreur 10105 : Connexion impossible !');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//Récupération des infos si pas de session
|
||||
|
||||
//Récupération des infos si pas de session
|
||||
try {
|
||||
$O = $client->getInfosLogin($login, $_SERVER['REMOTE_ADDR']);
|
||||
$user=$O['result'];
|
||||
$firephp->log($user,'result');
|
||||
|
||||
if ($user['connected']==true)
|
||||
|
||||
if ($user['connected']==true)
|
||||
{
|
||||
$tabInfo['login'] = $login;
|
||||
$tabInfo['password'] = $hach;
|
||||
@ -125,37 +130,37 @@ if($_REQUEST['action']=='logon' || $_SESSION['connected']==FALSE)
|
||||
$tabInfo['id'] = $user['id'];
|
||||
$tabInfo['idClient'] = $user['idClient'];
|
||||
$tabInfo['reference'] = $user['reference'];
|
||||
|
||||
|
||||
$_SESSION['connected']=true;
|
||||
$_SESSION['tabInfo']=$tabInfo;
|
||||
|
||||
|
||||
//include('./pages/main.php');
|
||||
logAction($tabInfo['login'], $page, $_REQUEST['siret'], $tabInfo['ip'], $tabInfo['host'], $tabInfo['resolution'], $tabInfo['nbcolors'], $tabInfo['user_agent'],$tabInfo['referer1'], gmdate('Y/m/d H:i:s',$tabInfo['date_login']+3600), gmdate('Y/m/d H:i:s',$tabInfo['date_last_action']+3600), implode(', ',$_REQUEST));
|
||||
|
||||
|
||||
} elseif ($O['error']['errnum']<>0) {
|
||||
$message='Erreur '. $O['error']['errnum'] .' : '. $O['error']['errmsg'];
|
||||
if($O['error']['errnum']=='10301' && $login=='rsipdll'){
|
||||
$message.= '<br/>Pour tout problème technique, contactez le service support par téléphone au 01.48.00.04.52 ou par mail à <a href="mailto:support@scores-decisions.com">support@scores-decisions.com</a>';
|
||||
$message.= '<br/>Pour tout problème technique, contactez le service support par téléphone au 01.48.00.04.52 ou par mail à <a href="mailto:support@scores-decisions.com">support@scores-decisions.com</a>';
|
||||
}
|
||||
include('./pages/logout.php');
|
||||
logAction($tabInfo['login'], $page, $_REQUEST['siret'], $tabInfo['ip'], $tabInfo['host'], $tabInfo['resolution'], $tabInfo['nbcolors'], $tabInfo['user_agent'],$tabInfo['referer1'], gmdate('Y/m/d H:i:s',$tabInfo['date_login']+3600), gmdate('Y/m/d H:i:s',$tabInfo['date_last_action']+3600), implode(', ',$_REQUEST));
|
||||
print_r($tabInfoUser);
|
||||
die();
|
||||
die();
|
||||
}else {
|
||||
$message="Erreur 10302 : Identifiant de connexion et/ou mot de passe incorrect !";
|
||||
include('./pages/logout.php');
|
||||
logAction($tabInfo['login'], $page, $_REQUEST['siret'], $tabInfo['ip'], $tabInfo['host'], $tabInfo['resolution'], $tabInfo['nbcolors'], $tabInfo['user_agent'],$tabInfo['referer1'], gmdate('Y/m/d H:i:s',$tabInfo['date_login']+3600), gmdate('Y/m/d H:i:s',$tabInfo['date_last_action']+3600), implode(', ',$_REQUEST));
|
||||
print_r($tabInfoUser);
|
||||
die();
|
||||
die();
|
||||
}
|
||||
} catch (SoapFault $fault) {
|
||||
if($fault->faultcode!='900'){
|
||||
if($fault->faultcode!='900'){
|
||||
require_once 'soaperror.php';
|
||||
processSoapFault($client,$fault,$tabInfo);
|
||||
}
|
||||
$message="Erreur 10301 : Identifiant de connexion et/ou mot de passe incorrect !";
|
||||
if($login=='rsipdll'){
|
||||
$message.= '<br/>Pour tout problème technique, contactez le service support par téléphone au 01.48.00.04.52 ou par mail à <a href="mailto:support@scores-decisions.com">support@scores-decisions.com</a>';
|
||||
$message.= '<br/>Pour tout problème technique, contactez le service support par téléphone au 01.48.00.04.52 ou par mail à <a href="mailto:support@scores-decisions.com">support@scores-decisions.com</a>';
|
||||
}
|
||||
include('./pages/logout.php');
|
||||
die();
|
||||
|
@ -1,4 +1,5 @@
|
||||
<?
|
||||
$refresh = 5;
|
||||
$url_connexion = $_SESSION['tabInfo']['referer_login'];
|
||||
|
||||
if ($url_connexion != SITEINST_URL1
|
||||
|
Loading…
Reference in New Issue
Block a user