Public Member Functions | Protected Member Functions | Protected Attributes | Static Protected Attributes

oxUser Class Reference

Inheritance diagram for oxUser:
Collaboration diagram for oxUser:

List of all members.

Public Member Functions

 __construct ()
 setMallUsersStatus ($blOn=false)
 __get ($sParamName)
 getNewsSubscription ()
 getUserCountry ($sCountryId=null, $iLang=null)
 getUserCountryId ($sCountry=null)
 getUserGroups ($sOXID=null)
 getUserAddresses ($sUserId=null)
 setSelectedAddressId ($sAddressId)
 getSelectedAddressId ()
 getSelectedAddress ($sWishId=false)
 getUserPayments ($sOXID=null)
 save ()
 allowDerivedUpdate ()
 inGroup ($sGroupID)
 delete ($sOXID=null)
 load ($oxID)
 exists ($sOXID=null)
 getOrders ($iLimit=false, $iPage=0)
 getOrderCount ()
 getNoticeListArtCnt ()
 getWishListArtCnt ()
 getEncodedDeliveryAddress ()
 getActiveCountry ()
 addToGroup ($sGroupID)
 removeFromGroup ($sGroupID=null)
 onOrderExecute ($oBasket, $iSuccess)
 getBasket ($sName)
 convertBirthday ($aData)
 getBoni ()
 setNewsSubscription ($blSubscribe, $blSendOptIn, $blForceCheckOptIn=false)
 changeUserData ($sUser, $sPassword, $sPassword2, $aInvAddress, $aDelAddress)
 logout ()
 loadAdminUser ()
 loadActiveUser ($blForceAdmin=false)
 checkIfEmailExists ($sEmail)
 getUserRecommLists ($sOXID=null)
 getRecommListsCount ($sOx=null)
 loadUserByUpdateId ($sUid)
 setUpdateKey ($blReset=false)
 getUpdateLinkTerm ()
 isExpiredUpdateId ($sKey)
 getUpdateId ()
 decodeSalt ($sSaltHex)
 isSamePassword ($sNewPass)
 isLoadedFromCookie ()
 getPasswordHash ()
 getReviewUserHash ($sUserId)
 getReviewUserId ($sReviewUserHash)
 getState ()
 getStateId ()
 getStateTitle ($sId=null)
 isTermsAccepted ()
 acceptTerms ()
 setCreditPointsForRegistrant ($sUserId, $sRecEmail)
 setCreditPointsForInviter ()
 updateFbId ()
 updateInvitationStatistics ($aRecEmail)
 getIdByUserName ($sUserName)
 hasAccount ()
 isPriceViewModeNetto ()

Protected Member Functions

 _getStateObject ()
 _getWishListId ()
 _getMergedAddressFields ()
 _assignAddress ($aDelAddress)
 _getLoginQueryHashedWithMD5 ($sUser, $sPassword, $sShopID, $blAdmin)
 _getLoginQuery ($sUser, $sPassword, $sShopID, $blAdmin)
 _getShopSelect ($myConfig, $sShopID, $blAdmin)
 _getFacebookUserId ()
 _getCookieUserId ()
 _getUserRights ()
 _insert ()
 _update ()
 _setAutoGroups ($sCountryId)
 _isDemoShop ()

Protected Attributes

 $_blDisableShopCheck = true
 $_oNewsSubscription = null
 $_sClassName = 'oxuser'
 $_aBaskets = array()
 $_oGroups
 $_aAddresses = array()
 $_oPayments
 $_oRecommList
 $_blMallUsers = false
 $_iCntNoticeListArticles = null
 $_iCntWishListArticles = null
 $_iCntRecommLists = null
 $_sUpdateKey = null
 $_blLoadedFromCookie = null
 $_sSelAddressId = null
 $_oSelAddress = null
 $_sWishId = null
 $_oUserCountryTitle = null
 $_oStateObject = null

Static Protected Attributes

static $_aUserCookie = array()

Detailed Description

User manager. Performs user managing function, as assigning to groups, updating information, deletion and other.

Definition at line 9 of file oxuser.php.


Constructor & Destructor Documentation

oxUser.__construct (  ) 

Class constructor, initiates parent constructor (parent.oxBase()).

Returns:
null

Reimplemented from oxBase.

Definition at line 169 of file oxuser.php.


Member Function Documentation

oxUser.__get ( sParamName  ) 

Getter for special not frequently used fields

Parameters:
string $sParamName name of parameter to get value
Returns:
mixed

Reimplemented from oxBase.

Definition at line 194 of file oxuser.php.

oxUser._assignAddress ( aDelAddress  )  [protected]

creates new address entry or updates existing

Parameters:
array $aDelAddress address data array

Definition at line 1191 of file oxuser.php.

oxUser._getCookieUserId (  )  [protected]

Checks if user is connected via cookies and if so, returns user id.

Returns:
string

Definition at line 1484 of file oxuser.php.

oxUser._getFacebookUserId (  )  [protected]

Checks if user is connected via Facebook connect and if so, returns user id.

Returns:
string

Definition at line 1462 of file oxuser.php.

oxUser._getLoginQuery ( sUser,
sPassword,
sShopID,
blAdmin 
) [protected]

Builds and returns user login query

Parameters:
string $sUser login name
string $sPassword login password
string $sShopID shopid
bool $blAdmin admin/non admin mode
Exceptions:
object 
Returns:
string

Definition at line 1260 of file oxuser.php.

oxUser._getLoginQueryHashedWithMD5 ( sUser,
sPassword,
sShopID,
blAdmin 
) [protected]

Builds and returns user login query

Parameters:
string $sUser login name
string $sPassword login password
string $sShopID shopid
bool $blAdmin admin/non admin mode
Returns:
string

Definition at line 1227 of file oxuser.php.

oxUser._getMergedAddressFields (  )  [protected]

Returns merged delivery address fields.

Returns:
string

Definition at line 1164 of file oxuser.php.

oxUser._getShopSelect ( myConfig,
sShopID,
blAdmin 
) [protected]

Returns shopselect part of login query sql

Parameters:
object $myConfig shop config
string $sShopID shopid
bool $blAdmin admin/non admin mode
Returns:
string

Definition at line 1293 of file oxuser.php.

oxUser._getStateObject (  )  [protected]

Gets state object.

Returns:
oxState

Definition at line 155 of file oxuser.php.

oxUser._getUserRights (  )  [protected]

Returns user rights index. Index cannot be higher than current session user rights index.

Returns:
string

Definition at line 1587 of file oxuser.php.

oxUser._getWishListId (  )  [protected]

Checks if product from wishlist is added

Returns:
$sWishId

Definition at line 390 of file oxuser.php.

oxUser._insert (  )  [protected]

Inserts user object data to DB. Returns true on success.

Returns:
bool

Reimplemented from oxBase.

Definition at line 1632 of file oxuser.php.

oxUser._isDemoShop (  )  [protected]

Return true - if shop is in demo mode

Returns:
bool

Definition at line 2285 of file oxuser.php.

oxUser._setAutoGroups ( sCountryId  )  [protected]

Automatically assigns user to specific groups according to users country information

Parameters:
string $sCountryId users country id

Definition at line 1787 of file oxuser.php.

oxUser._update (  )  [protected]

Updates changed user object data to DB. Returns true on success.

Returns:
bool

Definition at line 1650 of file oxuser.php.

oxUser.acceptTerms (  ) 

Writes terms acceptance info to db

Definition at line 2104 of file oxuser.php.

oxUser.addToGroup ( sGroupID  ) 

Adds user to the group

Parameters:
string $sGroupID group id
Returns:
bool

Definition at line 854 of file oxuser.php.

oxUser.allowDerivedUpdate (  ) 

Overrides parent isDerived check and returns true

Returns:
bool

Reimplemented from oxBase.

Definition at line 528 of file oxuser.php.

oxUser.changeUserData ( sUser,
sPassword,
sPassword2,
aInvAddress,
aDelAddress 
)

When changing/updating user information in frontend this method validates user input. If data is fine - automatically assigns this values. Additionally calls methods (oxuser._setAutoGroups, oxuser.setNewsSubscription) to perform automatic groups assignment and returns newsletter subscription status. If some action fails - exception is thrown.

Parameters:
string $sUser user login name
string $sPassword user password
string $sPassword2 user confirmation password
array $aInvAddress user billing address
array $aDelAddress delivery address
Exceptions:
oxUserException,oxInputException,oxConnectionException 

Definition at line 1138 of file oxuser.php.

oxUser.checkIfEmailExists ( sEmail  ) 

Checks for already used email

Parameters:
string $sEmail user email/login
Returns:
null

Definition at line 1679 of file oxuser.php.

oxUser.convertBirthday ( aData  ) 

User birthday converter. Usually this data comes in array form, so before writing into DB it must be converted into string

Parameters:
array $aData dirthday data
Returns:
string

Definition at line 963 of file oxuser.php.

oxUser.decodeSalt ( sSaltHex  ) 

Returns plains password salt representation

Parameters:
string $sSaltHex heximal representation of password salt value
Deprecated:
since v5.2 (2014-08-12); No need after introducing oxPasswordSaltGenerator
Returns:
string

Definition at line 1950 of file oxuser.php.

oxUser.delete ( sOXID = null  ) 

Removes user data stored in some DB tables (such as oxuserpayments, oxaddress oxobject2group, oxremark, etc). Return true on success.

Parameters:
string $sOXID object ID (default null)
Returns:
bool

Reimplemented from oxBase.

Definition at line 558 of file oxuser.php.

oxUser.exists ( sOXID = null  ) 

Checks if user exists in database.

Parameters:
string $sOXID object ID (default null)
Returns:
bool

Reimplemented from oxBase.

Definition at line 633 of file oxuser.php.

oxUser.getActiveCountry (  ) 

Returns user country ID, but If delivery address is given - returns delivery country.

Returns:
string

Definition at line 777 of file oxuser.php.

oxUser.getBasket ( sName  ) 

Returns notice, wishlist or saved basket object

Parameters:
string $sName name/type of basket
Returns:
oxuserbasket

Definition at line 934 of file oxuser.php.

oxUser.getBoni (  ) 

Return standart credit rating, can be set in config option iCreditRating;

Returns:
integer

Definition at line 1016 of file oxuser.php.

oxUser.getEncodedDeliveryAddress (  ) 

Returns encoded delivery address.

Returns:
string

Definition at line 766 of file oxuser.php.

oxUser.getIdByUserName ( sUserName  ) 

retruns user id by user name

Parameters:
string $sUserName user name
Returns:
string

Definition at line 2211 of file oxuser.php.

oxUser.getNewsSubscription (  ) 

Returns user newsletter subscription controller object

Returns:
object oxnewssubscribed

Definition at line 233 of file oxuser.php.

oxUser.getNoticeListArtCnt (  ) 

Returns amount of articles in noticelist

Returns:
int

Definition at line 732 of file oxuser.php.

oxUser.getOrderCount (  ) 

Caclulates amount of orders made by user

Returns:
int

Definition at line 715 of file oxuser.php.

oxUser.getOrders ( iLimit = false,
iPage = 0 
)

Returns object with ordering information (order articles list).

Parameters:
int $iLimit how many entries to load
int $iPage which page to start
Returns:
oxList

Definition at line 681 of file oxuser.php.

oxUser.getPasswordHash (  ) 

Returns password hash. In case password in db is plain or decodable password is processed and hash returned

Deprecated:
since v5.2 (2014-08-11); was used for eFire downloader, not used anymore.
Returns:
string

Definition at line 2007 of file oxuser.php.

oxUser.getRecommListsCount ( sOx = null  ) 

Returns recommlist count

Parameters:
string $sOx object ID (default is null)
Returns:
int

Definition at line 1764 of file oxuser.php.

oxUser.getReviewUserHash ( sUserId  ) 

Generates user password and username hash for review

Parameters:
string $sUserId userid
Returns:
string

Definition at line 2024 of file oxuser.php.

oxUser.getReviewUserId ( sReviewUserHash  ) 

Gets from review user hash user id

Parameters:
string $sReviewUserHash review user hash
Returns:
string

Definition at line 2039 of file oxuser.php.

oxUser.getSelectedAddress ( sWishId = false  ) 

Sets in the array oxuser._aAddresses selected address. Returns user selected Address id.

Parameters:
bool $sWishId wishlist user id
Returns:
object $oSelectedAddress

Definition at line 413 of file oxuser.php.

oxUser.getSelectedAddressId (  ) 

Returns user chosen address id ("oxaddressid" or "deladrid")

Returns:
string

Definition at line 371 of file oxuser.php.

oxUser.getState (  ) 

Return user state id

Deprecated:
since v5.2.0 (2014-01-10); Naming changed use function getStateId()
Returns:
string

Definition at line 2054 of file oxuser.php.

oxUser.getStateId (  ) 

Get state id for current user

Returns:
mixed

Definition at line 2064 of file oxuser.php.

oxUser.getStateTitle ( sId = null  ) 

Get state title by id

Parameters:
string $sId state ID
Returns:
string

Definition at line 2076 of file oxuser.php.

oxUser.getUpdateId (  ) 

Returns user passwords update id

Returns:
string

Definition at line 1894 of file oxuser.php.

oxUser.getUpdateLinkTerm (  ) 

Return password update link validity term (seconds). Default 3600 * 6

Returns:
int

Definition at line 1869 of file oxuser.php.

oxUser.getUserAddresses ( sUserId = null  ) 

Returns user defined Address list object

Parameters:
string $sUserId object ID (default is null)
Returns:
array

Definition at line 334 of file oxuser.php.

oxUser.getUserCountry ( sCountryId = null,
iLang = null 
)

Returns user country (object) according to passed parameters or they are taken from user object ( oxid, country id) and session (language)

Parameters:
string $sCountryId country id (optional)
int $iLang active language (optional)
Returns:
string

Definition at line 266 of file oxuser.php.

oxUser.getUserCountryId ( sCountry = null  ) 

Returns user countryid according to passed name

Parameters:
string $sCountry country
Returns:
string

Definition at line 291 of file oxuser.php.

oxUser.getUserGroups ( sOXID = null  ) 

Returns assigned user groups list object

Parameters:
string $sOXID object ID (default is null)
Returns:
object

Definition at line 307 of file oxuser.php.

oxUser.getUserPayments ( sOXID = null  ) 

Returns user payment history list object

Parameters:
string $sOXID object ID (default is null)
Returns:
object oxList with oxuserpayments objects

Definition at line 459 of file oxuser.php.

oxUser.getUserRecommLists ( sOXID = null  ) 

Returns user recommendation list object

Parameters:
string $sOXID object ID (default is null)
Returns:
object oxList with oxrecommlist objects

Definition at line 1732 of file oxuser.php.

oxUser.getWishListArtCnt (  ) 

Calculating user wishlist item count

Returns:
int

Definition at line 749 of file oxuser.php.

oxUser.hasAccount (  ) 

returns true if user registered and have account

Returns:
bool

Definition at line 2227 of file oxuser.php.

oxUser.inGroup ( sGroupID  ) 

Checks if this object is in group, returns true on success.

Parameters:
string $sGroupID user group ID
Returns:
bool

Definition at line 540 of file oxuser.php.

oxUser.isExpiredUpdateId ( sKey  ) 

Checks if password update key is not expired yet

Parameters:
string $sKey key
Returns:
bool

Definition at line 1881 of file oxuser.php.

oxUser.isLoadedFromCookie (  ) 

Returns if user was loaded from cookie

Returns:
bool

Definition at line 1994 of file oxuser.php.

oxUser.isPriceViewModeNetto (  ) 

Return user price view mode, true - if netto mode

Returns:
bool

Definition at line 2238 of file oxuser.php.

oxUser.isSamePassword ( sNewPass  ) 

Checks if user entered password is the same as old

Parameters:
string $sNewPass new password
Returns:
bool

Definition at line 1984 of file oxuser.php.

oxUser.isTermsAccepted (  ) 

Checks if user accepted latest shopping terms and conditions version

Returns:
bool

Definition at line 2092 of file oxuser.php.

oxUser.load ( oxID  ) 

Loads object (user) details from DB. Returns true on success.

Parameters:
string $oxID User ID
Returns:
bool

Reimplemented from oxBase.

Definition at line 608 of file oxuser.php.

oxUser.loadActiveUser ( blForceAdmin = false  ) 

Loads active user object. If user is not available - returns false.

Parameters:
bool $blForceAdmin (default false)
Returns:
bool

Definition at line 1409 of file oxuser.php.

oxUser.loadAdminUser (  ) 

Loads active admin user object (if possible). If user is not available - returns false.

Returns:
bool

Definition at line 1396 of file oxuser.php.

oxUser.loadUserByUpdateId ( sUid  ) 

Tries to load user object by passed update id. Update id is generated when user forgot passwords and wants to update it

Parameters:
string $sUid update id
Returns:
oxuser

Definition at line 1835 of file oxuser.php.

oxUser.logout (  ) 

Logs out session user. Returns true on success

Returns:
bool

Definition at line 1372 of file oxuser.php.

oxUser.onOrderExecute ( oBasket,
iSuccess 
)

Called after saving an order.

Parameters:
object $oBasket Shopping basket object
int $iSuccess order success status

Definition at line 900 of file oxuser.php.

oxUser.removeFromGroup ( sGroupID = null  ) 

Removes user from passed user group.

Parameters:
string $sGroupID group id

Definition at line 879 of file oxuser.php.

oxUser.save (  ) 

Saves (updates) user object data information in DB. Return true on success.

Returns:
bool

Reimplemented from oxBase.

Definition at line 482 of file oxuser.php.

oxUser.setCreditPointsForInviter (  ) 

Assigns credit points to inviter

Returns:
bool

Definition at line 2152 of file oxuser.php.

oxUser.setCreditPointsForRegistrant ( sUserId,
sRecEmail 
)

Assigns registration points for invited user and its inviter (calls oxUser.setInvitationCreditPoints())

Parameters:
string $sUserId inviter user id
string $sRecEmail recipient (registrant) email
Returns:
bool

Definition at line 2123 of file oxuser.php.

oxUser.setMallUsersStatus ( blOn = false  ) 

Sets mall user status

Parameters:
bool $blOn mall users is on or off

Definition at line 182 of file oxuser.php.

oxUser.setNewsSubscription ( blSubscribe,
blSendOptIn,
blForceCheckOptIn = false 
)

Sets newsletter subscription status to user

Parameters:
bool $blSubscribe subscribes/unsubscribes user from newsletter
bool $blSendOptIn if to send confirmation email
bool $blForceCheckOptIn forces to check subscription even when it is set to 1
Returns:
bool

Definition at line 1080 of file oxuser.php.

oxUser.setSelectedAddressId ( sAddressId  ) 

Selected user address setter

Parameters:
string $sAddressId selected address id

Definition at line 361 of file oxuser.php.

oxUser.setUpdateKey ( blReset = false  ) 

Generates or resets and saves users update key

Parameters:
bool $blReset marker to reset update info

Definition at line 1849 of file oxuser.php.

oxUser.updateFbId (  ) 

Updates user Facebook ID

Returns:
null

Definition at line 2170 of file oxuser.php.

oxUser.updateInvitationStatistics ( aRecEmail  ) 

Updating invitations statistics

Parameters:
array $aRecEmail array of recipients emails

Definition at line 2188 of file oxuser.php.


Member Data Documentation

oxUser.$_aAddresses = array() [protected]

Definition at line 52 of file oxuser.php.

oxUser.$_aBaskets = array() [protected]

Definition at line 38 of file oxuser.php.

oxUser.$_aUserCookie = array() [static, protected]

Definition at line 80 of file oxuser.php.

oxUser.$_blDisableShopCheck = true [protected]

Definition at line 17 of file oxuser.php.

oxUser.$_blLoadedFromCookie = null [protected]

Definition at line 115 of file oxuser.php.

oxUser.$_blMallUsers = false [protected]

Definition at line 73 of file oxuser.php.

oxUser.$_iCntNoticeListArticles = null [protected]

Definition at line 87 of file oxuser.php.

oxUser.$_iCntRecommLists = null [protected]

Definition at line 101 of file oxuser.php.

oxUser.$_iCntWishListArticles = null [protected]

Definition at line 94 of file oxuser.php.

oxUser.$_oGroups [protected]

Definition at line 45 of file oxuser.php.

oxUser.$_oNewsSubscription = null [protected]

Definition at line 24 of file oxuser.php.

oxUser.$_oPayments [protected]

Definition at line 59 of file oxuser.php.

oxUser.$_oRecommList [protected]

Definition at line 66 of file oxuser.php.

oxUser.$_oSelAddress = null [protected]

Definition at line 129 of file oxuser.php.

oxUser.$_oStateObject = null [protected]

Definition at line 148 of file oxuser.php.

oxUser.$_oUserCountryTitle = null [protected]

Definition at line 143 of file oxuser.php.

oxUser.$_sClassName = 'oxuser' [protected]

Reimplemented from oxBase.

Definition at line 31 of file oxuser.php.

oxUser.$_sSelAddressId = null [protected]

Definition at line 122 of file oxuser.php.

oxUser.$_sUpdateKey = null [protected]

Definition at line 108 of file oxuser.php.

oxUser.$_sWishId = null [protected]

Definition at line 136 of file oxuser.php.


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