plugins/SpecialUserFuncs.php
changeset 101 bb4e677a4da9
parent 93 95c4d91bd954
child 103 a8891e108c95
equal deleted inserted replaced
100:e9a685fb456f 101:bb4e677a4da9
   393       <h3>Create a user account</h3>
   393       <h3>Create a user account</h3>
   394       <form name="regform" action="<?php echo makeUrl($paths->page); ?>" method="post">
   394       <form name="regform" action="<?php echo makeUrl($paths->page); ?>" method="post">
   395         <div class="tblholder">
   395         <div class="tblholder">
   396           <table border="0" width="100%" cellspacing="1" cellpadding="4">
   396           <table border="0" width="100%" cellspacing="1" cellpadding="4">
   397             <tr><th class="subhead" colspan="3">Please tell us a little bit about yourself.</th></tr>
   397             <tr><th class="subhead" colspan="3">Please tell us a little bit about yourself.</th></tr>
       
   398             
   398             <?php if(isset($_POST['submit'])) echo '<tr><td colspan="3" class="row2" style="color: red;">'.$s.'</td></tr>'; ?>
   399             <?php if(isset($_POST['submit'])) echo '<tr><td colspan="3" class="row2" style="color: red;">'.$s.'</td></tr>'; ?>
   399             <tr><td class="row1" style="width: 50%;">Preferred username:<span id="e_username"></span></td><td class="row1" style="width: 50%;"><input type="text" name="username" size="30" onkeyup="namegood = false; validateForm();" onblur="checkUsername();" /></td><td class="row1" style="max-width: 24px;"><img alt="Good/bad icon" src="<?php echo scriptPath; ?>/images/bad.gif" id="s_username" /></td></tr>
   400             
   400             <tr><td class="row3" style="width: 50%;" rowspan="2">Password:<span id="e_password"></span></td><td class="row3" style="width: 50%;"><input type="password" name="password" size="30" onkeyup="validateForm();" /></td><td rowspan="2" class="row3" style="max-width: 24px;"><img alt="Good/bad icon" src="<?php echo scriptPath; ?>/images/bad.gif" id="s_password" /></td></tr>
   401             <!-- FIELD: Username -->
   401             <tr><td class="row3" style="width: 50%;"><input type="password" name="password_confirm" size="30" onkeyup="validateForm();" /> <small>Enter your password again to confirm.</small></td></tr>
   402             <tr>
   402             <tr><td class="row1" style="width: 50%;"><?php if ( $coppa ) echo 'Your parent or guardian\'s e'; else echo 'E'; ?>-mail address:<?php if(getConfig('account_activation')=='user') echo '<br /><small>An e-mail with an account activation key will be sent to this address, so please ensure that it is correct.</small></td>'; ?><td class="row1" style="width: 50%;"><input type="text" name="email" size="30" onkeyup="validateForm();" /></td><td class="row1" style="max-width: 24px;"><img alt="Good/bad icon" src="<?php echo scriptPath; ?>/images/bad.gif" id="s_email" /></td></tr>
   403               <td class="row1" style="width: 50%;">
   403             <tr><td class="row3" style="width: 50%;">Real name:<br /><small>Giving your real name is totally optional. If you choose to provide your real name, it will be used to provide attribution for any edits or contributions you may make to this site.</small><td class="row3" style="width: 50%;"><input type="text" name="real_name" size="30" /></td><td class="row3" style="max-width: 24px;"></td></tr>
   404                 Preferred username:
   404             <tr><td class="row1" style="width: 50%;" rowspan="2">Visual confirmation<br /><small>Please enter the code shown in the image to the right into the text box. This process helps to ensure that this registration is not being performed by an automated bot. If the image to the right is illegible, you can <a href="#" onclick="regenCaptcha(); return false;">generate a new image</a>.<br /><br />If you are visually impaired or otherwise cannot read the text shown to the right, please contact the site management and they will create an account for you.</small></td><td colspan="2" class="row1"><img id="captchaimg" alt="CAPTCHA image" src="<?php echo makeUrlNS('Special', 'Captcha/'.$captchacode); ?>" /><span id="b_username"></span></td></tr>
   405                 <span id="e_username"></span>
   405             <tr><td class="row1" colspan="2">Code: <input name="captchacode" type="text" size="10" /><input type="hidden" name="captchahash" value="<?php echo $captchacode; ?>" /></td></tr>
   406               </td>
   406             <tr><td class="row2" colspan="3" style="text-align: center;"><input type="submit" name="submit" value="Create my account" /></td></tr>
   407               <td class="row1" style="width: 50%;">
       
   408                 <input type="text" name="username" size="30" onkeyup="namegood = false; validateForm();" onblur="checkUsername();" />
       
   409               </td>
       
   410               <td class="row1" style="max-width: 24px;">
       
   411                 <img alt="Good/bad icon" src="<?php echo scriptPath; ?>/images/bad.gif" id="s_username" />
       
   412               </td>
       
   413             </tr>
       
   414             
       
   415             <!-- FIELD: Password -->
       
   416             <tr>
       
   417               <td class="row3" style="width: 50%;" rowspan="2">
       
   418                 Password:
       
   419                 <span id="e_password"></span>
       
   420               </td>
       
   421               <td class="row3" style="width: 50%;">
       
   422                 <input type="password" name="password" size="30" onkeyup="validateForm();" />
       
   423               </td>
       
   424               <td rowspan="2" class="row3" style="max-width: 24px;">
       
   425                 <img alt="Good/bad icon" src="<?php echo scriptPath; ?>/images/bad.gif" id="s_password" />
       
   426               </td>
       
   427             </tr>
       
   428             
       
   429             <!-- FIELD: Password confirmation -->
       
   430             <tr>
       
   431               <td class="row3" style="width: 50%;">
       
   432                 <input type="password" name="password_confirm" size="30" onkeyup="validateForm();" /> <small>Enter your password again to confirm.</small>
       
   433               </td>
       
   434             </tr>
       
   435             
       
   436             <!-- FIELD: E-mail address -->
       
   437             <tr>
       
   438               <td class="row1" style="width: 50%;">
       
   439                 <?php
       
   440                   if ( $coppa ) echo 'Your parent or guardian\'s e'; 
       
   441                   else echo 'E';
       
   442                 ?>-mail address:
       
   443                 <?php
       
   444                   if ( ( $x = getConfig('account_activation') ) == 'user' )
       
   445                   {
       
   446                     echo '<br /><small>An e-mail with an account activation key will be sent to this address, so please ensure that it is correct.</small>';
       
   447                   }
       
   448                 ?>
       
   449               </td>
       
   450               <td class="row1" style="width: 50%;">
       
   451                 <input type="text" name="email" size="30" onkeyup="validateForm();" />
       
   452               </td>
       
   453               <td class="row1" style="max-width: 24px;">
       
   454                 <img alt="Good/bad icon" src="<?php echo scriptPath; ?>/images/bad.gif" id="s_email" />
       
   455               </td>
       
   456             </tr>
       
   457             
       
   458             <!-- FIELD: Real name -->
       
   459             <tr>
       
   460               <td class="row3" style="width: 50%;">
       
   461                 Real name:<br />
       
   462                 <small>Giving your real name is totally optional. If you choose to provide your real name, it will be used to provide attribution for any edits or contributions you may make to this site.</small>
       
   463               </td>
       
   464               <td class="row3" style="width: 50%;">
       
   465                 <input type="text" name="real_name" size="30" /></td><td class="row3" style="max-width: 24px;">
       
   466               </td>
       
   467             </tr>
       
   468             
       
   469             <!-- FIELD: CAPTCHA image -->
       
   470             <tr>
       
   471               <td class="row1" style="width: 50%;" rowspan="2">
       
   472                 Visual confirmation<br />
       
   473                 <small>
       
   474                   Please enter the code shown in the image to the right into the text box. This process helps to ensure that this registration is not being performed by an automated bot. If the image to the right is illegible, you can <a href="#" onclick="regenCaptcha(); return false;">generate a new image</a>.<br />
       
   475                   <br />
       
   476                   If you are visually impaired or otherwise cannot read the text shown to the right, please contact the site management and they will create an account for you.
       
   477                 </small>
       
   478               </td>
       
   479               <td colspan="2" class="row1">
       
   480                 <img id="captchaimg" alt="CAPTCHA image" src="<?php echo makeUrlNS('Special', 'Captcha/'.$captchacode); ?>" />
       
   481                 <span id="b_username"></span>
       
   482               </td>
       
   483             </tr>
       
   484             
       
   485             <!-- FIELD: CAPTCHA input field -->
       
   486             <tr>
       
   487               <td class="row1" colspan="2">
       
   488                 Code:
       
   489                 <input name="captchacode" type="text" size="10" />
       
   490                 <input type="hidden" name="captchahash" value="<?php echo $captchacode; ?>" />
       
   491               </td>
       
   492             </tr>
       
   493             
       
   494             <!-- FIELD: submit button -->
       
   495             <tr>
       
   496               <th class="subhead" colspan="3" style="text-align: center;">
       
   497                 <input type="submit" name="submit" value="Create my account" />
       
   498               </td>
       
   499             </tr>
       
   500             
   407           </table>
   501           </table>
   408         </div>
   502         </div>
   409         <?php
   503         <?php
   410           $val = ( $coppa ) ? 'yes' : 'no';
   504           $val = ( $coppa ) ? 'yes' : 'no';
   411           echo '<input type="hidden" name="coppa" value="' . $val . '" />';
   505           echo '<input type="hidden" name="coppa" value="' . $val . '" />';
   431               document.getElementById('s_username').src='<?php echo scriptPath; ?>/images/bad.gif';
   525               document.getElementById('s_username').src='<?php echo scriptPath; ?>/images/bad.gif';
   432               document.getElementById('e_username').innerHTML = '<br /><small>Your username must be at least two characters in length and may contain only alphanumeric characters (A-Z and 0-9), spaces, and the following characters: :, !, @, #, *.</small>';
   526               document.getElementById('e_username').innerHTML = '<br /><small>Your username must be at least two characters in length and may contain only alphanumeric characters (A-Z and 0-9), spaces, and the following characters: :, !, @, #, *.</small>';
   433             }
   527             }
   434           }
   528           }
   435           document.getElementById('b_username').innerHTML = '';
   529           document.getElementById('b_username').innerHTML = '';
   436           if(hex_md5(frm.real_name.value) == 'fa8e397ae0f6cd5b0f90a3f48178cd7e')
   530           if(hex_md5(frm.real_name.value) == '5a397df72678128cf0e8147a2befd5f1')
   437           {
   531           {
   438             document.getElementById('b_username').innerHTML = '<br /><br />Hey...I know you!<br /><img alt="" src="http://upload.wikimedia.org/wikipedia/commons/thumb/7/7f/Bill_Gates_2004_cr.jpg/220px-Bill_Gates_2004_cr.jpg" />';
   532             document.getElementById('b_username').innerHTML = '<br /><br />Hey...I know you!<br /><img alt="" src="http://upload.wikimedia.org/wikipedia/commons/thumb/7/7f/Bill_Gates_2004_cr.jpg/220px-Bill_Gates_2004_cr.jpg" />';
   439           }
   533           }
   440           
   534           
   441           // Password
   535           // Password