summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYury German <blueknight@gentoo.org>2019-05-22 01:01:36 -0400
committerYury German <blueknight@gentoo.org>2019-05-22 01:01:36 -0400
commit0914c92da22824025992c368c745546e41fbeb84 (patch)
tree965f6adf3b725e56d559fe4a93eff02281499dcc /plugins/jetpack/sync/class.jetpack-sync-module-protect.php
parentDeleting plugins for update (diff)
downloadblogs-gentoo-0914c92da22824025992c368c745546e41fbeb84.tar.gz
blogs-gentoo-0914c92da22824025992c368c745546e41fbeb84.tar.bz2
blogs-gentoo-0914c92da22824025992c368c745546e41fbeb84.zip
Adding Plugins
Updating the following akismet.4.1.2, google-authenticator.0.52, jetpack.7.3.1 Signed-off-by: Yury German <blueknight@gentoo.org>
Diffstat (limited to 'plugins/jetpack/sync/class.jetpack-sync-module-protect.php')
-rw-r--r--plugins/jetpack/sync/class.jetpack-sync-module-protect.php23
1 files changed, 23 insertions, 0 deletions
diff --git a/plugins/jetpack/sync/class.jetpack-sync-module-protect.php b/plugins/jetpack/sync/class.jetpack-sync-module-protect.php
new file mode 100644
index 00000000..a8dcd43e
--- /dev/null
+++ b/plugins/jetpack/sync/class.jetpack-sync-module-protect.php
@@ -0,0 +1,23 @@
+<?php
+
+/**
+ * logs bruteprotect failed logins via sync
+ */
+class Jetpack_Sync_Module_Protect extends Jetpack_Sync_Module {
+
+ function name() {
+ return 'protect';
+ }
+
+ function init_listeners( $callback ) {
+ add_action( 'jpp_log_failed_attempt', array( $this, 'maybe_log_failed_login_attempt' ) );
+ add_action( 'jetpack_valid_failed_login_attempt', $callback );
+ }
+
+ function maybe_log_failed_login_attempt( $failed_attempt ) {
+ $protect = Jetpack_Protect_Module::instance();
+ if ( $protect->has_login_ability() && ! Jetpack_Constants::is_true( 'XMLRPC_REQUEST' ) ) {
+ do_action( 'jetpack_valid_failed_login_attempt', $failed_attempt );
+ }
+ }
+}