Exponential Basic 2.4.0.1 Exponential Basic CMS — PHP Class Reference

precheckout.php
Go to the documentation of this file.
1 <?php
3 //
4 // $Id: precheckout.php 9577 2002-06-03 08:11:11Z bf $
5 //
6 // Created on: <28-Sep-2000 15:52:08 bf>
7 //
8 // This source file is part of Exponential Basic, publishing software.
9 //
10 // Copyright (C) 1999-2001 eZ Systems. All rights reserved.
11 //
12 // This program 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; either version 2
15 // of the License, or (at your option) any later version.
16 //
17 // This program is distributed in the hope that it will be useful,
18 // but WITHOUT ANY WARRANTY; without even the implied warranty of
19 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20 // GNU General Public License for more details.
21 //
22 // You should have received a copy of the GNU General Public License
23 // along with this program; if not, write to the Free Software
24 // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, US
25 //
26
27
28 // include_once( "classes/INIFile.php" );
29 // include_once( "classes/eztemplate.php" );
30 // include_once( "classes/ezhttptool.php" );
31
32
33 $ini =& eZINI::instance( 'site.ini' );
34 $wwwDir = $ini->WWWDir;
35 $ForceSSL = $ini->variable( "eZTradeMain", "ForceSSL" );
36
37 $index = $ini->Index;
38
39
40 // set SSL mode and redirect if not already in SSL mode.
41 if ( ( $ForceSSL == "enabled" ) )
42 {
43 $session->setVariable( "SSLMode", "enabled" );
44
45 // force SSL if supposed to
46 // if ( $SERVER_PORT != '443' )
47 {
48 // $params = "?ShippingCost=1&ShippingVAT=1&TotalCost=1&TotalVAT=1&shippcost=1&shippname={ship_get_name}&Recalculate=Recalculate&lastshipid=1282&PayWithVoucher=false";
49 eZHTTPTool::header("Location: https://" . $HTTP_HOST . $index . "/trade/checkout/" );
50 exit();
51 }
52 }
53 elseif ( $ForceSSL == "disabled" )
54 {
55 $session->setVariable( "SSLMode", "disabled" );
56
57 eZHTTPTool::header("Location: http://" . $HTTP_HOST . $wwwDir . $index . "/trade/checkout/" );
58 exit();
59 }
60 elseif ( $ForceSSL == "choose" )
61 {
62 $session->setVariable( "SSLMode", "choose" );
63
64 if( isset ( $WithSSL ) )
65 {
66 eZHTTPTool::header( "Location: https://" . $HTTP_HOST . $wwwDir . $index . "/trade/checkout" );
67 exit();
68
69 }
70
71 if( isset ( $WithOutSSL ) )
72 {
73 eZHTTPTool::header( "Location: http://" . $HTTP_HOST . $wwwDir . $index . "/trade/checkout" );
74 exit();
75
76 }
77
78 $Language = $ini->variable( "eZTradeMain", "Language" );
79
80
81 $t = new eZTemplate( "kernel/eztrade/user/" . $ini->variable( "eZTradeMain", "TemplateDir" ),
82 "kernel/eztrade/user/intl/", $Language, "precheckout.php" );
83
84 $t->setAllStrings();
85
86 $t->set_file( array(
87 "precheckout_tpl" => "precheckout.tpl"
88 ) );
89
90 $t->set_var( "host", $HTTP_HOST );
91 $t->set_var( "php_session", "" );
92
93 $t->pparse( "output", "precheckout_tpl" );
94 }
95 ?>
$session
$session
Definition: admin/articlelist.php:44
eZHTTPTool\header
static header( $string)
Definition: ezhttptool.php:96
eZTemplate
Definition: eztemplate.php:107
$t
foreach( $Modules as $module) if(isset( $ItemInsert)) $t
Definition: classes/admin/linklist.php:168
$Language
$Language
Definition: classes/admin/linklist.php:65
exit
exit
Definition: folder.php:81
$wwwDir
$wwwDir
Definition: precheckout.php:34
$index
$index
Definition: precheckout.php:37
$ForceSSL
$ForceSSL
Definition: precheckout.php:35
$ini
$ini
Definition: precheckout.php:33
Copyright © 1998 – 2026 7x. All rights reserved. Licensed under the GNU GPLv2+.