-
Par karine971 le 22 Décembre 2009 à 01:14
Jeux gratuits
INSCRIVEZ-VOUS!<script language="javascript" src="http://www.gamersfirst.com/sites/all/modules/G1Login/jquery.form-min.js"></script> <script type="text/javascript">// <![CDATA[ $(function(){$('#signin_float').click(function() { $('.floatLogin').show(); }); $('#floatLoginClose').click(function() { $('.floatLogin').hide(); }); $('.login').focus(function(){ $(this).addClass('focus'); }).blur(function(){ $(this).removeClass('focus'); }); $('#loginForm').ajaxForm({beforeSubmit:onLoginFormBeforeSubmit, beforeSend:onLoginFormBeforeSend, error:onLoginFormError, success:onLoginFormSuccess }); $('.login').focus(function(){ $(this).addClass('focus'); }).blur(function(){ $(this).removeClass('focus'); }); $('#loginuser').keypress(function(e){ switch(capsLock(e)){ case 'SHIFT': $('#loginresponse').addClass('error').html('Use lowercase letters only.').fadeIn(); break; case 'CAPS': $('#loginresponse').addClass('error').html('Caps Lock is on.').fadeIn(); break; default: $('#loginresponse').fadeOut(); } }); $('.current_account').click(function() { var rel = $(this).attr("rel"); var vals = rel.split("|",3); var gameID = vals[0]; var username = vals[1]; var whereto = vals[2]; $.post("session-o-matic.php", { strPost: gameID + '|' + username }, function(){ var go_to_url = ""; switch(whereto) { case "profile": go_to_url = "myprofile.php"; break; case "redeemcode": go_to_url = "/redeemcode/"; break; case "marketplace": go_to_url = "/marketplace/"; break; case "knightcash": go_to_url = "distribute_knight_cash.php"; break; } window.location = go_to_url; }); }); function showLoginFormError(message) { message = message || 'Login error. Please try again.'; $('.floatLogin').show(); $('#loginresponse').addClass('error').html(message).fadeIn(); } function onLoginFormBeforeSubmit() { $('#login_action').show(); $('#loginsubmit').attr('disabled',true); if( $('#loginuser').val()!='' && $('#loginpass').val()!='' ) { if((checkIt($('#loginuser').val(),3)) && (checkIt($('#loginpass').val(),2))) { return true; } var returnVal = 'Login error. Please try again.'; $('#loginresponse').addClass('error').html(returnVal).fadeIn(); $('#loginForm')[0].reset(); $('#loginsubmit').attr('disabled',false); } else { var returnVal = 'Enter a Username and Password.'; $('#loginresponse').addClass('error').html(returnVal).fadeIn(); $('#loginsubmit').attr('disabled',false); } $('#login_action').fadeOut("fast"); return false; } function onLoginFormBeforeSend(xhr) { if (xhr.withCredentials != undefined) { xhr.withCredentials="true"; } return true; } function onLoginFormError(xhr) { showLoginFormError(); } function onLoginFormSuccess(response) { var returnVal = jQuery.trim(unescape(response)); if (returnVal=='') { var message = 'Login error. Please try again.'; $("#loginresponse").addClass('error').html(message).fadeIn(); $('#login_action').fadeOut(); $('#loginForm')[0].reset(); toggleLabel($('#loginuser')); toggleLabel($('#loginpass')); $('#loginsubmit').attr('disabled',false); } else { window.location = returnVal; } }}); // ]]></script> <script type="text/javascript">// <![CDATA[ function toggleLabel(element){ if(element.val() == "" && element.prev().is(":visible")) element.prev().hide(); else if(element.val() == "" && element.prev().is(":hidden")) element.prev().show(); } function checkIt(field,type){ fieldArr = field.split(""); fieldCt = fieldArr.length; var array; var username = new Array("a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p", "q", "r", "s", "t", "u", "v", "w", "x", "y", "z", "1", "2", "3", "4", "5", "6", "7", "8", "9", "0"); var email = new Array(".","_","-","+","@","a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p", "q", "r", "s", "t", "u", "v", "w", "x", "y", "z","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z", "1", "2", "3", "4", "5", "6", "7", "8", "9", "0"); var password = new Array("a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p", "q", "r", "s", "t", "u", "v", "w", "x", "y", "z","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z", "1", "2", "3", "4", "5", "6", "7", "8", "9", "0"); var password2 = new Array("!","@","#","$","%","^","&","*","?","_","~","-","(",")","a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p", "q", "r", "s", "t", "u", "v", "w", "x", "y", "z","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z", "1", "2", "3", "4", "5", "6", "7", "8", "9", "0"); var answers = new Array(" ",".","_","-","a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p", "q", "r", "s", "t", "u", "v", "w", "x", "y", "z","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z", "1", "2", "3", "4", "5", "6", "7", "8", "9", "0"); var re = /^(?[A-Za-z0-9])?(((?!.*[*|]|delete|select|update|insert|--).)*)$/ switch(type){ case 1: array = username; break; case 2: array = password; break; case 3: array = email; break; case 4: array = password2; break; case 5: array = answers; break; case 6: array = false; } if(type != 6){ var i,f,c; c = 0; for(i=0;i<fieldArr.length;i++){ for(f=0;f<array.length;f++){ if(fieldArr[i]==array[f]){ field.replace(fieldArr[i],"*"); c++; } } } if(c<field.length){ return false; } return true; }else if(type == 6) { if(re.test(field)) return true; else return false; } } // ]]></script>
votre commentaire
Suivre le flux RSS des articles de cette rubrique
Suivre le flux RSS des commentaires de cette rubrique