oxUser Class Reference
List of all members.
Detailed Description
User manager. Performs
user managing function, as assigning to groups, updating information, deletion and other.
|
Public Member Functions |
| __construct () |
| setMallUsersStatus ($blOn=false) |
| __get ($sParamName) |
| getNewsSubscription () |
| getUserCountry ($sCountryId=null, $iLang=null) |
| getUserGroups ($sOXID=null) |
| getUserAddresses ($sOXID=null) |
| getSelectedAddress ($sWishId=false) |
| getUserPayments ($sOXID=null) |
| save () |
| inGroup ($sGroupID) |
| delete ($sOXID=null) |
| load ($oxID) |
| exists ($sOXID=null) |
| getOrders () |
| getOrderCount () |
| getNoticeListArtCnt () |
| getWishListArtCnt () |
| getActiveCountry () |
| createUser () |
| addToGroup ($sGroupID) |
| removeFromGroup ($sGroupID=null) |
| onOrderExecute ($oBasket, $iSuccess) |
| getBasket ($sName) |
| convertBirthday ($aData) |
| getBoni () |
| addDynGroup ($sDynGoup, $aDeniedDynGroups) |
| checkValues ($sLogin, $sPassword, $sPassword2, $aInvAddress, $aDelAddress) |
| setNewsSubscription ($blSubscribe, $blSendOptIn) |
| changeUserData ($sUser, $sPassword, $sPassword2, $aInvAddress, $aDelAddress) |
| addUserAddress ($oUser) |
| login ($sUser, $sPassword, $blCookie=false) |
| logout () |
| checkIfEmailExists ($sEmail) |
| getUserRecommLists ($sOXID=null) |
| getRecommListsCount ($sOx=null) |
Static Public Member Functions |
static | getAdminUser () |
static | getActiveUser ($blForceAdmin=false) |
Protected Member Functions |
| _assignAddress ($aDelAddress) |
| _ldapLogin ($sUser, $sPassword, $sShopID, $sShopSelect) |
| _getUserRights () |
| _setRecordNumber ($sMaxField, $aWhere=null, $iMaxTryCnt=5) |
| _insert () |
| _update () |
| _checkLogin (&$sLogin, $aInvAddress) |
| _checkEmail ($sEmail) |
| _checkPassword ($sNewPass, $sConfPass, $blCheckLenght=false) |
| _checkRequiredFields ($aInvAddress, $aDelAddress) |
| _checkVatId ($aInvAddress) |
| _setAutoGroups ($sCountryId) |
| _hasUserAddress ($sUserId) |
| _setUserCookie ($sUser, $sPassword, $sShopId=null, $iTimeout=31536000) |
| _deleteUserCookie ($sShopId=null) |
Static Protected Member Functions |
static | _getUserCookie ($sShopId=null) |
Protected Attributes |
| $_blDisableShopCheck = true |
| $_oNewsSubscription = null |
| $_sCoreTbl = 'oxuser' |
| $_sClassName = 'oxuser' |
| $_aBaskets = array() |
| $_oGroups |
| $_oAddresses |
| $_oPayments |
| $_oRecommList |
| $_blMallUsers = false |
| $_iCntNoticeListArticles = null |
| $_iCntWishListArticles = null |
| $_iCntRecommLists = null |
Static Protected Attributes |
static | $_aUserCookie = array() |
Constructor & Destructor Documentation
Class constructor, initiates parent constructor (parent.oxBase()).
- Returns:
- null
Reimplemented from oxBase.
Member Function Documentation
oxUser.setMallUsersStatus |
( |
$ |
blOn = false |
) |
|
Sets mall user status
- Parameters:
-
| bool | $blOn mall users is on or off |
- Returns:
- null
oxUser.__get |
( |
$ |
sParamName |
) |
|
Getter for special not frequently used fields
- Parameters:
-
| string | $sParamName name of parameter to get value |
- Returns:
- mixed
Reimplemented from oxBase.
oxUser.getNewsSubscription |
( |
|
) |
|
Returns user newsletter subscription controller object
- Returns:
- object oxnewssubscribed
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
oxUser.getUserGroups |
( |
$ |
sOXID = null |
) |
|
Returns assigned user groups list object
- Parameters:
-
| string | $sOXID object ID (default is null) |
- Returns:
- object
oxUser.getUserAddresses |
( |
$ |
sOXID = null |
) |
|
Returns user defined Address list object
- Parameters:
-
| string | $sOXID object ID (default is null) |
- Returns:
- object
oxUser.getSelectedAddress |
( |
$ |
sWishId = false |
) |
|
Sets in the array oxuser._oAddresses selected address. Returns user selected Address id.
- Parameters:
-
- Returns:
- string $sAddressId
oxUser.getUserPayments |
( |
$ |
sOXID = null |
) |
|
Returns user payment history list object
- Parameters:
-
| string | $sOXID object ID (default is null) |
- Returns:
- object oxlist with oxuserpayments objects
Saves (updates) user object data information in DB. Return true on success.
- Returns:
- bool
Reimplemented from oxBase.
oxUser.inGroup |
( |
$ |
sGroupID |
) |
|
Checks if this object is in group, returns true on success.
- Parameters:
-
| string | $sGroupID user group ID |
- Returns:
- bool
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.
Loads object (user) details from DB. Returns true on success.
- Parameters:
-
- Returns:
- bool
Reimplemented from oxBase.
oxUser.exists |
( |
$ |
sOXID = null |
) |
|
Checks if user exists in database.
- Parameters:
-
| string | $sOXID object ID (default null) |
- Returns:
- bool
Reimplemented from oxBase.
Returns object with ordering information (order articles list).
- Returns:
- object
Caclulates amount of orders made by user
- Returns:
- int
oxUser.getNoticeListArtCnt |
( |
|
) |
|
Returns amount of articles in noticelist
- Returns:
- int
oxUser.getWishListArtCnt |
( |
|
) |
|
oxUser.getActiveCountry |
( |
|
) |
|
Returns user country ID, but If delivery address is given - returns delivery country.
- Returns:
- string
Inserts new or updates existing user
- Exceptions:
-
- Returns:
- bool
oxUser.addToGroup |
( |
$ |
sGroupID |
) |
|
Adds user to the group
- Parameters:
-
| string | $sGroupID group id |
- Returns:
- bool
oxUser.removeFromGroup |
( |
$ |
sGroupID = null |
) |
|
Removes user from passed user group.
- Parameters:
-
| string | $sGroupID group id |
- Returns:
- null
oxUser.onOrderExecute |
( |
$ |
oBasket, |
|
|
$ |
iSuccess | |
|
) |
| | |
Called after saving an order.
- Parameters:
-
| object | $oBasket Shopping basket object |
| int | $iSuccess order success status |
- Returns:
- null
oxUser.getBasket |
( |
$ |
sName |
) |
|
Returns notice, wishlist or saved basket object
- Parameters:
-
| string | $sName name/type of basket |
- Returns:
- oxuserbasket
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
No logic set, only returns "1000". You should extend this function according your needs.
- Returns:
- integer
oxUser.addDynGroup |
( |
$ |
sDynGoup, |
|
|
$ |
aDeniedDynGroups | |
|
) |
| | |
If there is a directove to add user to dynamic group (usually by URL - "dgr=any_group") - tries to add user to it. First checks if passed dynamic group is not in denied group list (defined ar oxConfig.aDeniedDynGroups) and if not - adds user to this group.
- Parameters:
-
| string | $sDynGoup deny group (oxSession.getVar( 'dgr' )) |
| array | $aDeniedDynGroups ($myConfig->getConfigParam( 'aDeniedDynGroups' )) |
- Returns:
- bool
oxUser.checkValues |
( |
$ |
sLogin, |
|
|
$ |
sPassword, |
|
|
$ |
sPassword2, |
|
|
$ |
aInvAddress, |
|
|
$ |
aDelAddress | |
|
) |
| | |
Performs bunch of checks if user profile data is correct; on any error exception is thrown
- Parameters:
-
| string | $sLogin user login name |
| string | $sPassword user password |
| string | $sPassword2 user password to compare |
| array | $aInvAddress array of user profile data |
| array | $aDelAddress array of user profile data |
- Exceptions:
-
- Returns:
- null
oxUser.setNewsSubscription |
( |
$ |
blSubscribe, |
|
|
$ |
blSendOptIn | |
|
) |
| | |
Sets newsletter subscription status to user
- Parameters:
-
| bool | $blSubscribe subscribes/unsubscribes user from newsletter |
| bool | $blSendOptIn |
- Returns:
- bool
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:
-
- Returns:
- bool
oxUser.addUserAddress |
( |
$ |
oUser |
) |
|
Adds new address info to user copied from passed user. Returns new address ID
- Parameters:
-
| object | $oUser user object to copy address info |
- Returns:
- mixed
oxUser._assignAddress |
( |
$ |
aDelAddress |
) |
[protected] |
creates new address entry or updates existing
- Parameters:
-
| array | $aDelAddress address data array |
- Returns:
- null
oxUser.login |
( |
$ |
sUser, |
|
|
$ |
sPassword, |
|
|
$ |
blCookie = false | |
|
) |
| | |
Performs user login by username and password. Fetches user data from DB. Registers in session. Returns true on success, FALSE otherwise.
- Parameters:
-
| string | $sUser User username |
| string | $sPassword User password |
| bool | $blCookie (default false) |
- Exceptions:
-
- Returns:
- bool
Logs out session user. Returns true on success
- Returns:
- bool
static oxUser.getAdminUser |
( |
|
) |
[static] |
Loads active admin user object (if possible). If user is not available - returns false.
- Returns:
- bool
static oxUser.getActiveUser |
( |
$ |
blForceAdmin = false |
) |
[static] |
Loads active user object. If user is not available - returns false.
- Parameters:
-
| bool | $blForceAdmin (default false) |
- Returns:
- bool
oxUser._ldapLogin |
( |
$ |
sUser, |
|
|
$ |
sPassword, |
|
|
$ |
sShopID, |
|
|
$ |
sShopSelect | |
|
) |
| | [protected] |
oxUser._getUserRights |
( |
|
) |
[protected] |
Returns user rights index. Index cannot be higher than current session user rights index.
- Returns:
- string
oxUser._setRecordNumber |
( |
$ |
sMaxField, |
|
|
$ |
aWhere = null , |
|
|
$ |
iMaxTryCnt = 5 | |
|
) |
| | [protected] |
Tries to fetch and set next record number in DB. Returns true on success
- Parameters:
-
| string | $sMaxField field name where record number is stored |
| array | $aWhere (optional) shop filter add SQL string |
| int | $iMaxTryCnt (optional) max number of tryouts |
- Returns:
- bool
Reimplemented from oxBase.
oxUser._insert |
( |
|
) |
[protected] |
Inserts user object data to DB. Returns true on success.
- Returns:
- bool
Reimplemented from oxBase.
oxUser._update |
( |
|
) |
[protected] |
Updates changed user object data to DB. Returns true on success.
- Returns:
- bool
Reimplemented from oxBase.
oxUser._checkLogin |
( |
&$ |
sLogin, |
|
|
$ |
aInvAddress | |
|
) |
| | [protected] |
Checks if user name does not break logics:
- if user wants to UPDATE his login name, performing check if user entered correct password
- additionally checking for user name dublicates. This is usually needed when creating new users. On any error exception is thrown.
- Parameters:
-
| string | $sLogin user preferred login name |
| array | $aInvAddress user information |
- Exceptions:
-
- Returns:
- null
oxUser.checkIfEmailExists |
( |
$ |
sEmail |
) |
|
Checks for already used email
- Parameters:
-
| string | $sEmail user email/login |
- Returns:
- null
oxUser.getUserRecommLists |
( |
$ |
sOXID = null |
) |
|
Returns user recommendation list object
- Parameters:
-
| string | $sOXID object ID (default is null) |
- Returns:
- object oxlist with oxrecommlist objects
oxUser.getRecommListsCount |
( |
$ |
sOx = null |
) |
|
Returns recommlist count
- Parameters:
-
| string | $sOXID object ID (default is null) |
- Returns:
- int
oxUser._checkEmail |
( |
$ |
sEmail |
) |
[protected] |
Checks if email (used as login) is not empty and is valid. On any error exception is thrown.
- Parameters:
-
| string | $sEmail user email/login |
- Returns:
- null
oxUser._checkPassword |
( |
$ |
sNewPass, |
|
|
$ |
sConfPass, |
|
|
$ |
blCheckLenght = false | |
|
) |
| | [protected] |
Checking if user password is fine. In case of error exception is thrown
- Parameters:
-
| string | $sNewPass new user password |
| string | $sConfPass retyped user password |
| bool | $blCheckLenght option to check password lenght |
- Exceptions:
-
- Returns:
- null
oxUser._checkRequiredFields |
( |
$ |
aInvAddress, |
|
|
$ |
aDelAddress | |
|
) |
| | [protected] |
Checking if all required fields were filled. In case of error exception is thrown
- Parameters:
-
| array | $aInvAddress billing address |
| array | $aDelAddress delivery address |
- Exceptions:
-
| oxInputExcpetion | exception |
- Returns:
- null
oxUser._checkVatId |
( |
$ |
aInvAddress |
) |
[protected] |
Checks if user passed VAT id is valid. Exception is thrown if id is not valid
- Parameters:
-
| array | $aInvAddress user input array |
- Exceptions:
-
- Returns:
- null
oxUser._setAutoGroups |
( |
$ |
sCountryId |
) |
[protected] |
Automatically assigns user to specific groups according to users country information
- Parameters:
-
| string | $sCountryId users country id |
- Returns:
- null
oxUser._hasUserAddress |
( |
$ |
sUserId |
) |
[protected] |
Checks if user allready has user address
- Parameters:
-
| object | $sUserId user to check Id |
- Returns:
- bool
oxUser._setUserCookie |
( |
$ |
sUser, |
|
|
$ |
sPassword, |
|
|
$ |
sShopId = null , |
|
|
$ |
iTimeout = 31536000 | |
|
) |
| | [protected] |
Sets user info into cookie
- Parameters:
-
| string | $sUser user ID |
| string | $sPassword password |
| string | $sShopId shop ID (default null) |
| integer | $iTimeout timeout value (default 31536000) |
- Returns:
- null
oxUser._deleteUserCookie |
( |
$ |
sShopId = null |
) |
[protected] |
Deletes user cookie data
- Parameters:
-
| string | $sShopId shop ID (default null) |
- Returns:
- null
static oxUser._getUserCookie |
( |
$ |
sShopId = null |
) |
[static, protected] |
Returns cookie stored used login data
- Parameters:
-
| string | $sShopId shop ID (default null) |
- Returns:
- string
Member Data Documentation
oxUser.$_blDisableShopCheck = true [protected] |
oxUser.$_oNewsSubscription = null [protected] |
oxUser.$_sCoreTbl = 'oxuser' [protected] |
oxUser.$_sClassName = 'oxuser' [protected] |
oxUser.$_aBaskets = array() [protected] |
oxUser.$_oGroups [protected] |
oxUser.$_oAddresses [protected] |
oxUser.$_oPayments [protected] |
oxUser.$_oRecommList [protected] |
oxUser.$_blMallUsers = false [protected] |
oxUser.$_aUserCookie = array() [static, protected] |
oxUser.$_iCntNoticeListArticles = null [protected] |
oxUser.$_iCntWishListArticles = null [protected] |
oxUser.$_iCntRecommLists = null [protected] |
The documentation for this class was generated from the following file: