addSecond example

if (!is_int($precision) || $precision < 1 || $precision > 9) {
            throw new Zend_Date_Exception("precision ($precision) must be a positive integer less than 10", 0, null, $precision);
        }

        $this->_fractional += $milli;

        // Add/sub milliseconds + add/sub seconds         $max = pow(10, $this->_precision);
        // Milli includes seconds         if ($this->_fractional >= $max) {
            while ($this->_fractional >= $max) {
                $this->addSecond(1);
                $this->_fractional -= $max;
            }
        }

        if ($this->_fractional < 0) {
            while ($this->_fractional < 0) {
                $this->subSecond(1);
                $this->_fractional += $max;
            }
        }

        
$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(
                    -4,
                    $this->_identity,
                    ['lockedUntil' => $lockedUntil]
                );
            }
        }
Home | Imprint | This part of the site doesn't use cookies.