Exemplo n.º 1
0
       }
     } elseif ($bounce["bounce"] == "") {
       $cnt = 0;
     }
   }*/
 #$alive = 1;$removed = 0; DT 051105
 $cnt = 0;
 $alive = 1;
 $removed = $msgokay = $unconfirmed = $unsubscribed = 0;
 #while ($alive && !$removed && $bounce = Sql_Fetch_Array($msg_req)) { DT 051105
 while ($alive && !$removed && !$msgokay && ($bounce = Sql_Fetch_Array($msg_req))) {
     $alive = checkLock($process_id);
     if ($alive) {
         keepLock($process_id);
     } else {
         bounceProcessError("Process Killed by other process");
     }
     if (stripos($bounce['status'], 'duplicate') === false && stripos($bounce['comment'], 'duplicate') === false) {
         if (sprintf('%d', $bounce["bounce"]) == $bounce["bounce"]) {
             $cnt++;
             if ($cnt >= $bounce_unsubscribe_threshold) {
                 if (!$unsubscribed) {
                     outputProcessBounce(sprintf('unsubscribing %d -> %d bounces', $user[0], $cnt));
                     $userurl = PageLink2("user&id={$user['0']}", $user[0]);
                     logEvent(s('User (url:%s) has consecutive bounces (%d) over threshold (%d), user marked unconfirmed', $userurl, $cnt, $bounce_unsubscribe_threshold));
                     $emailreq = Sql_Fetch_Row_Query("select email from {$tables["user"]} where id = {$user['0']}");
                     addUserHistory($emailreq[0], s('Auto Unconfirmed'), s('Subscriber auto unconfirmed for %d consecutive bounces', $cnt));
                     Sql_Query(sprintf('update %s set confirmed = 0 where id = %d', $tables["user"], $user[0]));
                     $email_req = Sql_Fetch_Row_Query(sprintf('select email from %s where id = %d', $tables["user"], $user[0]));
                     $unsubscribed_users .= $email_req[0] . "\t\t({$cnt})\t\t" . $GLOBALS['scheme'] . '://' . getConfig('website') . $GLOBALS['adminpages'] . '/?page=user&id=' . $user[0] . "\n";
                     $unsubscribed = 1;
Exemplo n.º 2
0
       }
     } elseif ($bounce["bounce"] == "") {
       $cnt = 0;
     }
   }*/
 #$alive = 1;$removed = 0; DT 051105
 $cnt = 0;
 $alive = 1;
 $removed = $msgokay = $unconfirmed = $unsubscribed = 0;
 #while ($alive && !$removed && $bounce = Sql_Fetch_Array($msg_req)) { DT 051105
 while ($alive && !$removed && !$msgokay && ($bounce = Sql_Fetch_Array($msg_req))) {
     $alive = checkLock($process_id);
     if ($alive) {
         keepLock($process_id);
     } else {
         bounceProcessError('Process Killed by other process');
     }
     if (stripos($bounce['status'], 'duplicate') === false && stripos($bounce['comment'], 'duplicate') === false) {
         if (sprintf('%d', $bounce['bounce']) == $bounce['bounce']) {
             ++$cnt;
             if ($cnt >= $bounce_unsubscribe_threshold) {
                 if (!$unsubscribed) {
                     outputProcessBounce(sprintf('unsubscribing %d -> %d bounces', $user[0], $cnt));
                     $userurl = PageLink2("user&id={$user['0']}", $user[0]);
                     logEvent(s('User (url:%s) has consecutive bounces (%d) over threshold (%d), user marked unconfirmed', $userurl, $cnt, $bounce_unsubscribe_threshold));
                     $emailreq = Sql_Fetch_Row_Query("select email from {$tables['user']} where id = {$user['0']}");
                     addUserHistory($emailreq[0], s('Auto Unconfirmed'), s('Subscriber auto unconfirmed for %d consecutive bounces', $cnt));
                     Sql_Query(sprintf('update %s set confirmed = 0 where id = %d', $tables['user'], $user[0]));
                     $email_req = Sql_Fetch_Row_Query(sprintf('select email from %s where id = %d', $tables['user'], $user[0]));
                     $unsubscribed_users .= $email_req[0] . "\t\t({$cnt})\t\t" . $GLOBALS['scheme'] . '://' . getConfig('website') . $GLOBALS['adminpages'] . '/?page=user&id=' . $user[0] . "\n";
                     $unsubscribed = 1;