OXID eShop CE  6.1.5
OxidEsales\EshopCommunity\Application\Component\UserComponent Class Reference
+ Inheritance diagram for OxidEsales\EshopCommunity\Application\Component\UserComponent:
+ Collaboration diagram for OxidEsales\EshopCommunity\Application\Component\UserComponent:

Public Member Functions

 init ()
 
 render ()
 
 login ()
 
 login_noredirect ()
 
 logout ()
 
 changeUser ()
 
 changeuser_testvalues ()
 
 createUser ()
 
 registerUser ()
 
 deleteShippingAddress ()
 
 setLoginStatus ($iStatus)
 
 getLoginStatus ()
 
 getInvitor ()
 
 setRecipient ()
 

Protected Member Functions

 _checkPsState ()
 
 _loadSessionUser ()
 
 _afterLogin ($oUser)
 
 _afterLogout ()
 
 resetPermissions ()
 
 configureUserBeforeCreation ($user)
 
 _saveInvitor ()
 
 _saveDeliveryAddressState ()
 
 _changeUser_noRedirect ()
 
 changeUserWithoutRedirect ()
 
 _getDelAddressData ()
 
 _getLogoutLink ()
 

Protected Attributes

 $_blIsNewUser = false
 
 $_blIsComponent = true
 
 $_blNewsSubscriptionStatus = null
 
 $_iLoginStatus = null
 
 $_sTermsVer = null
 
 $_aAllowedClasses
 

Private Member Functions

 canUserDeleteShippingAddress ($address)
 
 cleanAddress ($address, $updatableFields)
 
 trimAddress ($address)
 

Detailed Description

User object manager. Sets user details data, switches, logouts, logins user etc.

@subpackage oxcmp

Member Function Documentation

◆ _afterLogin()

OxidEsales\EshopCommunity\Application\Component\UserComponent::_afterLogin (   $oUser)
protected

Special functionality which is performed after user logs in (or user is created without pass). Performes additional checking if user is not BLOCKED (\OxidEsales\Eshop\Application\Model\User::InGroup("oxidblocked")) - if yes - redirects to blocked user page ("cl=content&tpl=user_blocked.tpl"). Stores cookie info if user confirmed in login screen. Then loads delivery info and forces basket to recalculate (\OxidEsales\Eshop\Core\Session::getBasket() + oBasket::blCalcNeeded = true). Returns "payment" to redirect to payment screen. If problems occured loading user - sets error code according problem, and returns "user" to redirect to user info screen.

Parameters
\OxidEsales\Eshop\Application\Model\User$oUseruser object
Returns
string

◆ _afterLogout()

OxidEsales\EshopCommunity\Application\Component\UserComponent::_afterLogout ( )
protected

Special utility function which is executed right after oxcmp_user::logout is called. Currently it unsets such session parameters as user chosen payment id, delivery address id, active delivery set.

◆ _changeUser_noRedirect()

OxidEsales\EshopCommunity\Application\Component\UserComponent::_changeUser_noRedirect ( )
protected

Mostly used for customer profile editing screen (OXID eShop -> MY ACCOUNT). Checks if oUser is set (oxcmp_user::oUser) - if not - executes oxcmp_user::_loadSessionUser(). If user unchecked newsletter subscription option - removes him from this group. There is an additional MUST FILL fields checking. Function returns true or false according to user data submission status.

Session variables: ordrem

Deprecated:
since v6.0.0 (2017-02-27); Use changeUserWithoutRedirect().
Returns
bool true on success, false otherwise

◆ _checkPsState()

OxidEsales\EshopCommunity\Application\Component\UserComponent::_checkPsState ( )
protected

If private sales enabled, checks: (1) if no session user and view can be accessed; (2) session user is available and accepted terms version matches actual version. In case any condition is not satisfied redirects user to: (1) login page; (2) terms agreement page;

◆ _getDelAddressData()

OxidEsales\EshopCommunity\Application\Component\UserComponent::_getDelAddressData ( )
protected

Returns delivery address from request. Before returning array is checked if all needed data is there

Returns
array

◆ _getLogoutLink()

OxidEsales\EshopCommunity\Application\Component\UserComponent::_getLogoutLink ( )
protected

Returns logout link with additional params

Returns
string $sLogoutLink

◆ _loadSessionUser()

OxidEsales\EshopCommunity\Application\Component\UserComponent::_loadSessionUser ( )
protected

Tries to load user ID from session.

Returns
null

◆ _saveDeliveryAddressState()

OxidEsales\EshopCommunity\Application\Component\UserComponent::_saveDeliveryAddressState ( )
protected

Saving show/hide delivery address state

◆ _saveInvitor()

OxidEsales\EshopCommunity\Application\Component\UserComponent::_saveInvitor ( )
protected

Saves invitor ID

◆ canUserDeleteShippingAddress()

OxidEsales\EshopCommunity\Application\Component\UserComponent::canUserDeleteShippingAddress (   $address)
private

Checks if shipping address is assigned to user.

Parameters
Address$address
Returns
bool

◆ changeUser()

OxidEsales\EshopCommunity\Application\Component\UserComponent::changeUser ( )

Executes blUserRegistered = oxcmp_user::_changeUser_noRedirect(). if this returns true - returns "payment" (this redirects to payment page), else returns blUserRegistered value.

See also
oxcmp_user::_changeUser_noRedirect()
Returns
mixed redirection string or true if user is registered, false otherwise

◆ changeuser_testvalues()

OxidEsales\EshopCommunity\Application\Component\UserComponent::changeuser_testvalues ( )

Executes oxcmp_user::_changeuser_noredirect(). returns "account_user" (this redirects to billing and shipping settings page) on success

Returns
null

◆ changeUserWithoutRedirect()

OxidEsales\EshopCommunity\Application\Component\UserComponent::changeUserWithoutRedirect ( )
protected

Mostly used for customer profile editing screen (OXID eShop -> MY ACCOUNT). Checks if oUser is set (oxcmp_user::oUser) - if not - executes oxcmp_user::_loadSessionUser(). If user unchecked newsletter subscription option - removes him from this group. There is an additional MUST FILL fields checking. Function returns true or false according to user data submission status.

Session variables: ordrem

Returns
bool true on success, false otherwise

◆ cleanAddress()

OxidEsales\EshopCommunity\Application\Component\UserComponent::cleanAddress (   $address,
  $updatableFields 
)
private
Parameters
array$address
AbstractUpdatableFields$updatableFields
Returns
array

◆ configureUserBeforeCreation()

OxidEsales\EshopCommunity\Application\Component\UserComponent::configureUserBeforeCreation (   $user)
protected

If any additional configurations required right before user creation

Parameters
\OxidEsales\Eshop\Application\Model\User$user
Returns
\OxidEsales\Eshop\Application\Model\User The user we gave in.

◆ createUser()

OxidEsales\EshopCommunity\Application\Component\UserComponent::createUser ( )

First test if all required fields were filled, then performed additional checking oxcmp_user::CheckValues(). If no errors occured - trying to create new user (\OxidEsales\Eshop\Application\Model\User::CreateUser()), logging him to shop (\OxidEsales\Eshop\Application\Model\User::Login() if user has entered password). If \OxidEsales\Eshop\Application\Model\User::CreateUser() returns false - this means user is already created - we only logging him to shop (oxcmp_user::Login()). If there is any error with missing data - function will return false and set error code (oxcmp_user::iError). If user was created successfully - will return "payment" to redirect to payment interface.

Template variables: usr_err

Session variables: usr_err, usr

Returns
mixed redirection string or true if successful, false otherwise

◆ deleteShippingAddress()

OxidEsales\EshopCommunity\Application\Component\UserComponent::deleteShippingAddress ( )

Deletes user shipping address.

◆ getInvitor()

OxidEsales\EshopCommunity\Application\Component\UserComponent::getInvitor ( )

Sets invitor id to session from URL

◆ getLoginStatus()

OxidEsales\EshopCommunity\Application\Component\UserComponent::getLoginStatus ( )

Returns user login state marker:

  • USER_LOGIN_SUCCESS - user successfully logged in;
  • USER_LOGIN_FAIL - login failed;
  • USER_LOGOUT - user logged out.
Returns
int

◆ init()

OxidEsales\EshopCommunity\Application\Component\UserComponent::init ( )

Sets oxcmp_oxuser::blIsComponent = true, fetches user error code and sets it to default - 0. Executes parent::init().

Session variable: usr_err

◆ login()

OxidEsales\EshopCommunity\Application\Component\UserComponent::login ( )

Collects posted user information from posted variables ("lgn_usr", "lgn_pwd", "lgn_cook"), executes \OxidEsales\Eshop\Application\Model\User::login() and checks if such user exists.

Session variables: usr, usr_err

Template variables: usr_err

Returns
string redirection string

◆ login_noredirect()

OxidEsales\EshopCommunity\Application\Component\UserComponent::login_noredirect ( )

Executes oxcmp_user::login() method. After loggin user will not be redirected to user or payment screens.

◆ logout()

OxidEsales\EshopCommunity\Application\Component\UserComponent::logout ( )

Deletes user information from session:
"usr", "dynvalue", "paymentid"
also deletes cookie, unsets \OxidEsales\Eshop\Core\Config::oUser, oxcmp_user::oUser, forces basket to recalculate.

Returns
null

◆ registerUser()

OxidEsales\EshopCommunity\Application\Component\UserComponent::registerUser ( )

Creates new oxid user

Returns
string partial parameter string or null

◆ render()

OxidEsales\EshopCommunity\Application\Component\UserComponent::render ( )

Executes parent::render(), oxcmp_user::_loadSessionUser(), loads user delivery info. Returns user object oxcmp_user::oUser.

Returns
object user object

◆ resetPermissions()

OxidEsales\EshopCommunity\Application\Component\UserComponent::resetPermissions ( )
protected

Any additional permission reset actions required on logout or changeuser actions

◆ setLoginStatus()

OxidEsales\EshopCommunity\Application\Component\UserComponent::setLoginStatus (   $iStatus)

Sets user login state

Parameters
int$iStatuslogin state (USER_LOGIN_SUCCESS/USER_LOGIN_FAIL/USER_LOGOUT)

◆ setRecipient()

OxidEsales\EshopCommunity\Application\Component\UserComponent::setRecipient ( )

sets from URL invitor id

◆ trimAddress()

OxidEsales\EshopCommunity\Application\Component\UserComponent::trimAddress (   $address)
private

Returns trimmed address.

Parameters
array$address
Returns
array

Member Data Documentation

◆ $_aAllowedClasses

OxidEsales\EshopCommunity\Application\Component\UserComponent::$_aAllowedClasses
protected
Initial value:
= [
'register',
'forgotpwd',
'content',
'account',
'clearcookies',
'oxwservicemenu',
'oxwminibasket',
]

◆ $_blIsComponent

OxidEsales\EshopCommunity\Application\Component\UserComponent::$_blIsComponent = true
protected

◆ $_blIsNewUser

OxidEsales\EshopCommunity\Application\Component\UserComponent::$_blIsNewUser = false
protected

◆ $_blNewsSubscriptionStatus

OxidEsales\EshopCommunity\Application\Component\UserComponent::$_blNewsSubscriptionStatus = null
protected

◆ $_iLoginStatus

OxidEsales\EshopCommunity\Application\Component\UserComponent::$_iLoginStatus = null
protected

◆ $_sTermsVer

OxidEsales\EshopCommunity\Application\Component\UserComponent::$_sTermsVer = null
protected

The documentation for this class was generated from the following file: