diff options
author | Christian Pointner <equinox@helsinki.at> | 2014-09-18 14:54:08 (GMT) |
---|---|---|
committer | Christian Pointner <equinox@helsinki.at> | 2014-09-18 14:54:08 (GMT) |
commit | ebbdacfb7cbe31ca917e3f115ff6913d85a439a3 (patch) | |
tree | c86bbcc65dc4daab42cc977f9897856445eaf9b7 /lib | |
parent | a6fb1a8e95126a33fd742ff014bc813e9fa20be4 (diff) |
consistent return value scheme
Diffstat (limited to 'lib')
-rwxr-xr-x | lib/rddb.pm | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/rddb.pm b/lib/rddb.pm index c12ea26..7767fde 100755 --- a/lib/rddb.pm +++ b/lib/rddb.pm @@ -35,16 +35,16 @@ sub get_token my ($dbh, $username) = @_; my $sth = $dbh->prepare('select PASSWORD from USERS where LOGIN_NAME = ?') - or return ('', 'ERROR', "Database Error: " . $dbh->errstr); + or return (undef, 'ERROR', "Database Error: " . $dbh->errstr); $sth->execute($username) - or return ('', 'ERROR', "Database Error: " . $sth->errstr); + or return (undef, 'ERROR', "Database Error: " . $sth->errstr); my ($token) = $sth->fetchrow_array; $sth->finish(); unless(defined $token) { - return ('', 'ERROR', "user '" . $username . "' not known by rivendell") + return (undef, 'ERROR', "user '" . $username . "' not known by rivendell") } return ($token, 'OK', 'success'); } |