=================================================================== RCS file: /cvs/palm/Palm-Keyring/examples/cgi/bin/keyring.cgi,v retrieving revision 1.5 retrieving revision 1.6 diff -u -r1.5 -r1.6 --- palm/Palm-Keyring/examples/cgi/bin/keyring.cgi 2010/01/19 18:01:23 1.5 +++ palm/Palm-Keyring/examples/cgi/bin/keyring.cgi 2012/06/10 04:48:05 1.6 @@ -113,25 +113,30 @@ } sub password { + my $message = ''; if ($password) { my $pdb = open_pdb(); - eval { $pdb->Password($password) }; + my $valid = eval { $pdb->Password($password) }; if ($@) { error($@); + $message = "Error: $@"; } - else { + elsif ($valid) { return 'Unlocked: ' . $query->hidden( 'unlock_password', $password ) . $query->submit( -name => 'lock', -value => 'Lock', ); } + else { + $message = "$message
Invalid Password"; + } } return 'Locked - Enter Password to Unlock: ' . $query->br() - . $query->password_field( - -name => 'unlock_password', - -value => '', - -override => 1, + . $message . $query->password_field( + -name => 'unlock_password', + -value => '', + -override => 1, ); }