1/* ************** Formulaire d'identification ************** */ 2function verifFormAccesSecu(kelForm){ 3 nbRequit = 0; 4 5 var requit = [ 6 'IDENT', 7 'PASS' 8 ]; 9 var focused = false; 10 for(i in requit){ 11 $field = $(kelForm).find('[name='+requit[i]+']'); 12 if( $field.length ){ 13 if( $field.val().match(/^\s*$/) ){ 14 $field.addClass('requit'); 15 nbRequit++; 16 if( !focused ){ 17 $field.focus(); 18 focused = true; 19 } 20 }else{ 21 switch( requit[i] ){ 22 default : 23 $field.removeClass('requit'); 24 } 25 } 26 } 27 } 28 29 if( nbRequit ){ 30 return false; 31 }else{ 32 if( $('#colorbox').is(":visible") ){ 33 // validerAccesSecu(kelForm.IDENT.value, kelForm.PASS.value); 34 validerAccesSecu(kelForm); 35 return false; 36 } else { 37 return true; 38 } 39 } 40} 41// function validerAccesSecu( kelIdent, kelPass ){ 42function validerAccesSecu( kelForm ){ 43 // $.post(racine+"/modules/accessecus/@accesSecu.php", {IDENT : kelIdent, PASS : kelPass} ,function(text){ 44 $.post(racine+"/modules/accessecus/@accesSecu.php?LGG="+LGG, $(kelForm).serialize(), function(text){ 45 reg_exp = /class="message error"/g; 46 if( reg_exp.exec(text) ){ 47 $.colorbox({ 48 html : text, 49 maxHeight : '100%', 50 maxWidth : '100%', 51 fixed : true, 52 onComplete : function(){ 53 initColorBox('#colorbox a.lightbox'); 54 } 55 }); 56 } else { 57 // Suppression des eventuels paramètres de l'url avant rechargement 58 window.location = 'http://' + window.location.hostname + window.location.pathname; 59 } 60 }); 61} 62 63 64/* ************** Formulaire de mot de passe oublié ************** */ 65function verifFormOubliMotdePasse( kelForm ){ 66 var reg = /^[a-z0-9_.-]+@(?:[a-z0-9-]{2,}\.)+(?:[a-z]{2,}){1,2}$/; 67// message = ""; 68 nbRequit = 0; 69 70// kelEmail = kelForm.EMAIL_OUBLIE.value; 71// if( kelEmail == "" ){ 72// message += "\n- Email"; 73// }else if( !kelEmail.match(reg) ){ 74// message += "\n- "; 75// } 76// if( message ){ 77// alert( "The form is incomplete "+message ); 78// }else{ 79 80 $email = $(kelForm.EMAIL_OUBLIE); 81 kelEmail = $email.val(); 82 if( kelEmail == "" || !kelEmail.match(reg) ){ 83 nbRequit++; 84 $email.addClass('requit'); 85 }else{ 86 $email.removeClass('requit'); 87 } 88 if( !nbRequit ){ 89 $('.lightbox_content').addClass('loading'); 90 $.post(racine+'/modules/accessecus/@motdepasseoublie.php?LGG='+LGG , { EMAIL_OUBLIE : kelEmail }, function(text){ 91 $.colorbox({ 92 html : text, 93 maxHeight : '100%', 94 maxWidth : '100%', 95 fixed : true, 96 onComplete : function(){ 97 $('.lightbox_content').removeClass('loading'); 98 initColorBox('#colorbox a.lightbox'); 99 } 100 }); 101 }) 102 } 103 return false; 104} 105 106/* ************** Formulaire de création de compte ************** */ 107function verifFormCreation( kelForm ){ 108 message = ""; 109 nbRequit = 0; 110 111 var requit = [ 112 kelForm.NOM, 113 kelForm.PRENOM, 114 kelForm.EMAIL, 115 kelForm.PASS, 116 kelForm.CONFIRMPASS 117 ]; 118 // if( kelForm.RAISONSOCIALE ) requit.push(kelForm.RAISONSOCIALE); 119 if( kelForm.MENTIONSLEGALES ) requit.push(kelForm.MENTIONSLEGALES); 120// console.log(requit); 121 122 var focused = false; 123 for(i in requit){ 124 if( requit[i] ){ 125 $field = $(requit[i]); 126 if( $field.is('[type=checkbox]') ){ 127 if( !$field.is(':checked') ){ 128 $field.parents('.listCheck').addClass('requit'); 129 if( !nbRequit ) requit[i].focus(); 130 nbRequit++; 131 if( !focused ){ 132 $field.focus(); 133 focused = true; 134 } 135 }else{ 136 $field.parents('.listCheck').removeClass('requit'); 137 } 138 }else{ 139 if( requit[i].value.match(/^\s*$/) ){ 140 $field.addClass('requit'); 141 if( !nbRequit ) requit[i].focus(); 142 nbRequit++; 143 if( !focused ){ 144 $field.focus(); 145 focused = true; 146 } 147 }else{ 148 switch( $field.attr('name') ){ 149 case 'EMAIL' : 150 if( erreurEmail = verifEmailDispo($field, false) ){ 151 if( erreurEmail == 1 ){ 152 message+= "\n- Your email address is invalid"; 153 } 154 if( erreurEmail == 2 ){ 155 message+= "\n- Email already taken!"; 156 } 157 nbRequit++; 158 if( !focused ){ 159 $field.focus(); 160 focused = true; 161 } 162 } 163 break; 164 165 default : 166 $field.removeClass('requit'); 167 } 168 } 169 } 170 } 171 } 172 173 if( !kelForm.PASS.value.match(/^\s*$/) ){ 174 175 if( $('input[name="CONFIRMPASS"]').length ){ 176 177 if( kelForm.CONFIRMPASS.value == "" || kelForm.PASS.value!=kelForm.CONFIRMPASS.value ){ 178 if( kelForm.CONFIRMPASS.value != "" ){ 179 message+= "\n- The password is not confirmed"; 180 } 181 $(kelForm.CONFIRMPASS).addClass('requit'); 182 nbRequit++; 183 if( !focused ){ 184 kelForm.CONFIRMPASS.focus(); 185 focused = true; 186 } 187 }else{ 188 $(kelForm.CONFIRMPASS).removeClass('requit'); 189 if( !kelForm.PASS.value.match(/^(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.{8,})/) ){ 190 // if(kelForm.PASS.value.length < 6){ 191 // message+= "\n- Password : Minimum 6 characters"; 192 message+= "\n- Password : Minimum: 8 characters including 1 uppercase, 1 lowercase and 1 digit"; 193 $(kelForm.PASS).addClass('requit'); 194 nbRequit++; 195 if( !focused ){ 196 kelForm.PASS.focus(); 197 focused = true; 198 } 199 } 200 } 201 202 } else { 203 204 if( $('.modifPass.active input[name="NEWPASS"]').length ){ 205 206 if( kelForm.NEWPASS.value == "" ){ 207 $(kelForm.NEWPASS).addClass('requit'); 208 nbRequit++; 209 } else{ 210 $(kelForm.NEWPASS).removeClass('requit'); 211 if(kelForm.CONFIRMNEWPASS.value == "" || kelForm.NEWPASS.value!=kelForm.CONFIRMNEWPASS.value ){ 212 $(kelForm.CONFIRMNEWPASS).addClass('requit'); 213 nbRequit++; 214 }else{ 215 $(kelForm.CONFIRMNEWPASS).removeClass('requit'); 216 if( !kelForm.NEWPASS.value.match(/^(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.{8,})/) ){ 217 // if(kelForm.NEWPASS.value.length < 6){ 218 // message+= "\n- Password : Minimum 6 characters"; 219 message+= "\n- Password Minimum: 8 characters including 1 uppercase, 1 lowercase and 1 digit"; 220 $(kelForm.NEWPASS).addClass('requit'); 221 nbRequit++; 222 } 223 } 224 } 225 226 } 227 } 228 } 229 230 if( nbRequit ){ 231 if(message) alert("The form is incomplete"+message); 232 return false; 233 }else{ 234 if( $('#colorbox').is(":visible") ){ 235 creationMembre( kelForm ); 236 return false; 237 } else { 238 return true; 239 } 240 } 241} 242function creationMembre( kelForm ){ 243 $('.lightbox_content').addClass('loading'); 244 $.ajax({
245 'type' : 'POST', 246 'dataType': 'json', 247 'url' : racine+"/modules/accessecus/@creation_acces.php?LGG="+LGG, 248 'data' : $(kelForm).serialize(), 249 'success' : function(dataReturn){ 250 $.colorbox({ 251 html : dataReturn.html, 252 maxHeight : '100%', 253 maxWidth : '100%', 254 fixed : true, 255 onComplete : function(){ 256 $('.lightbox_content').removeClass('loading'); 257 initCreationMembre(); 258 } 259 }); 260 if( dataReturn.succesCrea ){ 261 if( typeof onAfterSuccesCreationClient === "function" ){ 262 onAfterSuccesCreationClient(); 263 } else if( dataReturn.logged ){ 264 $.colorbox.close = function(){ 265 // recharger la page (sans renvoyer les paramètres) 266 location.assign(location.pathname); 267 }; 268 } 269 } 270 } 271 }); 272 return false; 273} 274 275// Vérifie que le format de l'adresse et si elle est déjà attribuée 276function verifEmailDispo($chpEmail, async){ 277 var email = $chpEmail.val(); 278 $chpEmail.val( email.toLowerCase() ); 279 var verif = /^[a-z0-9._-]+@[a-z0-9._-]{2,}\.[a-z]{2,}$/; 280 if( verif.exec(email) !== null ){ 281 $.ajax({ 282 type: "POST", 283 async : async, 284 url: racine+'/modules/accessecus/@verifEmail.php', 285 data: { 286 EMAIL : $chpEmail.val() 287 } 288 }).done(function( text ){ 289 if(text){ 290 $chpEmail 291 .removeClass('valide') 292 .addClass('requit'); 293 erreurEmail = 2; 294 }else{ 295 $chpEmail 296 .removeClass('requit') 297 .addClass('valide'); 298 erreurEmail = 0; 299 } 300 }); 301 }else{ 302 $chpEmail 303 .removeClass('valide') 304 .addClass('requit'); 305 erreurEmail = 1; 306 } 307 if( !async ) return erreurEmail; 308} 309 310function initCreationMembre(){ 311 $chpEmail = $('#formCreationAcces [name=EMAIL]'); 312 if($chpEmail.length){ 313 $chpEmail.on('keyup change',function(){ 314 verifEmailDispo($chpEmail,true); 315 }); 316 } 317} 318 319function initEmailConfirmation( ident ){ 320 $.ajax({ 321 type: "POST", 322 url: racine+'/modules/accessecus/@emailConfirmation.php', 323 dataType: 'json', 324 data: { 325 ident : ident 326 } 327 }).done(function( data ){ 328 var $messageError = $('#loginForm .message.error'); 329 $messageError.after( data.html ); 330 $messageError.remove(); 331 }); 332 return false; 333} 334$(function(){ 335 if($('#formCreationAcces #btModifPass').length){ 336 initCreationMembre(); 337 $('#formCreationAcces #btModifPass').click(function(){ 338 if( $('#formCreationAcces .modifPass').hasClass('active') ){ 339 $('#formCreationAcces .modifPass').removeClass('active'); 340 }else{ 341 $('#formCreationAcces .modifPass').addClass('active'); 342 } 343 return false; 344 }); 345 } 346});
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.