my $user = Text::Tradition::User->new(
id => $username,
password => ($password ? crypt_password($password) : ''),
- display => ($userinfo->{display} ? $userinfo->{display} : $username),
+ email => ($userinfo->{email} ? $userinfo->{email} : $username),
role => $role,
);
## Somewhat ugly attribute extension reponse, contains
## google-email string which we can use as the id
- $userinfo->{display} = $userinfo->{extensions}{'http://openid.net/srv/ax/1.0'}{'value.email'};
+ $userinfo->{email} = $userinfo->{extensions}{'http://openid.net/srv/ax/1.0'}{'value.email'};
}
return;
my $user = $self->lookup(Text::Tradition::User->id_for_user($username));
return if(!$user || !$user->active);
- print STDERR "Found user, $username, display is :", $user->display, ":\n";
+ print STDERR "Found user, $username, email is :", $user->email, ":\n";
return $user;
}
use Moose;
with qw(KiokuX::User);
-## 'id' provided by KiokuX::User stores our username
+## 'id' provided by KiokuX::User stores our username (email for local users, openid url for openid/google)
has 'password' => (is => 'rw', required => 1);
-has 'display' => (is => 'rw', lazy => 1, builder => '_build_display');
+has 'email' => (is => 'rw', lazy => 1, builder => '_build_email');
## Change this default active value if you want/need to have an admin confirm a user after they self-create.
has 'active' => (is => 'rw', default => sub { 1; });
has 'role' => (is => 'rw', default => sub { 'user' });
unless $tradition->has_user && $tradition->user->id eq $self->id;
};
-sub _build_display {
+sub _build_email {
my ($self) = @_;
- ## no display set, so use username/id
+ ## no email set, so use username/id
return $self->id;
}
login_id_field => 'username',
login_db_field => 'username',
action_after_login => '/index',
- send_register_email => 0,
+ action_after_register => '/index',
realm => 'default',
login_fields => { openid => [qw/openid_identifier/],
default => [qw/username password remember/],
<form method="post" action="[% c.uri_for_action('/users/register').hostless | html %]" autocomplete="off">
- [% form.field('username').render %]
+ [% form.field('username').render %] (email)
[% form.field('password').render %]
[% form.field('confirm_password').render %]
<div id="topbanner">
<h1>Stemmaweb - a collection of tools for analysis of collated texts</h1>
- <span class="mainnav">[% IF c.user_exists %]Hello! [% c.user.get_object.display %] [% ELSE %]<a href="[% c.uri_for('/login') %]">Login</a> | <a href="[% c.uri_for('/register') %]">Register</a> | [% END %]<a href="[% c.uri_for( 'about.html' ) %]">About<a> | <a href="[% c.uri_for( 'doc.html' ) %]">Help</a></span>
+ <span class="mainnav">[% IF c.user_exists %]Hello! [% c.user.get_object.email %] [% ELSE %]<a href="[% c.uri_for('/login') %]">Login</a> | <a href="[% c.uri_for('/register') %]">Register</a> | [% END %]<a href="[% c.uri_for( 'about.html' ) %]">About<a> | <a href="[% c.uri_for( 'doc.html' ) %]">Help</a></span>
</div>
<div id="directory_container">
<h2>Text directory</h2>