[ Index ]

Source Code Reference for V1.00

title

Body

[close]

/ -> createuser.php (source)

   1  <?php /* $Id: createuser.php 102 2008-03-18 19:52:59Z pedroix $ $URL: https://web2project.svn.sourceforge.net/svnroot/web2project/trunk/createuser.php $ */
   2  require_once  'base.php';
   3  if (!defined('W2P_BASE_DIR')) {
   4      die('You should not access this file directly');
   5  }
   6  require_once W2P_BASE_DIR . '/includes/config.php';
   7  
   8  if (!isset($GLOBALS['OS_WIN'])) {
   9      $GLOBALS['OS_WIN'] = (stristr(PHP_OS, 'WIN') !== false);
  10  }
  11  
  12  // tweak for pathname consistence on windows machines

  13  require_once  W2P_BASE_DIR . '/includes/main_functions.php';
  14  require_once  W2P_BASE_DIR . '/includes/db_adodb.php';
  15  require_once  W2P_BASE_DIR . '/classes/query.class.php';
  16  require_once  W2P_BASE_DIR . '/classes/ui.class.php';
  17  $AppUI = new CAppUI();
  18  include_once  W2P_BASE_DIR . '/classes/w2p.class.php';
  19  require_once  W2P_BASE_DIR . '/classes/date.class.php';
  20  require_once  W2P_BASE_DIR . '/modules/admin/admin.class.php';
  21  // Create the roles class container

  22  require_once  W2P_BASE_DIR . '/modules/system/roles/roles.class.php';
  23  
  24  require_once W2P_BASE_DIR . '/style/' . $uistyle . '/overrides.php';
  25  if (w2PgetConfig('activate_external_user_creation') != 'true') {
  26      die('You should not access this file directly');
  27  }
  28  
  29  require_once  W2P_BASE_DIR . '/lib/captcha/Captcha.class.php';
  30  require_once  W2P_BASE_DIR . '/lib/captcha/Functions.php';
  31  /*

  32  Re-Generating variables for html form...

  33  */
  34  $rnd = strtoupper(rnd_string());
  35  $uid = urlencode(md5_encrypt($rnd));
  36  $cid = md5_encrypt($rnd);
  37  
  38  $countries = array('' => $AppUI->_('(Select a Country)')) + w2PgetSysVal('GlobalCountries');
  39  
  40  ?>
  41  <script language="javascript">
  42  function submitIt(){
  43      var form = document.editFrm;
  44     if (form.user_username.value.length < <?php echo w2PgetConfig('username_min_len'); ?>) {
  45          alert("<?php echo $AppUI->_('Username size is invalid, should be greater than', UI_OUTPUT_JS); ?>" + ' ' + <?php echo w2PgetConfig('username_min_len'); ?>);
  46          form.user_username.focus();
  47      } else if (form.user_password.value.length < <?php echo w2PgetConfig('password_min_len'); ?>) {
  48          alert("<?php echo $AppUI->_('Password size is invalid, should be greater than', UI_OUTPUT_JS); ?>" + ' ' + <?php echo w2PgetConfig('password_min_len'); ?>);
  49          form.user_password.focus();
  50      } else if (form.user_password.value !=  form.password_check.value) {
  51          alert("<?php echo $AppUI->_('Password confirmation failed', UI_OUTPUT_JS); ?>");
  52          form.user_password.focus();
  53      } else if (form.contact_first_name.value.length < 1) {
  54          alert("<?php echo $AppUI->_('First name is invalid', UI_OUTPUT_JS); ?>");
  55          form.contact_first_name.focus();
  56      } else if (form.contact_last_name.value.length < 1) {
  57          alert("<?php echo $AppUI->_('Last name is invalid', UI_OUTPUT_JS); ?>");
  58          form.contact_last_name.focus();
  59      } else if (form.contact_email.value.length < 4) {
  60          alert("<?php echo $AppUI->_('Email is invalid', UI_OUTPUT_JS); ?>");
  61          form.contact_email.focus();
  62      } else if (form.spam_check.value.length < 1 ) {
  63          alert("<?php echo $AppUI->_('Anti Spam Security is invalid', UI_OUTPUT_JS); ?>");
  64      } else {
  65          form.submit();
  66      }
  67  }
  68  </script>
  69  <table width="100%" cellspacing="0" cellpadding="0" border="0">
  70  <tbody><tr>
  71      <td width="508"><a href="http://www.web2project.net"><img border="0" alt="web2Project Home" src="./style/<?php echo $uistyle; ?>/w2p_logo.jpg"/></a></td>
  72      <td style="background: url(./style/<?php echo $uistyle; ?>/logo_bkgd.jpg)">&nbsp;</td>
  73  </tr>
  74  </tbody>
  75  </table>
  76  <table width="100%" cellspacing="0" cellpadding="0" border="0">
  77  <tbody>
  78      <tr>
  79      <td valign="top" style="background: url(./style/<?php echo $uistyle; ?>/nav_shadow.jpg)" align="left">
  80          <img width="1" height="13" border="0" src="./style/<?php echo $uistyle; ?>/nav_shadow.jpg"/>
  81      </td>
  82  </tr>
  83  </tbody>
  84  </table>
  85  
  86  <table align="center" border="0" width="700" cellpadding="0" cellspacing="0" class="">
  87            <tr>
  88              <td style="padding-top:10px;padding-bottom:10px;" align="left" valign="top" class="txt"><h1>New Signup to web2Project!</h1>
  89              Please enter the info below to create a new signup.</td>
  90            </tr>
  91  </table>
  92  <form name="editFrm" action="./do_user_aed.php" method="post">
  93      <input type="hidden" name="user_id" value="<?php echo intval($user["user_id"]); ?>" />
  94      <input type="hidden" name="contact_id" value="<?php echo intval($user["contact_id"]); ?>" />
  95      <input type="hidden" name="username_min_len" value="<?php echo w2PgetConfig('username_min_len'); ?>)" />
  96      <input type="hidden" name="password_min_len" value="<?php echo w2PgetConfig('password_min_len'); ?>)" />
  97      <input type="hidden" name="cid" value="<?php echo $cid ?>" />
  98  
  99  <table style="border-style:none;" align="center" border="0" width="700" cellpadding="0" cellspacing="0" class="std">    
 100  <tr><td colspan="5">
 101  <?php
 102  echo styleRenderBoxTop();
 103  ?>
 104  </td></tr>
 105  <tr>
 106      <td align="right" width="230">* <?php echo $AppUI->_('Login Name'); ?>:</td>
 107      <td colspan="2">
 108  <?php
 109  if ($user['user_username']) {
 110      echo '<input type="hidden" class="text" name="user_username" value="' . $user['user_username'] . '" />';
 111      echo '<strong>' . $user["user_username"] . '</strong>';
 112  } else {
 113      echo '<input type="text" class="text" name="user_username" value="' . $user['user_username'] . '" maxlength="255" size="40" />';
 114      //    echo ' <span class="smallNorm">(' . $AppUI->_('required') . ')</span>';

 115  }
 116  ?>
 117      </td>
 118        <td class="right-brdr"><img src="/style/default/images/spacer.gif" width="1" height="1" /></td>
 119  </tr>
 120  <tr>
 121      <td align="right">* <?php echo $AppUI->_('Password'); ?>:</td>
 122      <td colspan="2"><input type="password" class="text" name="user_password" value="<?php echo $user['user_password']; ?>" maxlength="32" size="32" /> </td>
 123  </tr>
 124  <tr>
 125      <td align="right">* <?php echo $AppUI->_('Confirm Password'); ?>:</td>
 126      <td colspan="2"><input type="password" class="text" name="password_check" value="<?php echo $user['user_password']; ?>" maxlength="32" size="32" /> </td>
 127  </tr>
 128  <tr>
 129      <td align="right">* <?php echo $AppUI->_('Name'); ?>:</td>
 130      <td colspan="2"><input type="text" class="text" name="contact_first_name" value="<?php echo $user['contact_first_name']; ?>" maxlength="50" /> <input type="text" class="text" name="contact_last_name" value="<?php echo $user['contact_last_name']; ?>" maxlength="50" /></td>
 131  </tr>
 132  <tr>
 133      <td align="right">* <?php echo $AppUI->_('Email'); ?>:</td>
 134      <td colspan="2"><input type="text" class="text" name="contact_email" value="<?php echo $user['contact_email']; ?>" maxlength="255" size="40" /> </td>
 135  </tr>
 136  <tr>
 137      <td align="right"><?php echo $AppUI->_('Phone'); ?>:</td>
 138      <td colspan="2"><input type="text" class="text" name="contact_phone" value="<?php echo $user['contact_phone']; ?>" maxlength="50" size="40" /> </td>
 139  </tr>
 140  <tr>
 141      <td align="right"><?php echo $AppUI->_('Address'); ?>1:</td>
 142      <td colspan="2"><input type="text" class="text" name="contact_address1" value="<?php echo $user['contact_address1']; ?>" maxlength="50" size="40" /> </td>
 143  </tr>
 144  <tr>
 145      <td align="right"><?php echo $AppUI->_('Address'); ?>2:</td>
 146      <td colspan="2"><input type="text" class="text" name="contact_address2" value="<?php echo $user['contact_address2']; ?>" maxlength="50" size="40" /> </td>
 147  </tr>
 148  <tr>
 149      <td align="right"><?php echo $AppUI->_('City'); ?>:</td>
 150      <td colspan="2"><input type="text" class="text" name="contact_city" value="<?php echo $user['contact_city']; ?>" maxlength="50" size="40" /> </td>
 151  </tr>
 152  <tr>
 153      <td align="right"><?php echo $AppUI->_('State'); ?>:</td>
 154      <td colspan="2"><input type="text" class="text" name="contact_state" value="<?php echo $user['contact_state']; ?>" maxlength="50" size="40" /> </td>
 155  </tr>
 156  <tr>
 157      <td align="right"><?php echo $AppUI->_('Postcode') . ' / ' . $AppUI->_('Zip Code'); ?>:</td>
 158      <td colspan="2"><input type="text" class="text" name="contact_zip" value="<?php echo $user['contact_zip']; ?>" maxlength="50" size="40" /> </td>
 159  </tr>
 160  <tr>
 161      <td align="right"><?php echo $AppUI->_('Country'); ?>:</td>
 162      <td colspan="2">
 163  <?php
 164          echo arraySelect($countries, 'contact_country', 'size="1" class="text"', $user['contact_country']);
 165  ?>
 166      </td>
 167  </tr>
 168  <tr>
 169      <td valign="middle" align="right">* <?php echo $AppUI->_('Anti Spam Security'); ?>:</td>
 170      <td valign="middle" width="50"><input type="text" class="text" id="spam" name="spam_check" value="" maxlength="5" size="5" /></td>
 171      <td valign="middle" align="left"><img src="<?php echo W2P_BASE_URL; ?>/lib/captcha/CaptchaImage.php?uid=54;<?php echo $uid; ?>" alt="" /></td>
 172  </tr>
 173  <tr>
 174      <td align="right">* <?php echo $AppUI->_('Required Fields'); ?></td>
 175      <td colspan="2"></td>
 176  </tr>
 177  <tr>
 178      <td align="left">
 179          &nbsp;<input type="button" value="<?php echo $AppUI->_('cancel'); ?>" onclick="history.go(-1)" class="button" />
 180      </td>
 181      <td colspan="2" align="right">
 182          <input type="button" value="<?php echo $AppUI->_('sign me up!'); ?>" onclick="submitIt()" class="button" />&nbsp;
 183      </td>
 184  </tr>
 185  <tr><td colspan="5">
 186  <?php
 187  echo styleRenderBoxBottom();
 188  ?>
 189  </td></tr></form>
 190  </table>


Generated: Fri Mar 12 03:00:03 2010 Cross-referenced by PHPXref 0.7