45 \
Magento\Framework\Stdlib\DateTime\DateTime $coreDate,
46 \
Magento\Framework\HTTP\PhpEnvironment\RemoteAddress $remoteAddress,
49 $this->_coreDate = $coreDate;
50 $this->_remoteAddress = $remoteAddress;
77 'type' => self::TYPE_LOGIN,
80 'updated_at' => $this->_coreDate->gmtDate()
82 [
'count' => new \Zend\Db\Sql\Expression(
'count+1'),
'updated_at']
85 $ip = $this->_remoteAddress->getRemoteAddress();
90 'type' => self::TYPE_REMOTE_ADDRESS,
93 'updated_at' => $this->_coreDate->gmtDate()
95 [
'count' => new \Zend\Db\Sql\Expression(
'count+1'),
'updated_at']
110 if ($login !=
null) {
113 [
'type = ?' => self::TYPE_LOGIN,
'value = ?' => $login]
116 $ip = $this->_remoteAddress->getRemoteAddress();
120 [
'type = ?' => self::TYPE_REMOTE_ADDRESS,
'value = ?' => $ip]
135 $ip = $this->_remoteAddress->getRemoteAddress();
145 self::TYPE_REMOTE_ADDRESS
189 [
'updated_at < ?' => $this->_coreDate->gmtDate(
null,
time() - 60 * 30)]
countAttemptsByUserLogin($login)
countAttemptsByRemoteAddress()
const TYPE_REMOTE_ADDRESS
__construct(\Magento\Framework\Model\ResourceModel\Db\Context $context, \Magento\Framework\Stdlib\DateTime\DateTime $coreDate, \Magento\Framework\HTTP\PhpEnvironment\RemoteAddress $remoteAddress, $connectionName=null)
_setMainTable($mainTable, $idFieldName=null)
deleteUserAttempts($login)