Changeset 317 for trunk


Ignore:
Timestamp:
05/24/10 05:11:50 (14 years ago)
Author:
nanardon
Message:
  • use extern_uid existance to figure if the voters need an external authentication
Location:
trunk/lib/Epoll/DB
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/lib/Epoll/DB/Poll.pm

    r315 r317  
    846846    my $ext_auth = $options{ext_auth} && $handle->can_authenticate; 
    847847    my $authid; 
    848     if ($ext_auth) { # register authentication 
     848    if ($ext_auth || $options{save_param}) { 
    849849        my $find_next_id = $self->db->prepare_cached( 
    850850            q{select nextval('extern_auth_id_seq'::regclass)} 
     
    855855 
    856856        my $add_auth = $self->db->prepare_cached( 
    857             q{insert into extern_auth (id, params, owner, auth_type, desc) values 
     857            q{insert into extern_auth (id, params, owner, auth_type, "desc") values 
    858858            (?,?,?,?,?)} 
    859859        ); 
     
    867867    }; 
    868868    foreach (@list) { 
    869         $self->addupd_voting($_->[0], $_->[1] || '', $authid, $_->[2]) or do { 
     869        $self->addupd_voting( 
     870            $_->[0], $_->[1] || '', $authid, ($ext_auth ? $_->[2]: undef) 
     871        ) or do { 
    870872            $self->db->rollback; 
    871873            return; 
  • trunk/lib/Epoll/DB/Voting.pm

    r315 r317  
    5858 
    5959        warn "ee"; 
    60     if ($userinfo->{extern_auth}) { 
     60    if ($userinfo->{extern_uid}) { 
    6161        warn "rr"; 
    6262        my $handle = $self->stored_import_handle($userinfo->{extern_auth}) 
Note: See TracChangeset for help on using the changeset viewer.