Skip to content

Commit

Permalink
More error checking, and current_user_can
Browse files Browse the repository at this point in the history
  • Loading branch information
nelhage committed Mar 25, 2007
1 parent f716b64 commit 277b68f
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions lib/AuthMitEdu/Model/User.pm
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@ sub remote_user {
my $email = $ENV{SSL_CLIENT_S_DN_Email}; my $email = $ENV{SSL_CLIENT_S_DN_Email};
return unless $email; return unless $email;
my ($username) = $email =~ /^(.+)@/; my ($username) = $email =~ /^(.+)@/;
return unless $username;
my $user = AuthMitEdu::Model::User->new; my $user = AuthMitEdu::Model::User->new;
$user->load_or_create(username => $username); my ($ok, $err) = $user->load_or_create(username => $username);
die $err unless $ok;
return $user; return $user;
} }


Expand All @@ -36,5 +36,7 @@ sub is_trusted {
return 0; return 0;
} }


sub current_user_can {1};

1; 1;


0 comments on commit 277b68f

Please sign in to comment.