コード例 #1
0
ファイル: index_edit.php プロジェクト: brambravo/webtrees
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
use WT\Auth;
define('WT_SCRIPT_NAME', 'index_edit.php');
require './includes/session.php';
$controller = new WT_Controller_Ajax();
// Only one of $user_id and $gedcom_id should be set
$user_id = WT_Filter::get('user_id', WT_REGEX_INTEGER, WT_Filter::post('user_id', WT_REGEX_INTEGER));
if ($user_id) {
    $gedcom_id = null;
} else {
    $gedcom_id = WT_Filter::get('gedcom_id', WT_REGEX_INTEGER, WT_Filter::post('gedcom_id', WT_REGEX_INTEGER));
}
// Only an admin can edit the "default" page
// Only managers can edit the "home page"
// Only a user or an admin can edit a user’s "my page"
if ($gedcom_id < 0 && !Auth::isAdmin() || $gedcom_id > 0 && !Auth::isManager(WT_Tree::get($gedcom_id)) || $user_id && Auth::id() != $user_id && !Auth::isAdmin()) {
    $controller->pageHeader();
    $controller->addInlineJavascript('window.location.reload();');
    exit;
}
$action = WT_Filter::get('action');
if (isset($_REQUEST['main'])) {
    $main = $_REQUEST['main'];
} else {
    $main = array();
}
if (isset($_REQUEST['right'])) {
    $right = $_REQUEST['right'];
} else {
    $right = array();
}
コード例 #2
0
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
use WT\Auth;
use WT\User;
define('WT_SCRIPT_NAME', 'admin_site_logs.php');
require './includes/session.php';
$controller = new WT_Controller_Page();
$controller->restrictAccess(Auth::isManager())->setPageTitle(WT_I18N::translate('Logs'));
require WT_ROOT . 'includes/functions/functions_edit.php';
$earliest = WT_DB::prepare("SELECT DATE(MIN(log_time)) FROM `##log`")->execute(array())->fetchOne();
$latest = WT_DB::prepare("SELECT DATE(MAX(log_time)) FROM `##log`")->execute(array())->fetchOne();
// Filtering
$action = WT_Filter::get('action');
$from = WT_Filter::get('from', '\\d\\d\\d\\d-\\d\\d-\\d\\d', $earliest);
$to = WT_Filter::get('to', '\\d\\d\\d\\d-\\d\\d-\\d\\d', $latest);
$type = WT_Filter::get('type', 'auth|change|config|debug|edit|error|media|search');
$text = WT_Filter::get('text');
$ip = WT_Filter::get('ip');
$user = WT_Filter::get('user');
$search = WT_Filter::get('search');
$search = isset($search['value']) ? $search['value'] : null;
if (Auth::isAdmin()) {
    // Administrators can see all logs
コード例 #3
0
// the Free Software Foundation; either version 2 of the License or,
// at your discretion, any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
use WT\Auth;
define('WT_SCRIPT_NAME', 'admin_trees_renumber.php');
require './includes/session.php';
$controller = new WT_Controller_Page();
$controller->restrictAccess(Auth::isManager())->setPageTitle(WT_I18N::translate('Renumber family tree'))->pageHeader();
// Every XREF used by this tree and also used by some other tree
$xrefs = WT_DB::prepare("SELECT xref, type FROM (" . " SELECT i_id AS xref, 'INDI' AS type FROM `##individuals` WHERE i_file = ?" . "  UNION " . " SELECT f_id AS xref, 'FAM' AS type FROM `##families` WHERE f_file = ?" . "  UNION " . " SELECT s_id AS xref, 'SOUR' AS type FROM `##sources` WHERE s_file = ?" . "  UNION " . " SELECT m_id AS xref, 'OBJE' AS type FROM `##media` WHERE m_file = ?" . "  UNION " . " SELECT o_id AS xref, o_type AS type FROM `##other` WHERE o_file = ? AND o_type NOT IN ('HEAD', 'TRLR')" . ") AS this_tree JOIN (" . " SELECT xref FROM `##change` WHERE gedcom_id <> ?" . "  UNION " . " SELECT i_id AS xref FROM `##individuals` WHERE i_file <> ?" . "  UNION " . " SELECT f_id AS xref FROM `##families` WHERE f_file <> ?" . "  UNION " . " SELECT s_id AS xref FROM `##sources` WHERE s_file <> ?" . "  UNION " . " SELECT m_id AS xref FROM `##media` WHERE m_file <> ?" . "  UNION " . " SELECT o_id AS xref FROM `##other` WHERE o_file <> ? AND o_type NOT IN ('HEAD', 'TRLR')" . ") AS other_trees USING (xref)")->execute(array(WT_GED_ID, WT_GED_ID, WT_GED_ID, WT_GED_ID, WT_GED_ID, WT_GED_ID, WT_GED_ID, WT_GED_ID, WT_GED_ID, WT_GED_ID, WT_GED_ID))->fetchAssoc();
echo '<h2>', $controller->getPageTitle(), ' — ', $WT_TREE->tree_title_html, '</h2>';
if (WT_Filter::get('go')) {
    foreach ($xrefs as $old_xref => $type) {
        WT_DB::exec("START TRANSACTION");
        WT_DB::exec("LOCK TABLE `##individuals` WRITE," . " `##families` WRITE," . " `##sources` WRITE," . " `##media` WRITE," . " `##other` WRITE," . " `##name` WRITE," . " `##placelinks` WRITE," . " `##change` WRITE," . " `##next_id` WRITE," . " `##dates` WRITE," . " `##default_resn` WRITE," . " `##hit_counter` WRITE," . " `##link` WRITE," . " `##user_gedcom_setting` WRITE");
        $new_xref = get_new_xref($type);
        switch ($type) {
            case 'INDI':
                WT_DB::prepare("UPDATE `##individuals` SET i_id = ?, i_gedcom = REPLACE(i_gedcom, ?, ?) WHERE i_id = ? AND i_file = ?")->execute(array($new_xref, "0 @{$old_xref}@ INDI\n", "0 @{$new_xref}@ INDI\n", $old_xref, WT_GED_ID));
                WT_DB::prepare("UPDATE `##families` JOIN `##link` ON (l_file = f_file AND l_to = ? AND l_type = 'HUSB') SET f_gedcom = REPLACE(f_gedcom, ?, ?) WHERE f_file = ?")->execute(array($old_xref, " HUSB @{$old_xref}@", " HUSB @{$new_xref}@", WT_GED_ID));
                WT_DB::prepare("UPDATE `##families` JOIN `##link` ON (l_file = f_file AND l_to = ? AND l_type = 'WIFE') SET f_gedcom = REPLACE(f_gedcom, ?, ?) WHERE f_file = ?")->execute(array($old_xref, " WIFE @{$old_xref}@", " WIFE @{$new_xref}@", WT_GED_ID));
                WT_DB::prepare("UPDATE `##families` JOIN `##link` ON (l_file = f_file AND l_to = ? AND l_type = 'CHIL') SET f_gedcom = REPLACE(f_gedcom, ?, ?) WHERE f_file = ?")->execute(array($old_xref, " CHIL @{$old_xref}@", " CHIL @{$new_xref}@", WT_GED_ID));
                WT_DB::prepare("UPDATE `##families` JOIN `##link` ON (l_file = f_file AND l_to = ? AND l_type = 'ASSO') SET f_gedcom = REPLACE(f_gedcom, ?, ?) WHERE f_file = ?")->execute(array($old_xref, " ASSO @{$old_xref}@", " ASSO @{$new_xref}@", WT_GED_ID));
コード例 #4
0
ファイル: session.php プロジェクト: brambravo/webtrees
// Choose the selected tree (if it exists), or any valid tree otherwise
$WT_TREE = null;
foreach (WT_Tree::getAll() as $tree) {
    $WT_TREE = $tree;
    if ($WT_TREE->tree_name == $GEDCOM && ($WT_TREE->imported || Auth::isAdmin())) {
        break;
    }
}
// These attributes of the currently-selected tree are used frequently
if ($WT_TREE) {
    define('WT_GEDCOM', $WT_TREE->tree_name);
    define('WT_GED_ID', $WT_TREE->tree_id);
    define('WT_GEDURL', $WT_TREE->tree_name_url);
    define('WT_TREE_TITLE', $WT_TREE->tree_title_html);
    define('WT_IMPORTED', $WT_TREE->imported);
    define('WT_USER_GEDCOM_ADMIN', Auth::isManager($WT_TREE));
    define('WT_USER_CAN_ACCEPT', Auth::isModerator($WT_TREE));
    define('WT_USER_CAN_EDIT', Auth::isEditor($WT_TREE));
    define('WT_USER_CAN_ACCESS', Auth::isMember($WT_TREE));
    define('WT_USER_GEDCOM_ID', $WT_TREE->userPreference(WT_USER_ID, 'gedcomid'));
    define('WT_USER_ROOT_ID', $WT_TREE->userPreference(WT_USER_ID, 'rootid') ? $WT_TREE->userPreference(WT_USER_ID, 'rootid') : WT_USER_GEDCOM_ID);
    define('WT_USER_PATH_LENGTH', $WT_TREE->userPreference(WT_USER_ID, 'RELATIONSHIP_PATH_LENGTH'));
    if (WT_USER_GEDCOM_ADMIN) {
        define('WT_USER_ACCESS_LEVEL', WT_PRIV_NONE);
    } elseif (WT_USER_CAN_ACCESS) {
        define('WT_USER_ACCESS_LEVEL', WT_PRIV_USER);
    } else {
        define('WT_USER_ACCESS_LEVEL', WT_PRIV_PUBLIC);
    }
    load_gedcom_settings(WT_GED_ID);
} else {
コード例 #5
0
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
use WT\Auth;
define('WT_SCRIPT_NAME', 'admin_trees_download.php');
require './includes/session.php';
require WT_ROOT . 'includes/functions/functions_export.php';
$controller = new WT_Controller_Page();
$controller->setPageTitle(WT_I18N::translate('Download GEDCOM'))->restrictAccess(Auth::isManager());
// Validate user parameters
$action = WT_Filter::get('action', 'download');
$convert = WT_Filter::get('convert', 'yes|no', 'no');
$zip = WT_Filter::get('zip', 'yes|no', 'no');
$conv_path = WT_Filter::get('conv_path');
$privatize_export = WT_Filter::get('privatize_export', 'none|visitor|user|gedadmin');
if ($action == 'download') {
    $exportOptions = array();
    $exportOptions['privatize'] = $privatize_export;
    $exportOptions['toANSI'] = $convert;
    $exportOptions['path'] = $conv_path;
}
$fileName = WT_GEDCOM;
if ($action == "download" && $zip == "yes") {
    require WT_ROOT . 'library/pclzip.lib.php';
コード例 #6
0
                echo '</select>';
            } else {
                echo '<p>', WT_I18N::translate('No GEDCOM files found.  You need to copy files to the <b>%s</b> directory on your server.', WT_DATA_DIR);
                echo '</form>';
                exit;
            }
        }
        echo '<br><br><input type="checkbox" name="keep_media', $gedcom_id, '" value="1">';
        echo WT_I18N::translate('If you have created media objects in webtrees, and have edited your gedcom off-line using a program that deletes media objects, then check this box to merge the current media objects with the new GEDCOM.');
        echo '<br><br><input type="submit" value="', WT_I18N::translate('continue'), '">';
        echo '</form>';
        exit;
}
// List the gedcoms available to this user
foreach (WT_Tree::GetAll() as $tree) {
    if (Auth::isManager($tree)) {
        echo '<table class="gedcom_table">', '<tr><th>', WT_I18N::translate('Family tree'), '</th><th><a class="accepted" href="index.php?ctype=gedcom&amp;ged=', $tree->tree_name_url, '" dir="auto">', $tree->tree_title_html, '</a>', '</th></tr><tr><th class="accepted">', $tree->tree_name_html, '</th><td>';
        // The third row shows an optional progress bar and a list of maintenance options
        $importing = WT_DB::prepare("SELECT 1 FROM `##gedcom_chunk` WHERE gedcom_id=? AND imported=0 LIMIT 1")->execute(array($tree->tree_id))->fetchOne();
        if ($importing) {
            $in_progress = WT_DB::prepare("SELECT 1 FROM `##gedcom_chunk` WHERE gedcom_id=? AND imported=1 LIMIT 1")->execute(array($tree->tree_id))->fetchOne();
            if (!$in_progress) {
                echo '<div id="import', $tree->tree_id, '"><div id="progressbar', $tree->tree_id, '"><div style="position:absolute;">', WT_I18N::translate('Deleting old genealogy data…'), '</div></div></div>';
                $controller->addInlineJavascript('jQuery("#progressbar' . $tree->tree_id . '").progressbar({value: 0});');
            } else {
                echo '<div id="import', $tree->tree_id, '"></div>';
            }
            $controller->addInlineJavascript('jQuery("#import' . $tree->tree_id . '").load("import.php?gedcom_id=' . $tree->tree_id . '&keep_media' . $tree->tree_id . '=' . WT_Filter::get('keep_media' . $tree->tree_id) . '");');
            echo '<table border="0" width="100%" id="actions', $tree->tree_id, '" style="display:none">';
        } else {
            echo '<table border="0" width="100%" id="actions', $tree->tree_id, '">';
コード例 #7
0
ファイル: admin.php プロジェクト: sadr110/webtrees
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
use WT\Auth;
use WT\User;
define('WT_SCRIPT_NAME', 'admin.php');
require './includes/session.php';
require WT_ROOT . 'includes/functions/functions_edit.php';
$controller = new WT_Controller_Page();
$controller->restrictAccess(Auth::isManager())->addInlineJavascript('jQuery("#x").accordion({heightStyle: "content"});')->addInlineJavascript('jQuery("#tree_stats").accordion();')->addInlineJavascript('jQuery("#changes").accordion();')->addInlineJavascript('jQuery("#content_container").css("visibility", "visible");')->setPageTitle(WT_I18N::translate('Administration'))->pageHeader();
// Check for updates
$latest_version_txt = fetch_latest_version();
if (preg_match('/^[0-9.]+\\|[0-9.]+\\|/', $latest_version_txt)) {
    list($latest_version, $earliest_version, $download_url) = explode('|', $latest_version_txt);
} else {
    // Cannot determine the latest version
    $latest_version = '';
}
// Delete old files (if we can).
$old_files = array();
foreach (old_paths() as $path) {
    if (file_exists($path)) {
        delete_recursively($path);
        // we may not have permission to delete.  Is it still there?
        if (file_exists($path)) {
コード例 #8
0
// the Free Software Foundation; either version 2 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
use WT\Auth;
define('WT_SCRIPT_NAME', 'admin_site_merge.php');
require './includes/session.php';
$controller = new WT_Controller_Page();
$controller->restrictAccess(Auth::isManager())->setPageTitle(WT_I18N::translate('Merge records'))->addExternalJavascript(WT_STATIC_URL . 'js/autocomplete.js')->addInlineJavascript('autocomplete();')->pageHeader();
require_once WT_ROOT . 'includes/functions/functions_edit.php';
$ged = $GEDCOM;
$gid1 = WT_Filter::post('gid1', WT_REGEX_XREF);
$gid2 = WT_Filter::post('gid2', WT_REGEX_XREF);
$action = WT_Filter::post('action', 'choose|select|merge', 'choose');
$ged1 = WT_Filter::post('ged1', null, $ged);
$ged2 = WT_Filter::post('ged2', null, $ged);
$keep1 = WT_Filter::postArray('keep1');
$keep2 = WT_Filter::postArray('keep2');
if ($action != 'choose') {
    if ($gid1 == $gid2 && $ged1 == $ged2) {
        $action = 'choose';
        echo '<span class="error">', WT_I18N::translate('You entered the same IDs.  You cannot merge the same records.'), '</span>';
    } else {
        $rec1 = WT_GedcomRecord::getInstance($gid1, WT_Tree::getIdFromName($ged1));
コード例 #9
0
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
use WT\Auth;
use WT\User;
define('WT_SCRIPT_NAME', 'admin_trees_config.php');
require './includes/session.php';
$controller = new WT_Controller_Page();
$controller->restrictAccess(Auth::isManager())->setPageTitle(WT_I18N::translate('Family tree configuration'));
require WT_ROOT . 'includes/functions/functions_edit.php';
$PRIVACY_CONSTANTS = array('none' => WT_I18N::translate('Show to visitors'), 'privacy' => WT_I18N::translate('Show to members'), 'confidential' => WT_I18N::translate('Show to managers'), 'hidden' => WT_I18N::translate('Hide from everyone'));
switch (WT_Filter::post('action')) {
    case 'delete':
        if (!WT_Filter::checkCsrf()) {
            break;
        }
        WT_DB::prepare("DELETE FROM `##default_resn` WHERE default_resn_id=?")->execute(array(WT_Filter::post('default_resn_id')));
        // Reload the page, so that the new privacy restrictions are reflected in the header
        header('Location: ' . WT_SERVER_NAME . WT_SCRIPT_PATH . WT_SCRIPT_NAME . '#privacy');
        exit;
    case 'add':
        if (!WT_Filter::checkCsrf()) {
            break;
        }
コード例 #10
0
ファイル: edit_interface.php プロジェクト: brambravo/webtrees
 ////////////////////////////////////////////////////////////////////////////////
 case 'add_unlinked_indi':
     $controller->restrictAccess(Auth::isManager())->setPageTitle(WT_I18N::translate('Create a new individual'))->pageHeader();
     print_indi_form('add_unlinked_indi_action', null, null, null, null, null);
     break;
 case 'add_unlinked_indi_action':
     $glevels = WT_Filter::postArray('glevels', '[0-9]');
     $tag = WT_Filter::postArray('tag', WT_REGEX_TAG);
     $text = WT_Filter::postArray('text');
     $islink = WT_Filter::postArray('islink', '[01]');
     if (!WT_Filter::checkCsrf()) {
         Zend_Session::writeClose();
         header('Location: ' . WT_SERVER_NAME . WT_SCRIPT_PATH . WT_SCRIPT_NAME . '?action=add_unlinked_indi');
         exit;
     }
     $controller->restrictAccess(Auth::isManager())->pageHeader();
     splitSOUR();
     $gedrec = "0 @REF@ INDI";
     $gedrec .= addNewName();
     $gedrec .= addNewSex();
     if (preg_match_all('/([A-Z0-9_]+)/', $QUICK_REQUIRED_FACTS, $matches)) {
         foreach ($matches[1] as $match) {
             $gedrec .= addNewFact($match);
         }
     }
     if (WT_Filter::postBool('SOUR_INDI')) {
         $gedrec = handle_updates($gedrec);
     } else {
         $gedrec = updateRest($gedrec);
     }
     $new_indi = WT_GedcomRecord::createRecord($gedrec, WT_GED_ID);
コード例 #11
0
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
use WT\Auth;
use WT\Log;
define('WT_SCRIPT_NAME', 'admin_media_upload.php');
require './includes/session.php';
require_once WT_ROOT . 'includes/functions/functions_mediadb.php';
$controller = new WT_Controller_Page();
$controller->restrictAccess(Auth::isManager())->setPageTitle(WT_I18N::translate('Upload media files'));
$action = WT_Filter::post('action');
if ($action == "upload") {
    for ($i = 1; $i < 6; $i++) {
        if (!empty($_FILES['mediafile' . $i]["name"]) || !empty($_FILES['thumbnail' . $i]["name"])) {
            $folder = WT_Filter::post('folder' . $i);
            // Validate the media folder
            $folderName = str_replace('\\', '/', $folder);
            $folderName = trim($folderName, '/');
            if ($folderName == '.') {
                $folderName = '';
            }
            if ($folderName) {
                $folderName .= '/';
                // Not allowed to use “../”
                if (strpos('/' . $folderName, '/../') !== false) {
コード例 #12
0
        $record = WT_Family::getInstance($row->xref, $row->gedcom_id, $row->gedcom);
        foreach ($record->getFacts() as $fact) {
            $old_place = $fact->getAttribute('PLAC');
            if (preg_match('/(^|, )' . preg_quote($search, '/') . '$/i', $old_place)) {
                $new_place = preg_replace('/(^|, )' . preg_quote($search, '/') . '$/i', '$1' . $replace, $old_place);
                $changes[$old_place] = $new_place;
                if ($confirm == 'update') {
                    $gedcom = preg_replace('/(\\n2 PLAC (?:.*, )*)' . preg_quote($search, '/') . '(\\n|$)/i', '$1' . $replace . '$2', $fact->getGedcom());
                    $record->updateFact($fact->getFactId(), $gedcom, false);
                }
            }
        }
    }
}
$controller = new WT_Controller_Page();
$controller->restrictAccess(Auth::isManager())->setPageTitle(WT_I18N::translate('Administration - place edit'))->pageHeader();
?>

<h2>
	<?php 
echo WT_I18N::translate('Update all the place names in a family tree');
?>
</h2>

<p>
	<?php 
echo WT_I18N::translate('This will update the highest-level part or parts of the place name.  For example, “Mexico” will match “Quintana Roo, Mexico”, but not “Santa Fe, New Mexico”.');
?>
</p>

<form method="post">
コード例 #13
0
// at your discretion, any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
use WT\Auth;
define('WT_SCRIPT_NAME', 'admin_trees_check.php');
require './includes/session.php';
require WT_ROOT . 'includes/functions/functions_edit.php';
$controller = new WT_Controller_Page();
$controller->restrictAccess(Auth::isManager())->setPageTitle(WT_I18N::translate('Check for errors'))->pageHeader();
echo '<form method="get" action="', WT_SCRIPT_NAME, '">';
echo '<input type="hidden" name="go" value="1">';
echo select_edit_control('ged', WT_Tree::getNameList(), null, WT_GEDCOM);
echo '<input type="submit" value="', $controller->getPageTitle(), '">';
echo '</form>';
if (!WT_Filter::get('go')) {
    exit;
}
// We need to work with raw GEDCOM data, as we are looking for errors
// which may prevent the WT_GedcomRecord objects from working...
$rows = WT_DB::prepare("SELECT i_id AS xref, 'INDI' AS type, i_gedcom AS gedrec FROM `##individuals` WHERE i_file=?" . " UNION " . "SELECT f_id AS xref, 'FAM'  AS type, f_gedcom AS gedrec FROM `##families`    WHERE f_file=?" . " UNION " . "SELECT s_id AS xref, 'SOUR' AS type, s_gedcom AS gedrec FROM `##sources`     WHERE s_file=?" . " UNION " . "SELECT m_id AS xref, 'OBJE' AS type, m_gedcom AS gedrec FROM `##media`       WHERE m_file=?" . " UNION " . "SELECT o_id AS xref, o_type AS type, o_gedcom AS gedrec FROM `##other`       WHERE o_file=? AND o_type NOT IN ('HEAD', 'TRLR')")->execute(array(WT_GED_ID, WT_GED_ID, WT_GED_ID, WT_GED_ID, WT_GED_ID))->fetchAll();
$records = array();
foreach ($rows as $row) {
    $records[$row->xref] = $row;
}
コード例 #14
0
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
use WT\Auth;
define('WT_SCRIPT_NAME', 'admin_site_other.php');
require './includes/session.php';
require WT_ROOT . 'includes/functions/functions_edit.php';
$controller = new WT_Controller_Page();
$controller->restrictAccess(Auth::isManager())->setPageTitle(WT_I18N::translate('Add unlinked records'))->pageHeader();
?>
<div id="other">
	<p>
		<?php 
echo WT_I18N::translate('Add unlinked records');
?>
	</p>
	<p>
		<form method="post" action="?" name="tree">
			<?php 
echo select_edit_control('ged', WT_Tree::getNameList(), null, WT_GEDCOM, ' onchange="tree.submit();"');
?>
		</form>
	</p>
	<table id="other">
コード例 #15
0
ファイル: block_edit.php プロジェクト: brambravo/webtrees
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
use WT\Auth;
define('WT_SCRIPT_NAME', 'block_edit.php');
require './includes/session.php';
$block_id = WT_Filter::getInteger('block_id');
$block = WT_DB::prepare("SELECT SQL_CACHE * FROM `##block` WHERE block_id=?")->execute(array($block_id))->fetchOneRow();
// Check access.  (1) the block must exist, (2) gedcom blocks require
// managers, (3) user blocks require the user or an admin
if (!$block || $block->gedcom_id && !Auth::isManager(WT_Tree::get($block->gedcom_id)) || $block->user_id && $block->user_id != Auth::id() && !Auth::isAdmin()) {
    exit;
}
$class_name = $block->module_name . '_WT_Module';
$block = new $class_name();
$controller = new WT_Controller_Ajax();
$controller->pageHeader();
if (array_key_exists('ckeditor', WT_Module::getActiveModules())) {
    ckeditor_WT_Module::enableEditor($controller);
}
?>
<form name="block" method="post" action="block_edit.php?block_id=<?php 
echo $block_id;
?>
" onsubmit="return modalDialogSubmitAjax(this);" >
	<input type="hidden" name="save" value="1">