Title: [271175] trunk/Websites/webkit.org
Revision
271175
Author
[email protected]
Date
2021-01-05 14:37:34 -0800 (Tue, 05 Jan 2021)

Log Message

Enforce strong password changes on webkit.org blog
https://bugs.webkit.org/show_bug.cgi?id=220027

Reviewed by Timothy Hatcher.

* wp-content/plugins/strong-passwords.php: Added.

Modified Paths

Added Paths

Diff

Modified: trunk/Websites/webkit.org/ChangeLog (271174 => 271175)


--- trunk/Websites/webkit.org/ChangeLog	2021-01-05 22:30:31 UTC (rev 271174)
+++ trunk/Websites/webkit.org/ChangeLog	2021-01-05 22:37:34 UTC (rev 271175)
@@ -1,3 +1,12 @@
+2021-01-05  Jon Davis  <[email protected]>
+
+        Enforce strong password changes on webkit.org blog
+        https://bugs.webkit.org/show_bug.cgi?id=220027
+
+        Reviewed by Timothy Hatcher.
+
+        * wp-content/plugins/strong-passwords.php: Added.
+
 2020-12-11  Ryan Haddad  <[email protected]>
 
         Add Big Sur to WebKit Build Archives page

Added: trunk/Websites/webkit.org/wp-content/plugins/strong-passwords.php (0 => 271175)


--- trunk/Websites/webkit.org/wp-content/plugins/strong-passwords.php	                        (rev 0)
+++ trunk/Websites/webkit.org/wp-content/plugins/strong-passwords.php	2021-01-05 22:37:34 UTC (rev 271175)
@@ -0,0 +1,42 @@
+<?php
+/*
+Plugin Name: Strong Passwords
+Description: Enforce strong passwords
+Version:     1.0
+Author:      Jonathan Davis
+Author URI:  http://webkit.org
+*/
+
+function enforce_strong_passwords () {
+    wp_add_inline_script('user-profile','
+        jQuery(document).ready(function($) {
+            $weakRow = $(".pw-weak").remove();
+            $pass1 = $("#pass1");
+            $pass1Text = $("#pass1-text");
+            $submitButtons = $("input[type=submit]");
+            
+            function allowOrDisableSubmit() {
+                var passStrength = $("#pass-strength-result")[0];
+
+                if ( passStrength.className ) {
+                    if ( $( passStrength ).is( ".short, .bad, .good" ) ) {
+                        $submitButtons.prop( "disabled", true );
+                    } else {
+                        $submitButtons.prop( "disabled", false );
+                    }
+                }
+            }
+
+            currentPass = $pass1.val();
+            $pass1.on( "input pwupdate", function () {
+                if ( $pass1.val() === currentPass ) {
+                    return;
+                }
+                allowOrDisableSubmit();
+            } );
+        });
+    ','after');
+}
+
+add_action( 'admin_enqueue_scripts', 'enforce_strong_passwords' );
+add_action( 'login_enqueue_scripts', 'enforce_strong_passwords' );
\ No newline at end of file
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to