Correction de `upload/local_data` en fonction de la nouvelle structure.

This commit is contained in:
xdrm-brackets 2016-05-03 17:38:54 +02:00
parent 6c7ef41377
commit 9cef4c086b
2 changed files with 8 additions and 2 deletions

View File

@ -247,10 +247,15 @@
/* (4) Vérification des contacts */ /* (4) Vérification des contacts */
foreach($json['contacts'] as $contact){ foreach($json['contacts'] as $contact){
$checkContact = isset($contact['username']) && is_string($contact['username']); $checkContact = isset($contact['uid']) && is_numeric($contact['uid']);
$checkContact = $checkContact && isset($contact['username']) && is_string($contact['username']);
$checkContact = $checkContact && isset($contact['firstname']) && is_string($contact['firstname']); $checkContact = $checkContact && isset($contact['firstname']) && is_string($contact['firstname']);
$checkContact = $checkContact && isset($contact['lastname']) && is_string($contact['lastname']); $checkContact = $checkContact && isset($contact['lastname']) && is_string($contact['lastname']);
$checkContact = $checkContact && isset($contact['number']) && ( is_numeric($contact['number']) || is_string($contact['number']) ); $checkContact = $checkContact && isset($contact['number']) && ( is_numeric($contact['number']) || is_string($contact['number']) );
$checkContact = $checkContact && isset($contact['sms']) && is_numeric($contact['sms']);
$checkContact = $checkContact && isset($contact['call']) && is_numeric($contact['call']);
$checkContact = $checkContact && isset($contact['countsms']) && is_numeric($contact['countsms']);
$checkContact = $checkContact && isset($contact['countcall']) && is_numeric($contact['countcall']);
// Si erreur des attributs du contact incorrects ou manquants // Si erreur des attributs du contact incorrects ou manquants
if( !$checkContact ) if( !$checkContact )
@ -277,6 +282,7 @@
/* (6) Vérification des fiches */ /* (6) Vérification des fiches */
foreach($json['fiches'] as $fiches){ foreach($json['fiches'] as $fiches){
$checkFiche = isset($fiches['uid']) && is_numeric($fiches['uid']); $checkFiche = isset($fiches['uid']) && is_numeric($fiches['uid']);
$checkFiche = $checkFiche && isset($fiches['contact']) && is_numeric($fiches['contact']);
$checkFiche = $checkFiche && isset($fiches['sexe']) && is_array($fiches['sexe']); $checkFiche = $checkFiche && isset($fiches['sexe']) && is_array($fiches['sexe']);
$checkFiche = $checkFiche && isset($fiches['age']) && is_string($fiches['age']); $checkFiche = $checkFiche && isset($fiches['age']) && is_string($fiches['age']);
$checkFiche = $checkFiche && isset($fiches['job']) && is_string($fiches['job']); $checkFiche = $checkFiche && isset($fiches['job']) && is_string($fiches['job']);

File diff suppressed because one or more lines are too long