svn commit: r264569 - in user/des/fbp/lib/FBP: Controller Schema/Result
Dag-Erling Smørgrav
des at FreeBSD.org
Wed Apr 16 22:04:11 UTC 2014
Author: des
Date: Wed Apr 16 22:04:09 2014
New Revision: 264569
URL: http://svnweb.freebsd.org/changeset/base/264569
Log:
Remove all debugging output that could reveal how a user voted.
Modified:
user/des/fbp/lib/FBP/Controller/Poll.pm
user/des/fbp/lib/FBP/Controller/Root.pm
user/des/fbp/lib/FBP/Schema/Result/Question.pm
Modified: user/des/fbp/lib/FBP/Controller/Poll.pm
==============================================================================
--- user/des/fbp/lib/FBP/Controller/Poll.pm Wed Apr 16 21:57:53 2014 (r264568)
+++ user/des/fbp/lib/FBP/Controller/Poll.pm Wed Apr 16 22:04:09 2014 (r264569)
@@ -44,7 +44,6 @@ sub poll :Chained('/') :Path :CaptureArg
}
}
$$psession{qid} //= $poll->questions->first->id;
- $c->log->debug("Retrieved poll #$pid");
$c->stash(title => $poll->title);
}
@@ -90,7 +89,6 @@ sub vote :Chained('poll') :Path :Args(0)
}
$c->detach('/default')
unless $question;
- $c->log->debug("Retrieved question #$qid");
# Did the user submit any answers?
if ($c->req->params->{qid} ~~ $qid && $c->req->params->{answer}) {
@@ -127,25 +125,15 @@ sub vote :Chained('poll') :Path :Args(0)
# to that question and display an error message. If not, the
# voter has answered all the questions.
if (!$$psession{vote_error}) {
- # XXX do something!
$c->response->redirect($c->uri_for('/poll', $pid, 'review'));
$c->detach();
}
} elsif ($c->req->params->{prev} && $question->prev) {
$question = $question->prev;
- $c->log->debug("On to question #" . $question->id);
} elsif ($c->req->params->{next} && $question->next) {
$question = $question->next;
}
- # Debugging
- if ($question->id != $qid) {
- $c->log->debug("On to question #" . $question->id);
- }
- if ($$psession{vote_error}) {
- $c->log->debug($$psession{vote_error});
- }
-
# Store the current question
$$psession{qid} = $qid = $question->id;
Modified: user/des/fbp/lib/FBP/Controller/Root.pm
==============================================================================
--- user/des/fbp/lib/FBP/Controller/Root.pm Wed Apr 16 21:57:53 2014 (r264568)
+++ user/des/fbp/lib/FBP/Controller/Root.pm Wed Apr 16 22:04:09 2014 (r264569)
@@ -35,10 +35,8 @@ sub auto :Private {
# Stash active polls
if ($c->user_exists) {
- $c->log->debug("number of polls: " . int($c->model('FBP::Poll')->count()));
my $polls = $c->model('FBP::Poll')->
search({ starts => { '<=', $c->now }, ends => { '>=', $c->now } });
- $c->log->debug("active polls: " . int($polls->count()));
$c->stash(polls => $polls);
}
@@ -66,17 +64,14 @@ Display the login page and process login
sub login :Local :Args(0) {
my ($self, $c) = @_;
- $c->log->debug("FBP::Controller::Root::login()");
if ($c->user_exists) {
my $login = $c->user->login;
- $c->log->debug("user $login already authenticated");
$c->response->redirect($c->uri_for('/polls'));
$c->detach();
}
my ($login, $password) = @{$c->request->params}{'login', 'password'};
if ($login && $password &&
$c->authenticate({ login => $login, password => $password })) {
- $c->log->debug("user $login successfully authenticated");
$c->change_session_id();
$c->response->redirect($c->uri_for('/polls'));
}
@@ -95,7 +90,6 @@ sub logout :Local :Args(0) {
my $login = $c->user->login;
$c->delete_session();
$c->logout();
- $c->log->debug("user $login successfully authenticated");
}
$c->response->redirect($c->uri_for('/'));
}
Modified: user/des/fbp/lib/FBP/Schema/Result/Question.pm
==============================================================================
--- user/des/fbp/lib/FBP/Schema/Result/Question.pm Wed Apr 16 21:57:53 2014 (r264568)
+++ user/des/fbp/lib/FBP/Schema/Result/Question.pm Wed Apr 16 22:04:09 2014 (r264569)
@@ -217,7 +217,6 @@ Registers a voter's answer to this quest
sub commit_answer($$@) {
my ($self, $voter, @answer) = @_;
- print STDERR "Question ", $self->id, " commit_answer\n";
$voter->votes->search({ question => $self->id })->delete();
foreach my $oid (@answer) {
$voter->votes->create({ question => $self->id, option => $oid });
More information about the svn-src-user
mailing list