153 lines
5.2 KiB
PHP
Executable File
153 lines
5.2 KiB
PHP
Executable File
<?php
|
|
$nomFicAppelant = basename(__FILE__);
|
|
if (empty($navMsg)) {$refresh='Oui';include ($includePath. '/req/05-init.navMsgList.php');$refresh='N';}
|
|
if (empty($clientMsg)) {$refresh='Oui';include ($includePath. '/req/06-init.cliMsgList.php');$refresh='N';}
|
|
if (empty($contactMsg)) {$refresh='Oui';include ($includePath. '/req/13-init.contactMsgList.php');$refresh='N';}
|
|
include_once ($includePath. '/_fonctions/fonctions.gene.php');
|
|
|
|
// ---------------------------------------------------
|
|
// Liste des messages
|
|
// ---------------------------------------------------
|
|
$mess1='' .$clientMsg[82]. '';//caractere
|
|
$mess2='' .$clientMsg[83]. '';//interdit dans la chaine
|
|
$mess3='' .$clientMsg[84]. '';//caracateres dans
|
|
$mess4='' .$clientMsg[85]. '';//trop court
|
|
$mess5='' .$clientMsg[86]. '';//au lieu de
|
|
|
|
$validLogin='O';
|
|
|
|
// ---------------------------------------------------
|
|
// Controle si le mail est non vide
|
|
// ---------------------------------------------------
|
|
if (empty($cliMail) && $validLogin!='N') {
|
|
$usrSiteMsg .= $clientMsg[39];
|
|
$validLogin='N';
|
|
$usrSiteMsgClass='ko';
|
|
}
|
|
|
|
// ---------------------------------------------------
|
|
// Caracteres dans mail
|
|
// ---------------------------------------------------
|
|
if ($cliMail!='' && $validLogin!='N') {
|
|
$char =CheckValidName($cliMail);
|
|
if (!empty ($char)) {
|
|
$usrSiteMsg .= ''.$mess1.' "'.$char.'" '.$mess2.' "' .$cliMail. '"';
|
|
$validLogin='N';
|
|
$usrSiteMsgClass='ko';
|
|
}
|
|
|
|
$nbCar=5;
|
|
$longueur=mb_strlen($cliMail);
|
|
if ($longueur < $nbCar && $validLogin!='N') {
|
|
$usrSiteMsg .= $cliMail. ' ' .$mess4;
|
|
$validLogin='N';
|
|
$usrSiteMsgClass='ko';
|
|
}
|
|
}
|
|
|
|
// ---------------------------------------------------
|
|
// Controle si le mail a un @
|
|
// ---------------------------------------------------
|
|
$testMail=mb_strpos($cliMail,'@');
|
|
// echo 'testM:' .$testMail;
|
|
if (empty($testMail) && $validLogin!='N') {
|
|
$usrSiteMsg .= '' .$clientMsg[43]. ' : ' .$cliMail. '';
|
|
$validLogin='N';
|
|
$usrSiteMsgClass='ko';
|
|
}
|
|
|
|
// ---------------------------------------------------
|
|
// Controle si le mail a un '.' Apres @
|
|
// ---------------------------------------------------
|
|
$testPointApres=strstr($cliMail, '@');
|
|
// echo '<br>testPointApres=' .$testPointApres;
|
|
$testPoint=mb_strpos($testPointApres,'.');
|
|
// echo '<br>testP:' .$testPoint;
|
|
if ($testPoint==''&& $validLogin!='N') {
|
|
$usrSiteMsg .= '' .$clientMsg[42]. ' : ' .$cliMail. '';
|
|
$validLogin='N';
|
|
$usrSiteMsgClass='ko';
|
|
}
|
|
|
|
// ---------------------------------------------------
|
|
// Controle si le cli phone non vide
|
|
// ---------------------------------------------------
|
|
if (empty ($cliPhone) && $validLogin!='N') {
|
|
$usrSiteMsg .= '' .$clientMsg[47]. '';
|
|
$validLogin='N';
|
|
$usrSiteMsgClass='ko';
|
|
}
|
|
else {
|
|
$cliPhone=formatTelpourDB($cliPhone);
|
|
if (isset($cliPhone[0])) $test=substr($cliPhone,0,1);
|
|
if (isset($debug[1]) && $debug[1] == '1' ) $debugMsg .= '<br>test si `+` existe ? = ' .$test;
|
|
|
|
// ---------------------------------------------------
|
|
// le cliPhone à un +
|
|
// il doit faire 10
|
|
// il doit etre nmeric sur 17
|
|
// +33614993058
|
|
if ($test=='+') {
|
|
if (!is_numeric(substr($cliPhone,1)) && $validLogin!='0'){
|
|
//47==Numero de tel invalide
|
|
$usrSiteMsg .= '<span class="msgKo"> '.$clientMsg[47]. '</span>';
|
|
$validLogin='N';
|
|
}
|
|
// CONTROLE la longueur max du cliPhone --> +33614993058
|
|
if (mb_strlen($cliPhone)>17 && $validLogin!='0'){
|
|
//48==longueur incorrecte
|
|
$usrSiteMsg .= '<span class="msgKo"> ' .$clientMsg[48]. '</span>';
|
|
$validLogin='N';
|
|
}
|
|
|
|
// CONTROLE la longueur min du cliPhone --> +33614993058
|
|
if (mb_strlen($cliPhone)<9 && $validLogin!='0'){
|
|
//48==longueur incorrecte
|
|
$usrSiteMsg .= '<span class="msgKo"> ' .$clientMsg[48]. '</span>';
|
|
$validLogin='N';
|
|
}
|
|
}
|
|
else {
|
|
// ---------------------------------------------------
|
|
// le telephone à pas un +
|
|
// il doit faire 10
|
|
// il doit etre nmeric sur 16
|
|
// ---------------------------------------------------
|
|
if (!is_numeric($cliPhone) && $validLogin!='0'){
|
|
$usrSiteMsg .= '<span class="msgKo"> ' .$clientMsg[47]. ' </span>';
|
|
$validLogin='N';
|
|
}
|
|
|
|
// CONTROLE la longueur max du tel --> 0614993058
|
|
if (mb_strlen($cliPhone)>16 && $validLogin!='0'){
|
|
$usrSiteMsg .= '<span class="msgKo"> ' .$clientMsg[48]. '</span>';
|
|
$validLogin='N';
|
|
}
|
|
|
|
// CONTROLE la longueur min du cliPhone --> 0614993058
|
|
if (mb_strlen($cliPhone)<9 && $validLogin!='0'){
|
|
$usrSiteMsg .= '<span class="msgKo"> ' .$clientMsg[48]. '</span>';
|
|
$validLogin='N';
|
|
}
|
|
}
|
|
}
|
|
|
|
// ---------------------------------------------------
|
|
// Controle sujet non vide
|
|
// ---------------------------------------------------
|
|
if (empty($sujet) && $validLogin!='N') {
|
|
$usrSiteMsg .= '' .$contactMsg[63]. '';
|
|
$validLogin='N';
|
|
$usrSiteMsgClass='ko';
|
|
}
|
|
|
|
// ---------------------------------------------------
|
|
// Controle msg non vide
|
|
// ---------------------------------------------------
|
|
if (empty($message) && $validLogin!='N') {
|
|
$usrSiteMsg .= '' .$contactMsg[64]. '';
|
|
$validLogin='N';
|
|
$usrSiteMsgClass='ko';
|
|
}
|
|
?>
|