Skip to content

Commit

Permalink
Pass fix
Browse files Browse the repository at this point in the history
  • Loading branch information
marlencrabapple committed Jul 29, 2014
1 parent fa03378 commit abb7bdb
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions wakaba.pl
Original file line number Diff line number Diff line change
Expand Up @@ -1331,7 +1331,7 @@ ($)
}

# checks if a different IP is currently authorized
if($$row{ip} ne get_ip(USE_CLOUDFLARE)) {
if($$row{ip} ne dot_to_dec(get_ip(USE_CLOUDFLARE))) {
authorize_pass($token,$pin,undef,1);
}
else{
Expand Down Expand Up @@ -4094,8 +4094,15 @@ ($$$;$)

# some spaghetti code
if(($action eq "ban") or ($action eq "verify")) {
$unapprove = ",approved=0" unless $action eq "verify";
my $sth = $dbh->prepare("UPDATE ".SQL_PASS_TABLE." SET ".$$types{$action}."=1".$unapprove." WHERE num=?;") or make_error(S_SQLFAIL);
if($action ne 'verify') {
$unapprove = ',approved=0';
}
else {
# update lasthit on verify to avoid being deactivated on first post after inactivity period
$unapprove = ',lasthit='.time();
}

my $sth = $dbh->prepare("UPDATE ".SQL_PASS_TABLE." SET ".$$types{$action}."=1$unapprove WHERE num=?;") or make_error(S_SQLFAIL);
$sth->execute($num) or make_error(S_SQLFAIL);

if($action eq "ban") {
Expand Down

0 comments on commit abb7bdb

Please sign in to comment.