Пример #1
0
if (isset($_POST['aid']) && is_md5($_POST['aid'])) {
    $aid = $_POST['aid'];
} else {
    $aid = md5(uniqid(mt_rand()));
}
if (session::check_perm(USER_PERM_EMAIL_CONFIRM, 0)) {
    html_email_confirmation_error();
    exit;
}
if (isset($_POST['preview_poll']) || isset($_POST['preview_form']) || isset($_POST['post'])) {
    $valid = true;
    if (!isset($thread_title) || strlen(trim($thread_title)) == 0) {
        $error_msg_array[] = gettext("You must enter a title for the thread!");
        $valid = false;
    }
    if (!isset($fid) || !folder_is_valid($fid)) {
        $error_msg_array[] = gettext("Unknown folder");
        $valid = false;
    }
    if (!session::check_perm(USER_PERM_THREAD_CREATE | USER_PERM_POST_READ, $fid)) {
        $error_msg_array[] = gettext("You cannot create new threads in this folder");
        $valid = false;
    }
    if (attachments_get_count($aid) > 0 && !session::check_perm(USER_PERM_POST_ATTACHMENTS | USER_PERM_POST_READ, $fid)) {
        $error_msg_array[] = gettext("You cannot post attachments in this folder. Remove attachments to continue.");
        $valid = false;
    }
    if (!folder_thread_type_allowed($fid, FOLDER_ALLOW_POLL_THREAD)) {
        $error_msg_array[] = gettext("You cannot post this thread type in that folder!");
        $valid = false;
    }
Пример #2
0
         $t_rename = trim($_POST['rename']);
         if ($t_rename !== trim($thread_data['TITLE'])) {
             if (thread_change_title($tid, $t_rename)) {
                 post_add_edit_text($tid, 1);
                 if (session::check_perm(USER_PERM_FOLDER_MODERATE, $fid)) {
                     admin_add_log_entry(RENAME_THREAD, array($tid, $thread_data['TITLE'], $t_rename));
                 }
             } else {
                 $error_msg_array[] = gettext("Failed to rename thread");
                 $valid = false;
             }
         }
     }
     if (isset($_POST['move']) && is_numeric($_POST['move'])) {
         $t_move = $_POST['move'];
         if (folder_is_valid($t_move) && $t_move !== $thread_data['FID']) {
             if ((session::check_perm(USER_PERM_FOLDER_MODERATE, $t_move) || session::check_perm(USER_PERM_THREAD_MOVE, $t_move) && $thread_data['BY_UID'] == $uid && $thread_data['ADMIN_LOCK'] != THREAD_ADMIN_LOCK_ENABLED && forum_get_setting('allow_post_editing', 'Y') && (intval(forum_get_setting('post_edit_time', null, 0)) == 0 || time() - $thread_data['CREATED'] < intval(forum_get_setting('post_edit_time', null, 0) * MINUTE_IN_SECONDS))) && thread_change_folder($tid, $t_move)) {
                 $new_folder_title = folder_get_title($t_move);
                 $old_folder_title = folder_get_title($thread_data['FID']);
                 post_add_edit_text($tid, 1);
                 if (session::check_perm(USER_PERM_FOLDER_MODERATE, $fid)) {
                     admin_add_log_entry(MOVED_THREAD, array($tid, $thread_data['TITLE'], $old_folder_title, $new_folder_title));
                 }
             } else {
                 $error_msg_array[] = gettext("Failed to move thread to specified folder");
                 $valid = false;
             }
         }
     }
 }
 if (session::check_perm(USER_PERM_FOLDER_MODERATE, $fid)) {
Пример #3
0
     }
     if (attachments_get_count($aid) > 0 && !session::check_perm(USER_PERM_POST_ATTACHMENTS | USER_PERM_POST_READ, $t_fid)) {
         $error_msg_array[] = gettext("You cannot post attachments in this folder. Remove attachments to continue.");
         $valid = false;
     }
     $new_thread = false;
 } else {
     $new_thread = true;
     if (isset($_GET['fid']) && is_numeric($_GET['fid'])) {
         $t_fid = $_GET['fid'];
     } else {
         if (isset($_POST['t_fid']) && is_numeric($_POST['t_fid'])) {
             $t_fid = $_POST['t_fid'];
         }
     }
     if (isset($t_fid) && !folder_is_valid($t_fid)) {
         $error_msg_array[] = gettext("Invalid Folder ID. Check that a folder with this ID exists!");
         $valid = false;
     }
     if (session::check_perm(USER_PERM_EMAIL_CONFIRM, 0)) {
         html_email_confirmation_error();
         exit;
     }
     if (isset($t_fid) && !session::check_perm(USER_PERM_THREAD_CREATE | USER_PERM_POST_READ, $t_fid)) {
         $error_msg_array[] = gettext("You cannot create new threads in this folder");
         $valid = false;
     }
     if (attachments_get_count($aid) > 0 && !session::check_perm(USER_PERM_POST_ATTACHMENTS | USER_PERM_POST_READ, $t_fid)) {
         $error_msg_array[] = gettext("You cannot post attachments in this folder. Remove attachments to continue.");
         $valid = false;
     }
Пример #4
0
    }
}
if (isset($_POST['cancel'])) {
    header_redirect("admin_folders.php?webtag={$webtag}&page={$page}");
    exit;
}
if (isset($_POST['fid']) && is_numeric($_POST['fid'])) {
    $fid = $_POST['fid'];
} else {
    if (isset($_GET['fid']) && is_numeric($_GET['fid'])) {
        $fid = $_GET['fid'];
    } else {
        html_draw_error(gettext("No Folder ID specified"), 'admin_folders.php', 'get', array('back' => gettext("Back")), array('page' => $page));
    }
}
if (!folder_is_valid($fid)) {
    html_draw_error(gettext("Invalid Folder ID. Check that a folder with this ID exists!"), 'admin_folders.php', 'get', array('back' => gettext("Back")), array('page' => $page));
}
if (isset($_POST['save'])) {
    $valid = true;
    if (isset($_POST['name']) && strlen(trim($_POST['name'])) > 0) {
        $folder_data['TITLE'] = trim($_POST['name']);
    } else {
        $error_msg_array[] = gettext("You must enter a folder name");
        $valid = false;
    }
    if (isset($_POST['old_name']) && strlen(trim($_POST['old_name'])) > 0) {
        $folder_data['OLD_TITLE'] = trim($_POST['old_name']);
    } else {
        $folder_data['OLD_TITLE'] = "";
    }