예제 #1
0
 case 'delete':
     $gedcom_id = WT_Filter::postInteger('gedcom_id');
     if (WT_Filter::checkCsrf() && $gedcom_id) {
         WT_Tree::delete($gedcom_id);
     }
     header('Location: ' . WT_SERVER_NAME . WT_SCRIPT_PATH . WT_SCRIPT_NAME);
     break;
 case 'setdefault':
     if (WT_Filter::checkCsrf()) {
         WT_Site::preference('DEFAULT_GEDCOM', WT_Filter::post('default_ged'));
     }
     break;
 case 'new_tree':
     $ged_name = basename(WT_Filter::post('ged_name'));
     if (WT_Filter::checkCsrf() && $ged_name) {
         WT_Tree::create($ged_name);
     }
     break;
 case 'replace_upload':
     $gedcom_id = WT_Filter::postInteger('gedcom_id');
     // Make sure the gedcom still exists
     if (WT_Filter::checkCsrf() && get_gedcom_from_id($gedcom_id)) {
         foreach ($_FILES as $FILE) {
             if ($FILE['error'] == 0 && is_readable($FILE['tmp_name'])) {
                 import_gedcom_file($gedcom_id, $FILE['tmp_name'], $FILE['name']);
             }
         }
     }
     header('Location: ' . WT_SERVER_NAME . WT_SCRIPT_PATH . WT_SCRIPT_NAME . '?keep_media' . $gedcom_id . '=' . WT_Filter::postBool('keep_media' . $gedcom_id));
     exit;
 case 'replace_import':