[vhffs-dev] [641] Changed the regexp to allow dot in localpart of email addresses

[ Thread Index | Date Index | More vhffs.org/vhffs-dev Archives ]


Revision: 641
Author:   crafty
Date:     2007-06-12 16:19:44 +0000 (Tue, 12 Jun 2007)

Log Message:
-----------
Changed the regexp to allow dot in localpart of email addresses

Modified Paths:
--------------
    branches/vhffs-4.0/vhffs-api/src/Vhffs/Services/Mail.pm
    trunk/vhffs-api/src/Vhffs/Services/Mail.pm


Modified: branches/vhffs-4.0/vhffs-api/src/Vhffs/Services/Mail.pm
===================================================================
--- branches/vhffs-4.0/vhffs-api/src/Vhffs/Services/Mail.pm	2007-06-07 20:18:09 UTC (rev 640)
+++ branches/vhffs-4.0/vhffs-api/src/Vhffs/Services/Mail.pm	2007-06-12 16:19:44 UTC (rev 641)
@@ -286,7 +286,7 @@
 		{
 			$password = "";
 #			$query = "INSERT INTO vhffs_forward VALUES('". $self->{'domain'} ."' , '". $name ."' , '". $self->{'forward'}{$name}{'remote_name'} ."' , '".$self->{'forward'}{$name}{'password'}."')";
-			$query = "INSERT INTO vhffs_forward VALUES('". $self->{'domain'} ."' , '". $name ."' , '". $self->{'forward'}{$name}{'remote_name'} ."' , '4pr1lsUx')";
+			$query = "INSERT INTO vhffs_forward VALUES('". $self->{'domain'} ."' , '". $name ."' , '". $self->{'forward'}{$name}{'remote_name'} ."' , 'x')";
 			$request = $self->{'db'}->{'DB_WRITE'}->prepare( $query );
 			$request->execute;
 		}
@@ -404,7 +404,7 @@
 	my $password = shift;
 
 	return -1 if( ( ! defined $password ) || ( ! defined $name ) );
-	return -1 if( ! ( $name =~ /^[a-z0-9\_\-]+$/ ) );
+	return -1 if( ! ( $name =~ /^[a-z0-9\_\-\.]+$/ ) );
 	return -1 if( ! ( $password =~ /^[a-zA-Z0-9\_\-]+$/ ) );
 	return -2 if( ( defined ( $self->{'boxes'}{$name} ) ) || ( defined( $self->{'forward'}{$name} ) ) );
 

Modified: trunk/vhffs-api/src/Vhffs/Services/Mail.pm
===================================================================
--- trunk/vhffs-api/src/Vhffs/Services/Mail.pm	2007-06-07 20:18:09 UTC (rev 640)
+++ trunk/vhffs-api/src/Vhffs/Services/Mail.pm	2007-06-12 16:19:44 UTC (rev 641)
@@ -251,7 +251,7 @@
     return -1 unless(defined($name) && defined($remote) && $name =~ /^[a-z0-9\_\-\.]+$/ && Vhffs::Functions::valid_mail( $remote ) );
 	return -2 if( ( defined ( $self->{'forward'}{$name} ) ) || ( defined( $self->{'boxes'}{$name} ) ) );
 
-    my $sql = 'INSERT INTO vhffs_forward(domain, local_part, remote_name, password) VALUES(?, ?, ?, \'4pr1lsUx\')';
+    my $sql = 'INSERT INTO vhffs_forward(domain, local_part, remote_name, password) VALUES(?, ?, ?, \'x\')';
     my $dbh = $self->{db};
     my $sth = $dbh->prepare($sql);
     $sth->execute($self->{domain}, $name, $remote) or return -1;
@@ -259,7 +259,7 @@
 	$self->{'forward'}{$name}{'local_part'} = $name;
 	$self->{'forward'}{$name}{'domain'} = $self->{'domain'};
 	$self->{'forward'}{$name}{'remote_name'} = $remote;
-    $self->{forward}{$name}{password} = '4pr1lsUx';
+    $self->{forward}{$name}{password} = 'x';
 	
 	return 1;
 }
@@ -280,7 +280,7 @@
 	my $name = shift;
 	my $password = shift;
 
-    return -1 unless(defined($password) && defined($name) && $name =~ /^[a-z0-9\_\-]+$/ && $password =~ /^[a-zA-Z0-9\_\-]+$/);
+    return -1 unless(defined($password) && defined($name) && $name =~ /^[a-z0-9\_\-\.]+$/ && $password =~ /^[a-zA-Z0-9\_\-]+$/);
     return -2 if( ( defined ( $self->{'boxes'}{$name} ) ) || ( defined( $self->{'forward'}{$name} ) ) );
 
     $password = crypt_pwd( $password );


Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/