explnum_notice; if($ligne->explnum_bulletin != 0){ //si bulletin, les droits sont rattachés à la notice du bulletin, à défaut du pério... $req = "select bulletin_notice,num_notice from bulletins where bulletin_id =".$ligne->explnum_bulletin; $res = mysql_query($req,$dbh); if(mysql_num_rows($res)){ $row = mysql_fetch_object($res); $id_for_rigths = $row->num_notice; if(!$id_for_rigths){ $id_for_rigths = $row->bulletin_notice; } }$type = "" ; } //droits d'acces emprunteur/notice if ($gestion_acces_active==1 && $gestion_acces_empr_notice==1) { $ac= new acces(); $dom_2= $ac->setDomain(2); $rights= $dom_2->getRights($_SESSION['id_empr_session'],$id_for_rigths); } //Accessibilité des documents numériques aux abonnés en opac $req_restriction_abo = "SELECT explnum_visible_opac, explnum_visible_opac_abon FROM notices,notice_statut WHERE notice_id='".$id_for_rigths."' AND statut=id_notice_statut "; $result=mysql_query($req_restriction_abo,$dbh); $expl_num=mysql_fetch_array($result,MYSQL_ASSOC); if($pmb_logs_activate){ //Récupération des informations du document numérique recup_explnum_infos($explnum_id); //Enregistrement du log global $log, $infos_explnum; $rqt= " select empr_prof,empr_cp, empr_ville as ville, empr_year, empr_sexe, empr_login, empr_date_adhesion, empr_date_expiration, count(pret_idexpl) as nbprets, count(resa.id_resa) as nbresa, code.libelle as codestat, es.statut_libelle as statut, categ.libelle as categ, gr.libelle_groupe as groupe,dl.location_libelle as location from empr e left join empr_codestat code on code.idcode=e.empr_codestat left join empr_statut es on e.empr_statut=es.idstatut left join empr_categ categ on categ.id_categ_empr=e.empr_categ left join empr_groupe eg on eg.empr_id=e.id_empr left join groupe gr on eg.groupe_id=gr.id_groupe left join docs_location dl on e.empr_location=dl.idlocation left join resa on e.id_empr=resa_idempr left join pret on e.id_empr=pret_idempr where e.empr_login='".addslashes($_SESSION['user_code'])."' group by resa_idempr, pret_idempr"; $res=mysql_query($rqt,$dbh); if($res){ $empr_carac = mysql_fetch_array($res); $log->add_log('empr',$empr_carac); } $log->add_log('num_session',session_id()); $log->add_log('explnum',$infos_explnum); $infos_restriction_abo = array(); foreach ($expl_num as $key=>$value) { $infos_restriction_abo[$key] = $value; } $log->add_log('restriction_abo',$infos_restriction_abo); $log->save(); } if( $rights & 16 || (is_null($dom_2) && $expl_num["explnum_visible_opac"] && (!$expl_num["explnum_visible_opac_abon"] || ($expl_num["explnum_visible_opac_abon"] && $_SESSION["user_code"])))){ if (($ligne->explnum_data)||($ligne->explnum_path)) { if ($ligne->explnum_path) { $up = new upload_folder($ligne->repertoire_id); $path = str_replace("//","/",$ligne->path); $path=$up->encoder_chaine($path); if(file_exists($path) && filesize($path)){ $fo = fopen($path,'rb'); }else{ $fo=false; header("Location: images/mimetype/unknown.gif"); exit ; } if ($fo && (substr($ligne->explnum_mimetype,0,5)=="image")&&($opac_photo_watermark)) { $ligne->explnum_data=fread($fo,filesize($path)); fclose($fo); } else $ligne->explnum_data=""; } create_tableau_mimetype() ; $name=$_mimetypes_bymimetype_[$ligne->explnum_mimetype]["plugin"] ; if ($name) { $type = "" ; // width='700' height='525' $name = " name='$name' "; } $type="type='$ligne->explnum_mimetype'" ; if ($_mimetypes_bymimetype_[$ligne->explnum_mimetype]["embeded"]=="yes") { print "
" ; if ($fo) fclose($fo); exit ; } $nomfichier=""; if ($ligne->explnum_nomfichier) { $nomfichier=$ligne->explnum_nomfichier; } elseif ($ligne->explnum_extfichier) $nomfichier="pmb".$ligne->explnum_id.".".$ligne->explnum_extfichier; if ($nomfichier) header("Content-Disposition: inline; filename=".$nomfichier); if ((substr($ligne->explnum_mimetype,0,5)=="image")&&($opac_photo_watermark)) { $content_image=reduire_image_middle($ligne->explnum_data); if ($content_image) { print header("Content-Type: image/png"); print $content_image; } else { header("Content-Type: ".$ligne->explnum_mimetype); print $ligne->explnum_data; } } else { header("Content-Type: ".$ligne->explnum_mimetype); if (($fo)&&($ligne->explnum_path)&&(!$ligne->explnum_data)) { while(!feof($fo)){ print fread($fo,4096); } //fpassthru($fo); fclose($fo); } else print $ligne->explnum_data; } exit ; } if ($ligne->explnum_mimetype=="URL") { if ($ligne->explnum_url) header("Location: $ligne->explnum_url"); exit ; } }else{ print $msg['forbidden_docnum']; }