anonymous_user==$iduser) $es_r->anonymous_user=0; else if (array_search($iduser,$es_r->users)!==false) { //Réécriture du tableau des users //Copie $tusers=$es_r->users; $es_r->users=array(); for ($j=0; $jusers[]=$tusers[$j]; } } break; case 1: if ($es_r->anonymous_user==$iduser) { $es_r->anonymous_user=0; //Insertion dans le tableau $es_r->users[]=$iduser; } else if (array_search($iduser,$es_r->users)===false) { $es_r->users[]=$iduser; } break; case 2: if (array_search($iduser,$es_r->users)!==false) { //Si il existe dans les users, on le supprime //Réécriture du tableau des users //Copie $tusers=$es_r->users; $es_r->users=array(); for ($j=0; $jusers[]=$tusers[$j]; } } $es_r->anonymous_user=$iduser; break; } } //Enregistrement des droits si nécessaire if ((isset($is_not_first) && $is_not_first) || ($action == "update")) { foreach ($es->catalog->groups as $group_name => &$group_content) { $val = isset($grp_right[$group_name]) && $grp_right[$group_name]; $es_r=$es_rights->get_rights($group_name,""); update_rights_for_user($es_r,$val); //On enregistre les droits pour ce groupe $es_rights->set_rights($es_r); if ($es_rights->error) print ""; //On fait la même chose pour les méthodes du groupe ! foreach ($group_content->methods as $method_name => &$method_content) { $val = isset($mth_right[$group_name][$method_name]) && $mth_right[$group_name][$method_name]; $es_r=$es_rights->get_rights($group_name,$method_name); update_rights_for_user($es_r,$val); //On enregistre les droits pour ce groupe $es_rights->set_rights($es_r); if ($es_rights->error) print ""; } } } //Génération de la liste des utilisateurs $list_users=""; //Génération du tableau des droits $table_rights=" "; //Pour chaque groupe $group_list=$es->get_group_list(); for ($i=0; $iget_rights($group["name"],""); //$has_basics=(!$es_rights->has_basic_rights($iduser,$group["name"],"")?"disabled='disabled'":""); $full_group_allowed = array_search($iduser,$rights->users)!==false; $table_rights.= ""; $table_rights.= ""; //Pour chaque méthode if(isset($group["methods"])) { for ($j=0; $jget_rights($group["name"],$method["name"]); $has_basics=(!$es_rights->has_basic_rights($iduser,$group["name"],$method["name"])?"disabled='disabled'":""); $method_checked = !$full_group_allowed && array_search($iduser,$rights->users)!==false; $method_enabled = !$full_group_allowed; $table_rights.= " ".(!$j?"":"")." "; } } } $table_rights.="
GroupeDroits pour l'utilisateur

".htmlentities($group["name"],ENT_QUOTES,$charset)."

".htmlentities($group["description"],ENT_QUOTES,$charset)."  
".htmlentities($msg["external_services_peruser_methode"],ENT_QUOTES,$charset)."".htmlentities($msg["external_services_peruser_methode_autorisees"],ENT_QUOTES,$charset)."
 ".htmlentities($method["name"],ENT_QUOTES,$charset)."".htmlentities($method["description"],ENT_QUOTES,$charset)."
\n"; $js_funcs = << function enable_or_disable_group_checboxes(group_name) { var enable_or_disable = document.getElementById("nonavailable_"+group_name).checked; var c = new Array(); c = document.getElementsByTagName('input'); for (var i = 0; i < c.length; i++) { var es_group = ""; if (c[i].attributes.getNamedItem('es_group') != null) es_group = c[i].attributes.getNamedItem('es_group').nodeValue; if ((c[i].type == 'checkbox') && (es_group == group_name)) { if (enable_or_disable) { c[i].checked = false; c[i].disabled = true; } else { c[i].disabled = false; c[i].checked = true; } } } } JS; echo $js_funcs; $interface_form = new interface_admin_form('es_rights'); $interface_form->set_label("Définition des droits pour l'utilisateur ".$list_users); $interface_form->set_content_form(str_replace("!!table_rights!!",$table_rights,$es_admin_peruser)); print $interface_form->get_display_parameters(); ?>