roundcubemail/program/lib/Roundcube/rcube_user.php
function failed_login()
    {
        if ($this->ID && ($rate = (int) $this->rc->config->get('login_rate_limit', 3))) {
            if (empty($this->data['failed_login'])) {
                $failed_login = new DateTime('now');
                $counter      = 1;
            }
            else {
                $failed_login = new DateTime($this->data['failed_login']);
                $threshold    = new DateTime('- 60 seconds');

                if ($failed_login < $threshold) {
                    $failed_login = new DateTime('now');
                    $counter      = 1;
                }
            }

            $this->db->query(
                "UPDATE " . $this->db->table_name('users', true)
                    . " SET `failed_login` = ?"
                    . ", `failed_login_counter` = " . ($counter ?: "`failed_login_counter` + 1")
                . " WHERE `user_id` = ?",
                $failed_login, $this->ID);
        }
    }
function failed_login()
    {
        if ($this->ID && ($rate = (int) $this->rc->config->get('login_rate_limit', 3))) {
            if (empty($this->data['failed_login'])) {
                $failed_login = new DateTime('now');
                $counter      = 1;
            }
            else {
                $failed_login = new DateTime($this->data['failed_login']);
                $threshold    = new DateTime('- 60 seconds');

                if ($failed_login < $threshold) {
                    $failed_login = new DateTime('now');
                    $counter      = 1;
                }
            }

            $this->db->query(
                "UPDATE " . $this->db->table_name('users', true)
                    . " SET `failed_login` = ?"
                    . ", `failed_login_counter` = " . ($counter ?: "`failed_login_counter` + 1")
                . " WHERE `user_id` = ?",
                $failed_login, $this->ID);
        }
    }
function failed_login ( ) { if ( $ this -> ID && ( $ rate = ( int ) $ this -> rc -> config -> get ( 'login_rate_limit' , 3 ) ) ) { if ( empty ( $ this -> data [ 'failed_login' ] ) ) { $ failed_login = new DateTime ( 'now' ) ; $ counter = 1 ; } else { $ failed_login = new DateTime ( $ this -> data [ 'failed_login' ] ) ; $ threshold = new DateTime ( '- 60 seconds' ) ; if ( $ failed_login < $ threshold ) { $ failed_login = new DateTime ( 'now' ) ; $ counter = 1 ; } } $ this -> db -> query ( "UPDATE " . $ this -> db -> table_name ( 'users' , true ) . " SET `failed_login` = ?" . ", `failed_login_counter` = " . ( $ counter ? : "`failed_login_counter` + 1" ) . " WHERE `user_id` = ?" , $ failed_login , $ this -> ID ) ; } }
Update user's failed_login timestamp and counter
Update user s failed_login timestamp and counter