Exponential Basic 2.4.0.1 Exponential Basic CMS — PHP Class Reference

customerlogin.php
Go to the documentation of this file.
1 <?php
3 //
4 // $Id: customerlogin.php 9518 2002-05-08 11:51:36Z vl $
5 //
6 // Created on: <03-Oct-2000 16:45:30 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 // include_once( "classes/INIFile.php" );
28 // include_once( "classes/eztemplate.php" );
29 // include_once( "classes/ezhttptool.php" );
30 // include_once( "classes/eztexttool.php" );
31
32 // include_once( "ezuser/classes/ezuser.php" );
33
34 // include_once( "ezsession/classes/ezsession.php" );
35
36 $ini =& eZINI::instance( 'site.ini' );
37 $Language = $ini->variable( "eZTradeMain", "Language" );
38
39 // include_once( "ezuser/classes/ezuser.php" );
40
41 $session =& eZSession::globalSession();
42
43 $user =& eZUser::currentUser();
44 if ( $user )
45 {
46 if ( isset( $RedirectURL ) && ( $RedirectURL != "" ) )
47 {
48 eZHTTPTool::header( "Location: $RedirectURL" );
49 exit();
50 }
51
52 $session->setVariable( "RedirectURL", "/trade/customerlogin/" );
53 if ( count( $user->addresses() ) == 0 )
54 {
55 $userID = $user->id();
56 eZHTTPTool::header( "Location: /user/userwithaddress/edit/$userID/MissingAddress" );
57 exit();
58
59 }
60 else if ( count( $user->addresses() ) > 0 )
61 {
62 $addresses =& $user->addresses();
63
64 $countryError = false;
65 foreach ( $addresses as $address )
66 {
67 $country =& $address->country();
68 if ( ( is_a( $country, "eZCountry" ) ) && ( $country->id() == 0 ) )
69 $countryError = true;
70 }
71
72 if ( $countryError )
73 {
74 $userID = $user->id();
75 eZHTTPTool::header( "Location: /user/userwithaddress/edit/$userID/MissingCountry" );
76 exit();
77 }
78 }
79
80 eZHTTPTool::header( "Location: /trade/precheckout/" );
81 exit();
82 }
83 else
84 {
85 $t = new eZTemplate( "kernel/eztrade/user/" . $ini->variable( "eZTradeMain", "TemplateDir" ),
86 "kernel/eztrade/user/intl/", $Language, "customerlogin.php" );
87
88 $t->setAllStrings();
89
90 $t->set_file( array(
91 "customer_login_tpl" => "customerlogin.tpl"
92 ) );
93
94 if ( isset( $RedirectURL ) && ( $RedirectURL != "" ) )
95 {
96 $t->set_var( "redirect_url", eZTextTool::htmlspecialchars( $RedirectURL ) );
97 }
98 else
99 {
100 $t->set_var( "redirect_url", "/trade/customerlogin" );
101 }
102
103 $t->pparse( "output", "customer_login_tpl" );
104 }
105
106 ?>
$userID
else $userID
Definition: appointmentedit.php:121
$address
$address
Definition: checkout.php:588
eZHTTPTool\header
static header( $string)
Definition: ezhttptool.php:96
eZSession\globalSession
static & globalSession( $id="", $fetch=true)
Definition: kernel/ezsession/classes/ezsession.php:614
eZTemplate
Definition: eztemplate.php:107
eZTextTool\htmlspecialchars
static htmlspecialchars( $string)
Definition: eztexttool.php:144
eZUser\currentUser
static & currentUser()
Definition: ezuser.php:896
$t
foreach( $Modules as $module) if(isset( $ItemInsert)) $t
Definition: classes/admin/linklist.php:168
$user
$user
Definition: customerlogin.php:43
$Language
$Language
Definition: customerlogin.php:37
$ini
$ini
Definition: customerlogin.php:36
$session
$session
Definition: customerlogin.php:41
$RedirectURL
$RedirectURL
Definition: ezforum/user/userlogin.php:91
exit
exit
Definition: folder.php:81
$country
$country
Definition: paypal.php:46
Copyright © 1998 – 2026 7x. All rights reserved. Licensed under the GNU GPLv2+.