X-Git-Url: https://ruin.nu/git/?a=blobdiff_plain;f=lib%2FNDWeb%2FController%2FSettings.pm;h=f95a97922373f9853649ad4f3091fb1b117f97d4;hb=c7e26c754fc09d8837b5801bce4046c2493cf8a9;hp=a9aaf96faf6b7d0a22c3939fab5c299cb7a89f71;hpb=ab1ec1721c11a109546e162f87488db7dcfb9108;p=ndwebbie.git diff --git a/lib/NDWeb/Controller/Settings.pm b/lib/NDWeb/Controller/Settings.pm index a9aaf96..f95a979 100644 --- a/lib/NDWeb/Controller/Settings.pm +++ b/lib/NDWeb/Controller/Settings.pm @@ -132,6 +132,16 @@ sub changeEmail : Local { my $email = $c->req->param('email'); + if ($email =~ /^s?$/) { + my $update = $dbh->prepare(q{ +UPDATE users SET email = NULL WHERE uid = $1; + }); + $update->execute($c->user->id); + $c->flash(error => 'email cleared'); + $c->res->redirect($c->uri_for('')); + return, + } + unless (Email::Valid->address($email)){ $c->flash(email => $email); $c->flash(error => 'Invalid email address'); @@ -148,7 +158,7 @@ INSERT INTO email_change (uid,email) VALUES ($1,$2) RETURNING id; my ($id) = $insert->fetchrow_array; my %mail = ( - smtp => 'ruin.nu', + smtp => 'localhost', To => $email, From => 'NewDawn Command ', 'Content-type' => 'text/plain; charset="UTF-8"',