[Bio] / WebApplication / WebApplicationDBHandle.pm Repository:
ViewVC logotype

Diff of /WebApplication/WebApplicationDBHandle.pm

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.1, Fri Jan 23 14:45:54 2009 UTC revision 1.2, Tue Apr 7 17:47:16 2009 UTC
# Line 48  Line 48 
48      return ($dbmaster, undef);      return ($dbmaster, undef);
49  }  }
50    
51    sub authenticate_user {
52      my ($master, $key) = @_;
53    
54      unless (defined($master) && ref($master) eq "DBMaster") {
55        die "Undefined or invalid dbmaster passed to authenticate_user in WebApplicationDBHandle";
56      }
57    
58      unless (defined($key)) {
59        die "No key passed to authenticate_user in WebApplicationDBHandle";
60      }
61    
62      my $pref = $master->Preferences->get_objects( { value => $key } );
63      if (scalar(@$pref)) {
64        return $pref->[0]->user;
65      } else {
66        return undef;
67      }
68    
69    }
70    
71  1;  1;

Legend:
Removed from v.1.1  
changed lines
  Added in v.1.2

MCS Webmaster
ViewVC Help
Powered by ViewVC 1.0.3