Example #1
0
    unset($_SESSION['RETURN_LIST']);
    header('location: ' . $URL);
    exit;
}
if (isset($_POST['action']) && $_POST['action'] == "Yes") {
    $catscontrol = new MPTTcategories();
    $id = intval($_POST['id']);
    // get auction data
    $query = "SELECT a.title, a.description, a.category, a.closed, a.suspended, m.reason FROM " . $DBPrefix . "auctions a\n\tLEFT JOIN " . $DBPrefix . "auction_moderation m ON (a.id = m.auction_id)\n\tWHERE a.id = :auc_id";
    $params = array();
    $params[] = array(':auc_id', $id, 'int');
    $db->query($query, $params);
    $auc_data = $db->result();
    if ($auc_data['suspended'] > 0) {
        if (!is_null($auc_data['reason']) && $auc_data['reason'] == 1) {
            alert_auction_watchers($id, $auc_data['title'], $auc_data['description']);
            $query = "DELETE FROM `" . $DBPrefix . "auction_moderation` WHERE auction_id = :auc_id";
            $params = array();
            $params[] = array(':auc_id', $id, 'int');
            $db->query($query, $params);
        }
        // update auction table
        $query = "UPDATE " . $DBPrefix . "auctions SET suspended = 0 WHERE id = :auc_id";
        $params = array();
        $params[] = array(':auc_id', $id, 'int');
        $db->query($query, $params);
        if ($auc_data['closed']) {
            $query = "UPDATE " . $DBPrefix . "counters SET suspendedauctions = (suspendedauctions - 1), closedauctions = (closedauctions + 1)";
            $db->direct_query($query);
        } else {
            $query = "UPDATE " . $DBPrefix . "counters SET suspendedauctions = (suspendedauctions - 1), auctions = (auctions + 1)";
Example #2
0
     // Delete files, using dir (to eliminate eventual odd files)
     if (is_dir(UPLOAD_PATH . session_id())) {
         if ($dir = opendir(UPLOAD_PATH . session_id())) {
             while (($file = readdir($dir)) !== false) {
                 if (!is_dir(UPLOAD_PATH . session_id() . '/' . $file)) {
                     unlink(UPLOAD_PATH . session_id() . '/' . $file);
                 }
             }
             closedir($dir);
         }
         rmdir(UPLOAD_PATH . session_id());
     }
 }
 if (!isset($_SESSION['SELL_action']) || empty($_SESSION['SELL_action'])) {
     if (!$requires_premoderation) {
         alert_auction_watchers($auction_id, $_SESSION['SELL_title'], $_SESSION['SELL_description']);
     }
     if ($user->user_data['startemailmode'] == 'yes' && $addcounter) {
         if (!$requires_premoderation) {
             include INCLUDE_PATH . 'email/auction_confirmation.php';
         } else {
             include INCLUDE_PATH . 'email/auction_pending_moderation.php';
         }
     } elseif ($user->user_data['startemailmode'] == 'yes') {
         // awaiting payment
         include INCLUDE_PATH . 'auction_pending.php';
     }
     if ($system->SETTINGS['bn_only'] && $system->SETTINGS['bn_only_disable'] == 'y' && $system->SETTINGS['bn_only_percent'] < 100) {
         $query = "SELECT COUNT(*) as count FROM " . $DBPrefix . "auctions\n\t\t\t\t\t\t\tWHERE closed = 0 AND suspended = 0 AND user = :user_id";
         $params = array();
         $params[] = array(':user_id', $user->user_data['id'], 'int');