Advertisement
Guest User

js

a guest
Jan 18th, 2016
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.85 KB | None | 0 0
  1. var email = readCookie('email');
  2. var password = readCookie('password');
  3. var uid = readCookie('uid');
  4.  
  5. if(email == ""){
  6. window.location.replace("index.html");
  7. }
  8. if(password == ""){
  9. window.location.replace("index.html");
  10. }
  11. if(uid == ""){
  12. window.location.replace("index.html");
  13. }
  14.  
  15. $.post("https://panel.hostmyservers.fr/api/webapi.php", { apiversion: "1.1", apiusername: email, apipassword: password, apiformat: "json"})
  16. .done(function(data) {
  17. if(data.response == "Invalid login"){
  18. eraseCookie(email);
  19. eraseCookie(password);
  20. eraseCookie(uid);
  21. window.location.replace("index.html");
  22. }
  23. })
  24. .fail(function(jqXHR, textStatus, errorThrown){
  25. eraseCookie(email);
  26. eraseCookie(password);
  27. eraseCookie(uid);
  28. window.location.replace("index.html");
  29. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement