From 8634efae41f85cd8bf7560a3f12f6474f835cfe1 Mon Sep 17 00:00:00 2001 From: Buchan Milne Date: Thu, 28 Oct 2010 10:59:32 +0000 Subject: Add more useful logging, remove some more debug logging --- lib/CatDap/Controller/register.pm | 5 ++++- lib/CatDap/Controller/user.pm | 1 - 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/lib/CatDap/Controller/register.pm b/lib/CatDap/Controller/register.pm index 24ceb53..a321bdd 100644 --- a/lib/CatDap/Controller/register.pm +++ b/lib/CatDap/Controller/register.pm @@ -78,7 +78,6 @@ sub check : Local { $mesg = $c->model('Proxy')->search("(uid=$username)"); if ($mesg->entries()) { push @errors,$c->loc('An account already exists with this username'); - push @errors; } if (@errors) { @@ -91,6 +90,7 @@ sub check : Local { my $ug = Data::UUID->new; my $password = $ug->create_str(); my $cn = $c->request->params->{gn} . " " . $c->request->params->{sn}; + $c->log->info("Creating account for user $username"); $mesg = $c->model('Proxy')->add($dn, attr => [ objectclass => [ 'inetOrgPerson' ], @@ -104,6 +104,7 @@ sub check : Local { ); if ($mesg) { push @errors,$mesg->error; + $c->log->info( sprintf("Creating DN $dn failed: %s", $mesg->error) ); $c->stash(errors => \@errors); #$c->stash(template => 'register/index.tt'); } @@ -130,9 +131,11 @@ EOF body => $body, }; + $c->log->info("Sending activation mail for user $username to $email"); $c->forward( $c->view('Email') ); if ( @{ $c->error } ) { my $errors = join "\n",@{ $c->error }; + $c->log->info("Sending activation mail to $email failed: $errors"); $c->response->body($c->loc('An error occured sending the email, but your account was created. Please try the password recovery process f you entered the correct email address: [_1]', $errors)); $c->error(0); # Reset the error condition if you need to } diff --git a/lib/CatDap/Controller/user.pm b/lib/CatDap/Controller/user.pm index 41fe412..0603217 100644 --- a/lib/CatDap/Controller/user.pm +++ b/lib/CatDap/Controller/user.pm @@ -46,7 +46,6 @@ sub auto : Private { my $mesg; my $dn; my $keyprefix = sprintf("%02x%02x%02x",split /\./,$c->req->address); - $c->log->info("Using $keyprefix as first part of enc key"); if (! defined $c->user) { $c->log->info("No session, logging user in"); if (! $c->authenticate({ username => $c->req->param('username'), -- cgit v1.2.1