This commit is contained in:
Javier Casares 2026-06-06 05:08:20 +00:00
commit 054060374e

View file

@ -21,7 +21,7 @@ class Two_Factor_Config {
/**
* Retrieve global two-factor settings with multisite support.
*
* @return array{role_methods: array<string, array<int, string>>, frequency: string, force_frequency: bool, delete_on_uninstall: bool, max_attempts: int, lockout_duration: int, trust_device_days: int, grace_period_days: int, grace_period_action: string, app_passwords_exempt: bool, ip_allow: string, ip_deny: string, notifications: array{on_enable: bool, on_new_ip: bool, on_recovery_used: bool, on_recovery_used_admin: bool, digest_enabled: bool, digest_frequency: string}}
* @return array{role_methods: array<string, array<int, string>>, frequency: string, force_frequency: bool, delete_on_uninstall: bool, max_attempts: int, lockout_duration: int, trust_device_days: int, grace_period_days: int, grace_period_action: string, app_passwords_exempt: bool, ip_allow: string, ip_deny: string, notifications: array{on_enable: bool, on_new_ip: bool, on_recovery_used: bool, on_recovery_used_admin: bool, digest_enabled: bool, digest_frequency: string}, app_passwords_require_2fa_creation: bool, geoip_database_path: string, geoip_country_allow: string, geoip_country_deny: string, geoip_always_challenge: string}
*/
public function get_settings(): array {
$settings_page = new Settings_Page();
@ -225,4 +225,59 @@ class Two_Factor_Config {
public function get_notifications(): array {
return $this->get_settings()['notifications'];
}
/**
* Determine whether a recent 2FA verification is required before creating an Application Password.
*
* @since 1.5.0
*
* @return bool
*/
public function is_app_passwords_require_2fa_creation(): bool {
return $this->get_settings()['app_passwords_require_2fa_creation'];
}
/**
* Retrieve the GeoIP database file path.
*
* @since 1.5.0
*
* @return string
*/
public function get_geoip_database_path(): string {
return $this->get_settings()['geoip_database_path'];
}
/**
* Retrieve the GeoIP country allow list string (newline-separated ISO codes).
*
* @since 1.5.0
*
* @return string
*/
public function get_geoip_country_allow(): string {
return $this->get_settings()['geoip_country_allow'];
}
/**
* Retrieve the GeoIP country deny list string (newline-separated ISO codes).
*
* @since 1.5.0
*
* @return string
*/
public function get_geoip_country_deny(): string {
return $this->get_settings()['geoip_country_deny'];
}
/**
* Retrieve the GeoIP always-challenge country list string (newline-separated ISO codes).
*
* @since 1.5.0
*
* @return string
*/
public function get_geoip_always_challenge(): string {
return $this->get_settings()['geoip_always_challenge'];
}
}