added vpopmail_sql db connect error handling.

Conflicts:

	plugins/auth/auth_vpopmail_sql
This commit is contained in:
Matt Simerson 2012-05-04 17:49:23 -04:00 committed by Robert
parent 219392590e
commit 44ae52818e

View File

@ -84,7 +84,10 @@ sub auth_vmysql {
my $dbuser = $self->qp->config("vpopmail_mysql_user") || "vpopmailuser";
my $dbpass = $self->qp->config("vpopmail_mysql_pass") || "vpoppasswd";
my $dbh = DBI->connect( $dsn, $dbuser, $dbpass );
my $dbh = DBI->connect( $dsn, $dbuser, $dbpass ) or do {
$self->log(LOGERROR, "auth_vpopmail_sql: db connection failed");
return DECLINED;
};
$dbh->{ShowErrorStatement} = 1;
my ( $pw_name, $pw_domain ) = split '@', lc($user);