OXID eShop CE
6.2.0
|
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 () | |
getUserPayments ($sOXID=null) | |
save () | |
allowDerivedUpdate () | |
inGroup ($sGroupID) | |
delete ($oxid=null) | |
load ($oxID) | |
exists ($sOXID=null) | |
getOrders ($iLimit=false, $iPage=0) | |
getOrderCount () | |
getNoticeListArtCnt () | |
getWishListArtCnt () | |
getEncodedDeliveryAddress () | |
getActiveCountry () | |
createUser () | |
addToGroup ($sGroupID) | |
removeFromGroup ($sGroupID=null) | |
onOrderExecute ($oBasket, $iSuccess) | |
getBasket ($sName) | |
convertBirthday ($aData) | |
getBoni () | |
checkValues ($sLogin, $sPassword, $sPassword2, $aInvAddress, $aDelAddress) | |
setNewsSubscription ($blSubscribe, $blSendOptIn, $blForceCheckOptIn=false) | |
changeUserData ($sUser, $sPassword, $sPassword2, $aInvAddress, $aDelAddress) | |
login ($userName, $password, $setSessionCookie=false) | |
logout () | |
loadAdminUser () | |
loadActiveUser ($blForceAdmin=false) | |
checkIfEmailExists ($sEmail) | |
getUserRecommLists ($sOXID=null) | |
getRecommListsCount ($sOx=null) | |
loadUserByUpdateId ($sUid) | |
setUpdateKey ($blReset=false) | |
getUpdateLinkTerm () | |
isExpiredUpdateId ($sKey) | |
getUpdateId () | |
encodePassword ($sPassword, $sSalt) | |
setPassword ($password=null) | |
isSamePassword ($password) | |
isLoadedFromCookie () | |
getReviewUserHash ($sUserId) | |
getReviewUserId ($sReviewUserHash) | |
getStateId () | |
getStateTitle ($sId=null) | |
isTermsAccepted () | |
acceptTerms () | |
setCreditPointsForRegistrant ($sUserId, $sRecEmail) | |
setCreditPointsForInviter () | |
updateInvitationStatistics ($aRecEmail) | |
getIdByUserName ($userName) | |
hasAccount () | |
isPriceViewModeNetto () | |
isMallAdmin () | |
Public Attributes | |
const | USER_COOKIE_SALT = 'user_cookie_salt' |
Protected Member Functions | |
_getStateObject () | |
_getWishListId () | |
_getMergedAddressFields () | |
_assignAddress ($aDelAddress) | |
_getLoginQueryHashedWithMD5 ($userName, $password, $shopId, $isAdmin) | |
_getLoginQuery ($userName, $password, $shopId, $isAdmin) | |
_getShopSelect ($myConfig, $sShopID, $blAdmin) | |
_getCookieUserId () | |
_ldapLogin ($sUser, $sPassword, $sShopID, $sShopSelect) | |
_getUserRights () | |
_insert () | |
_update () | |
_setAutoGroups ($sCountryId) | |
_dbLogin (string $userName, $password, $shopID) | |
getPasswordHashFromDatabase (string $userName, int $shopId, bool $isLoginToAdminBackend) | |
_isDemoShop () | |
_getDemoShopLoginQuery ($sUser, $sPassword) | |
onChangeUserData ($aInvAddress) | |
deleteAdditionally ($sOXIDQuoted) | |
updateGetOrdersQuery ($query) | |
onLogin ($userName, $password) | |
getUtilsObjectInstance () | |
formQueryPartForSha512Password (string $password, DatabaseInterface $database, string $userCondition, string $shopCondition) | |
formQueryPartForMD5Password ($password, DatabaseInterface $databaseb) | |
formQueryPartForAdminView ($sShopID, $blAdmin) | |
formUserCookieQuery ($user, $shopId) | |
Protected Attributes | |
$_blDisableShopCheck = true | |
$_oNewsSubscription = null | |
$_sClassName = 'oxuser' | |
$_aBaskets = [] | |
$_oGroups | |
$_aAddresses = [] | |
$_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 = [] |
Private Member Functions | |
loadAuthenticatedUser (string $userName, int $shopId) | |
getAuthenticatedUserId (string $userName, int $shopId, bool $isLoginToAdminBackend) | |
hashPassword (string $password) | |
deleteUserFromGroups (DatabaseInterface $database) | |
deleteDeliveries (DatabaseInterface $database) | |
deleteDiscounts (DatabaseInterface $database) | |
deleteAcceptedTerms (DatabaseInterface $database) | |
deleteAddresses (DatabaseInterface $database) | |
deleteBaskets (DatabaseInterface $database) | |
deleteNotOrderRelatedRemarks (DatabaseInterface $database) | |
deleteRecommendationLists (DatabaseInterface $database) | |
deleteNewsletterSubscriptions (DatabaseInterface $database) | |
deleteReviews (DatabaseInterface $database) | |
deleteRatings (DatabaseInterface $database) | |
deletePriceAlarms (DatabaseInterface $database) | |
deleteItemById ($id, $key, $className) | |
formQueryPartForUserName ($user, DatabaseInterface $database) | |
formQueryPartForActiveUser () | |
Private Attributes | |
$isOutdatedPasswordHashAlgorithmUsed = false | |
User manager. Performs user managing function, as assigning to groups, updating information, deletion and other.
OxidEsales\EshopCommunity\Application\Model\User::__construct | ( | ) |
Class constructor, initiates parent constructor (parent::oxBase()).
OxidEsales\EshopCommunity\Application\Model\User::__get | ( | $sParamName | ) |
Getter for special not frequently used fields
string | $sParamName | name of parameter to get value |
|
protected |
creates new address entry or updates existing
array | $aDelAddress | address data array |
|
protected |
Initiates user login against data in DB.
UserException |
\OxidEsales\EshopCommunity\Internal\Domain\Authentication\Bridge\PasswordServiceBridgeInterface
was added as the new default for hashing passwords. Hashing passwords with MD5 and SHA512 is still supported in order support login with older password hashes. Therefor this method might not be compatible with the current passhword hash any more.
|
protected |
Checks if user is connected via cookies and if so, returns user id.
|
protected |
|
protected |
Builds and returns user login query
string | $userName | |
string | $password | |
int | $shopId | |
bool | $isAdmin |
\OxidEsales\EshopCommunity\Internal\Domain\Authentication\Bridge\PasswordServiceBridgeInterface
was added as the new default for hashing passwords. Hashing passwords with MD5 and SHA512 is still supported in order support login with older password hashes. Therefor this method might not be compatible with the current passhword hash any more.
|
protected |
Builds and returns user login query.
MD5 encoding is used in legacy eShop versions. We still allow to perform the login for users registered in the previous eshop versions.
string | $userName | login name |
string | $password | login password |
string | $shopId | shopid |
bool | $isAdmin | admin/non admin mode |
\OxidEsales\EshopCommunity\Internal\Domain\Authentication\Bridge\PasswordServiceBridgeInterface
was added as the new default for hashing passwords. Hashing passwords with MD5 and SHA512 is still supported in order support login with older password hashes. Therefor this method might not be compatible with the current passhword hash any more.
|
protected |
Returns merged delivery address fields.
|
protected |
Returns shopselect part of login query sql
object | $myConfig | shop config |
string | $sShopID | shopid |
bool | $blAdmin | admin/non admin mode |
|
protected |
Gets state object.
|
protected |
Returns user rights index. Index cannot be higher than current session user rights index.
|
protected |
Checks if product from wishlist is added
|
protected |
Inserts user object data to DB. Returns true on success.
|
protected |
Return true - if shop is in demo mode
|
protected |
Login for Ldap
string | $sUser | User username |
string | $sPassword | User password |
string | $sShopID | Shop id |
string | $sShopSelect | Shop select |
$oEx | if user is wrong |
|
protected |
Automatically assigns user to specific groups according to users country information
string | $sCountryId | users country id |
|
protected |
Updates changed user object data to DB. Returns true on success.
OxidEsales\EshopCommunity\Application\Model\User::acceptTerms | ( | ) |
Writes terms acceptance info to db
OxidEsales\EshopCommunity\Application\Model\User::addToGroup | ( | $sGroupID | ) |
Adds user to the group
string | $sGroupID | group id |
OxidEsales\EshopCommunity\Application\Model\User::allowDerivedUpdate | ( | ) |
Overrides parent isDerived check and returns true
OxidEsales\EshopCommunity\Application\Model\User::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 (\OxidEsales\Eshop\Application\Model\User::_setAutoGroups, \OxidEsales\Eshop\Application\Model\User::setNewsSubscription) to perform automatic groups assignment and returns newsletter subscription status. If some action fails - exception is thrown.
string | $sUser | user login name |
string | $sPassword | user password |
string | $sPassword2 | user confirmation password |
array | $aInvAddress | user billing address |
array | $aDelAddress | delivery address |
UserException,oxInputException,oxConnectionException |
OxidEsales\EshopCommunity\Application\Model\User::checkIfEmailExists | ( | $sEmail | ) |
Checks for already used email
string | $sEmail | user email/login |
OxidEsales\EshopCommunity\Application\Model\User::checkValues | ( | $sLogin, | |
$sPassword, | |||
$sPassword2, | |||
$aInvAddress, | |||
$aDelAddress | |||
) |
Performs bunch of checks if user profile data is correct; on any error exception is thrown
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 |
UserException,oxInputException |
OxidEsales\EshopCommunity\Application\Model\User::convertBirthday | ( | $aData | ) |
User birthday converter. Usually this data comes in array form, so before writing into DB it must be converted into string
array | $aData | birthday data |
OxidEsales\EshopCommunity\Application\Model\User::createUser | ( | ) |
Inserts new or updates existing user
UserException | exception |
OxidEsales\EshopCommunity\Application\Model\User::delete | ( | $oxid = null | ) |
Removes user data stored in some DB tables (such as oxuserpayments, oxaddress oxobject2group, oxremark, etc). Return true on success.
string | $oxid | object ID (default null) |
|
private |
Deletes user accepted terms.
DatabaseInterface | $database |
|
protected |
Method is used to make additional delete actions.
string | $sOXIDQuoted |
|
private |
Deletes User addresses.
DatabaseInterface | $database |
|
private |
Deletes noticelists, wishlists or saved baskets
DatabaseInterface | $database |
|
private |
Deletes deliveries.
DatabaseInterface | $database |
|
private |
Deletes discounts.
DatabaseInterface | $database |
|
private |
Callback function for array_walk to delete items using the delete method of the given model class
string | $id | Id of the item to be deleted |
integer | $key | Key of the array |
string | $className | Model class to be used |
|
private |
Deletes newsletter subscriptions.
DatabaseInterface | $database |
|
private |
Deletes not Order related remarks.
DatabaseInterface | $database |
|
private |
Deletes price alarms.
DatabaseInterface | $database |
|
private |
Deletes User ratings.
DatabaseInterface | $database |
|
private |
Deletes recommendation lists.
DatabaseInterface | $database |
|
private |
Deletes User reviews.
DatabaseInterface | $database |
|
private |
Deletes User from groups.
DatabaseInterface | $database |
OxidEsales\EshopCommunity\Application\Model\User::encodePassword | ( | $sPassword, | |
$sSalt | |||
) |
Encodes and returns given password
string | $sPassword | password to encode |
string | $sSalt | any unique string value |
\OxidEsales\EshopCommunity\Internal\Domain\Authentication\Bridge\PasswordServiceBridgeInterface
was added as the new default for hashing passwords. Hashing passwords with MD5 and SHA512 is still supported in order support login with older password hashes. Therefor this method might not be compatible with the current passhword hash any more.OxidEsales\EshopCommunity\Application\Model\User::exists | ( | $sOXID = null | ) |
Checks if user exists in database.
string | $sOXID | object ID (default null) |
|
private |
|
protected |
Forms shop select query.
string | $sShopID | Shop id is used when method is overridden. |
bool | $blAdmin |
|
protected |
string | $password | |
DatabaseInterface | $databaseb |
\OxidEsales\EshopCommunity\Internal\Domain\Authentication\Bridge\PasswordServiceBridgeInterface
was added as the new default for hashing passwords. Hashing passwords with MD5 and SHA512 is still supported in order support login with older password hashes. Therefor this method might not be compatible with the current passhword hash any more.
|
protected |
string | $password | |
DatabaseInterface | $database | |
string | $userCondition | |
string | $shopCondition |
\OxidEsales\EshopCommunity\Internal\Domain\Authentication\Bridge\PasswordServiceBridgeInterface
was added as the new default for hashing passwords. Hashing passwords with MD5 and SHA512 is still supported in order support login with older password hashes. Therefor this method might not be compatible with the current passhword hash any more.
|
private |
string | $user | |
DatabaseInterface | $database |
|
protected |
Updates given query. Method is for overriding.
string | $user | |
string | $shopId |
OxidEsales\EshopCommunity\Application\Model\User::getActiveCountry | ( | ) |
Returns user country ID, but If delivery address is given - returns delivery country.
|
private |
string | $userName | |
int | $shopId | |
bool | $isLoginToAdminBackend |
OxidEsales\EshopCommunity\Application\Model\User::getBasket | ( | $sName | ) |
Returns notice, wishlist or saved basket object
string | $sName | name/type of basket |
OxidEsales\EshopCommunity\Application\Model\User::getBoni | ( | ) |
Return standard credit rating, can be set in config option iCreditRating;
OxidEsales\EshopCommunity\Application\Model\User::getEncodedDeliveryAddress | ( | ) |
Returns encoded delivery address.
OxidEsales\EshopCommunity\Application\Model\User::getIdByUserName | ( | $userName | ) |
return user id by user name
string | $userName |
OxidEsales\EshopCommunity\Application\Model\User::getNewsSubscription | ( | ) |
Returns user newsletter subscription controller object
OxidEsales\EshopCommunity\Application\Model\User::getNoticeListArtCnt | ( | ) |
Returns amount of articles in noticelist
OxidEsales\EshopCommunity\Application\Model\User::getOrderCount | ( | ) |
Caclulates amount of orders made by user
OxidEsales\EshopCommunity\Application\Model\User::getOrders | ( | $iLimit = false , |
|
$iPage = 0 |
|||
) |
Returns object with ordering information (order articles list).
int | $iLimit | how many entries to load |
int | $iPage | which page to start |
|
protected |
string | $userName | |
int | $shopId | |
bool | $isLoginToAdminBackend |
OxidEsales\EshopCommunity\Application\Model\User::getRecommListsCount | ( | $sOx = null | ) |
Returns recommlist count
string | $sOx | object ID (default is null) |
OxidEsales\EshopCommunity\Application\Model\User::getReviewUserHash | ( | $sUserId | ) |
Generates user password and username hash for review
string | $sUserId | userid |
OxidEsales\EshopCommunity\Application\Model\User::getReviewUserId | ( | $sReviewUserHash | ) |
Gets from review user hash user id
string | $sReviewUserHash | review user hash |
OxidEsales\EshopCommunity\Application\Model\User::getSelectedAddress | ( | ) |
Sets in the array \OxidEsales\Eshop\Application\Model\User::_aAddresses selected address. Returns user selected address object.
OxidEsales\EshopCommunity\Application\Model\User::getSelectedAddressId | ( | ) |
Returns user chosen address id ("oxaddressid" or "deladrid")
OxidEsales\EshopCommunity\Application\Model\User::getStateId | ( | ) |
Get state id for current user
OxidEsales\EshopCommunity\Application\Model\User::getStateTitle | ( | $sId = null | ) |
Get state title by id
string | $sId | state ID |
OxidEsales\EshopCommunity\Application\Model\User::getUpdateId | ( | ) |
Returns user passwords update id
OxidEsales\EshopCommunity\Application\Model\User::getUpdateLinkTerm | ( | ) |
Return password update link validity term (seconds). Default 3600 * 6
OxidEsales\EshopCommunity\Application\Model\User::getUserAddresses | ( | $sUserId = null | ) |
Returns user defined Address list object
string | $sUserId | object ID (default is null) |
OxidEsales\EshopCommunity\Application\Model\User::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)
string | $sCountryId | country id (optional) |
int | $iLang | active language (optional) |
OxidEsales\EshopCommunity\Application\Model\User::getUserCountryId | ( | $sCountry = null | ) |
Returns user countryid according to passed name
string | $sCountry | country |
OxidEsales\EshopCommunity\Application\Model\User::getUserGroups | ( | $sOXID = null | ) |
Returns assigned user groups list object
string | $sOXID | object ID (default is null) |
OxidEsales\EshopCommunity\Application\Model\User::getUserPayments | ( | $sOXID = null | ) |
Returns user payment history list object
string | $sOXID | object ID (default is null) |
OxidEsales\EshopCommunity\Application\Model\User::getUserRecommLists | ( | $sOXID = null | ) |
Returns user recommendation list object
string | $sOXID | object ID (default is null) |
|
protected |
OxidEsales\EshopCommunity\Application\Model\User::getWishListArtCnt | ( | ) |
Calculating user wishlist item count
OxidEsales\EshopCommunity\Application\Model\User::hasAccount | ( | ) |
returns true if user registered and have account
|
private |
string | $password |
OxidEsales\EshopCommunity\Application\Model\User::inGroup | ( | $sGroupID | ) |
Checks if this object is in group, returns true on success.
string | $sGroupID | user group ID |
OxidEsales\EshopCommunity\Application\Model\User::isExpiredUpdateId | ( | $sKey | ) |
Checks if password update key is not expired yet
string | $sKey | key |
OxidEsales\EshopCommunity\Application\Model\User::isLoadedFromCookie | ( | ) |
Returns if user was loaded from cookie
OxidEsales\EshopCommunity\Application\Model\User::isMallAdmin | ( | ) |
Returns true if User is mall admin.
OxidEsales\EshopCommunity\Application\Model\User::isPriceViewModeNetto | ( | ) |
Return user price view mode, true - if netto mode
OxidEsales\EshopCommunity\Application\Model\User::isSamePassword | ( | $password | ) |
Checks if user entered password is the same as old
string | $password | new password |
OxidEsales\EshopCommunity\Application\Model\User::isTermsAccepted | ( | ) |
Checks if user accepted latest shopping terms and conditions version
OxidEsales\EshopCommunity\Application\Model\User::load | ( | $oxID | ) |
Loads object (user) details from DB. Returns true on success.
string | $oxID | User ID |
OxidEsales\EshopCommunity\Application\Model\User::loadActiveUser | ( | $blForceAdmin = false | ) |
Loads active user object. If user is not available - returns false.
bool | $blForceAdmin | (default false) |
OxidEsales\EshopCommunity\Application\Model\User::loadAdminUser | ( | ) |
Loads active admin user object (if possible). If user is not available - returns false.
|
private |
string | $userName | |
int | $shopId |
UserException |
OxidEsales\EshopCommunity\Application\Model\User::loadUserByUpdateId | ( | $sUid | ) |
Tries to load user object by passed update id. Update id is generated when user forgot passwords and wants to update it
string | $sUid | update id |
OxidEsales\EshopCommunity\Application\Model\User::login | ( | $userName, | |
$password, | |||
$setSessionCookie = false |
|||
) |
Performs user login by username and password. Fetches user data from DB. Registers in session. Returns true on success, FALSE otherwise.
NOTE: It the user has already been loaded prior calling \OxidEsales\Eshop\Application\Model\User::login, NO valid password is necessary for login.
string | $userName | User username |
string | $password | User password |
bool | $setSessionCookie | (default false) |
object | |
oxCookieException | |
UserException |
OxidEsales\EshopCommunity\Application\Model\User::logout | ( | ) |
Logs out session user. Returns true on success
|
protected |
Method used for override.
array | $aInvAddress |
|
protected |
Method is used for overriding and add additional actions when logging in.
string | $userName | |
string | $password |
OxidEsales\EshopCommunity\Application\Model\User::onOrderExecute | ( | $oBasket, | |
$iSuccess | |||
) |
Called after saving an order.
object | $oBasket | Shopping basket object |
int | $iSuccess | order success status |
OxidEsales\EshopCommunity\Application\Model\User::removeFromGroup | ( | $sGroupID = null | ) |
Removes user from passed user group.
string | $sGroupID | group id |
OxidEsales\EshopCommunity\Application\Model\User::save | ( | ) |
Saves (updates) user object data information in DB. Return true on success.
OxidEsales\EshopCommunity\Application\Model\User::setCreditPointsForInviter | ( | ) |
Assigns credit points to inviter
OxidEsales\EshopCommunity\Application\Model\User::setCreditPointsForRegistrant | ( | $sUserId, | |
$sRecEmail | |||
) |
Assigns registration points for invited user and its inviter (calls \OxidEsales\Eshop\Application\Model\User::setInvitationCreditPoints())
string | $sUserId | inviter user id |
string | $sRecEmail | recipient (registrant) email |
OxidEsales\EshopCommunity\Application\Model\User::setMallUsersStatus | ( | $blOn = false | ) |
Sets mall user status
bool | $blOn | mall users is on or off |
OxidEsales\EshopCommunity\Application\Model\User::setNewsSubscription | ( | $blSubscribe, | |
$blSendOptIn, | |||
$blForceCheckOptIn = false |
|||
) |
Sets newsletter subscription status to user
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 |
OxidEsales\EshopCommunity\Application\Model\User::setPassword | ( | $password = null | ) |
Sets new password for user ( save is not called)
string | $password | password |
OxidEsales\EshopCommunity\Application\Model\User::setSelectedAddressId | ( | $sAddressId | ) |
Selected user address setter
string | $sAddressId | selected address id |
OxidEsales\EshopCommunity\Application\Model\User::setUpdateKey | ( | $blReset = false | ) |
Generates or resets and saves users update key
bool | $blReset | marker to reset update info |
|
protected |
Updates query for selecting orders.
string | $query |
OxidEsales\EshopCommunity\Application\Model\User::updateInvitationStatistics | ( | $aRecEmail | ) |
Updating invitations statistics
array | $aRecEmail | array of recipients emails |
|
protected |
|
protected |
|
staticprotected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
private |
const OxidEsales\EshopCommunity\Application\Model\User::USER_COOKIE_SALT = 'user_cookie_salt' |