* Add enclair_db option to UserDB.pm. Allows logging of enclair password
[interchange.git] / code / OrderCheck / match.oc
1 # Copyright 2007 Interchange Development Group (http://www.icdevgroup.org/)
2 # Licensed under the GNU GPL v2. See file LICENSE for details.
3 # $Id: match.oc,v 1.1 2007-05-04 14:36:00 mheins Exp $
4
5 CodeDef match OrderCheck 1
6 CodeDef match Description Matches another CGI variable, possibly for password verify
7 CodeDef match Routine <<EOR
8 sub {
9         my($ref, $name, $value, $msg) = @_;
10         $msg =~ s/^\s*(\w[-\w]*)\s*//
11                 or return undef;
12         my $other = $1;
13
14         if($ref->{$other} ne $value) {
15                 $msg = errmsg(
16                                           "%s doesn't match %s.",
17                                           $name,
18                                           $other,
19                                           ) if ! $msg;
20                 return(0, $name, $msg);
21         }
22         return (1, $name, '');
23 }
24 EOR