Esempio n. 1
0
         }
         if (!$setvroot && ($oldfolder['vroot'] && $oldfolder['vroot'] == $cur_folder_id || $oldfolder['parent_id'] != $cur_folder['parent_id'])) {
             // get the parent_id and set its vroot (if its a folder)
             // to the desc folders/forums
             if ($cur_folder['parent_id'] > 0) {
                 // is it a real folder?
                 $parent_folder = phorum_db_get_forums($cur_folder['parent_id']);
                 // then set the vroot to the vroot of the parent-folder (be it 0 or a real vroot)
                 phorum_admin_set_vroot($cur_folder_id, $parent_folder[$cur_folder['parent_id']]['vroot'], $cur_folder_id);
             } else {
                 // just default root ...
                 phorum_admin_set_vroot($cur_folder_id, 0, $cur_folder_id);
             }
             // we have now set this folder as vroot
         } elseif ($setvroot && ($oldfolder['vroot'] == 0 || $oldfolder['vroot'] != $cur_folder_id)) {
             if (!phorum_admin_set_vroot($cur_folder_id)) {
                 $error = "Database error while setting virtual-root info.";
             }
         }
         // is there an else?
     } else {
         $error = "Database error while adding/updating folder.";
     }
 }
 if (empty($error)) {
     $redir_url = phorum_admin_build_url(array('parent_id=' . $cur_folder["parent_id"]), TRUE);
     phorum_redirect_by_url($redir_url);
     exit;
 }
 foreach ($_POST as $key => $value) {
     ${$key} = $value;
Esempio n. 2
0
    if ($_GET["folder_flag"]) {
        $cur_folder_id = (int) $_GET['forum_id'];
        // handling vroots
        $oldfolder_tmp = phorum_db_get_forums($cur_folder_id);
        $oldfolder = array_shift($oldfolder_tmp);
        if ($oldfolder['parent_id'] > 0) {
            // is it a real folder?
            $parent_folder = phorum_db_get_forums($oldfolder['parent_id']);
            if ($parent_folder[$oldfolder['parent_id']]['vroot'] > 0) {
                // is a vroot set?
                // then set the vroot to the vroot of the parent-folder
                phorum_admin_set_vroot($cur_folder_id, $parent_folder[$oldfolder['parent_id']]['vroot'], $cur_folder_id);
            }
        } else {
            // just default root ...
            phorum_admin_set_vroot($cur_folder_id, 0, $cur_folder_id);
        }
        // done with vroots
        phorum_db_drop_folder($cur_folder_id);
        $msg = "The folder was deleted.  All forums and folders in this folder have been moved to this folder's parent.";
    } else {
        phorum_db_drop_forum($_GET["forum_id"]);
        $msg = "The forum was deleted.  All messages in that forum were deleted.";
    }
} elseif ($_GET["confirm"] == "No") {
    $msg = "No action was taken.";
} else {
    $forums = phorum_db_get_forums((int) $_GET["forum_id"]);
    $forum = array_shift($forums);
    if ($forum["folder_flag"]) {
        $msg = "Are you sure you want to delete {$forum['name']}?  All forums and folders in this folder will be moved to this folder's parent.";