Code
Explorer
You are a developer and looking for Shopware projects?
Apply Now!
setFailedLogins example
$customer
->
setActive
(
$data
[
'__customer_active'
]
)
;
$customer
->
setAccountMode
(
$data
[
'__customer_accountmode'
]
)
;
$customer
->
setConfirmationKey
(
$data
[
'__customer_confirmationkey'
]
)
;
$customer
->
setPaymentId
(
$data
[
'__customer_paymentID'
]
)
;
$customer
->
setValidation
(
$data
[
'__customer_validation'
]
)
;
$customer
->
setAffiliate
(
$data
[
'__customer_affiliate'
]
)
;
$customer
->
setPaymentPreset
(
$data
[
'__customer_paymentpreset'
]
)
;
$customer
->
setLanguageId
(
$data
[
'__customer_language'
]
)
;
$customer
->
setShopId
(
$data
[
'__customer_subshopID'
]
)
;
$customer
->
setReferer
(
$data
[
'__customer_referer'
]
)
;
$customer
->
setInternalComment
(
$data
[
'__customer_internalcomment'
]
)
;
$customer
->
setFailedLogins
(
$data
[
'__customer_failedlogins'
]
)
;
$customer
->
setDefaultBillingAddressId
(
$data
[
'__customer_default_billing_address_id'
]
)
;
$customer
->
setDefaultShippingAddressId
(
$data
[
'__customer_default_shipping_address_id'
]
)
;
$customer
->
setTitle
(
$data
[
'__customer_title'
]
)
;
$customer
->
setSalutation
(
$data
[
'__customer_salutation'
]
)
;
$customer
->
setFirstname
(
$data
[
'__customer_firstname'
]
)
;
$customer
->
setLastname
(
$data
[
'__customer_lastname'
]
)
;
$customer
->
setNumber
(
$data
[
'__customer_customernumber'
]
)
;
$customer
->
setNewsletter
(
(bool)
$data
[
'__active_campaign'
]
)
;
if
(
$data
[
'__customer_birthday'
]
)
{
$customer
->
setBirthday
(
new
DateTime
(
$data
[
'__customer_birthday'
]
)
)
;
}
}
$this
->session->
migrate
(
true
)
;
$this
->
setSessionId
(
$this
->session->
getId
(
)
)
;
$this
->
updateExpiry
(
)
;
$this
->
updateSessionId
(
)
;
// Reset failed login count
$this
->
setFailedLogins
(
0
)
;
}
elseif
(
$user
)
{
// If more than 4 previous failed logins lock account for n * failedlogins seconds
if
(
$user
->failedlogins >= 4
)
{
$lockedUntil
=
new
Zend_Date
(
)
;
$lockedUntil
->
addSecond
(
$this
->lockSeconds *
$user
->failedlogins
)
;
$this
->
setLockedUntil
(
$lockedUntil
)
;
}
// Increase number of failed logins
$this
->
setFailedLogins
(
$user
->failedlogins + 1
)
;
if
(
isset
(
$lockedUntil
)
)
{
return
new
Zend_Auth_Result
(
-