Exemple #1
0
        }
        // this to make sure a cookie is set for 'no url'
        // fplanque: made cookies available for whole site
        evo_setcookie($cookie_name, $author, $cookie_expires, $cookie_path, $cookie_domain, false, true);
        evo_setcookie($cookie_email, $email, $cookie_expires, $cookie_path, $cookie_domain, false, true);
        evo_setcookie($cookie_url, $url, $cookie_expires, $cookie_path, $cookie_domain, false, true);
    } else {
        // Erase cookies:
        if (!empty($_COOKIE[$cookie_name])) {
            evo_setcookie($cookie_name, '', $cookie_expired, $cookie_path, $cookie_domain, false, true);
        }
        if (!empty($_COOKIE[$cookie_email])) {
            evo_setcookie($cookie_email, '', $cookie_expired, $cookie_path, $cookie_domain, false, true);
        }
        if (!empty($_COOKIE[$cookie_url])) {
            evo_setcookie($cookie_url, '', $cookie_expired, $cookie_path, $cookie_domain, false, true);
        }
    }
}
// Note: we don't give any clue that we have automatically deleted a comment. It would only give spammers the perfect tool to find out how to pass the filter.
if ($Comment->ID) {
    // comment has not been deleted
    // Trigger event: a Plugin should cleanup any temporary data here..
    $Plugins->trigger_event('AfterCommentFormInsert', array('Comment' => &$Comment, 'original_comment' => $original_comment));
    /*
     * --------------------------
     * New comment notifications:
     * --------------------------
     */
    // TODO: dh> this should only send published feedback probably and should also use "outbound_notifications_mode"
    // fp> yes for general users, but comment moderators need to receive notifications for new unpublished comments
 /**
  * Logout the user, by invalidating the session key and unsetting {@link $user_ID}.
  *
  * We want to keep the user in the session log, but we're unsetting {@link $user_ID}, which refers
  * to the current session.
  *
  * Because the session key is invalid/broken, on the next request a new session will be started.
  *
  * NOTE: we MIGHT want to link subsequent sessions together if we want to keep track...
  */
 function logout()
 {
     global $Debuglog, $cookie_session, $cookie_path, $cookie_domain;
     // Invalidate the session key (no one will be able to use this session again)
     $this->key = NULL;
     $this->_data = array();
     // We don't need to keep old data
     $this->session_needs_save(true);
     $this->dbsave();
     $this->user_ID = NULL;
     // Unset user_ID after invalidating/saving the session above, to keep the user info attached to the old session.
     // clean up the session cookie:
     evo_setcookie($cookie_session, '', 200000000, $cookie_path, $cookie_domain, false, true);
 }