", $admin_user_form); if(!$id) $title = $msg[85]; // ajout else $title = $msg[90]; // modification $admin_user_form = str_replace('!!id!!', $id, $admin_user_form); $admin_user_form = str_replace('!!title!!', $title, $admin_user_form); $admin_user_form = str_replace('!!login!!', $login, $admin_user_form); $admin_user_form = str_replace('!!nom!!', $nom, $admin_user_form); $admin_user_form = str_replace('!!prenom!!', $prenom, $admin_user_form); $admin_user_form = str_replace('!!nb_per_page_search!!', $nb_per_page_search, $admin_user_form); $admin_user_form = str_replace('!!nb_per_page_select!!', $nb_per_page_select, $admin_user_form); $admin_user_form = str_replace('!!nb_per_page_gestion!!', $nb_per_page_gestion, $admin_user_form); if(!$id) $admin_user_form = str_replace('!!password_field!!', $password_field, $admin_user_form); else $admin_user_form = str_replace('!!password_field!!', '', $admin_user_form); $flag & ADMINISTRATION_AUTH ? $admin_flg_form = "checked " : $admin_flg_form = ""; $flag & CIRCULATION_AUTH ? $circ_flg_form = "checked " : $circ_flg_form = ""; $flag & CATALOGAGE_AUTH ? $catal_flg_form = "checked " : $catal_flg_form = ""; $flag & AUTORITES_AUTH ? $auth_flg_form = "checked " : $auth_flg_form = ""; $flag & EDIT_AUTH ? $edit_flg_form = "checked " : $edit_flg_form = ""; $flag & SAUV_AUTH ? $sauv_flg_form = "checked " : $sauv_flg_form = ""; $flag & DSI_AUTH ? $dsi_flg_form = "checked " : $dsi_flg_form = ""; $flag & PREF_AUTH ? $pref_flg_form = "checked " : $pref_flg_form = ""; $flag & ACQUISITION_AUTH ? $acquisition_flg_form = "checked " : $acquisition_flg_form = ""; $flag & RESTRICTCIRC_AUTH ? $restrictcirc_flg_form = "checked " : $restrictcirc_flg_form = ""; $flag & THESAURUS_AUTH ? $thesaurus_flg_form = "checked " : $thesaurus_flg_form = ""; $flag & TRANSFERTS_AUTH ? $transferts_flg_form = "checked " : $transferts_flg_form = ""; $flag & EXTENSIONS_AUTH ? $extensions_flg_form = "checked " : $extensions_flg_form = ""; $flag & DEMANDES_AUTH ? $demandes_flg_form = "checked " : $extensions_flg_form = ""; $flag & CMS_AUTH ? $cms_flg_form = "checked " : $cms_flg_form = ""; $flag & FICHES_AUTH ? $fiches_flg_form = "checked " : $fiches_flg_form = ""; $admin_user_form = str_replace('!!admin_flg!!', $admin_flg_form, $admin_user_form); $admin_user_form = str_replace('!!catal_flg!!', $catal_flg_form, $admin_user_form); $admin_user_form = str_replace('!!circ_flg!!', $circ_flg_form, $admin_user_form); $admin_user_form = str_replace('!!auth_flg!!', $auth_flg_form, $admin_user_form); $admin_user_form = str_replace('!!edit_flg!!', $edit_flg_form, $admin_user_form); $admin_user_form = str_replace('!!sauv_flg!!', $sauv_flg_form, $admin_user_form); $admin_user_form = str_replace('!!dsi_flg!!', $dsi_flg_form, $admin_user_form); $admin_user_form = str_replace('!!pref_flg!!', $pref_flg_form, $admin_user_form); $admin_user_form = str_replace('!!acquisition_flg!!', $acquisition_flg_form, $admin_user_form); $admin_user_form = str_replace('!!restrictcirc_flg!!', $restrictcirc_flg_form, $admin_user_form); $admin_user_form = str_replace('!!thesaurus_flg!!', $thesaurus_flg_form, $admin_user_form); $admin_user_form = str_replace('!!transferts_flg!!', $transferts_flg_form, $admin_user_form); $admin_user_form = str_replace('!!extensions_flg!!', $extensions_flg_form, $admin_user_form); $admin_user_form = str_replace('!!demandes_flg!!', $demandes_flg_form, $admin_user_form); $admin_user_form = str_replace('!!cms_flg!!', $cms_flg_form, $admin_user_form); $admin_user_form = str_replace('!!fiches_flg!!', $fiches_flg_form, $admin_user_form); if ($form_user_alert_resamail==1) $alert_resa_mail=" checked"; else $alert_resa_mail=""; $admin_user_form = str_replace('!!alter_resa_mail!!', $alert_resa_mail, $admin_user_form); if ($demandes_active) { if ($form_user_alert_demandesmail==1) $alert_demandes_mail=" checked"; else $alert_demandes_mail=""; $admin_user_form = str_replace('!!alert_demandes_mail!!', $alert_demandes_mail, $admin_user_form); } $admin_user_form = str_replace('!!user_email!!', $form_user_email, $admin_user_form); if(!$id) $form_type = '1'; else $form_type = '0'; // récupération des codes langues $la = new XMLlist("$include_path/messages/languages.xml", 0); $la->analyser(); $languages = $la->table; // constitution du sélecteur $selector = "'; $admin_user_form = str_replace('!!select_lang!!', $selector, $admin_user_form); $admin_user_form = str_replace('!!form_type!!', $form_type, $admin_user_form); $admin_user_form = str_replace('!!form_param_default!!', $form_param_default, $admin_user_form); //groupes if ($usr_grp!==FALSE) { $q = "select * from users_groups order by grp_name "; $sel_group = gen_liste($q, 'grp_id', 'grp_name', 'sel_group', '', $usr_grp, '0', $msg[128], '0',$msg[128]); $sel_group = "
'.$sel_group; $admin_user_form = str_replace('', $sel_group, $admin_user_form); } print confirmation_delete("./admin.php?categ=users&sub=users&action=del&id="); print $admin_user_form; } function show_users($dbh) { global $msg; global $admin_user_list; global $admin_user_link1; // affichage du tableau des utilisateurs $requete = "SELECT * FROM users ORDER BY username"; $res = mysql_query($requete, $dbh); $nbr = mysql_num_rows($res); while(($row=mysql_fetch_object($res))) { // réinitialisation des chaînes $dummy = $admin_user_list; $dummy1 = $admin_user_link1; $flag = ""; $dummy =str_replace('!!user_link!!', $dummy1, $dummy); $dummy =str_replace('!!user_name!!', "$row->prenom $row->nom", $dummy); $dummy =str_replace('!!user_login!!', $row->username, $dummy); if($row->rights & ADMINISTRATION_AUTH) $dummy =str_replace('!!nuseradmin!!', '' , $dummy); else $dummy =str_replace('!!nuseradmin!!', '', $dummy); if($row->rights & CATALOGAGE_AUTH) $dummy =str_replace('!!nusercatal!!', '', $dummy); else $dummy =str_replace('!!nusercatal!!', '', $dummy); if($row->rights & CIRCULATION_AUTH) $dummy =str_replace('!!nusercirc!!', '', $dummy); else $dummy =str_replace('!!nusercirc!!', '', $dummy); if($row->rights & PREF_AUTH) $dummy =str_replace('!!nuserpref!!', '', $dummy); else $dummy =str_replace('!!nuserpref!!', '', $dummy); if($row->rights & AUTORITES_AUTH) $dummy =str_replace('!!nuserauth!!', '', $dummy); else $dummy =str_replace('!!nuserauth!!', '', $dummy); if($row->rights & EDIT_AUTH) $dummy =str_replace('!!nuseredit!!', '', $dummy); else $dummy =str_replace('!!nuseredit!!', '', $dummy); if($row->rights & SAUV_AUTH) $dummy =str_replace('!!nusersauv!!', '', $dummy); else $dummy =str_replace('!!nusersauv!!', '', $dummy); if($row->rights & DSI_AUTH) $dummy =str_replace('!!nuserdsi!!', '', $dummy); else $dummy =str_replace('!!nuserdsi!!', '', $dummy); if($row->rights & ACQUISITION_AUTH) $dummy =str_replace('!!nuseracquisition!!', '', $dummy); else $dummy =str_replace('!!nuseracquisition!!', '', $dummy); if($row->rights & RESTRICTCIRC_AUTH) $dummy =str_replace('!!nuserrestrictcirc!!', '', $dummy); else $dummy =str_replace('!!nuserrestrictcirc!!', '', $dummy); if($row->rights & THESAURUS_AUTH) $dummy =str_replace('!!nuserthesaurus!!', '', $dummy); else $dummy =str_replace('!!nuserthesaurus!!', '', $dummy); if($row->rights & TRANSFERTS_AUTH) $dummy =str_replace('!!nusertransferts!!', '', $dummy); else $dummy =str_replace('!!nusertransferts!!', '', $dummy); if($row->rights & EXTENSIONS_AUTH) $dummy =str_replace('!!nuserextensions!!', '', $dummy); else $dummy =str_replace('!!nuserextensions!!', '', $dummy); if($row->rights & DEMANDES_AUTH) $dummy =str_replace('!!nuserdemandes!!', '', $dummy); else $dummy =str_replace('!!nuserdemandes!!', '', $dummy); if($row->rights & CMS_AUTH) $dummy =str_replace('!!nusercms!!', '', $dummy); else $dummy =str_replace('!!nusercms!!', '', $dummy); if($row->rights & FICHES_AUTH) $dummy =str_replace('!!nuserfiches!!', '', $dummy); else $dummy =str_replace('!!nuserfiches!!', '', $dummy); $dummy = str_replace('!!lang_flag!!', $flag, $dummy); $dummy = str_replace('!!nuserlogin!!', $row->username, $dummy); $dummy = str_replace('!!nuserid!!', $row->userid, $dummy); if($row->user_alert_resamail) $dummy =str_replace('!!user_alert_resamail!!', $msg['alert_resa_user_mail'].'' , $dummy); else $dummy =str_replace('!!user_alert_resamail!!', '', $dummy); if($row->user_alert_demandesmail) $dummy =str_replace('!!user_alert_demandesmail!!', $msg['alert_demandes_user_mail'].'' , $dummy); else $dummy =str_replace('!!user_alert_demandesmail!!', '', $dummy); print $dummy; } print "
"; } function get_coordonnees_etab($user_id='0', $field_values, $current_field, $form_name) { global $dbh, $msg, $charset; global $acquisition_active; global $user_acquisition_adr_form; if (!$acquisition_active ) return; if (!($field_values[7] & ACQUISITION_AUTH)) return; if ($user_id=='0') return; //Affichage de la liste des bibliothèques auxquelles a accès l'utilisateur $q = entites::list_biblio($user_id); $res = mysql_query($q, $dbh); $nbr = mysql_num_rows($res); if ($nbr == '0') return; $tab1 = explode('|', $field_values[$current_field]); $tab_adr=array(); foreach ($tab1 as $key=>$value) { $tab2=explode(',', $value); $tab_adr[$tab2[0]]['id_adr_fac']=$tab2[1]; $tab_adr[$tab2[0]]['id_adr_liv']=$tab2[2]; } while($row=mysql_fetch_object($res)){ $acquisition_user_param.= "
"; $acquisition_user_param.= ""; $temp_adr_form = $user_acquisition_adr_form; if ($tab_adr[$row->id_entite]['id_adr_fac']) { $coord = new coordonnees($tab_adr[$row->id_entite]['id_adr_fac']); $id_adr_fac = $coord->id_contact; if($coord->libelle != '') $adr_fac = htmlentities($coord->libelle, ENT_QUOTES, $charset)."\n"; if($coord->contact != '') $adr_fac.= htmlentities($coord->contact, ENT_QUOTES, $charset)."\n"; if($coord->adr1 != '') $adr_fac.= htmlentities($coord->adr1, ENT_QUOTES, $charset)."\n"; if($coord->adr2 != '') $adr_fac.= htmlentities($coord->adr2, ENT_QUOTES, $charset)."\n"; if($coord->cp !='') $adr_fac.= htmlentities($coord->cp, ENT_QUOTES, $charset).' '; if($coord->ville != '') $adr_fac.= htmlentities($coord->ville, ENT_QUOTES, $charset); } else { $id_adr_fac = '0'; $adr_fac = ''; } if ($tab_adr[$row->id_entite]['id_adr_liv']) { $coord = new coordonnees($tab_adr[$row->id_entite]['id_adr_liv']); $id_adr_liv = $coord->id_contact; if($coord->libelle != '') $adr_liv = htmlentities($coord->libelle, ENT_QUOTES, $charset)."\n"; if($coord->contact != '') $adr_liv.= htmlentities($coord->contact, ENT_QUOTES, $charset)."\n"; if($coord->adr1 != '') $adr_liv.= htmlentities($coord->adr1, ENT_QUOTES, $charset)."\n"; if($coord->adr2 != '') $adr_liv.= htmlentities($coord->adr2, ENT_QUOTES, $charset)."\n"; if($coord->cp !='') $adr_liv.= htmlentities($coord->cp, ENT_QUOTES, $charset).' '; if($coord->ville != '') $adr_liv.= htmlentities($coord->ville, ENT_QUOTES, $charset); } else { $id_adr_liv = 0; $adr_liv = ''; } $temp_adr_form = str_replace('!!id_bibli!!',$row->id_entite, $temp_adr_form); $temp_adr_form = str_replace('!!id_adr_liv!!',$id_adr_liv, $temp_adr_form); $temp_adr_form = str_replace('!!adr_liv!!',$adr_liv, $temp_adr_form); $temp_adr_form = str_replace('!!id_adr_fac!!',$id_adr_fac, $temp_adr_form); $temp_adr_form = str_replace('!!adr_fac!!',$adr_fac, $temp_adr_form); $acquisition_user_param.= $temp_adr_form; $acquisition_user_param.= "
"; } $acquisition_user_param = str_replace('!!form_name!!', $form_name, $acquisition_user_param); $acquisition_user_param="
".htmlentities($msg['acquisition_user_deflt_adr'], ENT_QUOTES, $charset).$acquisition_user_param."
"; return $acquisition_user_param; } function set_coordonnees_etab() { global $id_adr_fac, $id_adr_liv; $acquisition_user_param = "speci_coordonnees_etab = '' "; if (!is_array($id_adr_fac)) return $acquisition_user_param ; ksort($id_adr_fac); reset($id_adr_fac); $i=0; $j=count($id_adr_fac); while (list($key, $val) = each($id_adr_fac)) { $acquisition_user_param.=$key.','.$val.','.$id_adr_liv[$key]; $i++; if ($i < $j) $acquisition_user_param.='|'; }; $acquisition_user_param = "speci_coordonnees_etab = '".$acquisition_user_param."' "; return $acquisition_user_param; } //Retourne un tableau (userid=>nom prenom) à partir d'un tableau d'id function getUserName($tab=array()) { global $dbh; $res=array(); if(is_array($tab) && count($tab)) { $q ="select userid, concat(nom,' ',prenom) as lib from users where userid in ('".implode("','", $tab)."') "; $r = mysql_query($q,$dbh); while($row=mysql_fetch_object($r)) { $res[$row->userid]=$row->lib; } } return $res; }