test_session(true,true)) { header("Location:".SITE_URL); exit(); } else { if(empty($Bd)) require("../modele/connexion-bd.php"); $msg_form=array(); if((empty($_POST["id_hub"]))||(empty($_POST["nom"]))) $msg_form[]=ERREUR_UTILISA_CHAMPS_ABSENTS; else { $form["limites"]["nom_long_min"]=HUB_MIN_NOM; $form["limites"]["nom_long_max"]=HUB_MAX_NOM; $form["id_hub"]=intval(trim($_POST["id_hub"])); $form["nom"]=trim($_POST["nom"]); $hub=new FclFlux_hub($form); if(!empty($hub->erreurs)) $msg_form=array_merge($hub->erreurs,$msg_form); if(empty($msg_form)) { if(!empty($_FILES['illustration']['tmp_name'])) { $hub->set_illustration($_FILES['illustration']); if(empty($hub->erreurs)) $action=$hub->actualise_illustration(); } if(!empty($_POST["suppr_illustration"])) $action=$hub->actualise_illustration(true);//supprime le fichier if(!empty($hub->erreurs)) $msg_form=array_merge($hub->erreurs,$msg_form); elseif($action===false) $msg_form[]=ERREUR_IMPREVUE; if(empty($msg_form)) $msg_form[]=MSG_ADMIN_VALID; } } //affiche les résultats dans l'iframe include("../vues/admin_hub_illustration_maj.php"); }