Changeset 34 for trunk/lib/Vote/Model/Vote.pm
- Timestamp:
- 03/15/09 16:28:12 (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/lib/Vote/Model/Vote.pm
r33 r34 207 207 select *, voting.key as vkey from voting left join signing 208 208 on signing.key = voting.key 209 where poll = ? order by voting. id209 where poll = ? order by voting.mail 210 210 } 211 211 ); … … 219 219 220 220 sub vote_voting { 221 my ($self, $ id) = @_;221 my ($self, $voteid) = @_; 222 222 223 223 my $sth = $self->db->prepare_cached( 224 224 q{ 225 225 select key from voting 226 where poll = ? order by voting. id227 } 228 ); 229 $sth->execute($ id);226 where poll = ? order by voting.mail 227 } 228 ); 229 $sth->execute($voteid); 230 230 my @people; 231 231 while (my $res = $sth->fetchrow_hashref) { … … 246 246 ); 247 247 $sth->execute($id); 248 248 249 249 my $res = $sth->fetchrow_hashref; 250 250 $sth->finish; … … 330 330 331 331 sub voting_info_id { 332 my ($self, $ id, $voteid) = @_;333 334 my $sth = $self->db->prepare_cached( 335 q{ 336 select * from voting where id= ? and poll = ?337 } 338 ); 339 $sth->execute($ id, $voteid);332 my ($self, $mail, $voteid) = @_; 333 334 my $sth = $self->db->prepare_cached( 335 q{ 336 select * from voting where mail = ? and poll = ? 337 } 338 ); 339 $sth->execute($mail, $voteid); 340 340 my $res = $sth->fetchrow_hashref(); 341 341 $sth->finish; … … 344 344 345 345 sub _register_signing { 346 my ($self, $ vid, $voteid, $referal) = @_;347 348 my $vinfo = $self->voting_info_id($ vid, $voteid) or return;346 my ($self, $mail, $voteid, $referal) = @_; 347 348 my $vinfo = $self->voting_info_id($mail, $voteid) or return; 349 349 350 350 my $sth = $self->db->prepare_cached( … … 464 464 465 465 sub auth_voting { 466 my ($self, $poll, $ user, $password) = @_;467 my $userinfo = $self->voting_info_id($ user, $poll) or return;466 my ($self, $poll, $mail, $password) = @_; 467 my $userinfo = $self->voting_info_id($mail, $poll) or return; 468 468 469 469 $userinfo->{passwd} or return; … … 496 496 select date from signing join voting 497 497 on voting.key = signing.key 498 where poll = ? and id= ?498 where poll = ? and mail = ? 499 499 } 500 500 ); … … 618 618 619 619 sub addupd_voting { 620 my ($self, $voteid, $ id, $mail) = @_;620 my ($self, $voteid, $mail, $id) = @_; 621 621 622 622 my $upd = $self->db->prepare_cached( 623 623 q{ 624 update voting set mail = ? where poll = ? and id= ?624 update voting set label = ? where mail = ? and poll = ? 625 625 } 626 626 ); … … 628 628 if ($upd->execute($mail, $voteid, $id) == 0) { 629 629 my $add = $self->db->prepare_cached(q{ 630 insert into voting (poll, id, mail) values (?,?,?)630 insert into voting (poll, label, mail) values (?,?,?) 631 631 }); 632 632 … … 705 705 $voteinfo->{label} 706 706 707 Votre identifiant est: $vinfo->{ id}707 Votre identifiant est: $vinfo->{mail} 708 708 Votre mot de passe est: $passwd 709 709
Note: See TracChangeset
for help on using the changeset viewer.