Changeset 13
- Timestamp:
- 03/06/09 17:13:26 (15 years ago)
- Location:
- trunk/lib/Vote
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/lib/Vote/Controller/Ballot.pm
r9 r13 36 36 my $password = $c->session->{password} || $c->req->param('password'); 37 37 38 if (!($uid && $password)) { 38 if (!$c->model('Vote')->auth_voting($id, $uid, $password)) { 39 $c->delete_session('invalid user/pass'); 39 40 $c->stash->{template} = 'ballot/login.tt'; 40 41 return; … … 51 52 $c->stash->{sbal} = { map { $_ => 1 } $c->req->param('sbal') }; 52 53 53 my $uid = 'Olivier Thauvin'; # for test now54 54 if ($c->req->param('confirm')) { 55 55 $vote->register_ballot( -
trunk/lib/Vote/Model/Vote.pm
r12 r13 238 238 } 239 239 240 sub auth_voting { 241 my ($self, $poll, $user, $password) = @_; 242 my $userinfo = $self->voting_info_id($user, $poll) or return; 243 244 $userinfo->{passwd} or return; 245 if (crypt($password, $userinfo->{passwd} || '') eq $userinfo->{passwd}) { 246 return 1; 247 } else { 248 return 0; 249 } 250 } 251 240 252 # Requete de decompte des voix: 241 253
Note: See TracChangeset
for help on using the changeset viewer.