Skip to content

Commit

Permalink
Better Greeting start
Browse files Browse the repository at this point in the history
  • Loading branch information
austein authored and nelhage committed Jan 16, 2009
1 parent 8530375 commit 155cff2
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 8 deletions.
5 changes: 5 additions & 0 deletions lib/AuthMitEdu/Model/User.pm
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,11 @@ sub remote_user {
return $user;
}

sub remote_real {
my $realname = $ENV{SSL_CLIENT_S_DN_CN};
return unless $realname;
return $realname;
}

sub is_identity {
my ($self, $url) = @_;
Expand Down
12 changes: 7 additions & 5 deletions lib/AuthMitEdu/View.pm
Original file line number Diff line number Diff line change
Expand Up @@ -34,14 +34,16 @@ template setup => page {
my $identity = get 'identity';
my $action = Jifty->web->new_action(class => 'SetupAuth');
p {
outs("The site ");
outs("Would you like to allow");
div {{id is "trust_root"}
a {{href is "$root"} $root};
};
};
p {
outs("would like you verify your identity ($identity). " .
"Do you want to allow them?");
outs("to verify your identity ($identity)? ");
};
p {
outs("Doing so will not grant access to any part of your Athena account. It will only provide confirmation that you are who you claim to be.");
};
form {
for (qw(return_to identity assoc_handle trust_root)) {
Expand All @@ -51,8 +53,6 @@ template setup => page {
default_value => get $_);
}

render_param($action => 'remember');

outs_raw($action->button(
label => "Yes",
arguments => { action => 'yes' },
Expand All @@ -61,6 +61,8 @@ template setup => page {
label => "No",
arguments => { action => 'no' },
key_binding => "N"));

render_param($action => 'remember');
}
};

Expand Down
5 changes: 2 additions & 3 deletions share/web/templates/_elements/sidebar
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
<div id="salutation">
% if (Jifty->web->current_user->id and Jifty->web->current_user->user_object) {
% my $u = Jifty->web->current_user->user_object;
% my $method = $u->_brief_description;
<%_('Hiya, %1.',$u->$method())%>
% my $u = AuthMitEdu::Model::User->remote_real;
<%_('Hiya, %1.',$u)%>
% } else {
<%_("You're not currently signed in.")%>
% }
Expand Down

0 comments on commit 155cff2

Please sign in to comment.