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

(-)a/koha-tmpl/intranet-tmpl/prog/en/js/members.js (+11 lines)
Lines 81-86 var myDate2=document.form.dateexpiry.value.split ('/'); Link Here
81
}
81
}
82
//end function
82
//end function
83
83
84
function check_password( password ) {
85
    if ( password.match(/^\s/) || password.match(/\s$/)) {
86
        return false;
87
    }
88
    return true;
89
}
84
90
85
// function to test all fields in forms and nav in different forms(1 ,2 or 3)
91
// function to test all fields in forms and nav in different forms(1 ,2 or 3)
86
function check_form_borrowers(nav){
92
function check_form_borrowers(nav){
Lines 106-111 function check_form_borrowers(nav){ Link Here
106
            statut=1;
112
            statut=1;
107
    }
113
    }
108
114
115
    if ( ! check_password( document.form.password.value ) ) {
116
        message_champ += MSG_PASSWORD_CONTAINS_TRAILING_SPACES;
117
        statut = 1;
118
    }
119
109
    //patrons form to test if you checked no to the question of double
120
    //patrons form to test if you checked no to the question of double
110
    if (statut!=1 && document.form.check_member.value > 0 ) {
121
    if (statut!=1 && document.form.check_member.value > 0 ) {
111
        if (!(document.form_double.answernodouble.checked)){
122
        if (!(document.form_double.answernodouble.checked)){
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/members/member-password.tt (-2 / +3 lines)
Lines 4-16 Link Here
4
<script type="text/JavaScript">
4
<script type="text/JavaScript">
5
//<![CDATA[
5
//<![CDATA[
6
    $(document).ready(function() {
6
    $(document).ready(function() {
7
        var MSG_PASSWORD_CONTAINS_TRAILING_SPACES = _("Password contains leading and/or trailing spaces.");
7
        $("#changepasswordf").submit(function(){
8
        $("#changepasswordf").submit(function(){
8
            if($("input[name='newpassword']").val() != $("input[name='newpassword2']").val()){
9
            if($("input[name='newpassword']").val() != $("input[name='newpassword2']").val()){
9
                alert(_("Passwords do not match"));
10
                alert(_("Passwords do not match"));
10
                return false;
11
                return false;
11
            } else {
12
            } else {
12
                if ($("input[name='newpassword']").val().match(/^\s/) || $("input[name='newpassword']").val().match(/\s$/)) {
13
                if ( ! check_password( $("input[name='newpassword']").val() ) ) {
13
                  alert(_("Password contains leading and/or trailing spaces."));
14
                  alert(MSG_PASSWORD_CONTAINS_TRAILING_SPACES);
14
                  return false;
15
                  return false;
15
              } else {
16
              } else {
16
                return true;
17
                return true;
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/members/memberentrygen.tt (+1 lines)
Lines 156-161 Link Here
156
        var MSG_LATE_EXPIRY = _("Warning: Expiration date falls before enrollment date");
156
        var MSG_LATE_EXPIRY = _("Warning: Expiration date falls before enrollment date");
157
        var MSG_DUPLICATE_SUSPICION = _("Please confirm whether this is a duplicate patron");
157
        var MSG_DUPLICATE_SUSPICION = _("Please confirm whether this is a duplicate patron");
158
        var MSG_PASSWORD_MISMATCH = _("The passwords entered do not match");
158
        var MSG_PASSWORD_MISMATCH = _("The passwords entered do not match");
159
        var MSG_PASSWORD_CONTAINS_TRAILING_SPACES = _("Password contains leading and/or trailing spaces.");
159
//]]>
160
//]]>
160
</script>
161
</script>
161
<script type="text/javascript" src="[% themelang %]/js/members.js"></script>
162
<script type="text/javascript" src="[% themelang %]/js/members.js"></script>
(-)a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-passwd.tt (+3 lines)
Lines 38-43 Link Here
38
                                [% IF ( WrongPass ) %]
38
                                [% IF ( WrongPass ) %]
39
                                Your current password was entered incorrectly.  If this problem persists, please ask a librarian to re-set your password for you.
39
                                Your current password was entered incorrectly.  If this problem persists, please ask a librarian to re-set your password for you.
40
                                [% END %]
40
                                [% END %]
41
                                [% IF PasswordContainsTrailingSpaces %]
42
                                    Your password contains leading and/or trailing spaces.
43
                                [% END %]
41
                            </p>
44
                            </p>
42
                        </div>
45
                        </div>
43
                    [% END # /IF Error_messages %]
46
                    [% END # /IF Error_messages %]
(-)a/opac/opac-passwd.pl (-2 / +7 lines)
Lines 54-60 if ( C4::Context->preference("OpacPasswordChange") ) { Link Here
54
        && $query->param('Confirm') )
54
        && $query->param('Confirm') )
55
    {
55
    {
56
        if ( goodkey( $dbh, $borrowernumber, $query->param('Oldkey') ) ) {
56
        if ( goodkey( $dbh, $borrowernumber, $query->param('Oldkey') ) ) {
57
            if ( $query->param('Newkey') eq $query->param('Confirm')
57
            if ( $query->param('Newkey') =~ m|^\s+| or $query->param('Newkey') =~ m|\s+$| ) {
58
                $template->param(
59
                    Error_messages => 1,
60
                    PasswordContainsTrailingSpaces => 1,
61
                );
62
            }
63
            elsif ( $query->param('Newkey') eq $query->param('Confirm')
58
                && length( $query->param('Confirm') ) >= $minpasslen )
64
                && length( $query->param('Confirm') ) >= $minpasslen )
59
            {    # Record password
65
            {    # Record password
60
                my $clave = hash_password( $query->param('Newkey') );
66
                my $clave = hash_password( $query->param('Newkey') );
61
- 

Return to bug 14509