Source for file registration.html.php

Documentation is available at registration.html.php

  1. <?php
  2. /**
  3. @package Mambo
  4. @subpackage Users
  5. @copyright  Refer to copyright.php
  6. @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
  7. @author Mambo Foundation Inc see README.php
  8. */
  9.  
  10. /** ensure this file is being included by a parent file */
  11. defined'_VALID_MOS' or die'Direct Access to this location is not allowed.' );
  12.  
  13.     function lostPassForm($option{
  14.         ?>
  15.  
  16. <div class="componentheading">
  17.     <?php echo T_('Lost your Password?')?>
  18. </div>
  19. <table cellpadding="0" cellspacing="0" border="0" width="100%" class="contentpane">
  20.   <form action="index.php" method="post">
  21.     <tr>
  22.       <td colspan="2"><?php printf(T_('Please enter your Username and e-mail address then click on the Send Password button.%s You will receive a new password shortly.  Use the new password to access the site.')'<br />')?></td>
  23.     </tr>
  24.     <tr>
  25.       <td><?php echo T_('Username:')?></td>
  26.       <td><input type="text" name="checkusername" class="inputbox" size="40" maxlength="25" /></td>
  27.     </tr>
  28.     <tr>
  29.       <td><?php echo T_('E-mail Address:')?></td>
  30.       <td><input type="text" name="confirmEmail" class="inputbox" size="40" /></td>
  31.     </tr>
  32.     <tr>
  33.       <td colspan="2"> <input type="hidden" name="option" value="<?php echo $option;?>" />
  34.         <input type="hidden" name="task" value="sendNewPass" /> <input type="submit" class="button" value="<?php echo T_('Send Password')?>" /></td>
  35.     </tr>
  36.   </form>
  37. </table>
  38. <?php
  39.     }
  40.  
  41. function registerForm($option$useractivation{
  42. $name trimmosGetParam$_REQUEST'name'"" ) );
  43. $username trimmosGetParam$_REQUEST'username'"" ) );
  44. $email trimmosGetParam$_REQUEST'email'"" ) );
  45. $useractivation trimmosGetParam$_REQUEST'useractivation'"" ) );
  46. ?>
  47.     <script language="javascript" type="text/javascript">
  48.         function submitbutton() {
  49.             var form = document.mosForm;
  50.             //old method didn't really work, just excluded certain characters rather than limiting to a range of characters.
  51.             //var r = new RegExp("[\<|\>|\"|\'|\%|\;|\(|\)|\&|\+|\-]", "i");
  52.             var r = new RegExp("[^A-Za-z0-9]", "i");
  53.  
  54.             // do field validation
  55.             if (form.name.value == "") {
  56.                 alert( "<?php echo html_entity_decode(T_('Please enter your name.'));?>" );
  57.                 form.name.focus();
  58.             } else if (form.username.value == "") {
  59.                 alert( "<?php echo html_entity_decode(T_('Please enter a user name.'));?>" );
  60.                 form.username.focus();
  61.             } else if (r.exec(form.username.value) || form.username.value.length < 3) {
  62.                 alert( "<?php printfhtml_entity_decode(T_("Please enter a valid %s.  No spaces, more than %d characters and containing only the characters 0-9,a-z, or A-Z"))html_entity_decode(T_('Please enter a user name.')));?>" );
  63.                 form.username.focus();
  64.             } else if (form.email.value == "" ) {
  65.                 alert( "<?php echo html_entity_decode(T_('Please enter a valid e-mail address.'));?>" );
  66.                 form.email.focus();
  67.             } else if (form.email2.value == "" ) {
  68.                 alert( "<?php echo html_entity_decode(T_('Please enter a valid e-mail address for the verification.'));?>" );
  69.                 form.email2.focus();
  70.             } else if (form.password.value.length < 6) {
  71.                 alert( "<?php echo html_entity_decode(T_('Please enter a valid password -- more than 6 characters with no spaces and containing only the characters 0-9, a-z, or A-Z'));?>" );
  72.                 form.password.focus();
  73.             } else if (form.password2.value == "") {
  74.                 alert( "<?php echo html_entity_decode(T_('Please verify the verification password.'));?>" );
  75.                 form.password2.focus();
  76.             } else if ((form.password.value != "") && (form.password.value != form.password2.value)){
  77.                 alert( "<?php echo html_entity_decode(T_('Password and verification do not match, please try again.'));?>" );
  78.                 form.password.value="";
  79.                 form.password2.value="";
  80.                 form.password.focus();
  81.             } else if (r.exec(form.password.value)) {
  82.                 alert( "<?php printfhtml_entity_decode(T_("Please enter a valid %s.  No spaces, more than %d characters and containing only the characters 0-9,a-z, or A-Z"))html_entity_decode(T_('Password:')));?>" );
  83.                 form.password.focus();
  84.             } else if ((form.password.value != "") && (form.email.value != form.email2.value)){
  85.                 alert( "<?php printfhtml_entity_decode(T_('Email and verification do not match, please try again.')));?>" );
  86.                 form.email.value="";
  87.                 form.email2.value="";
  88.                 form.email.focus();
  89.             } else if ( form.accept.checked == false) {
  90.                 alert( "<?php printfhtml_entity_decode(T_('You must accept the Privacy Policy and Disclaimer, to continue.')));?>" );
  91.                 form.accept.focus();
  92.             } else {
  93.                 form.submit();
  94.             }
  95.         }
  96.     </script>
  97.  
  98. <div class="componentheading">
  99.     <?php echo T_('Registration')?>
  100. </div>
  101. <form action="index.php" method="post" name="mosForm">
  102. <table cellpadding="0" cellspacing="0" border="0" width="100%" class="contentpane">
  103. <tr>
  104. <td colspan="2"><?php echo T_('Fields marked with an asterisk (*) are required.')?></td>
  105. </tr>
  106.     <tr>
  107.       <td width="30%"><?php echo T_('Name:')?> *</td>
  108.       <td><input type="text" name="name" size="40" value="<?php echo $name?>" class="inputbox" /></td>
  109.     </tr>
  110.  
  111.     <tr>
  112.  
  113.       <td><?php echo T_('Username:')?> *</td>
  114.       <td><input type="text" name="username" size="40" value="<?php echo $username?>" class="inputbox" /></td>
  115.     <tr>
  116.  
  117.       <td><?php echo T_('E-mail:')?> *</td>
  118.       <td><input type="text" name="email" size="40" value="<?php echo $email?>" class="inputbox" /></td>
  119.     </tr>
  120.  
  121.     <tr>
  122.       <td><?php echo T_('Verify E-mail:')?> *</td>
  123.       <td><input type="text" name="email2" class="inputbox" id="email2" value="<?php echo $email?>" size="40" /></td>
  124.     </tr>
  125.     <tr>
  126.       <td><?php echo T_('Password:')?> *</td>
  127.       <td><input class="inputbox" type="password" name="password" size="40" value="" /></td>
  128.     </tr>
  129.     <tr>
  130.       <td><?php echo T_('Verify Password:')?> *</td>
  131.       <td><input class="inputbox" type="password" name="password2" size="40" value="" /></td>
  132.     </tr>
  133.       <td valign="top"><?php echo T_('Disclaimer and<br />Privacy Policy:')?> *</td>
  134.       <td>
  135.      <textarea name="privacypolicy" cols="48" rows="4" id="privacypolicy" class="inputbox" style="font-size:0.85em;" readonly><?php echo T_('put your disclaimer here..')?></textarea>
  136.      </td>
  137.     </tr>
  138.     <tr>
  139.       <td align="right">&nbsp;</td>
  140.       <td><input name="accept" type="checkbox" id="accept" value="yes">        
  141.         <?php echo T_('Yes, I Accept')?></td>
  142.     </tr>
  143.     <tr>
  144.       <td colspan="2">&nbsp;</td>
  145.     </tr>
  146.  
  147.     <tr>
  148.       <td colspan=2>
  149.   </td>
  150.     </tr>
  151. </table>
  152. <input type="hidden" name="id" value="0" />
  153. <input type="hidden" name="gid" value="0" />
  154. <input type="hidden" name="useractivation" value="<?php echo $useractivation;?>" />
  155. <input type="hidden" name="option" value="<?php echo $option?>" />
  156. <input type="hidden" name="task" value="confirmRegistration" />
  157. <input type="button" value="<?php echo T_('Send Registration')?>" class="button" onclick="submitbutton()" />
  158. </form>
  159. <?php
  160.     }
  161.  
  162.  
  163. function confirmForm($option$name$username$password$email$useractivation{
  164. ?>
  165. <script language="javascript" type="text/javascript">
  166. function reviseData()
  167. {
  168.  var form = document.mosForm;
  169.  form.task.value='reviseRegistration';
  170.  form.submit();
  171. }
  172. </script>
  173. <div class="componentheading">
  174. <?php echo T_('Registration')?></div>
  175. <form action="index.php" method="post" name="mosForm">
  176. <table cellpadding="0" cellspacing="0" border="0" width="100%" class="contentpane">
  177.     <tr>
  178.       <td colspan="2"><?php echo T_('Please verify that the following data is correct and click the button below to complete registration.')?> </td>
  179.     </tr>
  180.     <tr>
  181.       <td colspan="2">&nbsp;</td>
  182.     </tr>
  183.     <tr>
  184.       <td width="15%"><?php echo T_('Name:')?> </td>
  185.       <td><b><?php echo $name;?></b><input type="hidden" name="name" size="40" value="<?php echo $name;?>" /></td>
  186.     </tr>
  187.     <tr>
  188.       <td><?php echo T_('Username:')?> </td>
  189.       <td><b><?php echo $username;?></b><input type="hidden" name="username" size="40" value="<?php echo $username;?>" /></td>
  190.     <tr>
  191.       <td><?php echo T_('E-mail:')?> </td>
  192.       <td><b><?php echo $email;?></b><input type="hidden" name="email" size="40" value="<?php echo $email;?>" /></td>
  193.     </tr>
  194.     <tr>
  195.       <td colspan="2">&nbsp;</td>
  196.     </tr>
  197.     <tr align="center">
  198.       <td colspan="2"><table width="80%" border="0" cellspacing="0" cellpadding="0">
  199.         <tr align="center" valign="top">
  200.           <td width="45%" align="center" valign="top" style="background-color:#FFE9E6;"><?php echo T_('Go back and correct your data.')?></td>
  201.           <td width="10%" valign="top">&nbsp;</td>
  202.           <td width="45%" align="center" style="background-color:#E8FFE8"><?php echo T_('The data is correct.')?></td>
  203.         </tr>
  204.         <tr align="center" valign="middle">
  205.           <td height="32" align="center" valign="middle" style="background-color:#FFE9E6;"><input name="back" type="button" class="button" id="back" value="<?php echo T_('Correct Your Data')?>" onClick="reviseData()"></td>
  206.           <td>&nbsp;</td>
  207.           <td align="center" valign="middle" style="background-color:#E8FFE8"><input name="confirm" type="submit" class="button" id="confirm" value="<?php echo T_('Confirm Registration')?>"/></td>
  208.         </tr>
  209.       </table></td>
  210.     </tr>
  211.     <tr>
  212.       <td colspan=2>
  213.   </td>
  214.     </tr>
  215. </table>
  216. <input type="hidden" name="id" value="0" />
  217. <input type="hidden" name="gid" value="0" />
  218. <input type="hidden" name="useractivation" value="<?php echo $useractivation;?>" />
  219. <input type="hidden" name="password" value="<?php echo $password;?>" />
  220. <input type="hidden" name="option" value="<?php echo $option?>" />
  221. <input type="hidden" name="task" value="saveRegistration" />
  222. </form>
  223. <?php
  224. }
  225.  
  226. }
  227. ?>

Documentation generated on Mon, 05 May 2008 16:22:35 +0400 by phpDocumentor 1.4.0