Browse Source

* LDV::User->create : send confirmation email

master
Alex 'AdUser' Z 10 years ago
parent
commit
9216db4d30
  1. 11
      lib/LDV/User.pm

11
lib/LDV/User.pm

@ -75,10 +75,17 @@ sub create {
die("$error") if $error; die("$error") if $error;
$error = $self->app->ldap->update($user, {mail => $mail}); $error = $self->app->ldap->update($user, {mail => $mail});
die("$error") if $error; die("$error") if $error;
if ($self->app->{user}->{confirm_register}) {
my $body = $self->render_partial(template => 'email/reg_success', format => 'txt')
my $email = $self->app->email->create($mail, $self->l("Registration"), $body);
$error = $self->app->email->send($to, $email);
die("$error") if $error;
# TODO: generate and store recover code
} else {
$error = $self->app->ldap->chpass($user, $pass); $error = $self->app->ldap->chpass($user, $pass);
die("$error") if $error; die("$error") if $error;
}
# TODO: confirmation email
$self->flash({result => "Success! Now you may log in."}); $self->flash({result => "Success! Now you may log in."});
$self->redirect_to('/user/profile'); 1; $self->redirect_to('/user/profile'); 1;

Loading…
Cancel
Save