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