Permalink
Browse files

More error checking, and current_user_can

  • Loading branch information...
1 parent f716b64 commit 277b68f0564f7fc1619d04266816c3dd85b49938 @nelhage committed Mar 25, 2007
Showing with 4 additions and 2 deletions.
  1. +4 −2 lib/AuthMitEdu/Model/User.pm
@@ -17,9 +17,9 @@ sub remote_user {
my $email = $ENV{SSL_CLIENT_S_DN_Email};
return unless $email;
my ($username) = $email =~ /^(.+)@/;
- return unless $username;
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;
}
@@ -36,5 +36,7 @@ sub is_trusted {
return 0;
}
+sub current_user_can {1};
+
1;

0 comments on commit 277b68f

Please sign in to comment.