powerhouse has asked for the wisdom of the Perl Monks concerning the following question:
I did it this way in the Remove them code:$cust_username = $dbh->selectrow_array(qq{SELECT username FROM + users WHERE id = "$in{id}"}); $sth1 = $dbh->prepare (qq{ SELECT * FROM session_db }); $sth1->execute(); while($row1 = $sth1->fetchrow_hashref()) { next if !$row1->{id}; $sess_ref1 = CWT::Site_DB->open_with_expiration(undef, $ro +w1->{id}); if($sess_ref1->attr("username") eq "$cust_username") { if ($sess_ref1->attr("logged_in") == 1) { $sess_ref1->attr("is_admin",1); } else { next; } } else { next; } } $sth1->finish();
$cust_username = $dbh->selectrow_array(qq{SELECT username FROM + users WHERE id = "$in{id}"}); $sth1 = $dbh->prepare (qq{ SELECT * FROM session_db }); $sth1->execute(); while($row1 = $sth1->fetchrow_hashref()) { next if !$row1->{id}; $sess_ref1 = CWT::Site_DB->open_with_expiration(undef, $ro +w1->{id}); if($sess_ref1->attr("username") eq "$cust_username") { if ($sess_ref1->attr("is_admin") == 1) { $sess_ref1->clear_attr("is_admin"); # Delete that +variable from sess. } else { next; } } else { next; } } $sth1->finish();
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Sessions, Perl and MySQL
by tachyon (Chancellor) on Mar 30, 2003 at 08:09 UTC | |
by runrig (Abbot) on Mar 30, 2003 at 19:37 UTC | |
by powerhouse (Friar) on Mar 30, 2003 at 20:03 UTC | |
by tachyon (Chancellor) on Mar 31, 2003 at 00:38 UTC | |
Re: Sessions, Perl and MySQL
by runrig (Abbot) on Mar 30, 2003 at 07:19 UTC | |
Re: Sessions, Perl and MySQL
by dws (Chancellor) on Mar 30, 2003 at 17:28 UTC |