Changeset 27 for trunk/lib/Vote/Model/Vote.pm
- Timestamp:
- 03/14/09 15:33:39 (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/lib/Vote/Model/Vote.pm
r26 r27 37 37 sub db { $_[0]->{db} } 38 38 39 sub random_string { 40 my $lenght = $_[-1] || 8; 41 42 return join('', map { ('a'..'z', 'A'..'Z', 0..9)[rand 62] } (1..$lenght)); 43 } 44 45 sub gen_enc_passwd { 46 my ($self, $passwd) = @_; 47 48 $passwd ||= random_string(8); 49 return(crypt($passwd, '$1$' . random_string(8) . '$')); 50 } 51 39 52 sub list_comming_vote { 40 53 my ($self) = @_; … … 623 636 } 624 637 638 sub mail_passwd_ifnul { 639 my ($self, $voteid) = @_; 640 641 my $list_voting = $self->db->prepare_cached( 642 q{select key from voting where poll = ? and passwd is null} 643 ); 644 645 $list_voting->execute($voteid); 646 while (my $res = $list_voting->fetchrow_hashref) { 647 $self->mail_voting_passwd($res->{key}); 648 } 649 } 650 651 sub mail_voting_passwd { 652 my ($self, $id) = @_; 653 654 my $vinfo = $self->voting_info($id) or return; 655 656 657 } 625 658 626 659 =head1 AUTHOR
Note: See TracChangeset
for help on using the changeset viewer.