Browse Source

* ability to change password

master
Alex 'AdUser' Z 10 years ago
parent
commit
bfc01166c5
  1. 1
      lib/LDV/I18N/ru.pm
  2. 5
      lib/LDV/User.pm
  3. 6
      templates/user/profile.html.ep

1
lib/LDV/I18N/ru.pm

@ -14,6 +14,7 @@ our %Lexicon =
'Login' => 'Имя входа',
'Log in' => 'Войти',
'Password' => 'Пароль',
'New password' => 'Новый пароль',
'Current password' => 'Действующий пароль',
'Display name' => 'Отображаемое имя',
'Email' => 'Эл. почта',

5
lib/LDV/User.pm

@ -109,6 +109,11 @@ sub update {
}
my $error = $self->app->ldap->update($user, \%attrs);
die("$error\n") if $error;
if ($self->app->config->{user}->{allow_chpass} and
my $newpass = $self->req->param('newpass')) {
$error = $self->app->ldap->chpass($user, $newpass);
die("$error\n") if $error;
}
$self->redirect_to('/user/profile'); 1;
} or do {
$self->flash({result => "Can't save profile: $@"});

6
templates/user/profile.html.ep

@ -33,6 +33,12 @@
<td><%= l('Avatar') %></td>
<td><%= file_field 'photo' %></td>
</tr>
% if (config->{user}->{allow_chpass}) {
<tr>
<td><%= l('New password') %></td>
<td><%= password_field 'newpass', placeholder => '******' %></td>
</tr>
% }
<tr><td colspan='2'><hr/></td></tr>
<tr>
<td><%= l('Current password') %></td>

Loading…
Cancel
Save