setDomain(1);
$acces_m = $dom_1->getRights($PMBuserid,$f_notice,8);
}
if ($acces_m==0) {
if (!$f_explnum_id) {
error_message('', htmlentities($dom_1->getComment('mod_noti_error'), ENT_QUOTES, $charset), 1, '');
} else {
error_message('', htmlentities($dom_1->getComment('mod_enum_error'), ENT_QUOTES, $charset), 1, '');
}
} else {
if(!isset($forcage)){
$forcage = 0;
}
if ($forcage == 1) {
$tab = unserialize(stripslashes($ret_url));
foreach($tab->GET as $key => $val){
if (get_magic_quotes_gpc()) {
$GLOBALS[$key] = $val;
} else {
add_sl($val);
$GLOBALS[$key] = $val;
}
}
foreach($tab->POST as $key => $val){
if (get_magic_quotes_gpc()) {
$GLOBALS[$key] = $val;
} else {
add_sl($val);
$GLOBALS[$key] = $val;
}
}
foreach($tab->FILES as $key => $val){
if (get_magic_quotes_gpc()) {
$_FILES[$key] = $val;
} else {
add_sl($val);
$_FILES[$key] = $val;
}
}
}
$retour = "./catalog.php?categ=isbd&id=$f_notice";
//Vérification des champs personalisés
$p_perso=new parametres_perso("explnum");
$nberrors=$p_perso->check_submited_fields();
if ($nberrors) {
error_message_history($msg["notice_champs_perso"],$p_perso->error_message,1);
exit();
}
$explnum = new explnum($f_explnum_id);
$explnum->set_p_perso($p_perso);
if(!$forcage && ($pmb_explnum_controle_doublons != 0) ) {
//Si controle de dedoublonnage active
if (file_exists($base_path.'/temp/explnum_doublon_'.$f_notice)) {
// On supprime les doublons stockés inutilement
unlink($base_path.'/temp/explnum_doublon_'.$f_notice);
}
// En modification de document numérique, on ne dedoublonne pas
if(!$f_explnum_id) {
$signature = $explnum->gen_signature($_FILES['f_fichier']['tmp_name']);
if ($signature) {
$query = "select explnum_id, explnum_notice, explnum_bulletin, explnum_nom from explnum where explnum_signature = '".$signature."'";
$result = pmb_mysql_query($query);
if ($dbls = pmb_mysql_num_rows($result)) {
$new_name = $base_path.'/temp/explnum_doublon_'.$f_notice;
move_uploaded_file($_FILES['f_fichier']['tmp_name'], $new_name);
$_FILES['f_fichier']['tmp_name'] = $new_name;
//affichage de l'erreur, en passant tous les param postes (serialise) pour l'eventuel forcage
$tab = new stdClass();
$tab->POST = $_POST;
$tab->GET = $_GET;
$tab->FILES = $_FILES;
$ret_url = htmlentities(serialize($tab), ENT_QUOTES, $charset);
print "