From 36d4201544deaa69b3bb25d583e0c65c4efcd431 Mon Sep 17 00:00:00 2001
From: David Roberts <david.roberts@ptfs-europe.com>
Date: Tue, 26 May 2015 21:09:18 +0000
Subject: [PATCH] Add password strength to member-password screen

http://bugs.koha-community.org/show_bug.cgi?id=13664
---
 .../intranet-tmpl/prog/en/modules/members/member-password.tt |   10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/members/member-password.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/members/member-password.tt
index 4cb04ef..bb01e29 100644
--- a/koha-tmpl/intranet-tmpl/prog/en/modules/members/member-password.tt
+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/members/member-password.tt
@@ -44,6 +44,7 @@
 <body id="pat_member-password" class="pat">
 [% INCLUDE 'header.inc' %]
 [% INCLUDE 'patron-search.inc' %]
+[% INCLUDE 'complexify.inc' %]
 
 <div id="breadcrumbs"><a href="/cgi-bin/koha/mainpage.pl">Home</a> &rsaquo; <a href="/cgi-bin/koha/members/members-home.pl">Patrons</a>  &rsaquo; <a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% borrowernumber %]">[% firstname %] [% surname %]</a> &rsaquo; [% IF ( newpassword ) %]Password Updated[% ELSE %]Change username and/or password[% END %]</div>
 
@@ -83,6 +84,12 @@
 		</div>
 	[% END %]
 
+<script src="https://raw.github.com/danpalmer/jquery.complexify.js/master/jquery.complexify.js"></script>
+      <script type="text/javascript"> $(function () {
+           $("#newpassword").complexify({}, function (valid, complexity) {               document.getElementById("PassValue").value = complexity;
+           });
+       });
+</script>
 
     <fieldset class="brief"><legend>Change username and/or password for [% firstname %] [% surname %]</legend>
 	<ol>
@@ -96,6 +103,9 @@
 	<input name="newpassword" id="newpassword_random" readonly="readonly" disabled="disabled" type="hidden" />
 	[% ELSE %]
 	<input name="newpassword"  id="newpassword" type="password" size="20" />
+[% IF (PasswordStrength) %]
+<meter value="0" id="PassValue" max="100"></meter>
+[% END %]
 	<input name="newpassword" readonly="readonly" disabled="disabled" type="hidden" />
 	[% END %]
 	</li>
-- 
1.7.10.4