Advertisement
Guest User

WPS

a guest
Feb 12th, 2016
59
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. function authorize() {
  2.  
  3.   if (authing == 1)  return;
  4.   authing = 1
  5.  
  6.   if( document.getElementById("userValue").value=="" || document.getElementById("passwdValue").value =="") {
  7.     alert("you must enter username and password!!");
  8.     authing = 0
  9.     return;
  10.   }
  11.  
  12.   response=null;
  13.  
  14.   var data;
  15.   var dtime = new Date();
  16.   /*Récupération du nom et remplacement pas l'expression régulière*/
  17.   var userValue_t;
  18.   userValue_t = document.getElementById("userValue").value; //récupération de la valeur du nom
  19.   userValue_t = userValue_t.replace(/\+/g, "%2B");    //replace '+' to '%2B'
  20.  
  21.  
  22.   /*Récupération du mot de passe et remplacement pas l'expression régulière*/
  23.   var passwdValue_t;
  24.   passwdValue_t = document.getElementById("passwdValue").value;
  25.   passwdValue_t = passwdValue_t.replace(/\+/g, "%2B");    //replace '+' to '%2B'
  26.  
  27.  
  28.   data="login.cgi?";
  29.   data+="username" + "=" + userValue_t;
  30.   data+="&" + "password" + "=" + passwdValue_t;
  31.   data+="&" + "realname" + "=" + document.getElementById("realValue").value;
  32.   data+="&" + "t" + "=" + dtime.getTime();
  33.  
  34.   eventload(data);
  35.   TimeoutID = setTimeout(reset_onclick_button,1000000);
  36. }
  37.  
  38.  
  39. /********************Fonction Evenload() *************/
  40.  
  41. function eventload(url){
  42.   if ( appstr.match('Mobile') != null || appstr.match('Pocket') != null ){
  43.     window.location.replace(url + '&Mobile#' + location.hash.substr(1))
  44.   }
  45.  
  46.   else{
  47.     url+="&" +"send" + "=" + "Auth";
  48.     load_text();
  49.     var node= document.getElementsByTagName("body")[0];
  50.     var scripts= document.createElement("script");
  51.     scripts.type= "text/javascript";
  52.     scripts.src= url;
  53.     scripts.name= 'script_node';
  54.  
  55.     for (  i =0 ;i < node.childNodes.length; i++) {
  56.       if ( node.childNodes[i].name == "script_node")
  57.         node.removeChild(node.childNodes[i]);
  58.     }
  59.     node.appendChild(scripts);
  60.   }
  61. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement