View | Details | Raw Unified | Return to bug 26266
Collapse All | Expand All

(-)a/koha-tmpl/opac-tmpl/bootstrap/en/includes/password_check.inc (-1 / +1 lines)
Lines 18-24 Link Here
18
        return ( this.optional(element) || !value.match(/^\s/) && !value.match(/\s$/) );
18
        return ( this.optional(element) || !value.match(/^\s/) && !value.match(/\s$/) );
19
    }, _("Password contains leading and/or trailing spaces"));
19
    }, _("Password contains leading and/or trailing spaces"));
20
    jQuery.validator.addMethod("password_match", function(value, element){
20
    jQuery.validator.addMethod("password_match", function(value, element){
21
        var new_password_node = $("input[name='" + new_password_node_name + "']:first");
21
        var new_password_node = $("#" + new_password_node_name);
22
        return this.optional(element) || value == $(new_password_node).val();
22
        return this.optional(element) || value == $(new_password_node).val();
23
    }, _("Please enter the same password as above"));
23
    }, _("Please enter the same password as above"));
24
</script>
24
</script>
(-)a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-password-recovery.tt (-2 / +18 lines)
Lines 5-10 Link Here
5
[% INCLUDE 'doc-head-close.inc' %]
5
[% INCLUDE 'doc-head-close.inc' %]
6
[% BLOCK cssinclude %][% END %]
6
[% BLOCK cssinclude %][% END %]
7
[% BLOCK jsinclude %]
7
[% BLOCK jsinclude %]
8
[% Asset.js("lib/jquery/plugins/jquery.validate.min.js") | $raw %]
9
[% PROCESS 'password_check.inc' %]
10
[% PROCESS 'add_password_check' new_password => 'password' %]
8
<script>
11
<script>
9
   $(function() {
12
   $(function() {
10
        $("#CheckAll").click(function(){
13
        $("#CheckAll").click(function(){
Lines 21-26 Link Here
21
            $("fieldset#serial, fieldset#book, fieldset#chapter").hide()
24
            $("fieldset#serial, fieldset#book, fieldset#chapter").hide()
22
            $("fieldset#" + $(this).val() ).show();
25
            $("fieldset#" + $(this).val() ).show();
23
        });
26
        });
27
28
        $("#mainform").validate({
29
            rules: {
30
                password: {
31
                    required: true,
32
                    password_strong: true,
33
                    password_no_spaces: true
34
                },
35
                repeatPassword: {
36
                    required: true,
37
                    password_match: true
38
                }
39
            }
40
        });
24
   });
41
   });
25
</script>
42
</script>
26
[% END %]
43
[% END %]
Lines 104-110 Link Here
104
                    </form>
121
                    </form>
105
[% ELSIF (new_password) %]
122
[% ELSIF (new_password) %]
106
    [% UNLESS ( errLinkNotValid ) %]
123
    [% UNLESS ( errLinkNotValid ) %]
107
                    <form action="/cgi-bin/koha/opac-password-recovery.pl" method="post" autocomplete="off">
124
                    <form id="mainform" name="mainform" action="/cgi-bin/koha/opac-password-recovery.pl" method="post" autocomplete="off">
108
                        <input type="hidden" name="koha_login_context" value="opac" />
125
                        <input type="hidden" name="koha_login_context" value="opac" />
109
                        <fieldset>
126
                        <fieldset>
110
                            [% IF ( Koha.Preference('RequireStrongPassword') ) %]
127
                            [% IF ( Koha.Preference('RequireStrongPassword') ) %]
111
- 

Return to bug 26266