Exponential Basic 2.4.0.1 Exponential Basic CMS — PHP Class Reference

registration.php
Go to the documentation of this file.
1 <?php
4 require( "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
30
31 $user =& eZUser::currentUser();
32 $form_type = "Registration";
33 $error = array();
34
35 if($next){
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 $error['password1'] = 'black';
44 $error['password2'] = 'black';
45 }
46
47 // Report non-matching password errors
48 if($password1 != $password2){
49 $error['password1'] = 'red';
50 $error['password2'] = 'red';
51 }
52
53 // Check if there were any errors
54 foreach($error as $k=>$v){
55 if($v == 'red'){
56 $errors_ind = 1;
57 }
58 }
59
60 if(! $errors_ind){
61
62 if(! $user){
63 $user = new eZUser();
64 }
65 $user->setLogin($username);
66 $user->setEmail($email);
67 $user->setLastName($last_name);
68 $user->setFirstName($first_name);
69 $user->setInfoSubscription($newsletter_ind ? 1 : 0);
70 if($password1){
71 $user->setPassword($password1);
72 }
73 $user->store();
74 $user = $user->validateUser( $username, $password1 );
75 }
76
77 }
78
79 function error_check($varcheck){
80 if(!($varcheck && strlen($varcheck) <= 50)){
81 return 'red';
82 }else{
83 return 'black';
84 }
85 }
86
87
88 if($user){
89 $first_name=$user->firstName();
90 $last_name=$user->lastName();
91 $email=$user->email();
92 $username=$user->Login();
93 $Info = $user->InfoSubscription() ? 'checked' : '';
94 $form_type = "Profile";
95 }
96
97 print_r($user);
98 ?>
99
100 <div id="breadcrumbs">
101 &nbsp;
102 </div>
103
104 <div id="contentWrap">
105 <h1 class="mainHeading"><?= $form_type ?> - Step 1 of 2</h1>
106
107 <p>
108 Completion of <?= $form_type ?> Step 1 allows you to post in our user forums and save products to a personal wish list.
109 </p>
110
111 <form method="post">
112 <table border="0" cellspacing="2" cellpadding="2" class="boxtext" style="font-size=13;">
113 <tr><td style="color:<?= $error['first_name'] ?>;">First Name: </td><td><input type="text" name="first_name" value="<?= $first_name ?>"></td>
114 <td>&nbsp;&nbsp;</td>
115 <td style="color:<?= $error['last_name'] ?>;">Last Name: </td><td><input type="text" name="last_name" value="<?= $last_name ?>"></td>
116 </tr>
117 <tr><td colspan="5">&nbsp;</td></tr>
118 <tr><td style="color:<?= $error['email'] ?>;">Email: </td><td><input type="text" name="email" value="<?= $email ?>"></td><td colspan="3"></td></tr>
119 <tr><td colspan="5">&nbsp;</td></tr>
120 <tr><td colspan="5">&nbsp;</td></tr>
121 <tr><td style="color:<?= $error['username'] ?>;">Username</td><td><input type="text" name="username" value="<?= $username ?>"></td><td colspan="3"></td></tr>
122 <tr><td colspan="5">&nbsp;</td></tr>
123 <tr><td style="color:<?= $error['password1'] ?>;">Password: </td><td><input type="password" name="password1"></td>
124 <td>&nbsp;&nbsp;</td>
125 <td style="color:<?= $error['password2'] ?>;">Repeat Password: </td><td><input type="password" name="password2"></td>
126 </tr>
127 <tr><td colspan="5">&nbsp;</td></tr>
128 </table>
129
130 <table border="0" cellspacing="2" cellpadding="2" class="boxtext" style="font-size=13;">
131 <tr><td><input type="checkbox" name="newsletter_ind" value="1" <?= $Info ?>></td><td>Check here to receive updates on sales & special offers</td>
132 </table>
133
134 <p>
135 <center><input type="submit" name="next" value="Next >">&nbsp;&nbsp;&nbsp;&nbsp;</center>
136 </p>
137
138 <br>
139
140 <p>
141 <center>FullThrottle.com respects your <a href="http://www.FullThrottle.com/index.php/article/articlestatic/75/1/5/">privacy</a> &nbsp;&nbsp;&nbsp;&nbsp;</center>
142 </p>
143 </form>
144
145 </div>
146
147
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
$SelectCountry
$SelectCountry
Definition: registration.php:14
$AnonymousUserGroup
$AnonymousUserGroup
Definition: registration.php:16
error_check
if($next) error_check($varcheck)
Definition: registration.php:79
$user
$user
Definition: registration.php:31
$form_type
$form_type
Definition: registration.php:32
$AutoCookieLogin
$AutoCookieLogin
Definition: registration.php:18
$SelectRegion
$SelectRegion
Definition: registration.php:15
$Language
$Language
Definition: registration.php:13
$ini
$ini
Definition: registration.php:12
$session
$session
Definition: registration.php:20
$error
$error
Definition: registration.php:33
Email
</td ></tr >< tr >< td style="color:<?= isset( $error['email'] ) ?> Email
Definition: step1.php:141
Password
</td ></tr >< tr >< td style="color:<?= isset( $error['password1'] ) ?> Password
Definition: step1.php:146
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
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+.