48 lines
1.4 KiB
PHP
Executable File
48 lines
1.4 KiB
PHP
Executable File
<?php
|
|
/**
|
|
* Script contrôlant les données envoyées leur d'une demande de mise à jour de l'image illustrant un post.
|
|
*
|
|
**/
|
|
require_once("../modele/FclFlux_post.php");
|
|
$user=new FclFlux_utilisateur();
|
|
if(!$user->test_session(false))
|
|
{
|
|
unset($user);
|
|
header("Location:".PAGE_CONNEXION);
|
|
exit();
|
|
}
|
|
if((empty($_POST["id_post_illustration"]))||(empty($_POST["ancre_illustration"])))
|
|
exit();
|
|
else
|
|
{
|
|
$form["limites"]["ancre_long_min"]=POST_MIN_ANCRE;
|
|
$form["limites"]["ancre_long_max"]=POST_MAX_ANCRE;
|
|
$form["id_post"]=intval($_POST["id_post_illustration"]);
|
|
$form["ancre"]=$_POST["ancre_illustration"];
|
|
$post=new FclFlux_post($form);
|
|
}
|
|
if(empty($Bd))
|
|
require("../modele/connexion-bd.php");
|
|
$msg_form=array();
|
|
if(!empty($_FILES['illustration']['tmp_name']))
|
|
{
|
|
$set_illus=$post->set_illustration($_FILES['illustration']);
|
|
if($set_illus===true)
|
|
$msg_form[]=MSG_UTILISA_TELECHARGE_VALID;
|
|
elseif(!empty($post->erreurs))
|
|
$msg_form=$post->erreurs;
|
|
else
|
|
$msg_form[]=ERREUR_IMPREVUE;
|
|
}
|
|
if(!empty($_POST["suppr_illustration"]))
|
|
{
|
|
$suppr=$post->suppr_illustration();
|
|
if(!empty($post->erreurs))
|
|
$msg_form=$post->erreurs;
|
|
else if($suppr===false)
|
|
$msg_form[]=ERREUR_IMPREVUE;
|
|
else
|
|
$msg_form[]=MSG_UTILISA_MAJ_SUPPR_VALID;
|
|
}
|
|
//affiche les résultats dans l'iframe qui passe l'infos à la page appelante via un javascript
|
|
include("../vues/post_illustration_maj.php"); |