[ Index ]

PHP Cross Reference of Mambo 4.6.5

[ Variables ]     [ Functions ]     [ Classes ]     [ Constants ]     [ Statistics ]

title

Body

[close]

/components/com_user/ -> user.html.php (source)

   1  <?php
   2  /**
   3  * @package Mambo
   4  * @subpackage Users
   5  * @author Mambo Foundation Inc see README.php
   6  * @copyright (C) 2000 - 2009 Mambo Foundation Inc.
   7  * See COPYRIGHT.php for copyright notices and details.
   8  * @license GNU/GPL Version 2, see LICENSE.php
   9  *
  10  * Redistributions of files must retain the above copyright notice.
  11  *
  12  * Mambo is free software; you can redistribute it and/or
  13  * modify it under the terms of the GNU General Public License
  14  * as published by the Free Software Foundation; version 2 of the License.
  15  */
  16  
  17  /** ensure this file is being included by a parent file */
  18  defined( '_VALID_MOS' ) or die( 'Direct Access to this location is not allowed.' );
  19  
  20  class HTML_user {
  21  	function frontpage() {
  22  ?>
  23  <div class="componentheading">
  24      <?php echo T_('Welcome!'); ?>
  25  </div>
  26  
  27      <table cellpadding="0" cellspacing="0" border="0" width="100%">
  28          <tr>
  29              <td><?php echo T_('Welcome to the user section of our site'); ?></td>
  30          </tr>
  31      </table>
  32  <?php
  33      }
  34  
  35  	function userEdit($row, $option,$submitvalue) {
  36          global $my;
  37  ?>
  38      <script type="text/javascript">
  39  		function submitbutton() {
  40              var form = document.mosUserForm;
  41              var r = new RegExp("[\<|\>|\"|\'|\%|\;|\(|\)|\&|\+|\-]", "i");
  42  
  43              // do field validation
  44              if (form.name.value == "") {
  45                  alert( "<?php echo T_('Please enter your name.');?>" );
  46              } else if (form.username.value == "") {
  47                  alert( "<?php echo T_('Please enter a user name.');?>" );
  48              } else if (r.exec(form.username.value) || form.username.value.length < 3) {
  49                  alert( "<?php printf( T_("Please enter a valid %s.  No spaces, more than %d characters and containing only the characters 0-9,a-z, or A-Z"), T_('Username:'), 4 );?>" );
  50              } else if (form.email.value == "") {
  51                  alert( "<?php echo T_('Please enter a valid e-mail address.');?>" );
  52              } else if ((form.password.value != "") && (form.password.value != form.verifyPass.value)){
  53                  alert( "<?php echo T_('Password and verification do not match, please try again.');?>" );
  54              } else if (r.exec(form.password.value)) {
  55                  alert( "<?php printf( T_("Please enter a valid %s.  No spaces, more than %d characters and containing only the characters 0-9,a-z, or A-Z"), T_('Password:'), 4 );?>" );
  56              } else {
  57                  form.submit();
  58              }
  59          }
  60      </script>
  61  <form action="index.php" method="post" name="mosUserForm">
  62          <div class="componentheading">
  63              <?php echo T_('Edit Your Details'); ?>
  64          </div>
  65          <table cellpadding="5" cellspacing="0" border="0" width="100%">
  66      <tr>
  67        <td width=85><?php echo T_('Your Name:'); ?></td>
  68        <td><input class="inputbox" type="text" name="name" value="<?php echo $row->name;?>" size="40" /></td>
  69      </tr>
  70      <tr>
  71        <td><?php echo T_('e-mail:'); ?></td>
  72        <td><input class="inputbox" type="text" name="email" value="<?php echo $row->email;?>" size="40" /></td>
  73      <tr>
  74        <td><?php echo T_('User Name:'); ?></td>
  75        <td><input class="inputbox" type="text" name="username" value="<?php echo $row->username;?>" size="40" /></td>
  76      </tr>
  77  <?php if ($my->id) { ?>
  78      <tr>
  79        <td><?php echo T_('Password:'); ?>&nbsp;(<?php echo strtolower(T_('Required')); ?>&nbsp;)</td>
  80        <td><input class="inputbox" type="password" name="requiredPass" value="" size="40" /></td>
  81      </tr>
  82  <?php } ?>
  83      <tr>
  84        <td><?php echo ($my->id ? (T_('New').'&nbsp;') : '').T_('Password:'); ?></td>
  85        <td><input class="inputbox" type="password" name="password" value="" size="40" /></td>
  86      </tr>
  87      <tr>
  88        <td><?php echo T_('Verify Password:'); ?></td>
  89        <td><input class="inputbox" type="password" name="verifyPass" size="40" /></td>
  90      </tr>
  91      <tr>
  92        <td colspan="2">
  93          <input class="button" type="button" value="<?php echo $submitvalue; ?>" onclick="submitbutton()" />
  94        </td>
  95      </tr>
  96    </table>
  97      <input type="hidden" name="id" value="<?php echo $row->id;?>" />
  98      <input type="hidden" name="option" value="<?php echo $option;?>" />
  99      <input type="hidden" name="f" value="<?php echo mosFormId($option, 'edit', $my); ?>" />
 100      <input type="hidden" name="task" value="saveUserEdit" />
 101  </form>
 102  <?php
 103      }
 104  
 105  	function confirmation() {
 106          ?>
 107      <div class="componentheading">
 108          <?php echo T_('Submission Success!'); ?>
 109      </div>
 110      <table>
 111          <tr>
 112              <td><?php echo T_('Your item has been submitted to the site administrators. It will be reviewed before being published on the site.'); ?></td>
 113          </tr>
 114      </table>
 115  <?php
 116      }
 117  }
 118  ?>