[interchange-cvs] interchange - heins modified lib/Vend/Order.pm
interchange-core@interchange.redhat.com
interchange-core@interchange.redhat.com
Tue Jun 11 00:17:01 2002
User: heins
Date: 2002-06-11 04:16:58 GMT
Modified: lib/Vend Order.pm
Log:
* Back out change in _email which prevents possibly-invalid email
addresses at cost of compatibility with previous, which would
accept a proper email address like "Some Guy"@email.com or
some_guy@email.com (Some Guy).
* Add new _email_only check_routine which does what the above
change did -- if it is important to have only that for ID
or reliability in mailing purposes, profile can be changed
Revision Changes Path
2.22 +14 -2 interchange/lib/Vend/Order.pm
rev 2.22, prev_rev 2.21
Index: Order.pm
===================================================================
RCS file: /anon_cvs/repository/interchange/lib/Vend/Order.pm,v
retrieving revision 2.21
retrieving revision 2.22
diff -u -r2.21 -r2.22
--- Order.pm 5 Jun 2002 07:26:56 -0000 2.21
+++ Order.pm 11 Jun 2002 04:16:58 -0000 2.22
@@ -1,6 +1,6 @@
# Vend::Order - Interchange order routing routines
#
-# $Id: Order.pm,v 2.21 2002/06/05 07:26:56 racke Exp $
+# $Id: Order.pm,v 2.22 2002/06/11 04:16:58 mheins Exp $
#
# Copyright (C) 1996-2001 Red Hat, Inc. <interchange@redhat.com>
#
@@ -28,7 +28,7 @@
package Vend::Order;
require Exporter;
-$VERSION = substr(q$Revision: 2.21 $, 10);
+$VERSION = substr(q$Revision: 2.22 $, 10);
@ISA = qw(Exporter);
@@ -1140,6 +1140,18 @@
}
sub _email {
+ my($ref, $var, $val) = @_;
+ if($val and $val =~ /[\040-\176]+\@[-A-Za-z0-9.]+\.[A-Za-z]+/) {
+ return (1, $var, '');
+ }
+ else {
+ return (undef, $var,
+ errmsg( "'%s' not an email address", $val )
+ );
+ }
+}
+
+sub _email_only {
my($ref, $var, $val) = @_;
if($val and $val =~ /^[\040-\176]+\@[-A-Za-z0-9.]+\.[A-Za-z]+$/) {
return (1, $var, '');