[system] / trunk / webwork2 / lib / WeBWorK / DB / Auth.pm Repository:
ViewVC logotype

Diff of /trunk/webwork2/lib/WeBWorK/DB/Auth.pm

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

Revision 330 Revision 332
55# ----- 55# -----
56 56
57sub getPassword($$) { 57sub getPassword($$) {
58 my $self = shift; 58 my $self = shift;
59 my $user = shift; 59 my $user = shift;
60 $self->{password_db}->connect("ro"); 60 return unless $self->{password_db}->connect("ro");
61 my $result = $self->{password_db}->hashRef()->{$user}; 61 my $result = $self->{password_db}->hashRef()->{$user};
62 $self->{password_db}->disconnect(); 62 $self->{password_db}->disconnect();
63 return $result; 63 return $result;
64} 64}
65 65
92# ----- 92# -----
93 93
94sub getKey($$) { 94sub getKey($$) {
95 my $self = shift; 95 my $self = shift;
96 my $user = shift; 96 my $user = shift;
97 $self->{keys_db}->connect("ro"); 97 return unless $self->{keys_db}->connect("ro");
98 my $result = $self->{keys_db}->hashRef()->{$user}; 98 my $result = $self->{keys_db}->hashRef()->{$user};
99 $self->{keys_db}->disconnect(); 99 $self->{keys_db}->disconnect();
100 my ($key, $timestamp) = defined $result ? split /\s+/, $result : (undef, undef); 100 my ($key, $timestamp) = defined $result ? split /\s+/, $result : (undef, undef);
101 return defined $result ? split /\s+/, $result : undef; 101 return defined $result ? split /\s+/, $result : undef;
102} 102}
138# ----- 138# -----
139 139
140sub getPermissions($$) { 140sub getPermissions($$) {
141 my $self = shift; 141 my $self = shift;
142 my $user = shift; 142 my $user = shift;
143 $self->{permissions_db}->connect("ro"); 143 return unless $self->{permissions_db}->connect("ro");
144 my $result = $self->{permissions_db}->hashRef()->{$user}; 144 my $result = $self->{permissions_db}->hashRef()->{$user};
145 $self->{permissions_db}->disconnect(); 145 $self->{permissions_db}->disconnect();
146 return $result; 146 return $result;
147} 147}
148 148

Legend:
Removed from v.330  
changed lines
  Added in v.332

aubreyja at gmail dot com
ViewVC Help
Powered by ViewVC 1.0.9