OXID eShop CE
4.8.11
Main Page
Related Pages
Classes
Files
File List
File Members
All
Classes
Files
Functions
Variables
Pages
register.php
Go to the documentation of this file.
1
<?php
2
7
class
Register
extends
User
8
{
14
protected
$_sThisTemplate
=
'page/account/register.tpl'
;
15
21
protected
$_sSuccessTemplate
=
'page/account/register_success.tpl'
;
22
28
protected
$_sConfirmTemplate
=
'page/account/register_confirm.tpl'
;
29
34
protected
$_blIsOrderStep
=
false
;
35
41
protected
$_iViewIndexState
=
VIEW_INDEXSTATE_NOINDEXNOFOLLOW
;
42
49
public
function
render
()
50
{
51
parent::render
();
52
53
// checking registration status
54
if
( $this->
isEnabledPrivateSales
() && $this->
isConfirmed
() ) {
55
$sTemplate =
$this->_sConfirmTemplate
;
56
} elseif ( $this->
getRegistrationStatus
() ) {
57
$sTemplate =
$this->_sSuccessTemplate
;
58
}
else
{
59
$sTemplate =
$this->_sThisTemplate
;
60
}
61
62
return
$sTemplate;
63
}
64
70
public
function
getRegistrationError
()
71
{
72
return
oxConfig::getParameter
(
'newslettererror'
);
73
}
74
80
public
function
getRegistrationStatus
()
81
{
82
return
oxConfig::getParameter
(
'success'
);
83
}
84
92
public
function
isFieldRequired
( $sField )
93
{
94
if
( $aMustFillFields = $this->
getMustFillFields
() ) {
95
if
( isset( $aMustFillFields[$sField] ) ) {
96
return
true
;
97
}
98
}
99
100
return
false
;
101
}
102
110
public
function
confirmRegistration
()
111
{
112
$oUser =
oxNew
(
'oxuser'
);
113
if
( $oUser->loadUserByUpdateId( $this->getUpdateId() ) ) {
114
115
// resetting update key parameter
116
$oUser->setUpdateKey(
true
);
117
118
// saving ..
119
$oUser->oxuser__oxactive =
new
oxField
( 1 );
120
$oUser->save();
121
122
// forcing user login
123
oxSession::setVar
(
'usr'
, $oUser->getId() );
124
125
// redirecting to confirmation page
126
return
'register?confirmstate=1'
;
127
}
else
{
128
// confirmation failed
129
oxRegistry::get
(
"oxUtilsView"
)->addErrorToDisplay(
'REGISTER_ERRLINKEXPIRED'
,
false
,
true
);
130
131
// redirecting to confirmation page
132
return
'account'
;
133
}
134
}
135
141
public
function
getUpdateId
()
142
{
143
return
oxConfig::getParameter
(
'uid'
);
144
}
145
151
public
function
isConfirmed
()
152
{
153
return
(
bool
)
oxConfig::getParameter
(
"confirmstate"
);
154
}
155
161
public
function
getBreadCrumb
()
162
{
163
$aPaths = array();
164
$aPath = array();
165
166
$aPath[
'title'
] =
oxRegistry::getLang
()->translateString(
'REGISTER'
,
oxRegistry::getLang
()->getBaseLanguage(),
false
);
167
$aPath[
'link'
] = $this->
getLink
();
168
$aPaths[] = $aPath;
169
170
return
$aPaths;
171
}
172
173
174
}
application
controllers
register.php
Generated by
1.8.1.2