/* valeur des elements du tableau pour les messages tableau_message_comLogin[0] = "La saisie de l'utilisateur est obligatoire" tableau_message_comLogin[1] = "Aucun accès précédent n'a été mémorisé" */ //***************************************************** // FONCTIONS JAVASCRIPT DES LOGIN //***************************************************** function memo_lang(lang){ //alert("mémorisation lang"); //SetCookie ("lang",lang, expdate); //SetCookie ("lang",lang, expdate,getRootCookies() +"/com",null,false) SetCookie ("lang",lang, expdate,"/",null,false) } function memo_uti_code(uti_code){ //alert("mémorisation uti_code"); SetCookie ("uti_code",uti_code, expdate,"/",null,false) return true; } function memo_cookies(vs_nom, vs_val){ //alert("mémorisation cookies"); SetCookie (vs_nom,vs_val, expdate,"/",null,false) return true; } function memo_cookies_minutes(vs_nom, vs_val, minute){ var expdate2 = new Date (); FixCookieDate (expdate); // Correct for Mac date bug - call only once for given Date object! expdate2.setTime (expdate.getTime() + (minute * 60 * 1000)); // 30 * 24 hrs from now //alert("mémorisation cookies"); SetCookie (vs_nom,vs_val, expdate2,"/",null,false) return true; } function memo_cookies_session(vs_nom, vs_val){ SetCookie (vs_nom,vs_val, null,"/",null,false) return true; } /*********************************************************************** VALIDATION ***********************************************************************/ //Fonction de test de la saisie de l'uti et pwd et et mémorisation cookies de l'uti/pwd function valide_pwd(vs_action){ //alert('valid pwd'); memo_lang(document.forms[0].lang.value) //alert(document.forms[0].pwd.value); if (document.forms[0].uti_code.value=="") { //alert("La saisie de l'utilisateur est obligatoire"); alert(tableau_message_comLogin[0]) document.forms[0].uti_code.focus(); return false; } if (document.forms[0].pwd.value=="") { //alert("La saisie du mot de passe est obligatoire"); alert(tableau_message_comLogin[2]) document.forms[0].pwd.focus(); return false; } memo_uti_code(document.forms[0].uti_code.value); //alert("memo_pwd checked="+document.forms[0].memo_pwd.checked) //alert("memo_pwd="+document.forms[0].memo_pwd.value) if (document.forms[0].memo_pwd.checked==true) { s_memo_pwd='O' s_pwd = document.forms[0].pwd.value; } else { s_memo_pwd='N'; s_pwd = ''; } memo_cookies("memo_pwd",s_memo_pwd); //memo_cookies("serveur_ident","1024"); memo_cookies("pwd",s_pwd); if (vs_action=="submit") document.forms[0].submit(); s_type_login = document.forms[0].type_login.value; //memo_cookies("type_login",s_type_login); //Pb de cookies avec frameset cachée comme intranet.oth.fr if (navigator.appVersion.indexOf("MSIE 6")>=0) { document.forms[0].target="_top"; } return true; } /*********************************************************************** RACCOURCIS ***********************************************************************/ function f_raccourci(vs_destination) { if (valide_pwd("contole")==false) return; uti_code = document.forms[0].uti_code.value;//GetCookie("uti_code"); ope = GetCookie("operation"); phas = GetCookie("phase"); serveurid = GetCookie("serveurid"); //alert('ope/phas/serveurid='+ope+'/'+phas+'/'+serveurid); if (ope ==null || phas ==null || serveurid == null) { //alert("Aucun accès précédent n'a été mémorisé") alert(tableau_message_comLogin[1]) document.forms[0].submit(); return; } if (serveurid !=1) { s_chaine_info = "\tAccès direct vers : \r\rUtilisateur :\t"+uti_code +"\nOpération :\t"+ope+"\nPhase :\t\t"+phas+"\nN° Serveur :\t"+serveurid } else { s_chaine_info = "\tAccès direct vers : \r\rUtilisateur :\t"+uti_code +"\nOpération :\t"+ope+"\nPhase :\t\t"+phas } //document.forms[0].xparam_action.value = 'RACCOURCI'; document.forms[0].xparam_action.value = vs_destination; document.forms[0].submit(); } /*********************************************************************** INITIALISATION ***********************************************************************/ function f_init_login() { //alert('0'); //var libelle_button_fr = '" + getMessage("FR","VALIDER","LOGIN")+"'"); //var libelle_button_uk = '" + getMessage("UK","VALIDER","LOGIN")+"'"); var tempo; tempo = GetCookie("LeChemin"); //alert(tempo) tempo = chaine_replace(tempo," ","%20") //alert(tempo) document.login.PathDownload.value=tempo lang = GetCookie("lang"); /* if (lang == "UK"){ document.login.lang.value=""; } else { document.login.lang.value="FR"; } */ uti_code = GetCookie("uti_code"); document.forms[0].pwd.value=""; if (uti_code != "" && uti_code !=null){ document.forms[0].uti_code.value=uti_code ; document.forms[0].pwd.focus(); var memo_pwd; memo_pwd= GetCookie("memo_pwd"); var pwd; pwd = GetCookie("pwd"); if ( (memo_pwd=='O') && (pwd != "" && pwd !=null)){ document.forms[0].pwd.value=pwd; document.forms[0].memo_pwd.checked=true; //document.forms[0].val.focus(); } } else { document.forms[0].uti_code.focus() } //alert('1'); ope = GetCookie("operation"); phas = GetCookie("phase"); serveurid = GetCookie("serveurid"); //alert("ope/phase="+ope+"/"+phas); if (ope != "" && ope !=null && phas != "" && phas !=null ){ document.forms[0].operation.value=ope ; document.forms[0].phase.value=phas ; } if (serveurid != "" && serveurid !=null ){ //Pb de relogin suite a un echec sut col9 et sph9, les tentative suivante se fpnt ts sur sph9 //document.forms[0].serveurid.value=serveurid; } //alert('window.location.host='+window.location.host); //alert('location.href='+location.href) //alert('window.location.protocol='+window.location.protocol); document.forms[0].host_saisie.value=window.location.host; //ERF : 2006/05/09 On informe dynamo du http ou https document.forms[0].protocol.value=window.location.protocol; s_liste_destinataire = GetCookie("liste_destinataire"); if (s_liste_destinataire != "" && s_liste_destinataire !=null ) { document.forms[0].liste_destinataire.value=s_liste_destinataire; } s_format_edition= GetCookie("format_edition"); if (s_format_edition != "" && s_format_edition !=null ) { document.forms[0].format_edition.value=s_format_edition; } /* 09/10/2002/ JLB gestion de la décompression des fichiers récupérés par l'applet */ s_decompression_avec_applet= GetCookie("decompresse_fichier_applet"); //s_decompression_avec_applet='N' if (s_decompression_avec_applet != "" && s_decompression_avec_applet !=null ) document.forms[0].decompresse_fichier_applet.value=s_decompression_avec_applet; else document.forms[0].decompresse_fichier_applet.value='N'; /* 09/10/2002/ JLB gestion de l'utilisation du plugin */ s_plugin= GetCookie("plugin"); if (s_plugin != "" && s_plugin !=null ) document.forms[0].plugin.value=s_plugin; else document.forms[0].plugin.value='N'; // 15/11/01 JLB // 25/10/2002 JLB // pour empecher l'applet dans les messages et dans l'envoi des documents //s_download_avec_applet = GetCookie("download_avec_applet"); s_download_avec_applet ='N' if (s_download_avec_applet != "" && s_download_avec_applet !=null ){ document.forms[0].download_avec_applet.value=s_download_avec_applet } f_init_login_info_technique(); } function f_init_login_info_technique() { //=======Info sur le Machine cliente============= document.forms[0].navigator_appCodeName.value= navigator.appCodeName ; document.forms[0].navigator_appName.value=navigator.appName; //Nom du navigateur //alert('navigator.appVersion='+navigator.appVersion); document.forms[0].navigator_appVersion.value=navigator.appVersion; //Version du Navigateur document.forms[0].navigator_userAgent.value= navigator.userAgent ; document.forms[0].navigator_platform.value = navigator.platform ; document.forms[0].navigator_javaEnabled.value= navigator.javaEnabled() ; document.cookie = "cookies=true"; var is_cookie = (document.cookie) ? "true" : "false"; document.forms[0].document_cookie.value= is_cookie; document.forms[0].screen_height.value= screen.height; document.forms[0].screen_width.value = screen.width; //ERF 2007/02/09 Nouvelle Valeur ! : nom de l'os finalisé (integration XP et linux + navateur Firefox etc .. // Variables globales var g_obj_SystemeExploitation = null; // Variable contenant les informations sur le système d'exploitation. var g_obj_Navigateur = null; // Variable contenant les informations sur le navigateur. var g_vec_Plugins = new Array(); // Vecteur contenant la liste des objet plugins installé. var g_obj_AntiPopups = null; // Variable contenant les informations sur les bloqueurs de popups. g_obj_SystemeExploitation = SystemeExploitation(); g_obj_SystemeExploitation.getMySE(); g_obj_Navigateur = Navigateur(); g_obj_Navigateur.getMyNav(); g_obj_lstPlugins = lstPlugin(); g_obj_AntiPopups = AntiPopups(); document.forms[0].TRA_OS_NOM.value = g_obj_SystemeExploitation.name+" "+g_obj_SystemeExploitation.version; //alert(g_obj_Navigateur.name+" "+g_obj_Navigateur.version); document.forms[0].navigator_appName.value=g_obj_Navigateur.name; document.forms[0].navigator_appVersion.value=g_obj_Navigateur.version; } /*********************************************************************** IMAGES ***********************************************************************/ function f_init_images() { var img_out = new Array(2); var img_over = new Array(2); var img_nom = new Array(2); var img_chm = new Array(8) // LR : stockage des chemins d'accès aux images img_chm[0] = "../_fr/com_menu/image/im_logo_derbi_nb.gif" img_chm[1] = "../_fr/com_menu/image/im_logo_sgti_10.gif" img_chm[2] = "../_fr/com_menu/image/tx_init_logo_sgti.gif" img_chm[3] = "../_fr/com_menu/image/im_blanc.gif" img_chm[4] = "../_fr/com_menu/image/tx_init_francais.gif" img_chm[5] = "../_fr/com_menu/image/tx_init_anglais.gif" img_chm[6] = "../_fr/com_menu/image/im_drap_fr.gif" img_chm[7] = "../_fr/com_menu/image/im_drap_uk.gif" img_out[0] = "../_fr/com_menu/image/tx_init_francais.gif"; img_over[0] = "../_fr/com_menu/image/tx_init_francais.gif"; img_nom[0] = "texte" img_out[1] = "../_fr/com_menu/image/tx_init_francais.gif"; img_over[1] = "../_fr/com_menu/image/tx_init_anglais.gif"; img_nom[1] = "texte" // LR : mémorisation du menu déjà sélectionné en modifiant le chemin stocké dans img_out function mouseover(num) { //alert("mouse over"); document.images[img_nom[num]].src = img_over[num]; window.status = ""; return true; } function mouseout(num) { //alert("mouse out"); document.images[img_nom[num]].src = img_out[num]; return true; } function chargerImagesPage() { for (var c=0; c<8; c++) { this[c]=new Image(); this[c].src=img_chm[c]; } } } function AfficheHomePage(s_url, s_titre) { if (document.all && document.getElementById) { document.write('
'); //'+s_titre+' en Favoris document.write(''+tableau_message_comLogin[4]+' ou '); //'+s_titre+' comme page de démarrage document.write(''+tableau_message_comLogin[3]+'
'); document.write('
'); } } function HomePage(obj,s_url) { obj.style.behavior='url(#default#homepage)'; obj.setHomePage(s_url); } function ajoutFavoris(arg1,s_titre) { window.external.AddFavorite(arg1, s_titre); //document.getElementById('ladiv').innerHTML = 'Si vous êtes sur Opera, ajoutez cette adresse à vos favoris:
' + arg1 + '
en vous y connectant vous serez automatiquement identifié(e).
Mais attention, gardez l\'adresse enregistrée pour vous.
'; } //============================================================================================ //TA 20080702 //Récupération du numéro d'instance d'un serveur web //============================================================================================ function getXhr(){ var xhr = null; if(window.XMLHttpRequest){ // Firefox et autres xhr = new XMLHttpRequest(); } else if(window.ActiveXObject){ // Internet Explorer try { xhr = new ActiveXObject("Msxml2.XMLHTTP"); } catch (e) { xhr = new ActiveXObject("Microsoft.XMLHTTP"); } } else { // XMLHttpRequest non supporté par le navigateur alert("Votre navigateur ne supporte pas les objets XMLHTTPRequest..."); xhr = false; } return xhr } function go(u){ var xhr = getXhr(); xhr.onreadystatechange = function(){ if(xhr.readyState == 4 && xhr.status == 200){ document.forms[0].INFO_SRV_WEB.value = xhr.responseText; //alert(xhr.responseText); } } xhr.open("GET",u,true); xhr.send(null); } function getInfoSrvWeb(){ var s_url = document.URL; switch (window.location.protocol) { case "http:": var i_pos = s_url.indexOf('/',7); s_url = s_url.substring(0,i_pos + 1); break; case "https:": var i_pos = s_url.indexOf('/',8); s_url = s_url.substring(0,i_pos + 1); break; default: break; } s_url = s_url + "infosrv/infosrv.pl"; go(s_url); } //Donne pour www.sgti.fr http://www2.sgti.fr function getUrlIpCliente(JEEHost){ //http://hydre:81/ipcliente/infoxff ou http://www2.sgti.fr/ipcliente/infoxff var s_url = ''; switch (window.location.protocol) { case "http:": s_url = "http://"+JEEHost+"/ipcliente/infoxff" break; case "https:": s_url = "https://"+JEEHost+"/ipcliente/infoxff" break; default: break; } return s_url; }