From 7ceb48fc1576f50e5182a700b86a31c8c6562c32 Mon Sep 17 00:00:00 2001 From: Chris Cormack Date: Mon, 7 Jan 2008 17:55:32 -0600 Subject: [PATCH] Fix for bug 1334 better error messages if one or 2 fields are left blank Signed-off-by: Joshua Ferraro --- koha-tmpl/opac-tmpl/prog/en/modules/opac-passwd.tmpl | 2 +- opac/opac-passwd.pl | 12 +++++++++++- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/koha-tmpl/opac-tmpl/prog/en/modules/opac-passwd.tmpl b/koha-tmpl/opac-tmpl/prog/en/modules/opac-passwd.tmpl index b3153a15eb..93997ffd14 100644 --- a/koha-tmpl/opac-tmpl/prog/en/modules/opac-passwd.tmpl +++ b/koha-tmpl/opac-tmpl/prog/en/modules/opac-passwd.tmpl @@ -28,7 +28,7 @@ -
+
Your password must be at least characters long.
  1. diff --git a/opac/opac-passwd.pl b/opac/opac-passwd.pl index 5684742a91..860f62a110 100755 --- a/opac/opac-passwd.pl +++ b/opac/opac-passwd.pl @@ -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'}, -- 2.39.5