Advertisement
Guest User

Untitled

a guest
Dec 9th, 2015
99
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 3.62 KB | None | 0 0
  1. <?php
  2. if( !defined( '_VALID_MOS' ) && !defined( '_JEXEC' ) ) die( 'Direct Access to '.basename(__FILE__).' is not allowed.' );
  3. /**
  4. *
  5. * @version $Id: checkout_register_form.php 1612 2009-01-22 20:11:25Z thepisu $
  6. * @package VirtueMart
  7. * @subpackage html
  8. * @copyright Copyright (C) 2004-2008 soeren - All rights reserved.
  9. * @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
  10. * VirtueMart is free software. This version may have been modified pursuant
  11. * to the GNU General Public License, and as distributed it includes or
  12. * is derivative of works licensed under the GNU General Public License or
  13. * other free or open source software licenses.
  14. * See /administrator/components/com_virtuemart/COPYRIGHT.php for copyright notices and details.
  15. *
  16. * http://virtuemart.net
  17. */
  18. mm_showMyFileName( __FILE__ );
  19. global $mosConfig_allowUserRegistration, $mosConfig_useractivation;
  20. require_once( CLASSPATH . "ps_userfield.php" );
  21. require_once( CLASSPATH . "htmlTools.class.php" );
  22.  
  23. $missing = vmGet( $_REQUEST, "missing", "" );
  24.  
  25. if (!empty( $missing )) {
  26.     echo "<script type=\"text/javascript\">alert('".$VM_LANG->_('CONTACT_FORM_NC',false)."'); </script>\n";
  27. }
  28.  
  29. // If not using NO_REGISTRATION, redirect with a warning when Joomla doesn't allow user registration
  30. if ($mosConfig_allowUserRegistration == "0" && VM_REGISTRATION_TYPE != 'NO_REGISTRATION' ) {
  31.     $msg = $VM_LANG->_('USER_REGISTRATION_DISABLED');
  32.     vmRedirect( $sess->url( 'index.php?page='.HOMEPAGE, true, false ), $msg );
  33.     return;
  34. }
  35.  
  36. if( vmIsJoomla( '1.5' ) ) {
  37.     // Set the validation value
  38.     $validate = JUtility::getToken();
  39. } else {
  40.     $validate =  function_exists( 'josspoofvalue' ) ? josSpoofValue(1) : vmSpoofValue(1);
  41. }
  42.  
  43. $fields = ps_userfield::getUserFields('registration', false, '', false );
  44. // Read-only fields on registration don't make sense.
  45. foreach( $fields as $field ) $field->readonly = 0;
  46. $skip_fields = array();
  47.  
  48. if ( $my->id > 0 || (VM_REGISTRATION_TYPE != 'NORMAL_REGISTRATION' && VM_REGISTRATION_TYPE != 'OPTIONAL_REGISTRATION'
  49.                                 && ( $page == 'checkout.index' || $page == 'shop.registration' ) ) ) {
  50.     // A listing of fields that are NOT shown
  51.     $skip_fields = array( 'username', 'password', 'password2' );
  52.     if( $my->id ) {
  53.         $skip_fields[] = 'email';
  54.     }
  55. }
  56.  
  57. // This is the part that prints out ALL registration fields!
  58. ps_userfield::listUserFields( $fields, $skip_fields );
  59.  
  60. echo '
  61. <div align="center">';
  62.     if( !$mosConfig_useractivation && @VM_SHOW_REMEMBER_ME_BOX && VM_REGISTRATION_TYPE == 'NORMAL_REGISTRATION' ) {
  63.         echo '<input type="checkbox" name="remember" value="yes" id="remember_login2" checked="checked" />
  64.         <label for="remember_login2">'. $VM_LANG->_('REMEMBER_ME') .'</label><br /><br />';
  65.     }
  66.     else {
  67.         if( VM_REGISTRATION_TYPE == 'NO_REGISTRATION' ) {
  68.             $rmbr = '';
  69.         } else {
  70.             $rmbr = 'yes';
  71.         }
  72.         echo '<input type="hidden" name="remember" value="'.$rmbr.'" />';
  73.     }
  74.     echo '
  75.         <input type="submit" value="'. $VM_LANG->_('BUTTON_SEND_REG') . '" class="button" onclick="return( submitregistration());" />
  76.     </div>
  77.     <input type="hidden" name="Itemid" value="'. $sess->getShopItemid() .'" />
  78.     <input type="hidden" name="gid" value="'. $my->gid .'" />
  79.     <input type="hidden" name="id" value="'. $my->id .'" />
  80.     <input type="hidden" name="user_id" value="'. $my->id .'" />
  81.     <input type="hidden" name="option" value="com_virtuemart" />
  82.     <input type="hidden" name="' . $validate . '" value="1" />
  83.     <input type="hidden" name="useractivation" value="'. $mosConfig_useractivation .'" />
  84.     <input type="hidden" name="func" value="shopperadd" />
  85.     <input type="hidden" name="page" value="checkout.index" />
  86.     </form>';
  87. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement