Public Member Functions | Protected Member Functions | Protected Attributes

oxcmp_user Class Reference

Inheritance diagram for oxcmp_user:
Collaboration diagram for oxcmp_user:

List of all members.

Public Member Functions

 init ()
 render ()
 login ()
 login_noredirect ()
 login_updateFbId ()
 logout ()
 changeUser ()
 changeuser_testvalues ()
 createUser ()
 registerUser ()
 loginOid ()
 setLoginStatus ($iStatus)
 getLoginStatus ()
 getOpenId ()
 getInvitor ()

Protected Member Functions

 _checkPsState ()
 _loadSessionUser ()
 _afterLogin ($oUser)
 _afterLogout ()
 _changeUser_noRedirect ()
 _getDelAddressData ()
 _getLogoutLink ()
 _setupDelAddress ()
 _getUserTitle ($sGender)
 _getReturnUrl ()

Protected Attributes

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

Detailed Description

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

Definition at line 13 of file oxcmp_user.php.


Member Function Documentation

oxcmp_user._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 (oxuser.InGroup("oxidblocked")) - if yes - redirects to blocked user page ("cl=content&tpl=user_blocked.tpl"). If user status is OK - sets user ID to session, automatically assigns him to dynamic group (oxuser.addDynGroup(); if this directive is set (usually by URL)). Stores cookie info if user confirmed in login screen. Then loads delivery info and forces basket to recalculate (oxsession.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:
oxuser $oUser user object
Returns:
string

Definition at line 279 of file oxcmp_user.php.

oxcmp_user._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.

Returns:
null

Definition at line 347 of file oxcmp_user.php.

oxcmp_user._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

Returns:
bool true on success, false otherwise

Definition at line 600 of file oxcmp_user.php.

oxcmp_user._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;

Returns:
null

Definition at line 159 of file oxcmp_user.php.

oxcmp_user._getDelAddressData (  )  [protected]

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

Returns:
array

Definition at line 662 of file oxcmp_user.php.

oxcmp_user._getLogoutLink (  )  [protected]

Returns logout link with additional params

Returns:
string $sLogoutLink

Definition at line 685 of file oxcmp_user.php.

oxcmp_user._getReturnUrl (  )  [protected]

Returns return url for openid.

Returns:
string $sReturnUrl

Definition at line 844 of file oxcmp_user.php.

oxcmp_user._getUserTitle ( sGender  )  [protected]

Returns gender for database

Parameters:
string $sGender F(femail) or M(mail)
Returns:
string

Definition at line 830 of file oxcmp_user.php.

oxcmp_user._loadSessionUser (  )  [protected]

Tries to load user ID from session.

Returns:
null

Definition at line 185 of file oxcmp_user.php.

oxcmp_user._setupDelAddress (  )  [protected]

Checks if shipping address fields must be displayed and sets into session.

Template variables: blshowshipaddress

Returns:
null

Definition at line 717 of file oxcmp_user.php.

oxcmp_user.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

Definition at line 403 of file oxcmp_user.php.

oxcmp_user.changeuser_testvalues (  ) 

Executes oxcmp_user._changeuser_noredirect().

Returns:
null

Definition at line 425 of file oxcmp_user.php.

oxcmp_user.createUser (  ) 

First test if all MUST FILL fields were filled, then performed additional checking oxcmp_user.CheckValues(). If no errors occured - trying to create new user (oxuser.CreateUser()), logging him to shop (oxuser.Login() if user has entered password) or assigning him to dynamic group (oxuser.addDynGroup()). If oxuser.CreateUser() returns false - thsi means user is allready 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

Definition at line 454 of file oxcmp_user.php.

oxcmp_user.getInvitor (  ) 

Returns invitor id

Returns:
null

Definition at line 898 of file oxcmp_user.php.

oxcmp_user.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

Definition at line 878 of file oxcmp_user.php.

oxcmp_user.getOpenId (  ) 

Returns oxOpenId class

Returns:
oxOpenId

Definition at line 888 of file oxcmp_user.php.

oxcmp_user.init (  ) 

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

Session variable: usr_err

Returns:
null

Reimplemented from oxView.

Definition at line 88 of file oxcmp_user.php.

oxcmp_user.login (  ) 

Collects posted user information from posted variables ("lgn_usr", "lgn_pwd", "lgn_cook"), executes oxuser.login() and checks if such user exists.

Session variables: usr, usr_err

Template variables: usr_err

Returns:
string redirection string

Definition at line 227 of file oxcmp_user.php.

oxcmp_user.login_noredirect (  ) 

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

Returns:
null

Definition at line 311 of file oxcmp_user.php.

oxcmp_user.login_updateFbId (  ) 

Executes oxcmp_user.login() and updates logged in user Facebook User ID (if user was connected using Facebook Connect)

Returns:
null

Definition at line 327 of file oxcmp_user.php.

oxcmp_user.loginOid (  ) 

Collects user information posted from openid server. If user do not exists creates new user and executes oxuser.openIdLogin().

Returns:
null

Definition at line 750 of file oxcmp_user.php.

oxcmp_user.logout (  ) 

Deletes user information from session:
"usr", "dgr", "dynvalue", "paymentid"
also deletes cookie, unsets oxconfig.oUser, oxcmp_user.oUser, forces basket to recalculate.

Returns:
null

Definition at line 369 of file oxcmp_user.php.

oxcmp_user.registerUser (  ) 

Creates new oxid user

Returns:
string partial parameter string or null

Definition at line 567 of file oxcmp_user.php.

oxcmp_user.render (  ) 

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

Template variables: invadr, lgn_usr, deladr,

Session variables: dgr

Returns:
object user object

Reimplemented from oxView.

Definition at line 113 of file oxcmp_user.php.

oxcmp_user.setLoginStatus ( iStatus  ) 

Sets user login state

Parameters:
int $iStatus login state (USER_LOGIN_SUCCESS/USER_LOGIN_FAIL/USER_LOGOUT)
Returns:
null

Definition at line 865 of file oxcmp_user.php.


Member Data Documentation

oxcmp_user.$_aAllowedClasses [protected]
Initial value:
 array(
                                        'register',
                                        'forgotpwd',
                                        'content',
                                        )

Definition at line 54 of file oxcmp_user.php.

oxcmp_user.$_aRawBillingFields [protected]
Initial value:
 array( 'oxuser__oxcompany', 'oxuser__oxaddinfo', 'oxuser__oxfname',
                                           'oxuser__oxlname', 'oxuser__oxstreet', 'oxuser__oxstreetnr',
                                           'oxuser__oxcity', 'oxuser__oxfon', 'oxuser__oxfax',
                                           'oxuser__oxmobfon', 'oxuser__oxprivfon' )

Definition at line 65 of file oxcmp_user.php.

oxcmp_user.$_aRawShippingFields [protected]
Initial value:
 array( 'oxaddress__oxcompany', 'oxaddress__oxaddinfo', 'oxaddress__oxfname',
                                            'oxaddress__oxlname', 'oxaddress__oxcity', 'oxaddress__oxstreet',
                                            'oxaddress__oxstreetnr', 'oxaddress__oxzip', 'oxaddress__oxfon',
                                            'oxaddress__oxfax' )

Definition at line 75 of file oxcmp_user.php.

oxcmp_user.$_blIsComponent = true [protected]

Reimplemented from oxView.

Definition at line 25 of file oxcmp_user.php.

oxcmp_user.$_blIsNewUser = false [protected]

Definition at line 19 of file oxcmp_user.php.

oxcmp_user.$_blNewsSubscriptionStatus = null [protected]

Definition at line 31 of file oxcmp_user.php.

oxcmp_user.$_iLoginStatus = null [protected]

Definition at line 40 of file oxcmp_user.php.

oxcmp_user.$_sTermsVer = null [protected]

Definition at line 47 of file oxcmp_user.php.


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