Fix for bug 1334 better error messages if one or 2 fields are left blank

Signed-off-by: Joshua Ferraro <jmf@liblime.com>
This commit is contained in:
Chris Cormack 2008-01-07 17:55:32 -06:00 committed by Joshua Ferraro
parent 6ecba451a3
commit 7ceb48fc15
2 changed files with 12 additions and 2 deletions

View file

@ -28,7 +28,7 @@
<!-- TMPL_IF NAME= "Ask_data" -->
<!-- TMPL_IF NAME="OpacPasswordChange" -->
<form action="/cgi-bin/koha/opac-passwd.pl" name="mainform" id="mainform" method="get"><fieldset class="rows">
<form action="/cgi-bin/koha/opac-passwd.pl" name="mainform" id="mainform" method="post"><fieldset class="rows">
<!-- TMPL_UNLESS NAME= "ShortPass" --><div class="hint">Your password must be at least <!-- TMPL_VAR NAME="minpasslen" --> characters long.</div><!-- /TMPL_UNLESS -->
<ol> <li><label for="password">Current Password:</label> <input type="password" id="Oldkey" size="25" name="Oldkey" /></li>
<li><label for="Newkey">New Password:</label> <input type="password" id="Newkey" size="25" name="Newkey" /></li>

View file

@ -81,9 +81,19 @@ if ( $query->param('Oldkey')
}
}
else {
# Called Empty, Ask for data.
$template->param( 'Ask_data' => '1' );
if (!$query->param('Oldkey') && ($query->param('Newkey') || $query->param('Confirm'))){
# Old password is empty but one of the others isnt
$template->param( 'Error_messages' => '1' );
$template->param( 'WrongPass' => '1' );
}
elsif ($query->param('Oldkey') && (!$query->param('Newkey') || !$query->param('Confirm'))){
# Oldpassword is entered but one of the other fields is empty
$template->param( 'Error_messages' => '1' );
$template->param( 'PassMismatch' => '1' );
}
}
$template->param(firstname => $borr->{'firstname'},