plugins/SpecialUserFuncs.php
changeset 404 fb4f9e6f378f
parent 402 d907601ccad2
child 407 35d94240a197
equal deleted inserted replaced
403:2c9745b5c09d 404:fb4f9e6f378f
   609                 <span id="e_username"></span>
   609                 <span id="e_username"></span>
   610               </td>
   610               </td>
   611               <td class="row1" style="width: 50%;">
   611               <td class="row1" style="width: 50%;">
   612                 <input tabindex="1" type="text" name="username" size="30" value="<?php echo $username; ?>" onkeyup="namegood = false; validateForm(this);" onblur="checkUsername();" />
   612                 <input tabindex="1" type="text" name="username" size="30" value="<?php echo $username; ?>" onkeyup="namegood = false; validateForm(this);" onblur="checkUsername();" />
   613               </td>
   613               </td>
   614               <td class="row1" style="max-width: 24px;">
   614               <td class="row1" style="width: 1px;">
   615                 <img alt="Good/bad icon" src="<?php echo scriptPath; ?>/images/bad.gif" id="s_username" />
   615                 <img alt="Good/bad icon" src="<?php echo scriptPath; ?>/images/checkbad.png" id="s_username" />
   616               </td>
   616               </td>
   617             </tr>
   617             </tr>
   618             
   618             
   619             <!-- FIELD: Password -->
   619             <!-- FIELD: Password -->
   620             <tr>
   620             <tr>
   627               </td>
   627               </td>
   628               <td class="row3" style="width: 50%;">
   628               <td class="row3" style="width: 50%;">
   629                 <input tabindex="2" type="password" name="password" size="15" onkeyup="<?php if ( getConfig('pw_strength_enable') == '1' ): ?>password_score_field(this); <?php endif; ?>validateForm(this);" /><?php if ( getConfig('pw_strength_enable') == '1' ): ?><span class="password-checker" style="font-weight: bold; color: #aaaaaa;"> Loading...</span><?php endif; ?>
   629                 <input tabindex="2" type="password" name="password" size="15" onkeyup="<?php if ( getConfig('pw_strength_enable') == '1' ): ?>password_score_field(this); <?php endif; ?>validateForm(this);" /><?php if ( getConfig('pw_strength_enable') == '1' ): ?><span class="password-checker" style="font-weight: bold; color: #aaaaaa;"> Loading...</span><?php endif; ?>
   630               </td>
   630               </td>
   631               <td rowspan="<?php echo ( getConfig('pw_strength_enable') == '1' ) ? '3' : '2'; ?>" class="row3" style="max-width: 24px;">
   631               <td rowspan="<?php echo ( getConfig('pw_strength_enable') == '1' ) ? '3' : '2'; ?>" class="row3" style="max-width: 24px;">
   632                 <img alt="Good/bad icon" src="<?php echo scriptPath; ?>/images/bad.gif" id="s_password" />
   632                 <img alt="Good/bad icon" src="<?php echo scriptPath; ?>/images/checkbad.png" id="s_password" />
   633               </td>
   633               </td>
   634             </tr>
   634             </tr>
   635             
   635             
   636             <!-- FIELD: Password confirmation -->
   636             <!-- FIELD: Password confirmation -->
   637             <tr>
   637             <tr>
   672               </td>
   672               </td>
   673               <td class="row1" style="width: 50%;">
   673               <td class="row1" style="width: 50%;">
   674                 <input tabindex="4" type="text" name="email" size="30" value="<?php echo $email; ?>" onkeyup="validateForm(this);" />
   674                 <input tabindex="4" type="text" name="email" size="30" value="<?php echo $email; ?>" onkeyup="validateForm(this);" />
   675               </td>
   675               </td>
   676               <td class="row1" style="max-width: 24px;">
   676               <td class="row1" style="max-width: 24px;">
   677                 <img alt="Good/bad icon" src="<?php echo scriptPath; ?>/images/bad.gif" id="s_email" />
   677                 <img alt="Good/bad icon" src="<?php echo scriptPath; ?>/images/checkbad.png" id="s_email" />
   678               </td>
   678               </td>
   679             </tr>
   679             </tr>
   680             
   680             
   681             <!-- FIELD: Real name -->
   681             <!-- FIELD: Real name -->
   682             <tr>
   682             <tr>
   860             {
   860             {
   861               //if(frm.username.value.match(/^([A-z0-9 \!@\-\(\)]+){2,}$/ig))
   861               //if(frm.username.value.match(/^([A-z0-9 \!@\-\(\)]+){2,}$/ig))
   862               var regex = new RegExp('^([^<>&\?]+){2,}$', 'ig');
   862               var regex = new RegExp('^([^<>&\?]+){2,}$', 'ig');
   863               if ( frm.username.value.match(regex) )
   863               if ( frm.username.value.match(regex) )
   864               {
   864               {
   865                 document.getElementById('s_username').src='<?php echo scriptPath; ?>/images/unknown.gif';
   865                 document.getElementById('s_username').src='<?php echo scriptPath; ?>/images/checkunk.png';
   866                 document.getElementById('e_username').innerHTML = '&nbsp;';
   866                 document.getElementById('e_username').innerHTML = '&nbsp;';
   867               } else {
   867               } else {
   868                 failed = true;
   868                 failed = true;
   869                 document.getElementById('s_username').src='<?php echo scriptPath; ?>/images/bad.gif';
   869                 document.getElementById('s_username').src='<?php echo scriptPath; ?>/images/checkbad.png';
   870                 document.getElementById('e_username').innerHTML = '<br /><small>' + $lang.get('user_reg_err_username_invalid') + '</small>';
   870                 document.getElementById('e_username').innerHTML = '<br /><small>' + $lang.get('user_reg_err_username_invalid') + '</small>';
   871               }
   871               }
   872             }
   872             }
   873             document.getElementById('b_username').innerHTML = '';
   873             document.getElementById('b_username').innerHTML = '';
   874             if(hex_md5(frm.real_name.value) == '5a397df72678128cf0e8147a2befd5f1')
   874             if(hex_md5(frm.real_name.value) == '5a397df72678128cf0e8147a2befd5f1')
   879             // Password
   879             // Password
   880             if ( field.name == 'password' || field.name == 'password_confirm' || field.name == '_nil' )
   880             if ( field.name == 'password' || field.name == 'password_confirm' || field.name == '_nil' )
   881             {
   881             {
   882               if(frm.password.value.match(/^(.+){6,}$/ig) && frm.password_confirm.value.match(/^(.+){6,}$/ig) && frm.password.value == frm.password_confirm.value )
   882               if(frm.password.value.match(/^(.+){6,}$/ig) && frm.password_confirm.value.match(/^(.+){6,}$/ig) && frm.password.value == frm.password_confirm.value )
   883               {
   883               {
   884                 document.getElementById('s_password').src='<?php echo scriptPath; ?>/images/good.gif';
   884                 document.getElementById('s_password').src='<?php echo scriptPath; ?>/images/check.png';
   885                 document.getElementById('e_password').innerHTML = '<br /><small>' + $lang.get('user_reg_err_password_good') + '</small>';
   885                 document.getElementById('e_password').innerHTML = '<br /><small>' + $lang.get('user_reg_err_password_good') + '</small>';
   886               } else {
   886               } else {
   887                 failed = true;
   887                 failed = true;
   888                 if(frm.password.value.length < 6)
   888                 if(frm.password.value.length < 6)
   889                 {
   889                 {
   895                 }
   895                 }
   896                 else
   896                 else
   897                 {
   897                 {
   898                   document.getElementById('e_password').innerHTML = '';
   898                   document.getElementById('e_password').innerHTML = '';
   899                 }
   899                 }
   900                 document.getElementById('s_password').src='<?php echo scriptPath; ?>/images/bad.gif';
   900                 document.getElementById('s_password').src='<?php echo scriptPath; ?>/images/checkbad.png';
   901               }
   901               }
   902             }
   902             }
   903             
   903             
   904             // E-mail address
   904             // E-mail address
   905             
   905             
   906             // workaround for idiot jEdit bug
   906             // workaround for idiot jEdit bug
   907             if ( validateEmail(frm.email.value) && ( field.name == 'email' || field.name == '_nil' ) )
   907             if ( validateEmail(frm.email.value) && ( field.name == 'email' || field.name == '_nil' ) )
   908             {
   908             {
   909               document.getElementById('s_email').src='<?php echo scriptPath; ?>/images/good.gif';
   909               document.getElementById('s_email').src='<?php echo scriptPath; ?>/images/check.png';
   910             } else {
   910             } else {
   911               failed = true;
   911               failed = true;
   912               document.getElementById('s_email').src='<?php echo scriptPath; ?>/images/bad.gif';
   912               document.getElementById('s_email').src='<?php echo scriptPath; ?>/images/checkbad.png';
   913             }
   913             }
   914             if(failed)
   914             if(failed)
   915             {
   915             {
   916               frm.submit.disabled = 'disabled';
   916               frm.submit.disabled = 'disabled';
   917             } else {
   917             } else {
   925             if(!namegood)
   925             if(!namegood)
   926             {
   926             {
   927               var regex = new RegExp('^([^<>&\?]+){2,}$', 'ig');
   927               var regex = new RegExp('^([^<>&\?]+){2,}$', 'ig');
   928               if ( frm.username.value.match(regex) )
   928               if ( frm.username.value.match(regex) )
   929               {
   929               {
   930                 document.getElementById('s_username').src='<?php echo scriptPath; ?>/images/unknown.gif';
   930                 document.getElementById('s_username').src='<?php echo scriptPath; ?>/images/checkunk.png';
   931                 document.getElementById('e_username').innerHTML = '&nbsp;';
   931                 document.getElementById('e_username').innerHTML = '&nbsp;';
   932               } else {
   932               } else {
   933                 document.getElementById('s_username').src='<?php echo scriptPath; ?>/images/bad.gif';
   933                 document.getElementById('s_username').src='<?php echo scriptPath; ?>/images/checkbad.png';
   934                 document.getElementById('e_username').innerHTML = '<br /><small>' + $lang.get('user_reg_err_username_invalid') + '</small>';
   934                 document.getElementById('e_username').innerHTML = '<br /><small>' + $lang.get('user_reg_err_username_invalid') + '</small>';
   935                 return false;
   935                 return false;
   936               }
   936               }
   937             }
   937             }
   938             
   938             
   939             document.getElementById('e_username').innerHTML = '<br /><small><b>' + $lang.get('user_reg_msg_username_checking') + '</b></small>';
   939             document.getElementById('e_username').innerHTML = '<br /><small><b>' + $lang.get('user_reg_msg_username_checking') + '</b></small>';
   940             ajaxGet('<?php echo scriptPath; ?>/ajax.php?title=null&_mode=checkusername&name='+escape(frm.username.value), function() {
   940             ajaxGet('<?php echo scriptPath; ?>/ajax.php?title=null&_mode=checkusername&name='+escape(frm.username.value), function() {
   941               if(ajax.readyState == 4)
   941               if(ajax.readyState == 4)
   942                 if(ajax.responseText == 'good')
   942                 if(ajax.responseText == 'good')
   943                 {
   943                 {
   944                   document.getElementById('s_username').src='<?php echo scriptPath; ?>/images/good.gif';
   944                   document.getElementById('s_username').src='<?php echo scriptPath; ?>/images/check.png';
   945                   document.getElementById('e_username').innerHTML = '<br /><small><b>' + $lang.get('user_reg_msg_username_available') + '</b></small>';
   945                   document.getElementById('e_username').innerHTML = '<br /><small><b>' + $lang.get('user_reg_msg_username_available') + '</b></small>';
   946                   namegood = true;
   946                   namegood = true;
   947                 } else if(ajax.responseText == 'bad') {
   947                 } else if(ajax.responseText == 'bad') {
   948                   document.getElementById('s_username').src='<?php echo scriptPath; ?>/images/bad.gif';
   948                   document.getElementById('s_username').src='<?php echo scriptPath; ?>/images/checkbad.png';
   949                   document.getElementById('e_username').innerHTML = '<br /><small><b>' + $lang.get('user_reg_msg_username_unavailable') + '</b></small>';
   949                   document.getElementById('e_username').innerHTML = '<br /><small><b>' + $lang.get('user_reg_msg_username_unavailable') + '</b></small>';
   950                   namegood = false;
   950                   namegood = false;
   951                 } else {
   951                 } else {
   952                   document.getElementById('e_username').innerHTML = ajax.responseText;
   952                   document.getElementById('e_username').innerHTML = ajax.responseText;
   953                 }
   953                 }