__( 'Login Locked Out / IP Banned', 'advanced-form-integration' ), ); } // Get Defender Security Fields function adfoin_defendersecurity_get_form_fields( $form_provider, $form_id ) { if ( $form_provider !== 'defendersecurity' || $form_id !== 'loginLockout' ) { return; } return array( 'ip_address' => __( 'IP Address', 'advanced-form-integration' ), 'scenario' => __( 'Scenario (ban or login_lockout)', 'advanced-form-integration' ), 'attempt_count' => __( 'Failed Attempt Count', 'advanced-form-integration' ), 'lockout_message' => __( 'Lockout Message', 'advanced-form-integration' ), 'lock_time' => __( 'Lock Time (timestamp)', 'advanced-form-integration' ), 'release_time' => __( 'Release Time (timestamp, if temporary)', 'advanced-form-integration' ), ); } // Handle Login Lockout / IP Ban function adfoin_defendersecurity_handle_lockout( $model, $scenario ) { if ( ! is_object( $model ) || empty( $model->ip ) ) { return; } $integration = new Advanced_Form_Integration_Integration(); $saved_records = $integration->get_by_trigger( 'defendersecurity', 'loginLockout' ); if ( empty( $saved_records ) ) { return; } $posted_data = array( 'ip_address' => $model->ip, 'scenario' => $scenario, 'attempt_count' => isset( $model->attempt ) ? $model->attempt : '', 'lockout_message' => isset( $model->lockout_message ) ? $model->lockout_message : '', 'lock_time' => isset( $model->lock_time ) ? $model->lock_time : '', 'release_time' => isset( $model->release_time ) ? $model->release_time : '', ); adfoin_dispatch_integrations( $saved_records, $posted_data ); }