Add check for empty attributes to perl_mysql
Signed-off-by: Thomas Hochstein <thh@inter.net>
This commit is contained in:
		
							parent
							
								
									dccf194c16
								
							
						
					
					
						commit
						c1ede6dbc1
					
				
					 1 changed files with 5 additions and 0 deletions
				
			
		| 
						 | 
				
			
			@ -56,6 +56,11 @@ sub authenticate() {
 | 
			
		|||
 # $attributes{username}  username
 | 
			
		||||
 # $attributes{password}  password
 | 
			
		||||
 | 
			
		||||
 # return if username or password not set
 | 
			
		||||
 if (!defined($attributes{username}) or !defined($attributes{password})) {
 | 
			
		||||
  return (481, 'Authentication failure');
 | 
			
		||||
 }
 | 
			
		||||
 | 
			
		||||
 ### DB init
 | 
			
		||||
 my $dbs = sprintf('DBI:%s:database=%s;host=%s',$conf{'dbdriver'},$conf{'database'},$conf{'dbhost'});
 | 
			
		||||
 my $dbhandle = DBI->connect($dbs, $conf{'dbuser'}, $conf{'dbpw'}, { PrintError => 1 });
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue