Changeset 9 for trunk/lib/Vote/Controller/Ballot.pm
- Timestamp:
- 03/06/09 05:09:15 (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/lib/Vote/Controller/Ballot.pm
r8 r9 33 33 $c->stash->{voteid} = $id; 34 34 35 my $uid = $c->session->{uid} || $c->req->param('uid'); 36 my $password = $c->session->{password} || $c->req->param('password'); 37 38 if (!($uid && $password)) { 39 $c->stash->{template} = 'ballot/login.tt'; 40 return; 41 } 42 $c->session->{uid} = $uid; 43 $c->session->{password} = $password; 44 35 45 my $vote = $c->model('Vote'); 36 46 my %choices; … … 38 48 $choices{$_->{key}} = $_->{label}; 39 49 } 50 $c->stash->{choices} = { %choices }; 51 $c->stash->{sbal} = { map { $_ => 1 } $c->req->param('sbal') }; 40 52 41 53 my $uid = 'Olivier Thauvin'; # for test now 42 if ($c->req->param(' ballot')) {54 if ($c->req->param('confirm')) { 43 55 $vote->register_ballot( 44 56 $uid, … … 50 62 $c->req->address, 51 63 ); # TODO trap error 64 $c->forward('done'); 52 65 } 53 66 } 54 67 68 sub done : Private { 69 my ( $self, $c ) = @_; 70 $c->response->body('Vote réussi.'); 71 $c->delete_session('Vote terminé'); 72 } 55 73 56 74 =head1 AUTHOR
Note: See TracChangeset
for help on using the changeset viewer.