host = $host; } /** * Get the host being locked out. * * @return string */ public function get_host() { return $this->host; } /** * Get whether this is a Network Brute Force generated lockout. * * @return bool */ public function is_network_brute_force() { return $this->network_brute_force; } /** * Set that this is a Network Brute Force generated lockout. * * @return $this */ public function set_network_brute_force() { $this->network_brute_force = true; return $this; } /** * If this lockout occurred while trying to login as a user, * this will return the user ID that was trying to be logged-in-to. * * @return int|null */ public function get_login_user_id() { return $this->login_user_id; } /** * Set who is being logging in as. * * @param int $user_id * * @return $this */ public function set_login_user_id( $user_id ) { $this->login_user_id = $user_id; return $this; } /** * If this lockout occurred while trying to login to a non-existent user, * this will return that username. * * @return string */ public function get_login_username() { return $this->login_username; } /** * Set which username is being logged in as. * * @param string $login_username * * @return Host_Context */ public function set_login_username( $login_username ) { $this->login_username = $login_username; return $this; } public function to_legacy() { $legacy = parent::to_legacy(); $legacy['host'] = $this->get_host(); $legacy['network_lock'] = $this->is_network_brute_force(); return $legacy; } }