[interchange-cvs] interchange - heins modified code/OrderCheck/match.oc

interchange-cvs at icdevgroup.org interchange-cvs at icdevgroup.org
Fri May 4 10:36:01 EDT 2007

User:      heins
Date:      2007-05-04 14:36:01 GMT
Added:     code/OrderCheck match.oc
* Add order check that allows you to do a password verify, i.e.:

	mv_password=match mv_verify Password must match verify.

  Default error message in the above is:

  	   mv_password does not match mv_verify.

Revision  Changes    Path
1.1                  interchange/code/OrderCheck/match.oc

rev 1.1, prev_rev 1.0
Index: match.oc
# Copyright 2007 Interchange Development Group (http://www.icdevgroup.org/)
# Licensed under the GNU GPL v2. See file LICENSE for details.
# $Id: match.oc,v 1.1 2007/05/04 14:36:00 mheins Exp $

CodeDef match OrderCheck 1
CodeDef match Description Matches another CGI variable, possibly for password verify
CodeDef match Routine <<EOR
sub {
	my($ref, $name, $value, $msg) = @_;
	$msg =~ s/^\s*(\w[-\w]*)\s*//
		or return undef;
	my $other = $1;

	if($ref->{$other} ne $value) {
		$msg = errmsg(
					  "%s doesn't match %s.",
					  ) if ! $msg;
		return(0, $name, $msg);
	return (1, $name, '');

More information about the interchange-cvs mailing list