Browse Source

* templates/user/profile.html.ep

master
Alex 'AdUser' Z 10 years ago
parent
commit
36fba797ca
  1. 2
      conf/ldv.conf.sample
  2. 2
      lib/LDV/User.pm
  3. 7
      templates/user/profile.html.ep

2
conf/ldv.conf.sample

@ -9,7 +9,7 @@
defclasses => ['inetOrgPerson'], defclasses => ['inetOrgPerson'],
defattrs => [ defattrs => [
'displayname', 'mail', 'cn', 'sn', 'displayname', 'mail', 'cn', 'sn', 'o',
'givenname', 'userpassword', 'uid', 'givenname', 'userpassword', 'uid',
], ],
}, },

2
lib/LDV/User.pm

@ -103,7 +103,7 @@ sub update {
or die("wrong password\n"); or die("wrong password\n");
my %attrs = (); my %attrs = ();
foreach my $key (qw(displayName mail org mobile)) { foreach my $key (qw(displayName mail o mobile)) {
my $value = $self->req->param(lc($key)); my $value = $self->req->param(lc($key));
$attrs{$key} = $value; $attrs{$key} = $value;
} }

7
templates/user/profile.html.ep

@ -1,6 +1,7 @@
% layout 'default'; % layout 'default';
% title l('User profile'); % title l('User profile');
<h2><%= l('User profile') %></h2> <h2><%= l('User profile') %></h2>
% my $data = (stash 'user_data') || {};
% my @attrs = (method => 'POST', enctype => 'multipart/form-data'); % my @attrs = (method => 'POST', enctype => 'multipart/form-data');
%= form_for "/user/update" => (@attrs) => begin %= form_for "/user/update" => (@attrs) => begin
<table> <table>
@ -8,18 +9,22 @@
<td><%= l('Login') %></td> <td><%= l('Login') %></td>
<td><%= session('useruid') %></td> <td><%= session('useruid') %></td>
</tr> </tr>
% param displayname => $data->{displayName};
<tr> <tr>
<td><%= l('Display name') %></td> <td><%= l('Display name') %></td>
<td><%= text_field 'displayname', placeholder => l('John Doe') %></td> <td><%= text_field 'displayname', placeholder => l('John Doe') %></td>
</tr> </tr>
% param mail => $data->{mail};
<tr> <tr>
<td><%= l('Email') %></td> <td><%= l('Email') %></td>
<td><%= text_field 'mail', type => 'email', placeholder => 'petrov@example.com' %></td> <td><%= text_field 'mail', type => 'email', placeholder => 'petrov@example.com' %></td>
</tr> </tr>
% param o => $data->{o};
<tr> <tr>
<td><%= l('Organization') %></td> <td><%= l('Organization') %></td>
<td><%= text_field 'org', placeholder => l('JSC Vector') %></td> <td><%= text_field 'o', placeholder => l('JSC Vector') %></td>
</tr> </tr>
% param mobile => $data->{mobile};
<tr> <tr>
<td><%= l('Cell phone') %></td> <td><%= l('Cell phone') %></td>
<td><%= text_field 'mobile', placeholder => '+79081235689' %></td> <td><%= text_field 'mobile', placeholder => '+79081235689' %></td>

Loading…
Cancel
Save