Exponential Basic 2.4.0.1 Exponential Basic CMS — PHP Class Reference

step1.php
Go to the documentation of this file.
1 <?php
4 require( "kernel/ezuser/user/usercheck.php" );
5
6 // include_once( "classes/INIFile.php" );
7 // include_once( "classes/eztemplate.php" );
8 // include_once( "classes/ezhttptool.php" );
9 // include_once( "ezsession/classes/ezsession.php" );
10 // include_once( "classes/eztexttool.php" );
11
12 $ini =& eZINI::instance( 'site.ini' );
13 $Language = $ini->variable( "eZUserMain", "Language" );
14 $SelectCountry = $ini->variable( "eZUserMain", "SelectCountry" );
15 $SelectRegion = $ini->variable( "eZUserMain", "SelectRegion" );
16 $AnonymousUserGroup = $ini->variable( "eZUserMain", "AnonymousUserGroup" );
17
18 $AutoCookieLogin = eZHTTPTool::getVar( "AutoCookieLogin" );
19
20 $session =& eZSession::globalSession();
21
22 // include_once( "ezuser/classes/ezuser.php" );
23 // include_once( "ezuser/classes/ezusergroup.php" );
24 // include_once( "ezaddress/classes/ezaddress.php" );
25 // include_once( "ezaddress/classes/ezcountry.php" );
26 // include_once( "ezaddress/classes/ezregion.php" );
27 // include_once( "ezmail/classes/ezmail.php" );
28
29 $user =& eZUser::currentUser();
30
31 $form_type = "Account Registration";
32 $error = array();
33
34 if( isset( $next ) && $next )
35 {
36 // Report blank errors
37 foreach($_POST as $k=>$v){
38 $error[$k] = error_check($v);
39 }
40
41 // Don't change blank passwords for users
42 if( $user && !$password1 )
43 {
44 $error['password1'] = 'black';
45 $error['password2'] = 'black';
46 }
47
48 // Check if there were any errors
49 foreach($error as $k=>$v){
50 if($v == 'red'){
51 $all_fields_error = 'please complete all fields';
52 }
53 }
54
55
56 // Report non-matching password errors
57 if($password1 != $password2){
58 $error['password1'] = 'red';
59 $error['password2'] = 'red';
60 $password_error = '<br>Passwords do not match';
61 }
62
63 // Check if there were any errors
64 foreach($error as $k=>$v){
65 if($v == 'red'){
66 $errors_ind = 1;
67 }
68 }
69
70 if( isset( $errors_ind ) && $errors_ind )
71 {
72 if(! $user){
73 $user = new eZUser();
74 }
75 $user->setLogin($username);
76 $user->setEmail($email);
77 $user->setLastName($last_name);
78 $user->setFirstName($first_name);
79 $user->setInfoSubscription($newsletter_ind ? 1 : 0);
80 if($password1){
81 $user->setPassword($password1);
82 }
83 $user->store();
84 $user->loginUser($user);
85 $user->setCookieValues();
86 header("Location: /index.php/user/step2/");
87 }
88
89 }
90
91 function error_check($varcheck){
92 if(!($varcheck && strlen($varcheck) <= 50)){
93 return 'red';
94 }else{
95 return 'black';
96 }
97 }
98
99
100 if($user){
101 $first_name=$user->firstName();
102 $last_name=$user->lastName();
103 $email=$user->email();
104 $username=$user->Login();
105 $Info = $user->InfoSubscription() ? 'checked' : '';
106 $form_type = "Profile";
107 }
108
109
110 ?>
111
112 <div id="breadcrumbs">
113 &nbsp;
114 </div>
115
116 <div id="contentWrap">
117 <h1 class="mainHeading"><?= $form_type ?> - Step 1 of 2</h1>
118
119 <p>
120 Complete <?= $form_type ?> Step 1 to post in our user forums and save
121 products to a personal wish list.
122
123 Complete both Account Registration Steps 1 & 2 to checkout or obtain
124 accurate shipping and handling prices for items in your shopping cart.
125 </p>
126
127 <? if( isset( $next ) && $next ): ?>
128 <p style="color:red;">
129 <?= isset( $all_fields_error ) && $all_fields_error ?>
130 <?= isset( $password_error ) && $password_error ?>
131 </p>
132 <? endif; ?>
133
134 <form method="post">
135 <table border="0" cellspacing="2" cellpadding="2" class="boxtext" style="font-size=13;">
136 <tr><td style="color:<?= isset( $error['first_name'] ) ?>;">First Name: </td><td><input type="text" name="first_name" value="<?= $first_name ?>"></td>
137 <td>&nbsp;&nbsp;</td>
138 <td style="color:<?= isset( $error['last_name'] ) ?>;">Last Name: </td><td><input type="text" name="last_name" value="<?= $last_name ?>"></td>
139 </tr>
140 <tr><td colspan="5">&nbsp;</td></tr>
141 <tr><td style="color:<?= isset( $error['email'] ) ?>;">Email: </td><td colspan="3"><input size="30" type="text" name="email" value="<?= $email ?>"></td><td colspan="1"></td></tr>
142 <tr><td colspan="5">&nbsp;</td></tr>
143 <tr><td colspan="5">&nbsp;</td></tr>
144 <tr><td style="color:<?= isset( $error['username'] ) ?>;">Username: </td><td><input type="text" name="username" value="<?= $username ?>"></td><td colspan="3"></td></tr>
145 <tr><td colspan="5">&nbsp;</td></tr>
146 <tr><td style="color:<?= isset( $error['password1'] ) ?>;">Password: </td><td><input type="password" name="password1"></td>
147 <td>&nbsp;&nbsp;</td>
148 <td style="color:<?= isset( $error['password2'] ) ?>;">Repeat Password: </td><td><input type="password" name="password2"></td>
149 </tr>
150 <tr><td colspan="5">&nbsp;</td></tr>
151 </table>
152
153 <table border="0" cellspacing="2" cellpadding="2" class="boxtext" style="font-size=13;">
154 <tr><td><input type="checkbox" name="newsletter_ind" value="1" <?= $Info ?>></td><td>Check here to receive updates on sales & special offers</td>
155 </table>
156
157 <p>
158 <center><input type="submit" name="next" value="Next >">&nbsp;&nbsp;&nbsp;&nbsp;</center>
159 </p>
160
161 <br>
162
163 </form>
164
165 </div>
eZHTTPTool\getVar
static getVar( $name, $onlyCheckPost=false)
Definition: ezhttptool.php:55
eZSession\globalSession
static & globalSession( $id="", $fetch=true)
Definition: kernel/ezsession/classes/ezsession.php:614
eZUser
Definition: ezuser.php:76
eZUser\currentUser
static & currentUser()
Definition: ezuser.php:896
table
$def table
Definition: ezprestauthorizedclient.php:13
error_check
if(isset( $next) && $next) error_check($varcheck)
Definition: step1.php:91
$SelectCountry
$SelectCountry
Definition: step1.php:14
$AnonymousUserGroup
$AnonymousUserGroup
Definition: step1.php:16
Email
</td ></tr >< tr >< td style="color:<?= isset( $error['email'] ) ?> Email
Definition: step1.php:141
$user
$user
Definition: step1.php:29
$form_type
$form_type
Definition: step1.php:31
$AutoCookieLogin
$AutoCookieLogin
Definition: step1.php:18
$SelectRegion
$SelectRegion
Definition: step1.php:15
$Language
$Language
Definition: step1.php:13
$ini
$ini
Definition: step1.php:12
Password
</td ></tr >< tr >< td style="color:<?= isset( $error['password1'] ) ?> Password
Definition: step1.php:146
$session
$session
Definition: step1.php:20
Name
if($user) if(isset( $next) && $next)<?=isset($all_fields_error) &&$all_fields_error ?><?=isset($password_error) &&$password_error ?></p ><? endif;?>< form method="post">< table border="0" cellspacing="2" cellpadding="2" class="boxtext" style="font-size=13;">< tr >< td style="color:<?= isset( $error['first_name'] ) ?> First Name
Definition: step1.php:127
$error
$error
Definition: step1.php:32
nbsp
& nbsp
Definition: step1.php:137
Username
</td ></tr >< tr >< td style="color:<?= isset( $error['username'] ) ?> Username
Definition: step1.php:144
Copyright © 1998 – 2026 7x. All rights reserved. Licensed under the GNU GPLv2+.