summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--addremotelink.php282
-rw-r--r--addsearchlink.php104
-rw-r--r--client.php445
-rw-r--r--editconfig_gedcom.php9
-rw-r--r--help_text.php31
-rw-r--r--includes/classes/class_family.php2
-rw-r--r--includes/classes/class_gedcomrecord.php97
-rw-r--r--includes/classes/class_localclient.php138
-rw-r--r--includes/classes/class_menubar.php13
-rw-r--r--includes/classes/class_person.php4
-rw-r--r--includes/classes/class_serviceclient.php906
-rw-r--r--includes/controllers/descendancy_ctrl.php8
-rw-r--r--includes/controllers/family_ctrl.php11
-rw-r--r--includes/controllers/individual_ctrl.php48
-rw-r--r--includes/controllers/remotelink_ctrl.php397
-rw-r--r--includes/controllers/search_ctrl.php213
-rw-r--r--includes/functions/functions.php25
-rw-r--r--includes/functions/functions_db.php35
-rw-r--r--includes/functions/functions_edit.php7
-rw-r--r--includes/functions/functions_import.php31
-rw-r--r--includes/functions/functions_print_facts.php56
-rw-r--r--includes/session.php11
-rw-r--r--includes/session_spider.php9
-rw-r--r--includes/set_gedcom_defaults.php1
-rw-r--r--individual.php18
-rw-r--r--manageservers.php305
-rw-r--r--modules/lightbox/functions/lightbox_print_media.php87
-rw-r--r--modules/relatives/module.php8
-rw-r--r--pgv_to_wt.php14
-rw-r--r--search.php48
-rw-r--r--serviceClientTest.php94
-rw-r--r--setup.php14
32 files changed, 91 insertions, 3380 deletions
diff --git a/addremotelink.php b/addremotelink.php
deleted file mode 100644
index 88d70684c7..0000000000
--- a/addremotelink.php
+++ /dev/null
@@ -1,282 +0,0 @@
-<?php
-/**
-* Add Remote Link Page
-*
-* Allow a user the ability to add links to people from other servers and other gedcoms.
-*
-* webtrees: Web based Family History software
- * Copyright (C) 2010 webtrees development team.
- *
- * Derived from PhpGedView
-* Copyright (C) 2002 to 2009 PGV Development Team. All rights reserved.
-*
-* This program is free software; you can redistribute it and/or modify
-* it under the terms of the GNU General Public License as published by
-* 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-*
-* @package webtrees
-* @subpackage Charts
-* @version $Id$
-*/
-
-define('WT_SCRIPT_NAME', 'addremotelink.php');
-require './includes/session.php';
-require WT_ROOT.'includes/controllers/remotelink_ctrl.php';
-
-$controller=new RemoteLinkController();
-$controller->init();
-
-print_simple_header(i18n::translate('Add Remote Link'));
-
-$pid=safe_REQUEST($_REQUEST, 'pid', WT_REGEX_XREF);
-$action=safe_POST('action', array('addlink'));
-
-//-- only allow managers to create remote links
-if (!$controller->canAccess()) {
- echo '<span class="error">', i18n::translate('<b>Access Denied</b><br />You do not have access to this resource.'), '<br />';
- if (!WT_USER_GEDCOM_ADMIN) {
- echo i18n::translate('This user name cannot edit this GEDCOM.');
- } else if (!$ALLOW_EDIT_GEDCOM) {
- echo i18n::translate('Editing this GEDCOM has been disabled by the administrator.');
- } else {
- echo i18n::translate('Privacy settings prevent you from editing this record.');
- if ($pid) {
- echo '<br />', i18n::translate('You have no access to'), ' ', $pid;
- }
- }
- echo '</span><br /><br /><div class="center"><a href="javascript://', i18n::translate('Close Window'), '" onclick="window.close();">', i18n::translate('Close Window'), '</a></div>';
- print_simple_footer();
- exit;
-}
-
-$success=$controller->runAction($action);
-
-echo WT_JS_START;
-?>
-function sameServer() {
- alert('<?php echo i18n::translate('You have selected the same site.'); ?>');
-}
-function remoteServer() {
- alert('<?php echo i18n::translate('You have selected a remote site.'); ?>');
-}
-function swapComponents(btnPressed) {
- var labelSite = document.getElementById('labelSite');
- var existingContent = document.getElementById('existingContent');
- var localContent = document.getElementById('localContent');
- var remoteContent = document.getElementById('remoteContent');
- if (btnPressed=="remote") {
- labelSite.innerHTML = '<?php echo i18n::translate('Site'); ?>';
- existingContent.style.display='none';
- localContent.style.display='none';
- remoteContent.style.display='block';
- } else if (btnPressed=="local") {
- labelSite.innerHTML = '<?php echo i18n::translate('Database ID'); ?>';
- existingContent.style.display='none';
- localContent.style.display='block';
- remoteContent.style.display='none';
- } else {
- labelSite.innerHTML = '<?php echo i18n::translate('Site'); ?>';
- existingContent.style.display='block';
- localContent.style.display='none';
- remoteContent.style.display='none';
- }
-}
-function edit_close() {
- if (window.opener.showchanges) window.opener.showchanges();
- window.close();
-}
-function checkform(frm) {
- if (frm.txtPID.value=='') {
- alert('Please enter all fields.');
- return false;
- }
- return true;
-}
-<?php
-echo WT_JS_END;
-
-if (!$success) {
-?>
-<form method="post" name="addRemoteRelationship" action="addremotelink.php" onsubmit="return checkform(this);">
-<input type="hidden" name="action" value="addlink" />
-<input type="hidden" name="pid" value="<?php echo $pid; ?>" />
-<span class="title">
- <?php echo PrintReady($controller->person->getFullName()), '&nbsp;', PrintReady("(".$controller->person->getXref().")"); ?>
-</span><br /><br />
-<table class="facts_table">
- <tr>
- <td class="title" colspan="2">
- <?php echo i18n::translate('Add Remote Link'), help_link('link_remote'); ?>
- </td>
- </tr>
- <tr>
- <td class="descriptionbox wrap width20">
- <?php echo i18n::translate('Relationship to current person'), help_link('link_remote_rel'); ?>
- </td>
- <td class="optionbox">
- <select id="cbRelationship" name="cbRelationship">
- <?php
- foreach (array(
- 'current_person'=>i18n::translate('Same as current'),
- 'mother' =>i18n::translate('Mother'),
- 'father' =>i18n::translate('Father'),
- 'husband' =>i18n::translate('Husband'),
- 'wife' =>i18n::translate('Wife'),
- 'son' =>i18n::translate('Son'),
- 'daughter' =>i18n::translate('Daughter')
- ) as $rel=>$display) {
- echo '<option value="', $rel, '"';
- if ($rel==$controller->form_cbRelationship) {
- echo ' checked="checked"';
- }
- echo '>', $display, '</option>';
- }
- ?>
- </select>
- </td>
- </tr>
- <?php if ($controller->server_list || $controller->gedcom_list) { ?>
- <tr>
- <td class="descriptionbox wrap width20">
- <?php echo i18n::translate('Site location'), help_link('link_remote_location'); ?>
- </td>
- <td class="optionbox">
- <?php
- echo '<input type="radio" id="local" name="location" value="local" onclick="swapComponents(\'local\')"';
- if (!$controller->gedcom_list) {
- echo ' disabled';
- }
- if ($controller->form_location=='local') {
- echo ' checked="checked"';
- }
- echo '/>', i18n::translate('Local site'), '&nbsp;&nbsp;&nbsp';
- echo '<input type="radio" id="existing" name="location" value="existing" onclick="swapComponents(\'existing\');"';
- if (!$controller->server_list) {
- echo ' disabled';
- }
- if ($controller->form_location=='existing') {
- echo ' checked="checked"';
- }
- echo '/>', i18n::translate('Existing remote site'), '&nbsp;&nbsp;&nbsp;';
- echo '<input type="radio" id="remote" name="location" value="remote" onclick="swapComponents(\'remote\');"';
- if ($controller->form_location=='remote') {
- echo ' checked="checked"';
- }
- echo '/>', i18n::translate('New remote site');
- ?>
- </td>
- </tr>
- <?php } ?>
-
- <tr>
- <td class="descriptionbox wrap width20">
- <?php echo i18n::translate('Person ID'), help_link('link_person_id'); ?>
- </td>
- <td class="optionbox">
- <input type="text" id="txtPID" name="txtPID" size="14" value="<?php echo $controller->form_txtPID; ?>" />
- </td>
- </tr>
- <tr>
- <td class="descriptionbox wrap width20">
- <span id="labelSite"><?php echo i18n::translate('Site'); ?></span><?php echo help_link('link_remote_site'); ?>
- </td>
- <td class="optionbox" id="tdUrlText">
- <div id="existingContent">
- <?php echo i18n::translate('Existing remote site'); ?><br />
- <select id="cbExistingServers" name="cbExistingServers" style="width: 400px;">
- <?php
- foreach ($controller->server_list as $key=>$server) {
- echo '<option value="', $key, '"';
- if ($key==$controller->form_cbExistingServers) {
- echo ' selected="selected"';
- }
- echo '/>', PrintReady($server['name']), '</option>';
- }
- ?>
- </select><br /><br />
- </div>
- <div id="remoteContent">
- <?php echo i18n::translate('Type in a new site.'); ?>
- <table>
- <tr>
- <td ><?php echo i18n::translate('Title:'); ?></td>
- <td><input type="text" id="txtTitle" name="txtTitle" size="66" value="<?php echo $controller->form_txtTitle; ?>" /></td>
- </tr><tr>
- <td valign="top"><?php echo i18n::translate('Site URL:'); ?></td>
- <td><input type="text" id="txtURL" name="txtURL" size="66" value="<?php echo $controller->form_txtURL; ?>" />
- </tr><tr>
- <td>&nbsp;&nbsp;<?php echo i18n::translate('Example:'); ?></td>
- <td>http://www.remotesite.com/phpGedView/genservice.php?wsdl</td>
- </tr><tr>
- <td><?php echo i18n::translate('Database ID:'); ?></td>
- <td><input type="text" id="txtGID" name="txtGID" value="<?php echo $controller->form_txtGID; ?>" /></td>
- </tr><tr>
- <td><?php echo i18n::translate('Username: '); ?></td>
- <td><input type="text" id="txtUsername" name="txtUsername" value="<?php echo $controller->form_txtUsername; ?>" /></td>
- </tr><tr>
- <td><?php echo i18n::translate('Password: '); ?></td>
- <td><input type="password" id="txtPassword" name="txtPassword" value="<?php echo $controller->form_txtPassword; ?>" /></td>
- </tr>
- </table>
- </div>
- <div id="localContent">
- <table><tr>
- <td ><?php echo i18n::translate('Title:'); ?></td>
- <td><input type="text" id="txtCB_Title" name="txtCB_Title" size="66" value="<?php echo $controller->form_txtCB_Title; ?>" /></td>
- </tr><tr>
- <td valign="top"><?php echo i18n::translate('GEDCOM File:'); ?></td>
- <td><select id="txtCB_GID" name="txtCB_GID">
- <?php
- foreach ($controller->gedcom_list as $ged_name) {
- echo '<option value="', $ged_name, '"';
- if ($ged_name==$controller->form_txtCB_GID) {
- echo ' selected="selected"';
- }
- echo '>', $ged_name, '</option>';
- }
- ?>
- </select></td>
- </tr></table>
- </div>
- </td>
- </tr>
- <?php
- if (WT_USER_IS_ADMIN) {
- echo "<tr><td class=\"descriptionbox ", $TEXT_DIRECTION, " wrap width25\">";
- echo i18n::translate('Admin Option'), help_link('no_update_CHAN'), '</td><td class="optionbox wrap">';
- if ($NO_UPDATE_CHAN) {
- echo "<input type=\"checkbox\" checked=\"checked\" name=\"preserve_last_changed\" />\n";
- } else {
- echo "<input type=\"checkbox\" name=\"preserve_last_changed\" />\n";
- }
- echo i18n::translate('Do not update the CHAN (Last Change) record'), "<br />\n";
- $event = new Event(get_sub_record(1, "1 CHAN", ""));
- echo format_fact_date($event, false, true);
- echo "</td></tr>\n";
- }
- ?>
-</table>
-<br />
-<input type="submit" value="<?php echo i18n::translate('Add Link'); ?>" id="btnSubmit" name="btnSubmit" />
-</form>
-<?php
- echo WT_JS_START, 'swapComponents("', $controller->form_location, '");', WT_JS_END;
-}
-
-// autoclose window when update successful unless debug on
-if ($success && !WT_DEBUG ) {
- echo WT_JS_START, 'edit_close();', WT_JS_END;
-} else {
- echo '<div class="center"><a href="javascript://', i18n::translate('Close Window'), '" onclick="edit_close();">', i18n::translate('Close Window'), '</a></div>';
- print_simple_footer();
-}
diff --git a/addsearchlink.php b/addsearchlink.php
deleted file mode 100644
index 1fe341b20c..0000000000
--- a/addsearchlink.php
+++ /dev/null
@@ -1,104 +0,0 @@
-<?php
-/**
- * Allows user to select a person on their server to create a remote link
- * to a person selected from the search results.
- *
- * webtrees: Web based Family History software
- * Copyright (C) 2010 webtrees development team.
- *
- * Derived from PhpGedView
- * Copyright (C) 2002 to 2005 John Finlay and Others
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- * @package webtrees
- * @subpackage Display
- * @version $Id$
- */
-
-define('WT_SCRIPT_NAME', 'addsearchlink.php');
-require './includes/session.php';
-
-print_simple_header(i18n::translate('Add Local Link'));
-
-//-- only allow users with editing access to this page
-if (!WT_USER_CAN_EDIT) {
- echo i18n::translate('<b>Access Denied</b><br />You do not have access to this resource.');
- print_simple_footer();
- exit;
-}
-
-if (isset($_REQUEST['pid'])) $pid = $_REQUEST['pid'];
-if (isset($_REQUEST['server'])) $server = $_REQUEST['server'];
-if (isset($_REQUEST['indiName'])) $indiName = $_REQUEST['indiName'];
-
-//To use addsearchlink you should have come from a multisearch result link
-if (isset($pid) && isset($server) && isset($indiName))
-{
-?>
-
-<br/>
-<center><font size="4"><?php echo $indiName; ?></font><center><br/>
-<table align="center">
- <tr>
- <td>
- <form method="post" name="addRemoteRelationship" action="addremotelink.php">
- <input type="hidden" name="action" value="addlink" />
- <input type="hidden" name="location" value="remote" />
- <input type="hidden" name="cbExistingServers" value="<?php echo $server; ?>" />
- <input type="hidden" name="txtPID" value="<?php echo $pid; ?>" />
-
- <table class="facts_table" align="center">
- <tr>
- <td class="facts_label03" colspan="3" align="center">
- <?php echo i18n::translate('Add Remote Link'), help_link('link_remote'); ?>
- </td>
- </tr>
- <tr>
- <td class="descriptionbox width20" id="tdId">
- <?php echo i18n::translate('Local Person ID'), help_link('link_person_id'); ?>
- </td>
- <td class="optionbox"><input type="text" id="pid" name="pid" size="14"/></td>
- <td class="optionbox" rowspan="2"><br/>
- <input type="submit" value="<?php echo i18n::translate('Add Link'); ?>" id="btnSubmit" name="btnSubmit" value="add"/>
- </td>
- </tr>
- <tr>
- <td class="descriptionbox width20">
- <?php echo i18n::translate('Relationship to current person'), help_link('link_remote_rel'); ?>
- </td>
- <td class="optionbox">
- <select id="cbRelationship" name="cbRelationship">
- <option value="self" selected><?php echo i18n::translate('Same as current'); ?></option>
- <option value="mother"><?php echo i18n::translate('Mother'); ?></option>
- <option value="father"><?php echo i18n::translate('Father'); ?></option>
- <option value="husband"><?php echo i18n::translate('Husband'); ?></option>
- <option value="wife"><?php echo i18n::translate('Wife'); ?></option>
- <option value="son"><?php echo i18n::translate('Son'); ?></option>
- <option value="daughter"><?php echo i18n::translate('Daughter'); ?></option>
- </select>
- </td>
- </tr>
- </table><br/>
- </form>
- </td>
- </tr>
-</table>
-
-<?php
-} else {
- echo "<br/><center><b><font color=\"red\">Oh, now you're hacking!</font></b></center><br/>";
-}
-print_footer();
diff --git a/client.php b/client.php
deleted file mode 100644
index 23b478df15..0000000000
--- a/client.php
+++ /dev/null
@@ -1,445 +0,0 @@
-<?php
-/**
-* Defines a protocol for interfacing remote requests over a http connection
-*
-* When $action is 'get' then the gedcom record with the given $xref is retrieved.
-* When $action is 'update' the gedcom record matching $xref is replaced with the data in $gedrec.
-* When $action is 'append' the gedcom record in $gedrec is appended to the end of the gedcom file.
-* When $action is 'delete' the gedcom record with $xref is removed from the file.
-*
-* webtrees: Web based Family History software
- * Copyright (C) 2010 webtrees development team.
- *
- * Derived from PhpGedView
-* Copyright (C) 2002 to 2009 PGV Development Team. All rights reserved.
-*
-* This program is free software; you can redistribute it and/or modify
-* it under the terms of the GNU General Public License as published by
-* 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-*
-* @package webtrees
-* @subpackage Edit
-* @version $Id$
-*/
-
-define('WT_SCRIPT_NAME', 'client.php');
-require './includes/session.php';
-require WT_ROOT.'includes/functions/functions_edit.php';
-
-header('Content-Type: text/plain; charset=UTF-8');
-
-$READ_ONLY = ((isset($_SESSION['readonly']))&&($_SESSION['readonly']==true)) ? 1 : 0;
-
-// Make sure there is at least one gedcom.
-if (count(get_all_gedcoms())==0) {
- addToLog($action." ERROR 21: No Gedcoms available on this site.", 'debug');
- echo "ERROR 21: No Gedcoms available on this site.\n";
- exit;
-}
-
-$gedcom=safe_REQUEST($_REQUEST,'GEDCOM');
-if ($gedcom) {
- if (!in_array($gedcom, get_all_gedcoms())) {
- addToLog("ERROR 21: Invalid GEDCOM specified.", 'debug');
- echo "ERROR 21: Invalid GEDCOM specified.\n";
- exit;
- }
- $GEDCOM=$gedcom;
-}
-$GED_ID=get_id_from_gedcom($GEDCOM);
-
-if (!get_gedcom_setting($GED_ID, 'imported')) {
- addToLog($action." ERROR 22: Gedcom [$GEDCOM] needs to be imported.", 'debug');
- echo "ERROR 22: Gedcom [$GEDCOM] needs to be imported.\n";
- exit;
-}
-
-$action=safe_REQUEST($_REQUEST,'action');
-
-// The following actions can be performed without being connected.
-switch ($action) {
-case '':
- addToLog("ERROR 1: No action specified.", 'debug');
- echo "ERROR 1: No action specified.\n";
- exit;
-case 'version':
- addToLog($action." SUCCESS\n".WT_VERSION_TEXT."\n", 'debug');
- echo "SUCCESS\n".WT_VERSION_TEXT."\n";
- exit;
-case 'connect':
- $username=safe_REQUEST($_REQUEST,'username');
- if ($username) {
- $password=safe_REQUEST($_REQUEST,'password');
- $user_id=authenticateUser($username, $password);
- if ($user_id) {
- $stat=newConnection();
- if ($stat!==false) {
- addToLog($action." username=$username SUCCESS\n".$stat, 'debug');
- echo "SUCCESS\n".$stat;
- }
- $_SESSION['connected']=$user_id;
- } else {
- addToLog($action." username=$username ERROR 10: Username and password key failed to authenticate.", 'debug');
- echo "ERROR 10: Username and password key failed to authenticate.\n";
- }
- } else {
- $stat=newConnection();
- if ($stat!==false) {
- addToLog($action." SUCCESS\n".$stat, 'debug');
- echo "SUCCESS\n".$stat;
- }
- AddToLog('Read-Only Anonymous Client connection.', 'auth');
- $_SESSION['connected']='Anonymous';
- $_SESSION['readonly']=1;
- }
- exit;
-case 'listgedcoms':
- $out_msg = "SUCCESS\n";
- foreach (get_all_gedcoms() as $ged_id=>$gedcom) {
- $out_msg.="$gedcom\t".get_gedcom_setting($ged_id, 'title')."\n";
- }
- addToLog($action." ".$out_msg, 'debug');
- echo $out_msg;
- exit;
-default:
- // All other actions require an authenticated connection
- if (empty($_SESSION['connected'])) {
- addToLog($action." ERROR 12: use 'connect' action to initiate a session.", 'debug');
- echo "ERROR 12: use 'connect' action to initiate a session.\n";
- exit;
- }
- break;
-}
-
-// The following actions can only be performed when connected
-switch ($action) {
-case 'get':
- $xref=safe_REQUEST($_REQUEST,'xref', WT_REGEX_XREF.'([ ,;]+'.WT_REGEX_XREF.')*');
- $view=safe_REQUEST($_REQUEST,'view', WT_REGEX_ALPHANUM);
- if ($xref) {
- $xrefs = preg_split("/[;, ]/", $xref, 0, PREG_SPLIT_NO_EMPTY);
- $gedrecords="";
- foreach ($xrefs as $xref1) {
- if (!empty($xref1)) {
- $gedrec=find_gedcom_record($xref1, $GED_ID, true);
- if ($gedrec) {
- preg_match("/0 @(.*)@ (.*)/", $gedrec, $match);
- $type = trim($match[2]);
- if (!canDisplayRecord($GED_ID, $gedrec)) {
- //-- do not have full access to this record, so privatize it
- $gedrec = privatize_gedcom($gedrec);
- }
- else if ($view=='version' || $view=='change') {
- $chan = get_gedcom_value('CHAN', 1, $gedrec);
- if (empty($chan)) {
- $head = find_gedcom_record("HEAD", $GED_ID);
- $head_date = get_sub_record(1, "1 DATE", $head);
- $lines = explode("\n", $head_date);
- $head_date = "";
- foreach ($lines as $line) {
- $num = $line{0};
- $head_date.=($num+1).substr($line, 1)."\n";
- }
- $chan = "1 CHAN\n".$head_date;
- }
- $gedrec = '0 @'.$xref1.'@ '.$type."\n".$chan;
- }
- if (!empty($gedrec)) $gedrecords = $gedrecords . "\n".trim($gedrec);
- }
- }
- }
- if (!safe_REQUEST($_REQUEST,'keepfile')) {
- $ct = preg_match_all("/ FILE (.*)/", $gedrecords, $match, PREG_SET_ORDER);
- for ($i=0; $i<$ct; $i++) {
- $mediaurl = WT_SERVER_NAME.WT_SCRIPT_PATH.$MEDIA_DIRECTORY.extract_filename($match[$i][1]);
- $gedrecords = str_replace($match[$i][1], $mediaurl, $gedrecords);
- }
- }
- addToLog($action." xref=$xref ".$gedrecords, 'debug');
- echo "SUCCESS\n".$gedrecords;
- } else {
- addToLog($action." ERROR 3: No gedcom id specified. Please specify a xref.", 'debug');
- echo "ERROR 3: No gedcom id specified. Please specify a xref.\n";
- }
- exit;
-case 'getvar':
- $var=safe_REQUEST($_REQUEST,'var', '[A-Za-z0-9_]+');
- $public_vars = array("READ_ONLY","GEDCOM","PEDIGREE_ROOT_ID");
- if ($var && in_array($var, $public_vars) && isset($$var)) {
- addToLog($action." var=$var SUCCESS\n".$$var, 'debug');
- echo "SUCCESS\n".$$var;
- } else if (WT_USER_ID && $var && isset($$var) && !in_array($var, $CONFIG_VARS)) {
- addToLog($action." var=$var SUCCESS\n".$$var, 'debug');
- echo "SUCCESS\n".$$var;
- } else {
- addToLog($action." var=$var ERROR 13: Invalid variable specified. Please provide a variable.", 'debug');
- echo "ERROR 13: Invalid variable specified.\n";
- }
- exit;
-case 'update':
- $xref=safe_REQUEST($_REQUEST,'xref', WT_REGEX_XREF);
- if ($xref) {
- $gedrec=safe_REQUEST($_REQUEST,'gedrec', WT_REGEX_UNSAFE); // raw data may contain any characters
- if ($gedrec) {
- if (empty($_SESSION['readonly']) && WT_USER_CAN_EDIT && canDisplayRecord($GED_ID, $gedrec)) {
- $gedrec = preg_replace(array("/\\\\+r/","/\\\\+n/"), array("\r","\n"), $gedrec);
- replace_gedrec($xref, $GED_ID, $gedrec);
- echo "SUCCESS\n";
- } else {
- addToLog($action." xref=$xref ERROR 11: No write privileges for this record.", 'debug');
- echo "ERROR 11: No write privileges for this record.\n";
- }
- } else {
- addToLog($action." xref=$xref ERROR 8: No gedcom record provided. Unable to process request.", 'debug');
- echo "ERROR 8: No gedcom record provided. Unable to process request.\n";
- }
- } else {
- addToLog($action." ERROR 3: No gedcom id specified. Please specify a xref.", 'debug');
- echo "ERROR 3: No gedcom id specified. Please specify a xref.\n";
- }
- exit;
-case 'append':
- $gedrec=safe_REQUEST($_REQUEST,'gedrec', '.*'); // raw data may contain any characters
- if ($gedrec) {
- if (empty($_SESSION['readonly']) && WT_USER_CAN_EDIT) {
- $gedrec = preg_replace(array("/\\\\+r/","/\\\\+n/"), array("\r","\n"), $gedrec);
- $xref = append_gedrec($gedrec, $GED_ID);
- if ($xref) {
- addToLog($action." gedrec=$gedrec SUCCESS\n$xref", 'debug');
- echo "SUCCESS\n$xref\n";
- }
- } else {
- addToLog($action." gedrec=$gedrec ERROR 11: No write privileges for this record.", 'debug');
- echo "ERROR 11: No write privileges for this record.\n";
- }
- } else {
- addToLog($action." ERROR 8: No gedcom record provided. Unable to process request.", 'debug');
- echo "ERROR 8: No gedcom record provided. Unable to process request.\n";
- }
- exit;
-case 'delete':
- $xref=safe_REQUEST($_REQUEST,'xref', WT_REGEX_XREF);
- if ($xref) {
- if (empty($_SESSION['readonly']) && WT_USER_CAN_EDIT && canDisplayRecord($GED_ID, find_gedcom_record($xref, $GED_ID))) {
- $success = delete_gedrec($xref, $GED_ID);
- if ($success) {
- addToLog($action." xref=$xref SUCCESS", 'debug');
- echo "SUCCESS\n";
- }
- } else {
- addToLog($action." xref=$xref ERROR 11: No write privileges for this record.", 'debug');
- echo "ERROR 11: No write privileges for this record.\n";
- }
- } else {
- addToLog($action." ERROR 3: No gedcom id specified. Please specify a xref.", 'debug');
- echo "ERROR 3: No gedcom id specified. Please specify a xref.\n";
- }
- exit;
-case 'getnext':
- $xref=safe_REQUEST($_REQUEST,'xref', WT_REGEX_XREF);
- if ($xref) {
- $xref1 = get_next_xref($xref, $GED_ID);
- $gedrec = find_gedcom_record($xref1, $GED_ID, true);
- if (!canDisplayRecord($GED_ID, $gedrec)) {
- //-- do not have full access to this record, so privatize it
- $gedrec = privatize_gedcom($gedrec);
- }
- addToLog($action." xref=$xref SUCCESS\n".trim($gedrec), 'debug');
- echo "SUCCESS\n".trim($gedrec);
- } else {
- addToLog($action." ERROR 3: No gedcom id specified. Please specify a xref.", 'debug');
- echo "ERROR 3: No gedcom id specified. Please specify a xref.\n";
- }
- exit;
-case 'getprev':
- $xref=safe_REQUEST($_REQUEST,'xref', WT_REGEX_XREF);
- if ($xref) {
- $xref1 = get_prev_xref($xref, $GED_ID);
- $gedrec = find_gedcom_record($xref1, $GED_ID, true);
- if (!canDisplayRecord($GED_ID, $gedrec)) {
- //-- do not have full access to this record, so privatize it
- $gedrec = privatize_gedcom($gedrec);
- }
- addToLog($action." xref=$xref SUCCESS\n".trim($gedrec), 'debug');
- echo "SUCCESS\n".trim($gedrec);
- } else {
- addToLog($action." ERROR 3: No gedcom id specified. Please specify a xref.", 'debug');
- echo "ERROR 3: No gedcom id specified. Please specify a xref.\n";
- }
- exit;
-case 'search':
- $query=safe_REQUEST($_REQUEST,'query');
- if ($query) {
- $sindilist=search_indis(array($query), array($GED_ID), 'AND', true);
- echo "SUCCESS\n";
- addToLog($action." query=$query SUCCESS", 'debug');
- foreach ($sindilist as $indi) {
- echo $indi->getXref(), "\n";
- }
- } else {
- addToLog($action." ERROR 15: No query specified. Please specify a query.", 'debug');
- echo "ERROR 15: No query specified. Please specify a query.\n";
- }
- exit;
-case 'soundex':
- $lastname=safe_REQUEST($_REQUEST,'lastname');
- $firstname=safe_REQUEST($_REQUEST,'firstname');
- $place=safe_REQUEST($_REQUEST,'place');
- $soundex=safe_REQUEST($_REQUEST,'soundex', '\w+', 'Russell');
-
- if ($lastname || $firstname) {
- $sindilist=search_indis_soundex($soundex, $lastname, $firstname, $place, array($GED_ID));
- echo "SUCCESS\n";
- addToLog($action." lastname=$lastname firstname=$firstname SUCCESS", 'debug');
- foreach ($sindilist as $indi) {
- echo $indi->getXref(), "\n";
- }
- } else {
- addToLog($action." ERROR 16: No names specified. Please specify a firstname or a lastname.", 'debug');
- echo "ERROR 16: No names specified. Please specify a firstname or a lastname.\n";
- }
- exit;
-case 'getxref':
- $position=safe_REQUEST($_REQUEST,'position', array('first','last','next','prev','new','all'));
- $type=safe_REQUEST($_REQUEST,'type', array('INDI','FAM','SOUR','REPO','NOTE','OBJE','OTHER'));
- $xref=safe_REQUEST($_REQUEST,'xref', WT_REGEX_XREF);
-
- if ($position=='next' && !$xref) {
- $position='first';
- }
- if ($position=='prev' && !$xref) {
- $position='last';
- }
-
- if (!$position || !$type) {
- addToLog($action." type=$type position=$position ERROR 18: Invalid \$type specification. Valid types are INDI, FAM, SOUR, REPO, NOTE, OBJE, or OTHER", 'debug');
- echo "ERROR 18: Invalid \$type or \$position specification. Valid types are INDI, FAM, SOUR, REPO, NOTE, OBJE, or OTHER\n";
- exit;
- }
- switch ($position) {
- case 'first':
- $xref=get_first_xref($type, $GED_ID);
- addToLog($action." type=$type position=$position SUCCESS\n$xref", 'debug');
- echo "SUCCESS\n$xref\n";
- break;
- case 'last':
- $xref=get_last_xref($type, $GED_ID);
- addToLog($action." type=$type position=$position SUCCESS\n$xref", 'debug');
- echo "SUCCESS\n$xref\n";
- break;
- case 'next':
- $xref=get_next_xref($xref, $GED_ID);
- addToLog($action." type=$type position=$position SUCCESS\n$xref", 'debug');
- echo "SUCCESS\n$xref\n";
- break;
- case 'prev':
- $xref=get_prev_xref($xref, $GED_ID);
- addToLog($action." type=$type position=$position SUCCESS\n$xref", 'debug');
- echo "SUCCESS\n$xref\n";
- break;
- case 'all':
- switch($type) {
- case "INDI":
- $statement=
- WT_DB::prepare("SELECT i_id FROM `##individuals` WHERE i_file=? ORDER BY i_id")
- ->execute(array($GED_ID));
- break;
- case "FAM":
- $statement=
- WT_DB::prepare("SELECT f_id FROM `##families` WHERE f_file=? ORDER BY f_id")
- ->execute(array($GED_ID));
- break;
- case "SOUR":
- $statement=
- WT_DB::prepare("SELECT s_id FROM `##sources` WHERE s_file=? ORDER BY s_id")
- ->execute(array($GED_ID));
- case "OBJE":
- $statement=
- WT_DB::prepare("SELECT m_media FROM `##media` WHERE m_gedfile=? ORDER BY m_media")
- ->execute(array($GED_ID));
- case "OTHER":
- $statement=
- WT_DB::prepare("SELECT o_id FROM `##other` WHERE o_file=? AND o_type NOT IN ('REPO', 'NOTE') ORDER BY o_id")
- ->execute(array($GED_ID));
- break;
- default:
- $statement=
- WT_DB::prepare("SELECT o_id FROM `##other` WHERE o_file=? AND o_type=? ORDER BY o_id")
- ->execute(array($GED_ID, $type));
- }
- echo "SUCCESS\n";
- foreach ($statement->fetchOneColumn() as $id) {
- echo "{$id}\n";
- }
- addToLog($action." type=$type position=$position ", 'debug');
- break;
- case 'new':
- if (empty($_SESSION['readonly']) && WT_USER_CAN_EDIT) {
- $gedrec = "0 @REF@ $type";
- $xref = append_gedrec($gedrec, $GED_ID);
- if ($xref) {
- addToLog($action." type=$type position=$position SUCCESS\n$xref", 'debug');
- echo "SUCCESS\n$xref\n";
- }
- } else {
- addToLog($action." type=$type position=$position ERROR 11: No write privileges for this record.", 'debug');
- echo "ERROR 11: No write privileges for this record.\n";
- }
- break;
- }
- exit;
-case 'uploadmedia':
- $error="";
- if (isset($_FILES['mediafile'])) {
- if (!move_uploaded_file($_FILES['mediafile']['tmp_name'], $MEDIA_DIRECTORY.$_FILES['mediafile']['name'])) {
- $error .= "ERROR 19: ".i18n::translate('There was an error uploading your file.')." ".file_upload_error_text($_FILES['mediafile']['error']);
- } else if (!isset($_FILES['thumbnail'])) {
- $filename = $MEDIA_DIRECTORY.$_FILES['mediafile']['name'];
- $thumbnail = $MEDIA_DIRECTORY."thumbs/".$_FILES['mediafile']['name'];
- generate_thumbnail($filename, $thumbnail);
- }
- }
- if (isset($_FILES['thumbnail'])) {
- if (!move_uploaded_file($_FILES['thumbnail']['tmp_name'], $MEDIA_DIRECTORY."thumbs/".$_FILES['thumbnail']['name'])) {
- $error .= "\nERROR 19: ".i18n::translate('There was an error uploading your file.')." ".file_upload_error_text($_FILES['thumbnail']['error']);
- }
- }
- if (!empty($error)) {
- addToLog($action." $error", 'debug');
- echo $error."\n";
- } else {
- addToLog($action." SUCCESS", 'debug');
- echo "SUCCESS\n";
- }
- exit;
-case 'getchanges':
- $lastdate = new GedcomDate(safe_REQUEST($_REQUEST,'date', '\d\d \w\w\w \d\d\d\d'));
- if ($lastdate->isOK()) {
- if ($lastdate->MinJD()<WT_SERVER_JD-180) {
- addToLog($action." ERROR 24: You cannot retrieve updates for more than 180 days.", 'debug');
- echo "ERROR 24: You cannot retrieve updates for more than 180 days.\n";
- } else {
- echo "SUCCESS\n";
- foreach (get_recent_changes($lastdate->MinJD()) as $xref) {
- echo "{$xref}\n";
- }
- }
- } else {
- addToLog($action." ERROR 23: Invalid date parameter. Please use a valid date in the GEDCOM format DD MMM YYYY.", 'debug');
- echo "ERROR 23: Invalid date parameter. Please use a valid date in the GEDCOM format DD MMM YYYY.\n";
- }
- exit;
-default:
- addToLog($action." ERROR 2: Unable to process request. Unknown action.", 'debug');
- echo "ERROR 2: Unable to process request. Unknown action.\n";
-}
diff --git a/editconfig_gedcom.php b/editconfig_gedcom.php
index 5f5ec31d1b..8569700e82 100644
--- a/editconfig_gedcom.php
+++ b/editconfig_gedcom.php
@@ -199,7 +199,6 @@ case 'update':
set_gedcom_setting(WT_GED_ID, 'SHOW_MARRIED_NAMES', safe_POST_bool('NEW_SHOW_MARRIED_NAMES'));
set_gedcom_setting(WT_GED_ID, 'SHOW_MEDIA_DOWNLOAD', safe_POST_bool('NEW_SHOW_MEDIA_DOWNLOAD'));
set_gedcom_setting(WT_GED_ID, 'SHOW_MEDIA_FILENAME', safe_POST_bool('NEW_SHOW_MEDIA_FILENAME'));
- set_gedcom_setting(WT_GED_ID, 'SHOW_MULTISITE_SEARCH', safe_POST('SHOW_MULTISITE_SEARCH'));
set_gedcom_setting(WT_GED_ID, 'SHOW_NO_WATERMARK', safe_POST('NEW_SHOW_NO_WATERMARK'));
set_gedcom_setting(WT_GED_ID, 'SHOW_PARENTS_AGE', safe_POST_bool('NEW_SHOW_PARENTS_AGE'));
set_gedcom_setting(WT_GED_ID, 'SHOW_PEDIGREE_PLACES', safe_POST('NEW_SHOW_PEDIGREE_PLACES'));
@@ -680,14 +679,6 @@ print_header(i18n::translate('GEDCOM configuration'));
</tr>
<tr>
<td class="descriptionbox nowrap">
- <?php echo i18n::translate('Show multi-site search'), help_link('SHOW_MULTISITE_SEARCH'); ?>
- </td>
- <td class="optionbox">
- <?php echo edit_field_access_level("SHOW_MULTISITE_SEARCH", get_gedcom_setting(WT_GED_ID, 'SHOW_MULTISITE_SEARCH')); ?>
- </td>
- </tr>
- <tr>
- <td class="descriptionbox nowrap">
<?php echo i18n::translate('Show private relationships'), help_link('SHOW_PRIVATE_RELATIONSHIPS'); ?>
</td>
<td class="optionbox width60">
diff --git a/help_text.php b/help_text.php
index cc56294850..ffc04223eb 100644
--- a/help_text.php
+++ b/help_text.php
@@ -1687,11 +1687,6 @@ case 'SHOW_MEDIA_FILENAME':
$text=i18n::translate('The Media Viewer can show the name of the Media file being viewed. This option determines whether that file name is shown to users or not.<br /><br />You may want to hide the file name for security reasons.');
break;
-case 'SHOW_MULTISITE_SEARCH':
- $title=i18n::translate('Show multi-site search');
- $text=i18n::translate('Multi-site search allows users to search across multiple <b>webtrees</b> websites which you have setup in the Manage Sites administration area or remotely linked to. This option controls whether the Multi-site Search feature is available to everyone or only to authenticated users.');
- break;
-
case 'SHOW_NO_WATERMARK':
$title=i18n::translate('Who can view non-watermarked images?');
$text=i18n::translate('If the Media Firewall is enabled, users will see watermarks if they do not have the privilege level specified here.');
@@ -1880,11 +1875,6 @@ case 'addmedia.php':
$text='';
break;
-case 'addsearchlink.php':
- $title=i18n::translate('Add a local link');
- $text='';
- break;
-
case 'admin.php':
$title=i18n::translate('Administration');
$text=/* I18N: do not translate this text - it will be updated very soon */i18n::translate('On this page you will find links to the configuration pages, administration pages, documentation, and log files.<br /><br /><b>Current Server Time:</b>, just below the page title, shows the time of the server on which your site is hosted. This means that if the server is located in New York while you\'re in France, the time shown will be six hours less than your local time, unless, of course, the server is running on Greenwich Mean Time (GMT). The time shown is the server time when you opened or refreshed this page.');
@@ -2002,6 +1992,7 @@ case 'logs.php':
case 'manageservers.php':
$title=i18n::translate('Manage sites');
+ // This text is out of date
$text=i18n::translate('On this page you can add remote sites and ban IP addresses.<br /><br />Remote sites can be added by providing the site title, URL, database id(optional), username, and password for the remote web service.<br /><br />IP address banning is accomplished by supplying any valid IP address range. For example, 212.10.*.* Remote sites within the IP address ranges in the Banned list will not be able to access your web service. You can ban specific IP addresses too.');
break;
@@ -2671,26 +2662,6 @@ case 'link_person_id':
$text=i18n::translate('In this field you enter the ID of the person you are linking to (e.g. I100).');
break;
-case 'link_remote':
- $title=i18n::translate('Link remote person');
- $text=''; // TODO: The original help text refered to the PGV wiki site (http://wiki.phpgedview.net/en/index.php?title=How_To:Remote_Link_Individuals_Across_Websites_And_Databases). We should write an equivalent page for WT.
- break;
-
-case 'link_remote_location':
- $title=i18n::translate('Site location');
- $text=i18n::translate('This option allows you to choose whether data for the person you are linking to is on the same site but in a different genealogical database set, or whether the data is on a different site accessible through the Internet.<br /><br />If the person is on the same site, you will be asked to select the dataset identifier and enter the person\'s ID.<br /><br />For a remote site, you will be asked to enter its URL, a database identifier, and the person\'s remote ID.');
- break;
-
-case 'link_remote_rel':
- $title=i18n::translate('Relationship to current person');
- $text=i18n::translate('Use this option to select the relationship the remote person has to the person you are linking them with on your site. For example, selecting <i>Father</i> would mean that the person on the remote site is the father of the person you are linking them to locally.');
- break;
-
-case 'link_remote_site':
- $title=i18n::translate('Site');
- $text=i18n::translate('In this section you specify the parameters that are required to connect to the remote site hosting the data you are linking to. You have the option of choosing from a list of known sites that you have used before, or entering the Site URL and Database ID for a new one.<br /><br />In the <b>Site URL</b> field, you enter the URL to access the web services description file (WDSL) which tells <b>webtrees</b> how to access the data on the remote site. For a remote <b>webtrees</b> website, the URL to the WSDL file will look like this: <u>http://www.remotesite.com/webtrees/genservice.php?wsdl</u><br /><br />The <b>Database ID</b> field is used to enter an optional database identifier for remote sites that require one. For <b>webtrees</b> sites, this is the name of the GEDCOM file. <br /><br />The <b>Username</b> and the <b>Password</b> fields are only necessary if the database requires it.');
- break;
-
case 'link_wife':
$title=i18n::translate('Link to an existing family as a wife');
$text=i18n::translate('This item will allow you to link the current individual as a wife to a family that is already in the database.<br /><br />This is an advanced editing option that should only be used if the family you want to link to already exists. If you want to add a <u>new</u> family to this individual, use the <b>Add a new husband</b> link.');
diff --git a/includes/classes/class_family.php b/includes/classes/class_family.php
index 8023d2d5a4..3768a7fba9 100644
--- a/includes/classes/class_family.php
+++ b/includes/classes/class_family.php
@@ -48,7 +48,7 @@ class Family extends GedcomRecord {
private $_isNotMarried = null;
// Create a Family object from either raw GEDCOM data or a database row
- function __construct($data, $simple=true) {
+ function __construct($data) {
if (is_array($data)) {
// Construct from a row from the database
if ($data['f_husb']) {
diff --git a/includes/classes/class_gedcomrecord.php b/includes/classes/class_gedcomrecord.php
index 9952052e8c..84a0c7a315 100644
--- a/includes/classes/class_gedcomrecord.php
+++ b/includes/classes/class_gedcomrecord.php
@@ -41,14 +41,12 @@ require_once WT_ROOT.'includes/classes/class_repository.php';
require_once WT_ROOT.'includes/classes/class_note.php';
require_once WT_ROOT.'includes/classes/class_media.php';
require_once WT_ROOT.'includes/classes/class_event.php';
-require_once WT_ROOT.'includes/classes/class_serviceclient.php';
class GedcomRecord {
protected $xref =null; // The record identifier
protected $type =null; // INDI, FAM, etc.
public $ged_id =null; // The gedcom file, only set if this record comes from the database
protected $gedrec =null; // Raw gedcom text (privatised)
- protected $rfn =null;
protected $facts =null;
protected $changeEvent=null;
public $disp =true; // Can we display details of this object
@@ -62,7 +60,7 @@ class GedcomRecord {
protected $_getSecondaryName=null;
// Create a GedcomRecord object from either raw GEDCOM data or a database row
- public function __construct($data, $simple=false) {
+ public function __construct($data) {
if (is_array($data)) {
// Construct from a row from the database
$this->xref =$data['xref'];
@@ -79,24 +77,6 @@ class GedcomRecord {
}
}
- //-- lookup the record from another gedcom
- $remoterfn = get_gedcom_value('RFN', 1, $this->gedrec);
- if (!empty($remoterfn)) {
- $parts = explode(':', $remoterfn);
- if (count($parts)==2) {
- $servid = $parts[0];
- $aliaid = $parts[1];
- if (!empty($servid)&&!empty($aliaid)) {
- $serviceClient = ServiceClient::getInstance($servid);
- if (!is_null($serviceClient)) {
- if (!$simple || $serviceClient->type=='local') {
- $this->gedrec = $serviceClient->mergeGedcomRecord($aliaid, $this->gedrec, true);
- }
- }
- }
- }
- }
-
//-- set the gedcom record a privatized version
$this->disp =canDisplayRecord($this->ged_id, $this->gedrec);
$this->gedrec=privatize_gedcom($this->gedrec);
@@ -156,16 +136,6 @@ class GedcomRecord {
$data=fetch_gedcom_record($pid, $ged_id);
}
- // If we didn't find the record in the database, it may be remote
- if (!$data && strpos($pid, ':')) {
- list($servid, $remoteid)=explode(':', $pid);
- $service=ServiceClient::getInstance($servid);
- if ($service) {
- // TYPE will be replaced with the type from the remote record
- $data=$service->mergeGedcomRecord($remoteid, "0 @{$pid}@ TYPE\n1 RFN {$pid}", false);
- }
- }
-
// If we didn't find the record in the database, it may be new/pending
if (!$data && WT_USER_CAN_EDIT && ($data=find_gedcom_record($pid, $ged_id, true))!='') {
$is_pending=true;
@@ -218,8 +188,6 @@ class GedcomRecord {
// Store it in the cache
$gedcom_record_cache[$object->xref][$object->ged_id]=&$object;
- //-- also store it using its reference id (sid:pid and local gedcom for remote links)
- $gedcom_record_cache[$pid][$ged_id]=&$object;
return $object;
}
@@ -272,21 +240,6 @@ class GedcomRecord {
}
/**
- * is this person from another server
- * @return boolean return true if this person was linked from another server
- */
- public function isRemote() {
- if (is_null($this->rfn)) $this->rfn = get_gedcom_value('RFN', 1, $this->gedrec);
- if (empty($this->rfn) || $this->xref!=$this->rfn) return false;
-
- $parts = explode(':', $this->rfn);
- if (count($parts)==2) {
- return true;
- }
- return false;
- }
-
- /**
* check if this object is equal to the given object
* @param GedcomRecord $obj
*/
@@ -306,55 +259,11 @@ class GedcomRecord {
protected function _getLinkUrl($link, $separator) {
if ($this->ged_id) {
// If the record was created from the database, we know the gedcom
- $url=$link.rawurlencode($this->getXref()).$separator.'ged='.rawurlencode(get_gedcom_from_id($this->ged_id));
+ return $link.$this->getXref().$separator.'ged='.rawurlencode(get_gedcom_from_id($this->ged_id));
} else {
// If the record was created from a text string, assume the current gedcom
- $url=$link.rawurlencode($this->getXref()).$separator.'ged='.WT_GEDURL;
- }
- if ($this->isRemote()) {
- list($servid, $aliaid)=explode(':', $this->rfn);
- if ($aliaid && $servid) {
- $serviceClient = ServiceClient::getInstance($servid);
- if ($serviceClient) {
- $surl = $serviceClient->getURL();
- $url = $link.$aliaid;
- if ($serviceClient->getType()=='remote') {
- if (!empty($surl)) {
- $url = dirname($surl).'/'.$url;
- }
- } else {
- $url = $surl.$url;
- }
- $gedcom = $serviceClient->getGedfile();
- if ($gedcom) {
- $url .= $separator.'ged='.rawurlencode($gedcom);
- }
- }
- }
- }
- return $url;
- }
-
- /**
- * Get the title that should be used in the link
- * @return string
- */
- public function getLinkTitle() {
- $title = get_gedcom_setting($this->ged_id, 'title');
- if ($this->isRemote()) {
- $parts = explode(':', $this->rfn);
- if (count($parts)==2) {
- $servid = $parts[0];
- $aliaid = $parts[1];
- if (!empty($servid)&&!empty($aliaid)) {
- $serviceClient = ServiceClient::getInstance($servid);
- if (!empty($serviceClient)) {
- $title = $serviceClient->getTitle();
- }
- }
- }
+ return $link.$this->getXref().$separator.'ged='.WT_GEDURL;
}
- return $title;
}
// Get an HTML link to this object, for use in sortable lists.
diff --git a/includes/classes/class_localclient.php b/includes/classes/class_localclient.php
deleted file mode 100644
index 6aaf812c33..0000000000
--- a/includes/classes/class_localclient.php
+++ /dev/null
@@ -1,138 +0,0 @@
-<?php
-/**
- *
- * webtrees: Web based Family History software
- * Copyright (C) 2010 webtrees development team.
- *
- * Derived from PhpGedView
- * Copyright (C) 2002 to 2009 PGV Development Team. All rights reserved.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- * @package webtrees
- * @subpackage DataModel
- * @version $Id$
- */
-
-if (!defined('WT_WEBTREES')) {
- header('HTTP/1.0 403 Forbidden');
- exit;
-}
-
-define('WT_CLASS_LOCALCLIENT_PHP', '');
-
-require_once WT_ROOT.'includes/classes/class_serviceclient.php';
-
-class LocalClient extends ServiceClient {
- /**
- * constructor
- * @param string $gedrec the gedcom record
- */
- function __construct($gedrec) {
- parent::__construct($gedrec);
- $this->type = "local";
- }
-
- /**
- * authenticate the client
- */
- function authenticate() {
- //-- nothing to do in a local client
- }
-
- /**
- * Get a record from the remote site
- * @param string $remoteid the id of the record to get
- */
- function getRemoteRecord($remoteid) {
- $rec = find_gedcom_record($remoteid, WT_GED_ID);
- $rec = preg_replace("/@(.*)@/", "@".$this->xref.":$1@", $rec);
- return $rec;
- }
-
- /**
- * merge a local gedcom record with the information from the remote site
- * @param string $xref the remote ID to merge with
- * @param string $localrec the local gedcom record to merge the remote record with
- * @param boolean $isStub whether or not this is a stub record
- * @param boolean $firstLink is this the first time this record is being linked
- */
- function mergeGedcomRecord($xref, $localrec, $isStub=false, $firstLink=false) {
- //-- get the record from the database
- $gedrec = find_gedcom_record($xref, WT_GED_ID);
- $gedrec = preg_replace("/@(.*)@/", "@".$this->xref.":$1@", $gedrec);
- $gedrec = $this->checkIds($gedrec);
- if (empty($localrec)) return $gedrec;
- $localrec = $this->_merge($localrec, $gedrec);
-
- //-- used to force an update on the first time linking a person
- if ($firstLink) {
- require_once WT_ROOT.'includes/functions/functions_edit.php';
- $ct=preg_match("/0 @(.*)@/", $localrec, $match);
- if ($ct>0)
- {
- $pid = trim($match[1]);
- $localrec = $this->UpdateFamily($localrec,$gedrec);
- //-- restore the correct id since it may have been changed by the UpdateFamily method
- $localrec = preg_replace("/0 @(.*)@/", "0 @$pid@", $localrec);
- replace_gedrec($pid, WT_GED_ID, $localrec);
- }
- }
- return $localrec;
- }
-
- /**
- * get a singleton instance of the results
- * returned by the soapClient search method
- *
- * @param string $query - the query to search on
- * @param integer $start - the start index of the results to return
- * @param integer $max - the maximum number of results to return
- */
- function search($query, $start=0, $max=100) {
- //$this->authenticate();
- //$result = $this->soapClient->search($this->SID, $query, $start, $max);
- $search_results = search_indis(array($query), array($this->gedfile), 'AND', true);
-
- // loop thru the returned result of the method call
- foreach ($search_results as $gid=>$indi)
- {
- // privatize the gedcoms returned
- $gedrec = privatize_gedcom($indi["gedcom"]);
- // set the fields that exist and return all the results that are not private
- if (preg_match("~".$query."~i",$gedrec)>0)
- {
- $person = new SOAP_Value('person', 'person', "");
- $person->PID = $gid;
- $person->gedcomName = get_gedcom_value("NAME", 1, $gedrec, '', false);
- $person->birthDate = get_gedcom_value("BIRT:DATE", 1, $gedrec, '', false);
- $person->birthPlace = get_gedcom_value("BIRT:PLAC", 1, $gedrec, '', false);
- $person->deathDate = get_gedcom_value("DEAT:DATE", 1, $gedrec, '', false);
- $person->deathPlace = get_gedcom_value("DEAT:PLAC", 1, $gedrec, '', false);
- $person->gender = get_gedcom_value("SEX", 1, $gedrec, '', false);
- //$search_result_element['gedcom'] = $gedrec;
- $results_array[] = $person;
- }
- }
- // set the number of possible results
- //$results[0]['totalResults'] = count($results_array);
- $results_array = array_slice($results_array,$start,$max);
- //$results[0]['persons'] = $results_array;
- $return = new SOAP_Value('searchResult', 'searchResult', "");
- $return->totalResults = count($results_array);
- $return->persons = $results_array;
- return $return;
- }
-}
diff --git a/includes/classes/class_menubar.php b/includes/classes/class_menubar.php
index 3f1101c215..1d705ba060 100644
--- a/includes/classes/class_menubar.php
+++ b/includes/classes/class_menubar.php
@@ -610,7 +610,7 @@ class MenuBar {
* @return Menu the menu item
*/
public static function getSearchMenu() {
- global $TEXT_DIRECTION, $WT_IMAGES, $SHOW_MULTISITE_SEARCH, $SEARCH_SPIDER;
+ global $TEXT_DIRECTION, $WT_IMAGES, $SEARCH_SPIDER;
if ($TEXT_DIRECTION=="rtl") $ff="_rtl"; else $ff="";
if ((!file_exists(WT_ROOT.'search.php')) || (!empty($SEARCH_SPIDER))) {
@@ -642,17 +642,6 @@ class MenuBar {
$submenu->addClass("submenuitem$ff", "submenuitem_hover$ff", "", "icon_small_search");
$menu->addSubmenu($submenu);
}
-
- //-- search_multisite sub menu
- if ($SHOW_MULTISITE_SEARCH >= WT_USER_ACCESS_LEVEL) {
- $sitelist = get_server_list();
- if (count($sitelist)>0) {
- $submenu = new Menu(i18n::translate('Multi Site Search'), "search.php?ged=".WT_GEDURL."&amp;action=multisite");
- $submenu->addIcon('search');
- $submenu->addClass("submenuitem$ff", "submenuitem_hover$ff", "", "icon_small_search");
- $menu->addSubmenu($submenu);
- }
- }
return $menu;
}
diff --git a/includes/classes/class_person.php b/includes/classes/class_person.php
index 5efdf7f6c5..7e7730b8cc 100644
--- a/includes/classes/class_person.php
+++ b/includes/classes/class_person.php
@@ -68,7 +68,7 @@ class Person extends GedcomRecord {
private $_getEstimatedDeathDate=null;
// Create a Person object from either raw GEDCOM data or a database row
- function __construct($data, $simple=true) {
+ function __construct($data) {
if (is_array($data)) {
// Construct from a row from the database
$this->isdead=$data['i_isdead'];
@@ -77,7 +77,7 @@ class Person extends GedcomRecord {
// Construct from raw GEDCOM data
}
- parent::__construct($data, $simple);
+ parent::__construct($data);
$this->dispname=$this->disp || showLivingNameById($this->xref);
}
diff --git a/includes/classes/class_serviceclient.php b/includes/classes/class_serviceclient.php
deleted file mode 100644
index 17aa414b13..0000000000
--- a/includes/classes/class_serviceclient.php
+++ /dev/null
@@ -1,906 +0,0 @@
-<?php
-/**
-* Class used to access records and data on a remote server
-*
-* webtrees: Web based Family History software
- * Copyright (C) 2010 webtrees development team.
- *
- * Derived from PhpGedView
-* Copyright (C) 2002 to 2009 PGV Development Team. All rights reserved.
-*
-* This program is free software; you can redistribute it and/or modify
-* it under the terms of the GNU General Public License as published by
-* 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-*
-* @package webtrees
-* @subpackage DataModel
-* @version $Id$
-*/
-
-if (!defined('WT_WEBTREES')) {
- header('HTTP/1.0 403 Forbidden');
- exit;
-}
-
-define('WT_CLASS_SERVICECLIENT_PHP', '');
-
-require_once WT_ROOT.'includes/classes/class_gedcomrecord.php';
-require_once WT_ROOT.'includes/classes/class_family.php';
-require_once WT_ROOT.'includes/functions/functions_import.php';
-
-class ServiceClient extends GedcomRecord {
- var $url = "";
- var $soapClient = null;
- var $SID = "";
- var $gedfile = "";
- var $title = "";
- var $username = "";
- var $password = "";
- var $type = "";
- var $client_type = "SOAP"; // whether to use SOAP or PEAR:SOAP by default
-
- /**
- * contstructor to create a new ServiceClient object
- * @param string $gedrec the SERV gedcom record
- */
- function __construct($gedrec) {
- //parse url
- //crate soap client class
- //authenticate/get/set sid
- parent::__construct($gedrec);
- //echo "creating new service client ".$this->xref;
- //get the url from the gedcom
- $this->url = get_gedcom_value("URL",1,$gedrec);
- $this->gedfile = get_gedcom_value("_DBID", 1, $gedrec);
- $this->title = get_gedcom_value("TITL", 1, $gedrec);
- $this->username = get_gedcom_value("_USER", 2, $gedrec);
- $this->password = get_gedcom_value("_PASS", 2, $gedrec);
- $this->type = "remote";
- if (empty($this->url) && empty($this->gedfile))
- return null;
- }
-
- /**
- * check if the service returned an error
- */
- static function isError($result) {
- if (PEAR::isError($result) || isset($result->faultcode) || isset($result->message) || get_class($result)=='SOAP_Fault') {
- return true;
- }
- return false;
- }
-
- /**
- * get the title of this source record
- * @return string
- */
- function getTitle() {
- if (empty($this->title)) return i18n::translate('unknown');
- return $this->title;
- }
-
- function getURL() {
- return $this->url;
- }
-
- /**
- * get the gedcom file
- */
- function getGedfile() {
- return $this->gedfile;
- }
-
- /**
- * authenticate the client
- */
- function authenticate() {
- if (!empty($this->SID)) return $this->SID;
- if (is_null($this->soapClient)) {
- if (!class_exists('Soap_Client') || $this->client_type=='PEAR:SOAP') {
-
- require_once './SOAP/Client.php';
- // get the wsdl and cache it
- $wsdl = new SOAP_WSDL($this->url);
- //change the encoding style
- $this->__change_encoding($wsdl);
- $this->soapClient = $wsdl->getProxy();
- } else {
- //AddtoLog("Using SOAP Extension");
- //-- don't use exceptions in PHP 4
- $this->soapClient = new Soap_Client($this->url, array('exceptions' => 0));
- }
- }
- if ($this->soapClient!=null && !$this->isError($this->soapClient)) {
- $res = $this->soapClient->Authenticate($this->username, $this->password, $this->gedfile, "");
- if (!is_object($res)) {
- return false;
- }
- if (!isset($res->SID)) {
- return false;
- }
- $this->SID = $res->SID;
- return $this->SID;
- } else {
- addToLog("Unable to generate web service proxy from WSDL. ".print_r($this->soapClient, true));
- return false;
- }
- }
-
- /**
- * Get a record from the remote site
- * @param string $remoteid the id of the record to get
- */
- function getRemoteRecord($remoteid) {
- if (!is_object($this->soapClient)) $this->authenticate();
- if (!is_object($this->soapClient)||$this->isError($this->soapClient)) return false;
- $rec = $this->soapClient->getGedcomRecord($this->SID, $remoteid);
- if (is_string($rec)) {
- $rec = preg_replace("/@([^#@\s]+)@/", "@".$this->xref.":$1@", $rec);
- return $rec;
- } else {
- return "";
- }
- }
-
- /**
- * get the title for this service
- * @return string
- */
- function getServiceTitle() {
- if (!empty($this->title)) return $this->title;
-
- $this->authenticate();
- $info = $this->soapClient->ServiceInfo();
- //print_r($info);
- foreach ($info->gedcoms as $ind=>$gedobj) {
- if ($gedobj->ID==$this->gedfile) break;
- }
- $this->title = $gedobj->title;
- return $this->title;
- }
-
- /**
- * Merge people together.
- */
- function _merge($record1, $record2) {
- // Returns second record if first is empty, no merge needed
- if (empty($record1)) return $record2;
- // Returns first record if second is empty, no merge needed
- if (empty($record2)) return $record1;
-
- $remoterecs = get_all_subrecords($record2, "", false, false);
- $localrecs = get_all_subrecords($record1, "", false, false);
-
- $newrecs = array();
- //-- make sure we don't get circular links
- foreach ($remoterecs as $ind2=>$subrec2) {
- if (strpos($subrec2, "1 RFN")===false) {
- $newrecs[] = $subrec2;
- }
- }
-
- foreach ($localrecs as $ind=>$subrec) {
- $found = false;
- if (strpos($subrec, "1 CHAN")===false) {
- $subrec = trim($subrec);
- $orig_subrec = $subrec;
- $subrec = preg_replace("/\s+/", " ", $subrec);
-
- foreach ($remoterecs as $ind2=>$subrec2) {
- $subrec2 = trim($subrec2);
- $subrec2 = preg_replace("/\s+/", " ", $subrec2);
-
- if ($subrec2 == $subrec) {
- $found = true;
- break;
- }
- }
- } else {
- $found = true;
- }
- if (!$found) {
- $newrecs[] = $orig_subrec;
- }
- }
-
- //-- start with the first line from the local record
- $pos1 = strpos($record1, "\n1");
- if ($pos1!==false) $localrec = substr($record1, 0, $pos1+1);
- else $localrec = $record1;
-
- //-- update the type of the remote record
- $ct = preg_match("/0 @(.*)@ (\w*)/", $record2, $match);
- if ($ct>0) $localrec = preg_replace("/0 @(.*)@ (\w*)/", "0 @$1@ ".trim($match[2]), $localrec);
- //-- add all of the new records
- foreach ($newrecs as $ind=>$subrec) {
- $localrec .= trim($subrec)."\n";
- }
- $localrec = trim($localrec);
-//echo "[<pre>$localrec</pre>]";
- // Update the last change time
- $pos1 = strpos($localrec, "1 CHAN");
- if ($pos1!==false) {
- $pos2 = strpos($localrec, "\n1", $pos1+4);
- if ($pos2===false) $pos2 = strlen($localrec);
- $newgedrec = substr($localrec, 0, $pos1);
- $newgedrec .= "1 CHAN\n2 DATE ".date("d M Y")."\n";
- $newgedrec .= "3 TIME ".date("H:i:s")."\n";
- $newgedrec .= "2 _WT_USER @".$this->xref."@\n";
- $newgedrec .= trim(substr($localrec, $pos2+1));
- $localrec = $newgedrec;
- } else {
- $newgedrec = "\n1 CHAN\n2 DATE ".date("d M Y")."\n";
- $newgedrec .= "3 TIME ".date("H:i:s")."\n";
- $newgedrec .= "2 _WT_USER @".$this->xref."@";
- $localrec .= $newgedrec;
- }
-
- //echo "merged record is ".$localrec;
- return $localrec;
- }
-
- /**
- * Updates Family Records such as children, spouse, and parents
- */
- function UpdateFamily($record1,$record2) {
- // This makes sure there is a record in both the server and client else it returns the record that
- // exist if any
- if (empty($record1)) {
- return $record2;
- } elseif (empty($record2)) {
- return $record1;
- }
-
- $this->authenticate();
- //this makes sure that the person is the one that was clicked so that this methade is not called more then ti needs to be
- $ct = preg_match("/0 @(.*)@ (.*)/", $record1, $match);
- $personId1=null;
- if ($ct>0) {
- $personId1 = $match[1];
- $type1 = trim($match[2]);
- if ($type1!="INDI") {
- return $record1;
- }
- }
- $ct = preg_match("/0 @(.*)@ (.*)/", $record2, $match);
- if ($ct>0) {
- $personId2 = $match[1];
- $type2 = trim($match[2]);
- if ($type2!="INDI") {
- return $record1;
- }
- }
-
- //-- remove all remote family links added in _merge() so that we can add them back in if we need to
- $record1 = preg_replace("/\d FAM[SC] @".$this->xref.":[\w\d]+@\r?\n/", "", $record1);
-
- //debug_print_backtrace();
- // holds the arrays of the current individual Familys
- $List1FamilyChildID = find_families_in_record($record1, "FAMC");
- $List2FamilyChildID = find_families_in_record($record2, "FAMC");
- $List1FamilySpouseID = find_families_in_record($record1, "FAMS");
- $List2FamilySpouseID = find_families_in_record($record2, "FAMS");
- $FamilyListSpouse = array();
- $FamilyListChild = array();
-
- // bools used to make sure the same children and/or familys are not counted more then twice
- $firstTimeFamily=true;
-
- // starting the comparisons for family as child
- if (empty($List1FamilyChildID)) {
- //-- add all remote ids
- foreach ($List2FamilyChildID as $famc=>$famCild2) {
- $FamilyListChild[] = $famCild2;
- }
- } elseif (empty($List2FamilyChildID)) {
- //-- nothing to do if there are no remote families
- } else {
- // Creating the first family
- foreach ($List1FamilyChildID as $famc=>$famCild1) {
- if (!empty($famCild1)) {
- // Creating the Secound Family
- foreach ($List2FamilyChildID as $famc=>$famCild2) {
- if (!empty($famCild2)) {
- if (!$this->CompairForUpdateFamily($famCild1,$famCild2)) {
- if ($firstTimeFamily) {
- $FamilyListChild[] = $famCild2;
- }
- } else {
- $this->MergeForUpdateFamily($famCild1,$famCild2,$FamilyListChild,$FamilyListChild);
- }
- }
- }
- }
- }
- }
- // starting the comparisons for family as spouse
- if (empty($List1FamilySpouseID)) {
- //-- add all remote ids
- foreach ($List2FamilySpouseID as $fams=>$famSpouse2) {
- if (!empty($famSpouse2)) {
- $FamilyListSpouse[] = $famSpouse2;
- }
- }
- } elseif (empty($List2FamilySpouseID)) {
- //-- don't do anything if there are no remote families
- } else {
- // Creating the first family
- foreach ($List1FamilySpouseID as $fams=>$famSpouse1) {
- if (!empty($famSpouse1)) {
- // Creating the Secound Family
- foreach ($List2FamilySpouseID as $fams=>$famSpouse2) {
- if (!empty($famSpouse2)) {
- if (!$this->CompairForUpdateFamily($famSpouse1,$famSpouse2)) {
- if ($firstTimeFamily) {
- $FamilyListSpouse[] = $famSpouse2;
- }
- } else {
- $this->MergeForUpdateFamily($famSpouse1,$famSpouse2,$FamilyListSpouse,$FamilyListSpouse);
- }
- }
- }
- }
- }
- }
- // This Adds any new familys to the person.
- if (count($FamilyListChild)>0) {
- for ($i=0;$i<count($FamilyListChild);$i++) {
- $record1.="\n1 FAMC @";
- if (strpos($FamilyListChild[$i], $this->xref)!==0) $record1 .= $this->xref.":";
- $record1 .= $FamilyListChild[$i]."@";
- }
- }
- if (count($FamilyListSpouse)>0) {
- for ($i=0;$i<count($FamilyListSpouse);$i++) {
- $record1.="\n1 FAMS @";
- if (strpos($FamilyListSpouse[$i], $this->xref)!==0) $record1 .= $this->xref.":";
- $record1 .= $FamilyListSpouse[$i]."@";
- }
- }
- return $record1;
- }
-
- /**
- * This mergest the the two familys together
- */
- function MergeForUpdateFamily($Family1,$Family2,$Familylist,&$FamilyListReturn) {
- global $GEDCOM;
- require_once WT_ROOT.'includes/functions/functions_edit.php';
-
- //echo "<br />In MergeForUpdateFamily ".$Family1." ".$Family2;
- //print_r($Familylist);
- $FamilyListReturn=$Familylist;
-
- $famrec1 = find_gedcom_record($Family1, get_id_from_gedcom($GEDCOM), true);
-
- $ct = preg_match("/(\w+):(.+)/", $Family2, $match);
- if ($ct>0) {
- $servid = trim($match[1]);
- $remoteid = trim($match[2]);
- $famrec2 = $this->getRemoteRecord($remoteid);
- } else {
- return $famrec1;
- }
-
- // Creating the familys from the xref
- $family1 = Family::getInstance($Family1);
- $family2 = new Family($famrec2);
-
- // Creat the fathers if their is some
- $father1 = $family1->getHusband();
- $father2 = $family2->getHusband();
-
- // Creat the mothers if their is some
- $mother1=$family1->getWife();
- $mother2=$family2->getWife();
-
- // Creat an array of Children
- $children1=$family1->getChildren();
- $children2=$family2->getChildren();
-
- if (count($FamilyListReturn)>0) { // removes the updated family from the list so it does not get added later.
- $index=null;
- for ($i=0; $i<count($FamilyListReturn); $i++) {
- if ($FamilyListReturn[$i]==$Family2) {
- $ndex=$i;
- break;
- }
- }
- if ($index!=null) {
- unset($FamilyListReturn[$index]);
- }
- }
-
- $famupdated = false;
- // Merging starts here, the merging of children.
- if (empty($children1)) {
- $children1=$children2;
- } elseif (empty($children2)) {
- } else {
- // Children are looped to see if they need to be added or merged to an esisting child
- foreach ($children2 as $childID2=>$Child2) {
- if (!empty($Child2)) {
- //echo "<br/>child 2 Xref ".$Child2->getXref()."-".$childID2;
-
- $found = false;
- //-- compare to children in local family
- foreach ($children1 as $childID1=>$Child1) {
- if (!empty($Child1)) {
- //echo "<br/>child 2 Xref ".$Child2->getXref()." == ".$Child1->getXref();
- $found=$this->ComparePeople($Child1,$Child2);
- if ($found) break;
- }
- }
- if ($found) {
- $childrec = $Child1->getGedcomRecord();
- if (strpos($childrec, "1 RFN ".$this->xref.":")===false) {
- $childrec .= "\n1 RFN ".$Child2->getXref();
- //echo "<br/> repalcing for child ".$Child1->getXref();
- replace_gedrec($Child1->getXref(), WT_GED_ID, $childrec);
- $this->setSameId($Child1->getXref(), $Child2->getXref());
- }
- } else {
- $famupdated = true;
- $famrec1 .="\n1 CHIL @".$Child2->getXref()."@";
- //echo "<br/> adding for child ".$Child2->getXref();
- }
- }
- }
- }
-
- //-- update the family record
- if (strpos($famrec1, "1 RFN ".$this->xref.":")===false) {
- $famrec1 .= "\n1 RFN ".$family2->getXref();
- $famupdated = true;
- }
- if ($famupdated) {
- //echo "<br /> updating family record ".$family1->getXref();
- replace_gedrec($family1->getXref(), WT_GED_ID, $famrec1);
- }
-
- // Merge Father basicly they just add the rfn numer and let the merge handle it latter
- if (empty($father1)) {
- if (!empty($father2)) {
- $father1=$father2;
- $famrec1 .="\n1 HUSB @".$father1->getXref()."@";
- //echo "<br/> adding for fahter ".$father1->getXref();
- replace_gedrec($family1->getXref(), WT_GED_ID, $famrec1);
- }
- } elseif (!empty($father2)) {
- if ($this->ComparePeople($father1,$father2)) {
- $fatherrec = $father1->getGedcomRecord();
- if (strpos($fatherrec, "1 RFN ".$this->xref.":")===false) {
- $fatherrec .= "\n1 RFN ".$father2->getXref();
- //echo "<br/> repalcing for father ".$father1->getXref();
- replace_gedrec($father1->getXref(), WT_GED_ID, $fatherrec);
- $this->setSameId($father1->getXref(), $father2->getXref());
- }
- }
- }
- // Merge Mother
- if (empty($mother1)) {
- if (!empty($mother2)) {
- $mother1=$mother2;
- $famrec1 .="\n1 WIFE @".$mother1->getXref()."@";
- //echo "<br/> adding for mother ".$mother1->getXref();
- replace_gedrec($family1->getXref(), WT_GED_ID, $famrec1);
- }
- } else if (!empty($mother2)) {
- if ($this->ComparePeople($mother1,$mother2)) {
- $motherrec = $mother1->getGedcomRecord();
- if (strpos($motherrec, "1 RFN ".$this->xref.":")===false) {
- $motherrec .= "\n1 RFN ".$mother2->getXref();
- //echo "<br/> repalcing for mother ".$mother1->getXref();
- replace_gedrec($mother1->getXref(), WT_GED_ID, $motherrec);
- $this->setSameId($mother1->getXref(), $mother2->getXref());
- }
- }
- }
- $this->setSameId($Family1, $Family2);
- }
-
- /**
- * Compairs familys and then returns true if the have 50% or more chance of being the same family.
- * Other wise it returns false.
- */
- function CompairForUpdateFamily($family1,$family2) {
- global $GEDCOM;
-
- // Values used to calculate the Percent of likley hood that the family is the same.
- $ChanceSameFamily=0.0;
- $CountFamily1=0.0;
- $CountFamily2=0.0;
- $ChanceSame=0.0;
-
- $firstTimeChildren=true;
-
- $famrec1 = find_family_record($family1, get_id_from_gedcom($GEDCOM));
- $ct = preg_match("/(\w+):(.+)/", $family2, $match);
- if ($ct>0) {
- $servid = trim($match[1]);
- $remoteid = trim($match[2]);
- $famrec2 = $this->getRemoteRecord($remoteid);
- } else return false;
- $family1 = Family::getInstance($family1);
- if (is_null($family1)) return false;
- $family2 = new Family($famrec2);
-
- if (!is_null($family1)) {
- // Creat the fathers if their is some
- $father1 = $family1->getHusband();
- $CountFamily1+=1.0;
- $mother1=$family1->getWife();
- $CountFamily1+=1.0;
- }
- $father2 = $family2->getHusband();
- $CountFamily2+=1.0;
- if (empty($father1)) {
- unset($father1);
- $CountFamily1-=1.0;
- }
- if (empty($father2)) {
- unset($father2);
- $CountFamily2-=1.0;
- }
-
- // Creat the mothers if their is some
- $mother2=$family2->getWife();
- $CountFamily2+=1.0;
- if (empty($mother1)) {
- unset($mother1);
- $CountFamily1-=1.0;
- }
- if (empty($mother2)) {
- unset($mother2);
- $CountFamily2-=1.0;
- }
-
- // Creat an array of Children
- $children1=$family1->getChildren();
- $children2=$family2->getChildren();
-
- // finds the probablity that they are the same family Bassed of both sites information
- $CountFamily1 += count($children1);
- $CountFamily2 += count($children2);
- foreach ($children1 as $childID1=>$Person1) {
- if (!empty($Person1)) {
- foreach ($children2 as $childID2=>$Person2) {
- if (!empty($Person2)) {
- if ($this->ComparePeople($Person1,$Person2)) {
- $ChanceSameFamily+=1.0;
- //echo "<br />".$Person1->getXref()." equals ".$Person2->getXref();
- break;
- }
- }
- }
- }
- }
-
- if (empty($father1)) {
- } elseif (empty($father2)) {
- } else {
- if ($this->ComparePeople($father1,$father2)) {
- $ChanceSameFamily+=1.0;
- }
- }
- if (empty($mother1)) {
- } elseif (empty($mother2)) {
- } else {
- if ($this->ComparePeople($mother1,$mother2)) {
- $ChanceSameFamily+=1.0;
- }
- }
- if ($CountFamily1!=0&&$CountFamily2!=0) {
- $ChanceSame=(($ChanceSameFamily/$CountFamily1)+($ChanceSameFamily/$CountFamily2))/2;
- //echo "<br />chancesame=".$ChanceSameFamily." count1=".$CountFamily1." count2=".$CountFamily2." ".$family1->getXref()." compared to ".$family2->getXref()." is ".$ChanceSame;
- } else
- return false;
-
- if ($ChanceSame<0.5) { // If the probabilty is less then 0.5 or 50% then the current family is stored here to be added later
- return false;
- } else { return true; }
- }
-
- /**
- * set two ids in the same person
- * @param string $local The local id
- * @param string $remote the remote id that matches the $local id
- */
- static function setSameId($local, $remote) {
- global $GEDCOM;
-
- if ($local == $remote) {
- debug_print_backtrace();
- return;
- }
- //-- check if the link already exists
- $gid=get_remote_id($remote);
- if (empty($gid)) {
- WT_DB::prepare("INSERT INTO `##remotelinks` (r_gid, r_linkid, r_file) VALUES (? ,? ,?)")
- ->execute(array($local, $remote, get_id_from_gedcom($GEDCOM)));
- }
- }
-
- /**
- * Compares to see if two people are the same, and it returns true if they are, but
- * false if they are not. It only compares the name, sex birthdate, and deathdate
- * of the person
- */
- static function ComparePeople(&$Person1,&$Person2) {
- $PersonName1=$Person1->getFullName();
- $PersonSex1=$Person1->getSex();
- $PersonBirth1=$Person1->getEstimatedBirthDate();
- $PersonDeath1=$Person1->getEstimatedDeathDate();
-
- $PersonName2=$Person2->getFullName();
- $PersonSex2=$Person2->getSex();
- $PersonBirth2=$Person2->getEstimatedBirthDate();
- $PersonDeath2=$Person2->getEstimatedDeathDate();
-
- $count=0;
- $Probability=0;
- if (!empty($PersonName1)&&!empty($PersonName2)) {
- $lev = levenshtein(utf8_strtolower($PersonName1), utf8_strtolower($PersonName2));
- if ($lev<4) {
- $Probability+=2;
- } else
- $Probability-=2;
- $count+=2;
- }
- $sex_prob=array('UU'=>0, 'UF'=>0, 'UM'=>0, 'MU'=>0, 'FU'=>0, 'MM'=>1, 'FF'=>1,'MF'=>-2, 'FM'=>-2);
- $Probability+=$sex_prob[$PersonSex1.$PersonSex2];
- $count++;
-
- if ($PersonBirth1->isOK() && $PersonBirth2->isOK()) {
- $diff=abs($PersonBirth1->JD() - $PersonBirth2->JD());
- if ($diff==0) {
- $Probability+=2;
- } elseif ($diff<366) {
- $Probability+=1;
- } else {
- $Probability-=1;
- }
- $count++;
- }
-
- if ($PersonDeath1->isOK() && $PersonDeath2->isOK()) {
- $diff=abs($PersonDeath1->JD() - $PersonDeath2->JD());
- if ($diff==0) {
- $Probability+=2;
- } elseif ($diff<366) {
- $Probability+=1;
- } else {
- $Probability-=1;
- }
- $count++;
- }
-
- $prob=$Probability/$count;
- if ($prob<0.5) {
- return false;
- } else {
- return true;
- }
- }
-
- /**
- * check if any there are any stub records with RFN tags that match the
- * ids in the gedcom record
- * @param string $gedrec
- * @return string
- */
- function checkIds($gedrec) {
- $ids_checked = array();
- $ct = preg_match_all("/@(".$this->xref.":.*)@/", $gedrec, $match, PREG_SET_ORDER);
- for ($i=0; $i<$ct; $i++) {
- $id = trim($match[$i][1]);
- if (isset($ids_checked[$id])) continue;
- $ids_checked[$id]=true;
- $gid=get_remote_id($id);
- if ($gid)
- $gedrec = str_replace("@".$id."@", "@".$gid."@", $gedrec);
- }
- return $gedrec;
- }
-
- /**
- * merge a local gedcom record with the information from the remote site
- * @param string $xref the remote ID to merge with
- * @param string $localrec the local gedcom record to merge the remote record with
- * @param boolean $isStub whether or not this is a stub record
- * @param boolean $firstLink is this the first time this record is being linked
- */
- function mergeGedcomRecord($xref, $localrec, $isStub=false, $firstLink=false) {
- global $GEDCOM;
-
- if (!$isStub) {
- $gedrec = find_gedcom_record($this->xref.":".$xref, get_id_from_gedcom($GEDCOM));
- if (!empty($gedrec)) $localrec = $gedrec;
- }
- //-- used to force an update on the first time linking a person
- if ($firstLink) {
- $this->authenticate();
- $result = $this->soapClient->getGedcomRecord($this->SID, $xref);
- if (PEAR::isError($result) || isset($result->faultcode) || get_class($result)=='SOAP_Fault' || is_object($result)) {
- if (isset($result->faultstring)) {
- AddToLog($result->faultstring, 'error');
- echo $result->faultstring;
- }
- return $localrec;
- }
- $gedrec = $result;
- $gedrec = preg_replace("/@([^#@\s]+)@/", "@".$this->xref.":$1@", $gedrec);
- $gedrec = $this->checkIds($gedrec);
- $localrec = $this->_merge($localrec, $gedrec);
- require_once WT_ROOT.'includes/functions/functions_edit.php';
- $localrec = $this->UpdateFamily($localrec,$gedrec);
- $ct=preg_match("/0 @(.*)@/", $localrec, $match);
- if ($ct>0) {
- $pid = trim($match[1]);
- replace_gedrec($pid, WT_GED_ID, $localrec);
- }
- }
-
- //-- get the last change date of the record
- $change_date = get_gedcom_value("CHAN:DATE", 1, $localrec, '', false);
- if (empty($change_date)) {
- $this->authenticate();
- if (!is_object($this->soapClient) || $this->isError($this->soapClient)) return false;
- $result = $this->soapClient->getGedcomRecord($this->SID, $xref);
- if (PEAR::isError($result) || isset($result->faultcode) || is_object($result) && get_class($result)=='SOAP_Fault') {
- if (isset($result->faultstring)) {
- AddToLog($result->faultstring, 'error');
- echo $result->faultstring;
- }
- return $localrec;
- }
- $gedrec = $result;
- $gedrec = preg_replace("/@([^#@\s]+)@/", "@".$this->xref.":$1@", $gedrec);
- $gedrec = $this->checkIds($gedrec);
-
- $localrec = $this->_merge($localrec, $gedrec);
- $ct=preg_match("/0 @(.*)@/", $localrec, $match);
- if ($ct>0) {
- $pid = trim($match[1]);
- if ($isStub) {
- require_once WT_ROOT.'includes/functions/functions_edit.php';
- $localrec = $this->UpdateFamily($localrec,$gedrec);
- replace_gedrec($pid, WT_GED_ID, $localrec);
- } else {
- update_record($localrec, get_id_from_gedcom($GEDCOM), false);
- }
- }
- } else {
- $chan_date = new GedcomDate($change_date);
- $chan_time_str = get_gedcom_value("CHAN:DATE:TIME", 1, $localrec, '', false);
- $chan_time = parse_time($chan_time_str);
- $change_time = mktime($chan_time[0], $chan_time[1], $chan_time[2], $chan_date->date1->m, $chan_date->date1->d, $chan_date->date1->y);
- /**
- * @todo make the timeout a config option
- */
- // Time Clock (determines how often a record is checked)
- if ($change_time < time()-(60*60*24*14)) // if the last update (to the remote individual) was made more than 14 days ago
- {
- //$change_date= "1 JAN 2000";
- $this->authenticate();
- if (!is_object($this->soapClient) || $this->isError($this->soapClient)) return false;
- $person = $this->soapClient->checkUpdatesByID($this->SID, $xref, $change_date);
- // If there are no changes between the local and remote copies
- if (PEAR::isError($person) || isset($person->faultcode) || get_class($person)=='SOAP_Fault' || isset($person->error_message_prefix)) {
-
- if (isset($person->faultstring)) AddToLog($person->faultstring, 'error');
- else AddToLog($person->message, 'edit');
- //-- update the last change time
- $pos1 = strpos($localrec, "1 CHAN");
- if ($pos1!==false) {
- $pos2 = strpos($localrec, "\n1", $pos1+4);
- if ($pos2===false) $pos2 = strlen($localrec);
- $newgedrec = substr($localrec, 0, $pos1);
- $newgedrec .= "1 CHAN\n2 DATE ".date("d M Y")."\n";
- $newgedrec .= "3 TIME ".date("H:i:s")."\n";
- $newgedrec .= "2 _WT_USER @".$this->xref."@\n";
- $newgedrec .= substr($localrec, $pos2);
- $localrec = $newgedrec;
- } else {
- $newgedrec = "\n1 CHAN\n2 DATE ".date("d M Y")."\n";
- $newgedrec .= "3 TIME ".date("H:i:s")."\n";
- $newgedrec .= "2 _WT_USER @".$this->xref."@";
- $localrec .= $newgedrec;
- }
- update_record($localrec, get_id_from_gedcom($GEDCOM), false);
- }
- // If changes have been made to the remote record
- else {
- $gedrec = $person->gedcom;
- $gedrec = preg_replace("/@([^#@\s]+)@/", "@".$this->xref.":$1@", $gedrec);
- $gedrec = $this->checkIds($gedrec);
- $ct=preg_match("/0 @(.*)@/", $localrec, $match);
- if ($ct>0) {
- $pid = trim($match[1]);
- $localrec = find_gedcom_record($pid, get_id_from_gedcom($GEDCOM), true);
- $localrec = $this->_merge($localrec, $gedrec);
- if ($isStub) {
- require_once WT_ROOT.'includes/functions/functions_edit.php';
- $localrec = $this->UpdateFamily($localrec,$gedrec);
- replace_gedrec($pid, WT_GED_ID, $localrec);
- } else {
- update_record($localrec, get_id_from_gedcom($GEDCOM), false);
- }
- }
- }
- }
- }
-
- return $localrec;
- }
-
- /**
- * get a singleton instance of the results
- * returned by the soapClient search method
- *
- * @param string $query - the query to search on
- * @param integer $start - the start index of the results to return
- * @param integer $max - the maximum number of results to return
- */
- function search($query, $start=0, $max=100) {
- $this->authenticate();
- $result = $this->soapClient->search($this->SID, $query, $start, $max);
- return $result;
- }
-
- /***
- * Change encoding style to literal
- * used when calling a java service
- *
- * @param object $wsdl SOAP_WSDL object
- * @returns object modified wsdl object
- */
- function __change_encoding(&$wsdl) {
- $namespace = array_keys($wsdl->bindings);
- if (isset($namespace[0]) && isset($wsdl->bindings[$namespace[0]]['operations'])) {
- $operations = array_keys($wsdl->bindings[$namespace[0]]['operations']);
-
- for ($i = 0; $i<count($operations); $i++) {
- $wsdl->bindings[$namespace[0]]['operations'][$operations[$i]]['input']['use'] = 'literal';
- $wsdl->bindings[$namespace[0]]['operations'][$operations[$i]]['output']['use'] = 'literal';
- }
- }
- }
-
- /**
- * get a singleton instance of this client
- * @return ServiceClient
- */
- static function &getInstance($id) {
- global $WT_SERVERS, $GEDCOM;
- $ged_id=get_id_from_gedcom($GEDCOM);
-
- if (isset($WT_SERVERS[$id])) return $WT_SERVERS[$id];
- $gedrec = find_gedcom_record($id, $ged_id, true);
- if (!empty($gedrec)) {
- $url = get_gedcom_value("URL",1,$gedrec);
- $gedfile = get_gedcom_value("_DBID", 1, $gedrec);
- if (empty($url) && empty($gedfile))
- return null;
- if (!empty($url) && (strtolower($url)!=strtolower(WT_SERVER_NAME.WT_SCRIPT_PATH))) {
- $server = new ServiceClient($gedrec);
- } else {
- require_once WT_ROOT.'includes/classes/class_localclient.php';
- $server = new LocalClient($gedrec);
- }
- $WT_SERVERS[$id] = $server;
- return $server;
- }
- return null;
- }
-}
diff --git a/includes/controllers/descendancy_ctrl.php b/includes/controllers/descendancy_ctrl.php
index a3de123406..92c5136c6f 100644
--- a/includes/controllers/descendancy_ctrl.php
+++ b/includes/controllers/descendancy_ctrl.php
@@ -106,14 +106,6 @@ class DescendancyController extends BaseController {
$this->descPerson = Person::getInstance($this->pid);
$this->name=$this->descPerson->getFullName();
-
- //-- if the person is from another gedcom then forward to the correct site
- /*
- if ($this->indi->isRemote()) {
- header('Location: '.$this->indi->getRawUrl());
- exit;
- }
- */
}
/**
diff --git a/includes/controllers/family_ctrl.php b/includes/controllers/family_ctrl.php
index bd8e0534d8..d5ee19447b 100644
--- a/includes/controllers/family_ctrl.php
+++ b/includes/controllers/family_ctrl.php
@@ -63,17 +63,6 @@ class FamilyController extends BaseController {
$this->family = Family::getInstance($this->famid);
if (empty($this->famrec)) {
- $ct = preg_match('/(\w+):(.+)/', $this->famid, $match);
- if ($ct>0) {
- $servid = trim($match[1]);
- $remoteid = trim($match[2]);
- require_once WT_ROOT.'includes/classes/class_serviceclient.php';
- $service = ServiceClient::getInstance($servid);
- if (!is_null($service)) {
- $newrec= $service->mergeGedcomRecord($remoteid, "0 @".$this->famid."@ FAM\n1 RFN ".$this->famid, false);
- $this->famrec = $newrec;
- }
- }
//-- if no record was found create a default empty one
if (find_updated_record($this->famid, WT_GED_ID)!==null) {
$this->famrec = "0 @".$this->famid."@ FAM\n";
diff --git a/includes/controllers/individual_ctrl.php b/includes/controllers/individual_ctrl.php
index 593894bb98..1d4d5170f0 100644
--- a/includes/controllers/individual_ctrl.php
+++ b/includes/controllers/individual_ctrl.php
@@ -70,19 +70,7 @@ class IndividualController extends BaseController {
$gedrec = find_person_record($this->pid, WT_GED_ID);
}
if (empty($gedrec)) {
- $ct = preg_match('/(\w+):(.+)/', $this->pid, $match);
- if ($ct>0) {
- $servid = trim($match[1]);
- $remoteid = trim($match[2]);
- require_once WT_ROOT.'includes/classes/class_serviceclient.php';
- $service = ServiceClient::getInstance($servid);
- if ($service != null) {
- $newrec= $service->mergeGedcomRecord($remoteid, "0 @".$this->pid."@ INDI\n1 RFN ".$this->pid, false);
- $gedrec = $newrec;
- }
- } else {
- $gedrec = "0 @".$this->pid."@ INDI\n";
- }
+ $gedrec = "0 @".$this->pid."@ INDI\n";
}
if (WT_USER_ID) {
@@ -94,7 +82,7 @@ class IndividualController extends BaseController {
}
if (find_person_record($this->pid, WT_GED_ID) || find_updated_record($this->pid, WT_GED_ID)!==null) {
- $this->indi = new Person($gedrec, false);
+ $this->indi = new Person($gedrec);
$this->indi->ged_id=WT_GED_ID; // This record is from a file
} else if (!$this->indi) {
return false;
@@ -154,38 +142,8 @@ class IndividualController extends BaseController {
//-- if the user can edit and there are changes then get the new changes
if ($this->show_changes && WT_USER_CAN_EDIT) {
$newrec = find_updated_record($this->pid, WT_GED_ID);
- if ($newrec) {
- //-- get the changed record from the file
- //print("jkdsakjhdkjsadkjsakjdhsakd".$newrec);
- $remoterfn = get_gedcom_value("RFN", 1, $newrec);
- } else {
- $remoterfn = get_gedcom_value("RFN", 1, $gedrec);
- }
- // print "remoterfn=".$remoterfn;
- //-- get an updated record from the web service
- if (!empty($remoterfn)) {
- $parts = explode(':', $remoterfn);
- if (count($parts)==2) {
- $servid = $parts[0];
- $aliaid = $parts[1];
- if (!empty($servid)&&!empty($aliaid)) {
- require_once WT_ROOT.'includes/classes/class_serviceclient.php';
- $serviceClient = ServiceClient::getInstance($servid);
- if (!is_null($serviceClient)) {
- if (!empty($newrec)) $mergerec = $serviceClient->mergeGedcomRecord($aliaid, $newrec, true);
- else $mergerec = $serviceClient->mergeGedcomRecord($aliaid, $gedrec, true);
- if ($serviceClient->type=="remote") {
- $newrec = $mergerec;
- }
- else {
- $gedrec = $mergerec;
- }
- }
- }
- }
- }
if (!empty($newrec)) {
- $this->diffindi = new Person($newrec, false);
+ $this->diffindi = new Person($newrec);
$this->diffindi->setChanged(true);
$gedrec = $newrec;
}
diff --git a/includes/controllers/remotelink_ctrl.php b/includes/controllers/remotelink_ctrl.php
deleted file mode 100644
index 5b9e5a5242..0000000000
--- a/includes/controllers/remotelink_ctrl.php
+++ /dev/null
@@ -1,397 +0,0 @@
-<?php
-// Add Remote Link Page
-//
-// Allow a user the ability to add links to people from other servers and other gedcoms.
-//
-// webtrees: Web based Family History software
-// Copyright (C) 2010 webtrees development team.
-//
-// Derived from PhpGedView
-// Copyright (C) 2002 to 2009 PGV Development Team. All rights reserved.
-//
-// This program is free software; you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// @version $Id$
-
-if (!defined('WT_WEBTREES')) {
- header('HTTP/1.0 403 Forbidden');
- exit;
-}
-
-define('WT_REMOTELINK_CTRL_PHP', '');
-
-require_once WT_ROOT.'includes/controllers/basecontrol.php';
-require_once WT_ROOT.'includes/functions/functions_edit.php';
-require_once WT_ROOT.'includes/classes/class_serviceclient.php';
-
-class RemoteLinkController extends BaseController {
- var $has_familysearch=null;
- var $pid=null;
- var $person=null;
- var $server_list=null;
- var $gedcom_list=null;
-
- // Values from the add remote link form.
- public $form_txtPID=null;
- public $form_cbRelationship='current_person';
- public $form_location=null;
- public $form_txtURL=null;
- public $form_txtTitle=null;
- public $form_txtGID=null;
- public $form_txtUsername=null;
- public $form_txtPassword=null;
- public $form_cbExistingServers=null;
- public $form_txtCB_Title=null;
- public $form_txtCB_GID=null;
- public $form_txtFS_URL=null;
- public $form_txtFS_Title=null;
- public $form_txtFS_GID=null;
- public $form_txtFS_Username=null;
- public $form_txtFS_Password=null;
-
- // Initialize the controller for the add remote link
- function init() {
- // Coming soon ???
- $this->has_familysearch=file_exists(WT_ROOT.'modules/FamilySearch/familySearchWrapper.php');
- if ($this->has_familysearch) {;
- require_once WT_ROOT.'modules/FamilySearch/familySearchWrapper.php';
- }
-
- // The PID can come from a URL or a form
- $this->pid=safe_REQUEST($_REQUEST, 'pid', WT_REGEX_XREF);
-
- $this->person=Person::getInstance($this->pid);
- $this->server_list=get_server_list();
- $this->gedcom_list=get_all_gedcoms();
-
- // Other input values come from the form
- $this->form_txtPID =safe_POST('txtPID', WT_REGEX_XREF);
- $this->form_cbRelationship =safe_POST('cbRelationship');
- $this->form_location =safe_POST('location');
- $this->form_txtURL =safe_POST('txtURL', WT_REGEX_URL);
- $this->form_txtTitle =safe_POST('txtTitle', '[^<>"%{};]+');
- $this->form_txtGID =safe_POST('txtGID', preg_quote_array($this->gedcom_list));
- $this->form_txtUsername =safe_POST('txtUsername', WT_REGEX_USERNAME);
- $this->form_txtPassword =safe_POST('txtPassword', WT_REGEX_PASSWORD);
- $this->form_cbExistingServers=safe_POST('cbExistingServers', array_keys($this->server_list));
- $this->form_txtCB_Title =safe_POST('txtCB_Title', '[^<>"%{};]+');
- $this->form_txtCB_GID =safe_POST('txtCB_GID', preg_quote_array($this->gedcom_list));
- $this->form_txtFS_URL =safe_POST('txtFS_URL', WT_REGEX_URL);
- $this->form_txtFS_Title =safe_POST('txtFS_Title', '[^<>"%{};]+');
- $this->form_txtFS_GID =safe_POST('txtFS_GID', preg_quote_array($this->gedcom_list));
- $this->form_txtFS_Username =safe_POST('txtFS_Username', WT_REGEX_USERNAME);
- $this->form_txtFS_Password =safe_POST('txtFS_Password', WT_REGEX_PASSWORD);
-
- if (is_null($this->form_location)) {
- if ($this->server_list) {
- $this->form_location='existing';
- } else {
- $this->form_location='remote';
- }
- }
-
- }
-
- // Perform the desired action and return true/false success.
- function runAction($action) {
- switch ($action) {
- case 'addlink':
- return $this->addLink();
- default:
- return false;
- }
- }
-
- // Add a remote webtrees server
- //
- // @param string $title
- // @param string $url
- // @param string $gedcom_id
- // @param string $username
- // @param string $password
- // @return mixed the serverID of the server to link to
- function addRemoteServer($title, $url, $gedcom_id, $username, $password) {
- if (!$url || !$gedcom_id || !$username || !$password) {
- return null;
- }
-
- if (preg_match('/\?wsdl$/', $url)==0) {
- $url.="?wsdl";
- }
-
- $serverID=$this->checkExistingServer($url, $gedcom_id);
- if (!$serverID) {
- $gedcom_string="0 @new@ SOUR\n1 URL {$url}\n1 _DBID {$gedcom_id}\n2 _USER {$username}\n2 _PASS {$password}\n3 RESN confidential";
- $service=new ServiceClient($gedcom_string);
- $sid=$service->authenticate();
- if (PEAR::isError($sid)) {
- $sid='';
- }
- if (!$sid) {
- echo '<span class="error">failed to authenticate to remote site</span>';
- $serverID=null;
- } else {
- if (!$title) {
- $title=$service->getServiceTitle();
- }
- $gedcom_string.="\n1 TITL {$title}";
- $serverID=append_gedrec($gedcom_string, WT_GED_ID);
- }
- }
- return $serverID;
- }
-
- // Add a familySearch server
- //
- // @param string $title
- // @param string $url
- // @param string $gedcom_id
- // @param string $username
- // @param string $password
- // @return mixed the serverID of the server to link to
- function addFamilySearchServer($title, $url, $gedcom_id, $username, $password) {
- $serverID = $this->checkExistingServer($url, $gedcom_id);
- if (!$serverID) {
- $gedcom_string = "0 @new@ SOUR\n";
- $gedcom_string.= "1 URL ".$url."\n";
- $gedcom_string.= "2 TYPE FamilySearch\n";
- $gedcom_string.= "1 _DBID ".$gedcom_id."\n";
- $gedcom_string.= "2 _USER ".$username."\n";
- $gedcom_string.= "2 _PASS ".$password."\n";
- //-- only allow admin users to see password
- $gedcom_string.= "3 RESN confidential\n";
- $service = new FamilySearchWrapper($gedcom_string);
- $sid = $service->authenticate();
- if (PEAR::isError($sid)) {
- $sid = '';
- }
- if (empty($sid)) {
- echo "<span class=\"error\">failed to authenticate to remote site</span>";
- } else {
- if (empty($title)) {
- $title = $service->getServiceTitle();
- }
- $title = $service->getServiceTitle();
- $gedcom_string.= "1 TITL ".$title."\n";
- $serverID = append_gedrec($gedcom_string, WT_GED_ID);
- }
- }
- return $serverID;
- }
-
- // Add a server record for a local remote link
- //
- // @param string $gedcom_id
- // @return mixed the serverID of the server to link to
- function addLocalServer($title, $gedcom_id) {
- $serverID = $this->checkExistingServer(WT_SERVER_NAME.WT_SCRIPT_PATH, $gedcom_id);
- if (!$serverID) {
- $gedcom_string = "0 @new@ SOUR\n";
- if (empty($title)) {
- $title=get_gedcom_setting(get_id_from_gedcom($gedcom_id), 'title');
- }
- $gedcom_string.= "1 TITL ".$title."\n";
- $gedcom_string.= "1 URL ".WT_SERVER_NAME.WT_SCRIPT_PATH."\n";
- $gedcom_string.= "1 _DBID ".$gedcom_id."\n";
- $gedcom_string.= "2 _BLOCK false\n";
- $serverID = append_gedrec($gedcom_string, WT_GED_ID);
- }
- return $serverID;
- }
-
- // check if the server already exists
- //
- // @param string $url
- // @param string $gedcom_id
- // @return mixed the id of the server to link to or false if it does not exist
- function checkExistingServer($url, $gedcom_id='') {
- //-- get rid of the protocol
- $turl = preg_replace('~^\w+://~', '', $url);
- //-- check the existing server list
- foreach ($this->server_list as $id=>$server) {
- if (stristr($server['url'], $turl)) {
- if (empty($gedcom_id) || preg_match("/\n1 _DBID {$gedcom_id}/", $server['gedcom']))
- return $id;
- }
- }
-
- //-- check for recent additions
- return WT_DB::prepare(
- "SELECT xref".
- " FROM `##change`".
- " WHERE status='pending' AND gedcom_id=? AND new_gedcom LIKE CONCAT('%\n1 _DBID ', ?, '%')".
- " ORDER BY change_id DESC".
- " LIMIT 1"
- )->execute(array(WT_GED_ID, $gedcom_id))->fetchOne();
- }
-
- function addLink() {
- global $GEDCOM;
-
- switch ($this->form_location) {
- case 'remote':
- $serverID=$this->addRemoteServer(
- $this->form_txtTitle,
- $this->form_txtURL,
- $this->form_txtGID,
- $this->form_txtUsername,
- $this->form_txtPassword
- );
- break;
- case 'local':
- $serverID=$this->addLocalServer(
- $this->form_txtCB_Title,
- $this->form_txtCB_GID
- );
- break;
- case 'existing':
- $serverID=$this->form_cbExistingServers;
- break;
- case "FamilySearch":
- //TODO: Make sure that it is merging correctly
- $serverID=$this->addFamilySearchServer(
- $this->form_txtFS_URL,
- $this->form_txtFS_URL,
- $this->form_txtFS_GID,
- $this->form_txtFS_Username,
- $this->form_txtFS_Password
- );
- break;
- }
-
- $link_pid =$this->form_txtPID;
- $relation_type=$this->form_cbRelationship;
- if ($serverID && $link_pid) {
- $indirec=find_gedcom_record($this->pid, WT_GED_ID, true);
-
- switch ($relation_type) {
- case "father":
- $indistub="0 @new@ INDI\n1 SOUR @{$serverID}@\n2 PAGE {$link_pid}\n1 RFN {$serverID}:{$link_pid}";
- $stub_id=append_gedrec($indistub, WT_GED_ID);
- $indistub=find_gedcom_record($stub_id, WT_GED_ID, true);
-
- $gedcom_fam="0 @new@ FAM\n1 HUSB @{$stub_id}@\n1 CHIL @{$this->pid}@";
- $fam_id=append_gedrec($gedcom_fam, WT_GED_ID);
-
- $indirec.= "\n1 FAMC @{$fam_id}@";
- replace_gedrec($this->pid, WT_GED_ID, $indirec);
-
- $serviceClient=ServiceClient::getInstance($serverID);
- $indistub=$serviceClient->mergeGedcomRecord($link_pid, $indistub, true, true);
- $indistub.="\n1 FAMS @{$fam_id}@";
- replace_gedrec($stub_id, WT_GED_ID, $indistub);
- break;
- case "mother":
- $indistub="0 @new@ INDI\n1 SOUR @{$serverID}@\n2 PAGE {$link_pid}\n1 RFN {$serverID}:{$link_pid}";
- $stub_id=append_gedrec($indistub, WT_GED_ID);
- $indistub=find_gedcom_record($stub_id, WT_GED_ID, true);
-
- $gedcom_fam="0 @new@ FAM\n1 WIFE @{$stub_id}@\n1 CHIL @{$this->pid}@";
- $fam_id=append_gedrec($gedcom_fam, WT_GED_ID);
-
- $indirec.="\n1 FAMC @{$fam_id}@";
- replace_gedrec($this->pid, WT_GED_ID, $indirec);
-
- $serviceClient=ServiceClient::getInstance($serverID);
- $indistub=$serviceClient->mergeGedcomRecord($link_pid, $indistub, true, true);
- $indistub.="\n1 FAMS @".$fam_id."@";
- replace_gedrec($stub_id, WT_GED_ID, $indistub);
- break;
- case "husband":
- $indistub="0 @new@ INDI\n1 SOUR @{$serverID}@\n2 PAGE {$link_pid}\n1 RFN {$serverID}:{$link_pid}";
- $stub_id=append_gedrec($indistub, WT_GED_ID);
- $indistub=find_gedcom_record($stub_id, WT_GED_ID, true);
-
- $gedcom_fam="0 @new@ FAM\n1 MARR Y\n1 WIFE @{$this->pid}@\n1 HUSB @{$stub_id}@\n";
- $fam_id=append_gedrec($gedcom_fam, WT_GED_ID);
-
- $indirec.="\n1 FAMS @{$fam_id}@";
- replace_gedrec($this->pid, WT_GED_ID, $indirec);
-
- $serviceClient=ServiceClient::getInstance($serverID);
- $indistub=$serviceClient->mergeGedcomRecord($link_pid, $indistub, true, true);
- $indistub.="\n1 FAMS @{$fam_id}@";
- replace_gedrec($stub_id, WT_GED_ID, $indistub);
- break;
- case "wife":
- $indistub="0 @new@ INDI\n1 SOUR @{$serverID}@\n2 PAGE {$link_pid}\n1 RFN {$serverID}:{$link_pid}";
- $stub_id=append_gedrec($indistub, WT_GED_ID);
- $indistub=find_gedcom_record($stub_id, WT_GED_ID, true);
-
- $gedcom_fam="0 @new@ FAM\n1 MARR Y\n1 WIFE @{$stub_id}@\n1 HUSB @{$this->pid}@";
- $fam_id=append_gedrec($gedcom_fam, WT_GED_ID);
-
- $indirec.="\n1 FAMS @{$fam_id}@";
- replace_gedrec($this->pid, WT_GED_ID, $indirec);
-
- $serviceClient=ServiceClient::getInstance($serverID);
- $indistub=$serviceClient->mergeGedcomRecord($link_pid, $indistub, true, true);
- $indistub.="\n1 FAMS @{$fam_id}@\n";
- replace_gedrec($stub_id, WT_GED_ID, $indistub);
- break;
- case "son":
- case "daughter":
- $indistub="0 @new@ INDI\n1 SOUR @{$serverID}@\n2 PAGE {$link_pid}\n1 RFN {$serverID}:{$link_pid}";
- $stub_id=append_gedrec($indistub, WT_GED_ID);
- $indistub=find_gedcom_record($stub_id, WT_GED_ID, true);
-
- if (get_gedcom_value('SEX', 1, $indirec, '', false)=='F') {
- $gedcom_fam="0 @new@ FAM\n1 WIFE @{$this->pid}@\n1 CHIL @{$stub_id}@";
- } else {
- $gedcom_fam="0 @new@ FAM\n1 HUSB @{$this->pid}@\n1 CHIL @{$stub_id}@";
- }
- $fam_id=append_gedrec($gedcom_fam, WT_GED_ID);
- $indirec.="\n1 FAMS @{$fam_id}@";
- replace_gedrec($this->pid, WT_GED_ID, $indirec);
-
- $serviceClient=ServiceClient::getInstance($serverID);
- $indistub=$serviceClient->mergeGedcomRecord($link_pid, $indistub, true, true);
- $indistub.="\n1 FAMC @".$fam_id."@";
- replace_gedrec($stub_id, WT_GED_ID, $indistub);
- break;
- case 'current_person':
- $indirec.="\n1 RFN {$serverID}:{$link_pid}\n1 SOUR @{$serverID}@\n2 PAGE {$link_pid}";
-
- $serviceClient = ServiceClient::getInstance($serverID);
- if (!is_null($serviceClient)) {
- //-- get rid of change date
- $pos1=strpos($indirec, "\n1 CHAN");
- if ($pos1!==false) {
- $pos2=strpos($indirec, "\n1", $pos1+5);
- $indirec=substr($indirec, 0, $pos1).substr($indirec, $pos2);
- }
- $indirec=$serviceClient->mergeGedcomRecord($link_pid, $indirec, true, true);
- } else {
- echo 'Unable to find server';
- }
- break;
- }
- echo '<b>', i18n::translate('Successfully added link'), '</b>';
- return true;
- }
- return false;
- }
-
- /**
- * whether or not the user has access to this area
- *
- * @return boolean
- */
- function canAccess() {
- global $ALLOW_EDIT_GEDCOM;
-
- return $ALLOW_EDIT_GEDCOM && WT_USER_GEDCOM_ADMIN && $this->person->canDisplayDetails();
- }
-}
diff --git a/includes/controllers/search_ctrl.php b/includes/controllers/search_ctrl.php
index 29dd72d68d..35aeabbaea 100644
--- a/includes/controllers/search_ctrl.php
+++ b/includes/controllers/search_ctrl.php
@@ -47,8 +47,6 @@ class SearchController extends BaseController {
var $indiResultsPrinted = -1;
var $famResultsPrinted = -1;
var $srcResultsPrinted = -1;
- var $multiResultsPerPage = -1;
- var $multiTotalResults = -1;
var $query;
var $myquery = "";
//var $soundex = "Russell";
@@ -57,8 +55,6 @@ class SearchController extends BaseController {
var $nameprt = "";
var $tagfilter = "on";
var $showasso = "off";
- var $multiquery="";
- var $mymultiquery;
var $name="";
var $myname;
var $birthdate="";
@@ -80,12 +76,10 @@ class SearchController extends BaseController {
var $year="";
var $myyear;
var $sgeds = array ();
- var $Sites = array ();
var $myindilist = array ();
var $mysourcelist = array ();
var $myfamlist = array ();
var $mynotelist = array ();
- var $multisiteResults = array ();
var $inputFieldNames = array ();
var $replace = false;
var $replaceNames = false;
@@ -134,7 +128,7 @@ class SearchController extends BaseController {
}
// Aquire all the variables values from the $_REQUEST
- $varNames = array ("isPostBack", "action", "topsearch", "srfams", "srindi", "srsour", "srnote", "view", "soundex", "subaction", "nameprt", "tagfilter", "showasso", "resultsPageNum", "resultsPerPage", "totalResults", "totalGeneralResults", "indiResultsPrinted", "famResultsPrinted", "multiTotalResults", "srcResultsPrinted", "multiResultsPerPage", "myindilist", "mysourcelist", "mynotelist", "myfamlist");
+ $varNames = array ("isPostBack", "action", "topsearch", "srfams", "srindi", "srsour", "srnote", "view", "soundex", "subaction", "nameprt", "tagfilter", "showasso", "resultsPageNum", "resultsPerPage", "totalResults", "totalGeneralResults", "indiResultsPrinted", "famResultsPrinted", "srcResultsPrinted", "myindilist", "mysourcelist", "mynotelist", "myfamlist");
$this->setRequestValues($varNames);
if (!$this->isPostBack) {
@@ -157,9 +151,6 @@ class SearchController extends BaseController {
$this->sgeds[WT_GED_ID] = $GEDCOM;
}
- // Retrieve the sites that can be searched
- $this->Sites = get_server_list();
-
// vars use for soundex search
if (!empty ($_REQUEST["firstname"])) {
$this->firstname = $_REQUEST["firstname"];
@@ -194,14 +185,6 @@ class SearchController extends BaseController {
$this->myquery=htmlspecialchars(implode(' ', array($this->firstname, $this->lastname, $this->place)));
};
- // vars use for multisite search
- if (!empty ($_REQUEST["multiquery"])) {
- $this->multiquery = $_REQUEST["multiquery"];
- $this->mymultiquery = $this->multiquery;
- } else {
- $this->multiquery="";
- $this->mymultiquery = "";
- }
if (!empty ($_REQUEST["name"])) {
$this->name = $_REQUEST["name"];
$this->myname = $this->name;
@@ -261,7 +244,6 @@ class SearchController extends BaseController {
$this->inputFieldNames[] = "soundex";
$this->inputFieldNames[] = "nameprt";
$this->inputFieldNames[] = "subaction";
- $this->inputFieldNames[] = "multiquery";
$this->inputFieldNames[] = "name";
$this->inputFieldNames[] = "birthdate";
$this->inputFieldNames[] = "birthplace";
@@ -285,10 +267,6 @@ class SearchController extends BaseController {
case 'replace':
$this->SearchAndReplace();
return;
- case 'multisite':
- $this->MultiSiteSearch();
- break;
-
}
}
@@ -300,8 +278,6 @@ class SearchController extends BaseController {
return i18n::translate('Soundex Search');
case 'replace':
return i18n::translate('Search and replace');
- case 'multisite':
- return i18n::translate('Multi Site Search');
}
}
@@ -643,77 +619,6 @@ class SearchController extends BaseController {
usort($this->myfamlist, array('GedcomRecord', 'Compare'));
}
- /**
- *
- */
- function MultiSiteSearch() {
- require_once WT_ROOT.'includes/classes/class_serviceclient.php';
-
- if (!empty ($this->Sites) && count($this->Sites) > 0) {
- $this->myindilist = array ();
- // This first tests to see if it just a basic site search
- if (!empty ($this->multiquery) && ($this->subaction == "basic")) {
- // Find out if the string is longer then one char if dont perform the search
- if (strlen($this->multiquery) > 1) {
- $my_query = $this->multiquery;
- // Now see if there is a query left after the cleanup
- if (trim($my_query) != "") {
- // Cleanup the querystring so it can be used in a database query
- $my_query = "%".preg_replace("/\s+/", "%", $my_query)."%";
- }
- }
-
- } else
- if (($this->subaction == "advanced") && (!empty ($this->myname) || !empty ($this->mybirthdate) || !empty ($this->mybirthplace) || !empty ($this->deathdate) || !empty ($this->mydeathplace) || !empty ($this->mygender))) {
- //Building the query string up
- $my_query = '';
- if (!empty ($this->myname)) {
- $my_query .= "NAME=".$this->myname;
- }
- if (!empty ($this->mybirthdate)) {
- if ($my_query != '')
- $my_query .= '&';
- $my_query .= "BIRTHDATE=".$this->mybirthdate;
- }
- if (!empty ($this->mybirthplace)) {
- if ($my_query != '')
- $my_query .= '&';
- $my_query .= "BIRTHPLACE=".$this->mybirthplace;
- }
- if (!empty ($this->deathdate)) {
- if ($my_query != '')
- $my_query .= '&';
- $my_query .= "DEATHDATE=".$this->deathdate;
- }
- if (!empty ($this->mydeathplace)) {
- if ($my_query != '')
- $my_query .= '&';
- $my_query."DEATHPLACE=".$this->mydeathplace;
- }
- if (!empty ($this->mygender)) {
- if ($my_query != '')
- $my_query .= '&';
- $my_query .= "GENDER=".$this->mygender;
- }
- }
-
- if (!empty ($my_query)) {
- $this->multisiteResults = array ();
- // loop through the selected site to search
- $i = 0;
- foreach ($this->Sites as $key => $site) {
- $vartemp = "server".$i;
- if (isset ($_REQUEST["$vartemp"])) {
- $serviceClient = ServiceClient :: getInstance($key);
- $result = $serviceClient->search($my_query);
- $this->multisiteResults[$key] = $result;
- }
- $i++;
- }
- }
- }
- }
-
function printResults() {
require_once WT_ROOT.'includes/functions/functions_print_lists.php';
global $GEDCOM, $TEXT_DIRECTION, $WT_IMAGES;
@@ -803,122 +708,6 @@ class SearchController extends BaseController {
$this->printPageResultsLinks($this->inputFieldNames, $this->totalGeneralResults, $this->resultsPerPage);
}
}
-
- // ----- section to search and display results for multisite
- if ($this->action == "multisite") {
- // Only Display 5 results per 2 sites if the total results per page is 10
- $sitesChecked = 0;
- $i = 0;
- foreach ($this->Sites as $server) {
- $siteName = "server".$i;
- if (isset ($_REQUEST["$siteName"]))
- $sitesChecked ++;
- $i ++;
- }
- if ($sitesChecked >= 1) {
- $this->multiResultsPerPage = $this->resultsPerPage / $sitesChecked;
-
- if (!empty ($this->Sites) && count($this->Sites) > 0) {
- $no_results_found = false;
- // Start output here, because from the indi's we may have printed some fams which need the column header.
- echo "<br />";
- echo "<div class=\"center\">";
-
- if (isset ($this->multisiteResults) && (count($this->multisiteResults) > 0)) {
- $this->totalResults = 0;
- $this->multiTotalResults = 0;
- $somethingPrinted = true;
- foreach ($this->multisiteResults as $key => $siteResults) {
- require_once WT_ROOT.'includes/classes/class_serviceclient.php';
- $serviceClient = ServiceClient :: getInstance($key);
- $siteName = $serviceClient->getServiceTitle();
- $siteURL = dirname($serviceClient->getURL());
-
- echo "<table id=\"multiResultsOutTbl\" class=\"list_table, $TEXT_DIRECTION\" align=\"center\">";
-
- if (isset ($siteResults) && !empty ($siteResults->persons)) {
- $displayed_once = false;
- $personlist = $siteResults->persons;
-
- /***************************************************** PAGING HERE **********************************************************************/
-
- //set the total results and only get the results for this page
- $this->multiTotalResults += count($personlist);
- if ($this->totalResults < $this->multiTotalResults)
- $this->totalResults = $this->multiTotalResults;
- $personlist = $this->getPagedResults($personlist, $this->multiResultsPerPage);
- $pageResultsNum = 0;
- foreach ($personlist as $index => $person) {
- //if there is a name to display then diplay it
- if (!empty ($person->gedcomName)) {
- if (!$displayed_once) {
- if (!$no_results_found) {
- $no_results_found = true;
- echo "<tr><td class=\"list_label\" colspan=\"2\" width=\"100%\">";
- if (isset($WT_IMAGES["indis"])) echo "<img src=\"".$WT_IMAGES["indis"]."\" border=\"0\" width=\"25\" alt=\"\" /> ";
- echo i18n::translate('People')."</td></tr>";
- echo "<tr><td><table id=\"multiResultsInTbl\" align=\"center\" cellspacing=\"0\" cellpadding=\"0\" border=\"0\" ><tr>";
- }
- $displayed_once = true;
- echo "<td class=\"list_label\" colspan=\"2\" cellspacing=\"0\" cellpadding=\"0\" border=\"0\" >".i18n::translate('Site: ')."<a href=\"".$siteURL."\" target=\"_blank\">".$siteName."</a>".i18n::translate(' contained the following')."</td></tr>";
- }
- echo "<tr><td class=\"list_value $TEXT_DIRECTION\" cellspacing=\"0\" cellpadding=\"0\" border=\"0\" valign=\"center\" ><ul>";
- echo "<li class=\"$TEXT_DIRECTION\" dir=\"$TEXT_DIRECTION\">";
- echo "<a href=\"{$siteURL}/individual.php?pid={$person->PID}&amp;ged=".rawurlencode($serviceClient->gedfile)."\" target=\"_blank\">";
- $pageResultsNum += 1;
- echo "<b>".$person->getFullName()."</b>";
- if (!empty ($person->PID)) {
- echo " (".$person->PID.")";
- }
- if (!empty ($person->birthDate) || !empty ($person->birthPlace)) {
- echo " -- <i>";
- if (!empty ($person->birthDate)) {
- echo " ".$person->birthDate;
- }
- if (!empty ($person->birthPlace)) {
- echo " ".$person->birthPlace;
- }
- echo "</i>";
- }
- echo "</a></li></ul></td>";
-
- /******************************* Remote Links Per Result *************************************************/
- if (WT_USER_CAN_EDIT) {
- echo "<td class=\"list_value $TEXT_DIRECTION\" cellspacing=\"0\" cellpadding=\"0\" border=\"0\" >"."<ul style=\"list-style: NONE\"><li><a href=\"javascript:;\" "."onclick=\"return open_link('".$key."', '".$person->PID."', '".$person->getFullName()."');\">"."<b>".i18n::translate('Add Local Link')."</b></a></ul></li></td></tr>";
- }
- }
- }
-
- echo "</table>";
-
- echo "&nbsp;</td></tr></table>";
- }
- if ($this->multiTotalResults > 0) {
- echo "</tr><tr><td align=\"left\">Displaying individuals ";
- echo (($this->multiResultsPerPage * $this->resultsPageNum) + 1)." ".i18n::translate('to')." ". (($this->multiResultsPerPage * $this->resultsPageNum) + $pageResultsNum);
- echo " ".i18n::translate('of')." ". ($this->multiTotalResults)."</td></tr></table>";
- $this->multiTotalResults = 0;
- } else
- echo "</tr></table>";
- }
- echo "</table>";
- }
- echo '</div>';
- if (!$no_results_found && $this->multiTotalResults == 0 && (isset ($this->multiquery) || isset ($this->name) || isset ($this->birthdate) || isset ($this->birthplace) || isset ($this->deathdate) || isset ($this->deathplace) || isset ($this->gender))) {
- echo "<table align=\"center\" \><td class=\"warning\" style=\" text-align: center;\"><font color=\"red\"><b><i>".i18n::translate('No results found.')."</i></b></font><br /></td></tr></table>";
- }
- }
- } else
- if ($sitesChecked < 1 && $this->isPostBack) {
- echo "<table align=\"center\" \><tr><td class=\"warning\" style=\" text-align: center;\"><font color=\"red\"><b><i>".i18n::translate('Be sure to select at least one remote site.')."</i></b></font><br /></td></tr></table>";
- }
-
- echo "</table>";
- // Prints the Paged Results: << 1 2 3 4 >> links if there are more than $this->resultsPerPage results
- if ($this->resultsPerPage > 1 && $this->totalResults > $this->resultsPerPage) {
- $this->printPageResultsLinks($this->inputFieldNames, $this->totalResults, $this->multiResultsPerPage);
- }
- }
return $somethingPrinted; // whether anything printed
}
diff --git a/includes/functions/functions.php b/includes/functions/functions.php
index fe76f48646..6319c8dea4 100644
--- a/includes/functions/functions.php
+++ b/includes/functions/functions.php
@@ -294,7 +294,6 @@ function load_gedcom_settings($ged_id=WT_GED_ID) {
global $SHOW_MARRIED_NAMES; $SHOW_MARRIED_NAMES =get_gedcom_setting($ged_id, 'SHOW_MARRIED_NAMES');
global $SHOW_MEDIA_DOWNLOAD; $SHOW_MEDIA_DOWNLOAD =get_gedcom_setting($ged_id, 'SHOW_MEDIA_DOWNLOAD');
global $SHOW_MEDIA_FILENAME; $SHOW_MEDIA_FILENAME =get_gedcom_setting($ged_id, 'SHOW_MEDIA_FILENAME');
- global $SHOW_MULTISITE_SEARCH; $SHOW_MULTISITE_SEARCH =get_gedcom_setting($ged_id, 'SHOW_MULTISITE_SEARCH');
global $SHOW_NO_WATERMARK; $SHOW_NO_WATERMARK =get_gedcom_setting($ged_id, 'SHOW_NO_WATERMARK');
global $SHOW_PARENTS_AGE; $SHOW_PARENTS_AGE =get_gedcom_setting($ged_id, 'SHOW_PARENTS_AGE');
global $SHOW_PEDIGREE_PLACES; $SHOW_PEDIGREE_PLACES =get_gedcom_setting($ged_id, 'SHOW_PEDIGREE_PLACES');
@@ -975,25 +974,6 @@ function find_highlighted_object($pid, $ged_id, $indirec) {
$objectC = array();
$objectD = array();
- //-- handle finding the media of remote objects
- $ct = preg_match("/(.*):(.*)/", $pid, $match);
- if ($ct>0) {
- require_once WT_ROOT.'includes/classes/class_serviceclient.php';
- $client = ServiceClient::getInstance($match[1]);
- if (!is_null($client)) {
- $mt = preg_match_all('/\n\d OBJE @('.WT_REGEX_XREF.')@/', $indirec, $matches, PREG_SET_ORDER);
- for ($i=0; $i<$mt; $i++) {
- $mediaObj = Media::getInstance($matches[$i][1]);
- $mrec = $mediaObj->getGedcomRecord();
- if (!empty($mrec)) {
- $file = get_gedcom_value("FILE", 1, $mrec);
- $row = array($matches[$i][1], $file, $mrec, $matches[$i][0]);
- $media[] = $row;
- }
- }
- }
- }
-
//-- find all of the media items for a person
$media=
WT_DB::prepare("SELECT m_media, m_file, m_gedrec, mm_gedrec FROM `##media`, `##media_mapping` WHERE m_media=mm_media AND m_gedfile=mm_gedfile AND m_gedfile=? AND mm_gid=? ORDER BY mm_order")
@@ -3561,8 +3541,3 @@ function pathinfo_utf($path) {
return array('dirname'=>$dirname, 'basename'=>$basename, 'extension'=>$extension, 'filename'=>$filename);
}
-
-// optional extra file
-if (file_exists(WT_ROOT.'includes/functions.extra.php')) {
- require WT_ROOT.'includes/functions.extra.php';
-}
diff --git a/includes/functions/functions_db.php b/includes/functions/functions_db.php
index 293d476ad1..50d2c0387f 100644
--- a/includes/functions/functions_db.php
+++ b/includes/functions/functions_db.php
@@ -1650,27 +1650,6 @@ function get_top_surnames($ged_id, $min, $max) {
}
}
-/**
-* get a list of remote servers
-*/
-function get_server_list($ged_id=WT_GED_ID) {
- $sitelist = array();
-
- $rows=WT_DB::prepare("SELECT s_id, s_name, s_gedcom, s_file FROM `##sources` WHERE s_file=? AND s_dbid=? ORDER BY s_name")
- ->execute(array($ged_id, 'Y'))
- ->fetchAll();
- foreach ($rows as $row) {
- $source = array();
- $source["name"] = $row->s_name;
- $source["gedcom"] = $row->s_gedcom;
- $source["gedfile"] = $row->s_file;
- $source["url"] = get_gedcom_value("URL", 1, $row->s_gedcom);
- $sitelist[$row->s_id] = $source;
- }
-
- return $sitelist;
-}
-
function delete_fact($linenum, $pid, $gedrec) {
global $linefix;
@@ -1715,20 +1694,6 @@ function delete_fact($linenum, $pid, $gedrec) {
}
}
-/**
-* get_remote_id Recieves a RFN key and returns a Stub ID if the RFN exists
-*
-* @param mixed $rfn RFN number to see if it exists
-* @access public
-* @return gid Stub ID that contains the RFN number. Returns false if it didn't find anything
-*/
-function get_remote_id($rfn) {
- return
- WT_DB::prepare("SELECT r_gid FROM `##remotelinks` WHERE r_linkid=? AND r_file=?")
- ->execute(array($rfn, WT_GED_ID))
- ->fetchOne();
-}
-
////////////////////////////////////////////////////////////////////////////////
// Get a list of events whose anniversary occured on a given julian day.
// Used on the on-this-day/upcoming blocks and the day/month calendar views.
diff --git a/includes/functions/functions_edit.php b/includes/functions/functions_edit.php
index 338038652c..6708492638 100644
--- a/includes/functions/functions_edit.php
+++ b/includes/functions/functions_edit.php
@@ -291,13 +291,6 @@ function edit_field_default_tab($name, $selected='', $extra='') {
return select_edit_control($name, $tabs, null, $selected, $extra);
}
-//-- this function creates a new unique connection
-//-- and adds it to the connections file
-//-- it returns the connection identifier
-function newConnection() {
- return WT_SESSION_NAME."\t".Zend_Session::getId()."\n";
-}
-
/**
* Check if the given gedcom record has changed since the last session access
* This is used to check if the gedcom record changed between the time the user
diff --git a/includes/functions/functions_import.php b/includes/functions/functions_import.php
index bc6b4ae2f5..c68b572d92 100644
--- a/includes/functions/functions_import.php
+++ b/includes/functions/functions_import.php
@@ -597,7 +597,7 @@ function import_record($gedrec, $ged_id, $update) {
"INSERT INTO `##families` (f_id, f_file, f_husb, f_wife, f_gedcom, f_numchil) VALUES (?,?,?,?,?,?)"
);
$sql_insert_sour=WT_DB::prepare(
- "INSERT INTO `##sources` (s_id, s_file, s_name, s_gedcom, s_dbid) VALUES (?,?,?,?,?)"
+ "INSERT INTO `##sources` (s_id, s_file, s_name, s_gedcom) VALUES (?,?,?,?)"
);
$sql_insert_other=WT_DB::prepare(
"INSERT INTO `##other` (o_id, o_file, o_type, o_gedcom) VALUES (?,?,?,?)"
@@ -669,7 +669,6 @@ function import_record($gedrec, $ged_id, $update) {
update_places($xref, $ged_id, $gedrec);
update_dates ($xref, $ged_id, $gedrec);
update_links ($xref, $ged_id, $gedrec);
- update_rlinks($xref, $ged_id, $gedrec);
update_names ($xref, $ged_id, $record);
switch ($type) {
@@ -714,12 +713,7 @@ function import_record($gedrec, $ged_id, $update) {
} else {
$name=$xref;
}
- if (strpos($gedrec, "\n1 _DBID")) {
- $_dbid='Y';
- } else {
- $_dbid=null;
- }
- $sql_insert_sour->execute(array($xref, $ged_id, $name, $gedrec, $_dbid));
+ $sql_insert_sour->execute(array($xref, $ged_id, $name, $gedrec));
break;
case 'OBJE':
// OBJE records are imported by update_media function
@@ -856,25 +850,6 @@ function update_dates($xref, $ged_id, $gedrec) {
return;
}
-// extract all the remote links from the given record and insert them into the database
-function update_rlinks($xref, $ged_id, $gedrec) {
- static $sql_insert_rlink=null;
- if (!$sql_insert_rlink) {
- $sql_insert_rlink=WT_DB::prepare("INSERT INTO `##remotelinks` (r_gid,r_linkid,r_file) VALUES (?,?,?)");
- }
-
- if (preg_match_all("/\n1 RFN (".WT_REGEX_XREF.')/', $gedrec, $matches, PREG_SET_ORDER)) {
- foreach ($matches as $match) {
- // Ignore any errors, which may be caused by "duplicates" that differ on case/collation, e.g. "S1" and "s1"
- try {
- $sql_insert_rlink->execute(array($xref, $match[1], $ged_id));
- } catch (PDOException $e) {
- // We could display a warning here....
- }
- }
- }
-}
-
// extract all the links from the given record and insert them into the database
function update_links($xref, $ged_id, $gedrec) {
static $sql_insert_link=null;
@@ -1160,7 +1135,6 @@ function empty_database($ged_id, $keepmedia) {
WT_DB::prepare("DELETE FROM `##other` WHERE o_file =?")->execute(array($ged_id));
WT_DB::prepare("DELETE FROM `##places` WHERE p_file =?")->execute(array($ged_id));
WT_DB::prepare("DELETE FROM `##placelinks` WHERE pl_file=?")->execute(array($ged_id));
- WT_DB::prepare("DELETE FROM `##remotelinks` WHERE r_file =?")->execute(array($ged_id));
WT_DB::prepare("DELETE FROM `##name` WHERE n_file =?")->execute(array($ged_id));
WT_DB::prepare("DELETE FROM `##dates` WHERE d_file =?")->execute(array($ged_id));
WT_DB::prepare("DELETE FROM `##change` WHERE gedcom_id=?")->execute(array($ged_id));
@@ -1261,7 +1235,6 @@ function update_record($gedrec, $ged_id, $delete) {
}
WT_DB::prepare("DELETE FROM `##media_mapping` WHERE mm_gid=? AND mm_gedfile=?")->execute(array($gid, $ged_id));
- WT_DB::prepare("DELETE FROM `##remotelinks` WHERE r_gid=? AND r_file=?")->execute(array($gid, $ged_id));
WT_DB::prepare("DELETE FROM `##name` WHERE n_id=? AND n_file=?")->execute(array($gid, $ged_id));
WT_DB::prepare("DELETE FROM `##link` WHERE l_from=? AND l_file=?")->execute(array($gid, $ged_id));
diff --git a/includes/functions/functions_print_facts.php b/includes/functions/functions_print_facts.php
index 054752cf78..1777adfc14 100644
--- a/includes/functions/functions_print_facts.php
+++ b/includes/functions/functions_print_facts.php
@@ -1359,46 +1359,22 @@ function print_main_media($pid, $level=1, $related=false, $noedit=false) {
foreach ($current_objes as $media_id=>$value) {
while ($value>0) {
$objSubrec = array_pop($obje_links[$media_id]);
- //-- check if we need to get the object from a remote location
- $ct = preg_match("/(.*):(.*)/", $media_id, $match);
- if ($ct>0) {
- require_once WT_ROOT.'includes/classes/class_serviceclient.php';
- $client = ServiceClient::getInstance($match[1]);
- if (!is_null($client)) {
- $newrec = $client->getRemoteRecord($match[2]);
- $row['m_media'] = $media_id;
- $row['m_gedfile']=$ged_id;
- $row['m_file'] = get_gedcom_value("FILE", 1, $newrec);
- $row['m_titl'] = get_gedcom_value("TITL", 1, $newrec);
- if (empty($row['m_titl'])) $row['m_titl'] = get_gedcom_value("FILE:TITL", 1, $newrec);
- $row['m_gedrec'] = $newrec;
- $et = preg_match("/(\.\w+)$/", $row['m_file'], $ematch);
- $ext = "";
- if ($et>0) $ext = substr(trim($ematch[1]), 1);
- $row['m_ext'] = $ext;
- $row['mm_gid'] = $pid;
- $row['mm_gedrec'] = get_sub_record($objSubrec{0}, $objSubrec, $gedrec);
- $res = print_main_media_row('normal', $row, $pid);
- $media_found = $media_found || $res;
- }
- } else {
- $row = array();
- $newrec = find_gedcom_record($media_id, $ged_id, true);
- $row['m_media'] = $media_id;
- $row['m_gedfile']=$ged_id;
- $row['m_file'] = get_gedcom_value("FILE", 1, $newrec);
- $row['m_titl'] = get_gedcom_value("TITL", 1, $newrec);
- if (empty($row['m_titl'])) $row['m_titl'] = get_gedcom_value("FILE:TITL", 1, $newrec);
- $row['m_gedrec'] = $newrec;
- $et = preg_match("/(\.\w+)$/", $row['m_file'], $ematch);
- $ext = "";
- if ($et>0) $ext = substr(trim($ematch[1]), 1);
- $row['m_ext'] = $ext;
- $row['mm_gid'] = $pid;
- $row['mm_gedrec'] = get_sub_record($objSubrec{0}, $objSubrec, $gedrec);
- $res = print_main_media_row('new', $row, $pid);
- $media_found = $media_found || $res;
- }
+ $row = array();
+ $newrec = find_gedcom_record($media_id, $ged_id, true);
+ $row['m_media'] = $media_id;
+ $row['m_gedfile']=$ged_id;
+ $row['m_file'] = get_gedcom_value("FILE", 1, $newrec);
+ $row['m_titl'] = get_gedcom_value("TITL", 1, $newrec);
+ if (empty($row['m_titl'])) $row['m_titl'] = get_gedcom_value("FILE:TITL", 1, $newrec);
+ $row['m_gedrec'] = $newrec;
+ $et = preg_match("/(\.\w+)$/", $row['m_file'], $ematch);
+ $ext = "";
+ if ($et>0) $ext = substr(trim($ematch[1]), 1);
+ $row['m_ext'] = $ext;
+ $row['mm_gid'] = $pid;
+ $row['mm_gedrec'] = get_sub_record($objSubrec{0}, $objSubrec, $gedrec);
+ $res = print_main_media_row('new', $row, $pid);
+ $media_found = $media_found || $res;
$value--;
}
}
diff --git a/includes/session.php b/includes/session.php
index 68da16de39..9192508952 100644
--- a/includes/session.php
+++ b/includes/session.php
@@ -48,7 +48,7 @@ define('WT_DEBUG_SQL', false);
define('WT_ERROR_LEVEL', 2); // 0=none, 1=minimal, 2=full
// Required version of database tables/columns/indexes/etc.
-define('WT_SCHEMA_VERSION', 6);
+define('WT_SCHEMA_VERSION', 7);
// Regular expressions for validating user input, etc.
define('WT_REGEX_XREF', '[A-Za-z0-9:_-]+');
@@ -303,15 +303,6 @@ if ($SEARCH_SPIDER) {
Zend_Session::setId('search_engine_'.$_SERVER['REMOTE_ADDR']);
}
-// If we're using remote linking, the session ID is in the body of the POST request
-if (
- WT_SCRIPT_NAME=='genservice.php' &&
- isset($HTTP_RAW_POST_DATA) &&
- preg_match('/<SID xsi:type="xsd:string">([a-z0-9]+)<\/SID>/', $HTTP_RAW_POST_DATA, $match)
-) {
- Zend_Session::setId($match[1]);
-}
-
Zend_Session::start($cfg);
// Register a session "namespace" to store session data. This is better than
diff --git a/includes/session_spider.php b/includes/session_spider.php
index 89e313c563..a19b24dccb 100644
--- a/includes/session_spider.php
+++ b/includes/session_spider.php
@@ -225,20 +225,13 @@ if ($ua != "") {
}
}
}
-}
-else {
+} else {
// For the people who firewall identifying information
// Switch real to false if you wish to restrict these connections.
$ua = "Browser User Agent Empty";
$real = true;
}
-if (WT_SCRIPT_NAME=='genservice.php') {
- // Robots look very similar to remote-link requests. Allow them to
- // access the remote linking service.
- $real=true;
-}
-
if (!$real) {
$bot_name = $ua;
// strip out several common strings that clutter the User Agent.
diff --git a/includes/set_gedcom_defaults.php b/includes/set_gedcom_defaults.php
index 75d4131499..7cc95c5f73 100644
--- a/includes/set_gedcom_defaults.php
+++ b/includes/set_gedcom_defaults.php
@@ -124,7 +124,6 @@ set_gedcom_setting($ged_id, 'SHOW_LIVING_NAMES', WT_PRIV_USER);
set_gedcom_setting($ged_id, 'SHOW_MARRIED_NAMES', true);
set_gedcom_setting($ged_id, 'SHOW_MEDIA_DOWNLOAD', false);
set_gedcom_setting($ged_id, 'SHOW_MEDIA_FILENAME', false);
-set_gedcom_setting($ged_id, 'SHOW_MULTISITE_SEARCH', WT_PRIV_NONE);
set_gedcom_setting($ged_id, 'SHOW_NO_WATERMARK', WT_PRIV_USER);
set_gedcom_setting($ged_id, 'SHOW_PARENTS_AGE', true);
set_gedcom_setting($ged_id, 'SHOW_PEDIGREE_PLACES', '9');
diff --git a/individual.php b/individual.php
index 4b0ab5a6b8..baadafc619 100644
--- a/individual.php
+++ b/individual.php
@@ -74,11 +74,6 @@ function show_gedcom_record(shownew) {
var recwin = window.open("gedrecord.php?pid=<?php echo $controller->pid; ?>"+fromfile, "_blank", "top=50,left=50,width=600,height=400,scrollbars=1,scrollable=1,resizable=1");
}
<?php if (WT_USER_CAN_EDIT) { ?>
-function open_link_remote(pid) {
- window.open("addremotelink.php?pid="+pid, "_blank", "top=50,left=50,width=600,height=500,scrollbars=1,scrollable=1,resizable=1");
- return false;
-}
-
function showchanges() {
window.location = '<?php echo $controller->indi->getRawUrl(); ?>&show_changes=yes';
}
@@ -190,19 +185,6 @@ jQuery(document).ready(function() {
require WT_ROOT.'includes/hitcount.php';
echo i18n::translate('Hit Count:'), " ", $hitCount;
}
- // if individual is a remote individual
- // if information for this information is based on a remote site
- if ($controller->indi->isRemote()) {
- echo '<br />';
- echo i18n::translate('The information for this individual was linked from a remote site.');//<br />--><!--take this out if you want break the remote site and the fact that it was remote into two separate lines
- echo '<a href="', $controller->indi->getHtmlUrl(), '">', $controller->indi->getLinkTitle(), '</a>';
- }
- // if indivual is not a remote individual
- // if information for this individual is based on this local site
- // this is not need to be printed, but may be uncommented if desired
- /*else
- echo("This is a local individual.");
- }*/
?>
</div>
diff --git a/manageservers.php b/manageservers.php
index 1d4b1e57f5..e9165f9363 100644
--- a/manageservers.php
+++ b/manageservers.php
@@ -37,7 +37,6 @@ require './includes/session.php';
require_once WT_ROOT.'includes/functions/functions.php';
require_once WT_ROOT.'includes/functions/functions_edit.php';
require_once WT_ROOT.'includes/functions/functions_import.php';
-require_once WT_ROOT.'includes/classes/class_serviceclient.php';
print_header(i18n::translate('Manage sites'));
//-- only allow managers here
@@ -50,8 +49,6 @@ if (!WT_USER_GEDCOM_ADMIN) {
exit;
}
-$remoteServers = get_server_list();
-
$action = safe_GET('action');
if (empty($action)) $action = safe_POST('action');
$address = safe_GET('address');
@@ -72,12 +69,6 @@ if (!empty($deleteSearch)) { // A "remove search engine IP" button was pushed
$address = $deleteSearch;
}
-$deleteServer = safe_POST('deleteServer');
-if (!empty($deleteServer)) { // A "remove remote server" button was pushed
- $action = 'deleteServer';
- $address = $deleteServer;
-}
-
if (empty($action)) $action = 'showForm';
/*
@@ -119,73 +110,6 @@ if ($action=='addBanned' || $action=='addSearch' || $action=='deleteBanned' || $
$action='showForm';
}
-/**
-* Adds a server to the outbound remote linking list
-*/
-if ($action=='addServer') {
- $serverTitle = safe_POST('serverTitle', '[^<>"%{};]+'); // same as WT_REGEX_NOSCRIPT, but allow ampersand in title
- $serverURL = safe_POST('serverURL', WT_REGEX_URL);
- $gedcom_id = safe_POST('gedcom_id');
- $username = safe_POST('username', WT_REGEX_USERNAME);
- $password = safe_POST('password', WT_REGEX_PASSWORD);
-
- if (!$serverTitle=="" || !$serverURL=="") {
- $errorServer = '';
- $turl = preg_replace("~^\w+://~", "", $serverURL);
- //-- check the existing server list
- foreach ($remoteServers as $server) {
- if (stristr($server['url'], $turl)) {
- if (empty($gedcom_id) || (strpos($server['gedcom'], "_DBID $gedcom_id")!==false)) {
- $whichFile = $server['name'];
- $errorServer = i18n::translate('This remote database is already in the list as <i>%s</i>', $server['name']);
- break;
- }
- }
- }
- if (empty($errorServer)) {
- $gedcom_string = "0 @new@ SOUR\n";
- $gedcom_string.= "1 TITL ".$serverTitle."\n";
- $gedcom_string.= "1 URL ".$serverURL."\n";
- $gedcom_string.= "1 _DBID ".$gedcom_id."\n";
- $gedcom_string.= "2 _USER ".$username."\n";
- $gedcom_string.= "2 _PASS ".$password."\n";
- //-- only allow admin users to see password
- $gedcom_string.= "3 RESN confidential\n";
-
- $service = new ServiceClient($gedcom_string);
- $sid = $service->authenticate();
- if (empty($sid) || PEAR::isError($sid)) {
- $errorServer = i18n::translate('Failed to authenticate to remote site');
- } else {
- $serverID = append_gedrec($gedcom_string, WT_GED_ID);
- accept_all_changes($serverID, WT_GED_ID);
- $remoteServers = get_server_list(); // refresh the list
- }
- }
- } else $errorServer = i18n::translate('Please do not leave remote site title or URL blank');
-
- $action = 'showForm';
-}
-
-/**
-* Removes a server from the remote linking outbound list
-*/
-if ($action=='deleteServer') {
- if (!empty($address)) {
- $sid = $address;
-
- if (count_linked_indi($sid, 'SOUR', WT_GED_ID) || count_linked_fam($sid, 'SOUR', WT_GED_ID)) {
- $errorDelete = i18n::translate('The remote server could not be removed because its Connections list is not empty.');
- } else {
- // No references exist: it's OK to delete this source
- delete_gedrec($sid, WT_GED_ID);
- }
- }
-
- $remoteServers = get_server_list(); // refresh the list
- $action = 'showForm';
-}
-
?>
<script language="JavaScript" type="text/javascript">
@@ -267,212 +191,33 @@ echo '<p class="center"><input TYPE="button" VALUE="', i18n::translate('Return t
<td class="facts_value">
<table align="center">
<?php
- $sql="SELECT ip_address, comment FROM `##ip_address` WHERE category='banned' ORDER BY INET_ATON(ip_address)";
- $banned=WT_DB::prepare($sql)->fetchAssoc();
- foreach ($banned as $ip_address=>$ip_comment) {
- echo '<tr><td>';
- if (isset($WT_IMAGES["remove"])) {
- echo '<input type="image" src="', $WT_IMAGES["remove"], '" alt="', i18n::translate('Delete'), '" name="deleteBanned" value="', $ip_address, '">';
- } else {
- echo '<button name="deleteBanned" value="', $ip_address, '" type="submit">', i18n::translate('Remove'), '</button>';
- }
- echo '</td><td><span dir="ltr"><input type="text" name="address', ++$index, '" size="16" value="', $ip_address, '" readonly /></span></td>';
- echo '<td><input type="text" name="comment', ++$index, '" size="60" value="', $ip_comment, '" readonly /></td></tr>';
- }
- echo '<tr><td valign="top"><input name="action" type="hidden" value="addBanned"/>';
- if (isset($WT_IMAGES["add"])) {
- echo '<input type="image" src="', $WT_IMAGES["add"], '" alt="', i18n::translate('Add'), '">';
+$sql="SELECT ip_address, comment FROM `##ip_address` WHERE category='banned' ORDER BY INET_ATON(ip_address)";
+$banned=WT_DB::prepare($sql)->fetchAssoc();
+foreach ($banned as $ip_address=>$ip_comment) {
+ echo '<tr><td>';
+ if (isset($WT_IMAGES["remove"])) {
+ echo '<input type="image" src="', $WT_IMAGES["remove"], '" alt="', i18n::translate('Delete'), '" name="deleteBanned" value="', $ip_address, '">';
} else {
- echo '<input type="submit" value="', i18n::translate('Add'), '" />';
- }
- echo '</td><td valign="top"><span dir="ltr"><input type="text" id="txtAddIp" name="address" size="16" value="', empty($errorBanned) ? '':$address, '" /></span></td>';
- echo '<td><input type="text" id="txtAddComment" name="comment" size="60" value="" />';
- echo '<br />', i18n::translate('You may enter a comment here.'), '</td></tr>';
-
- if (!empty($errorBanned)) {
- echo '<tr><td colspan="2"><span class="warning">';
- echo $errorBanned;
- echo '</span></td></tr>';
- $errorBanned = '';
- }
- echo '</table></td></tr></table></form></td></tr></table>';
-?>
-
-<!-- remote server list -->
-<table class="width66" align="center">
-<tr>
- <td>
- <form name="serverlistform" action="manageservers.php" method="post">
- <table class="width100">
- <tr>
- <td class="facts_label">
- <b><?php echo i18n::translate('Remote Servers'); ?></b>
- </td>
- </tr>
- <tr>
- <td class="facts_value">
- <table>
-<?php
- foreach ($remoteServers as $sid=>$server) {
- $serverTitle = $server['name'];
- $serverURL = $server['url'];
- $gedcom_id = get_gedcom_value('_DBID', 1, $server['gedcom']);
- $username = get_gedcom_value('_USER', 2, $server['gedcom']);
-?>
- <tr>
- <td>
- <button type="submit" onclick="return (confirm('<?php echo i18n::translate('Are you sure you want to delete this Source?'); ?>'))" name="deleteServer" value="<?php echo $sid; ?>"><?php echo i18n::translate('Remove'); ?></button>
- &nbsp;&nbsp;
- <button id="buttonShow_<?php echo $sid; ?>" type="button" onclick="showSite('<?php echo $sid; ?>');"><?php echo i18n::translate('Show Details'); ?></button>
- &nbsp;&nbsp;
- <button type="button" onclick="window.open('source.php?sid=<?php echo $sid; ?>&ged=<?php echo WT_GEDURL; ?>')"><?php echo i18n::translate('View Connections'); ?></button>
- &nbsp;&nbsp;
- <?php echo PrintReady($serverTitle); ?>
- <div id="siteDetails_<?php echo $sid; ?>" style="display:none">
- <br />
- <table>
- <tr>
- <td class="facts_label width20">
- <?php echo i18n::translate('ID'); ?>
- </td>
- <td class="facts_value">
- <?php echo $sid; ?>
- </td>
- </tr>
- <tr>
- <td class="facts_label width20">
- <?php echo i18n::translate('Title:'); ?>
- </td>
- <td class="facts_value">
- <?php echo PrintReady($serverTitle); ?>
- </td>
- </tr>
- <tr>
- <td class="facts_label width20">
- <?php echo i18n::translate('Site URL/IP'); ?>
- </td>
- <td class="facts_value">
- <?php echo PrintReady($serverURL); ?>
- </td>
- </tr>
- <tr>
- <td class="facts_label width20">
- <?php echo i18n::translate('Database ID:'); ?>
- </td>
- <td class="facts_value">
- <?php echo PrintReady($gedcom_id); ?>
- </td>
- </tr>
- <tr>
- <td class="facts_label width20">
- <?php echo i18n::translate('Username'); ?>
- </td>
- <td class="facts_value">
- <?php echo PrintReady($username); ?>
- </td>
- </tr>
- </table>
- <br />
- </div>
- </td>
- </tr>
-<?php
- }
- if (!empty($errorDelete)) {
- echo '<tr><td colspan="2"><span class="warning">';
- echo $errorDelete;
- echo '</span></td></tr>';
- $errorDelete = '';
+ echo '<button name="deleteBanned" value="', $ip_address, '" type="submit">', i18n::translate('Remove'), '</button>';
}
-?>
- </table>
- </td>
- </tr>
- </table>
- </form>
- </td>
-</tr>
-</table>
+ echo '</td><td><span dir="ltr"><input type="text" name="address', ++$index, '" size="16" value="', $ip_address, '" readonly /></span></td>';
+ echo '<td><input type="text" name="comment', ++$index, '" size="60" value="', $ip_comment, '" readonly /></td></tr>';
+}
+echo '<tr><td valign="top"><input name="action" type="hidden" value="addBanned"/>';
+if (isset($WT_IMAGES["add"])) {
+ echo '<input type="image" src="', $WT_IMAGES["add"], '" alt="', i18n::translate('Add'), '">';
+} else {
+ echo '<input type="submit" value="', i18n::translate('Add'), '" />';
+}
+echo '</td><td valign="top"><span dir="ltr"><input type="text" id="txtAddIp" name="address" size="16" value="', empty($errorBanned) ? '':$address, '" /></span></td>';
+echo '<td><input type="text" id="txtAddComment" name="comment" size="60" value="" />';
+echo '<br />', i18n::translate('You may enter a comment here.'), '</td></tr>';
-<!-- Add remote server form -->
-<?php
-if (empty($errorServer)) {
- $serverTitle = '';
- $serverURL = '';
- $gedcom_id = '';
- $username = '';
+if (!empty($errorBanned)) {
+ echo '<tr><td colspan="2"><span class="warning">';
+ echo $errorBanned;
+ echo '</span></td></tr>';
+ $errorBanned = '';
}
-?>
-<form name="addserversform" action="manageservers.php" method="post"">
-<table class="width66" align="center">
-<tr>
- <td valign="top">
- <table class="width100">
- <tr>
- <td class="facts_label" colspan="2">
- <b><?php echo i18n::translate('Add new site'); ?></b>
- <?php echo help_link('link_remote_site'); ?>
- </td>
- </tr>
- <tr>
- <td class="facts_label width20">
- <?php echo i18n::translate('Title:'); ?>
- </td>
- <td class="facts_value">
- <input type="text" size="66" name="serverTitle" value="<?php echo PrintReady($serverTitle); ?>" />
- </td>
- </tr>
- <tr>
- <td class="facts_label width20">
- <?php echo i18n::translate('Site URL/IP'); ?>
- </td>
- <td class="facts_value">
- <input type="text" size="66" name="serverURL" value="<?php echo PrintReady($serverURL); ?>" />
- <br /><?php echo i18n::translate('Example:'); ?> http://www.remotesite.com/phpGedView/genservice.php?wsdl
- </td>
- </tr>
- <tr>
- <td class="facts_label width20">
- <?php echo i18n::translate('Database ID:'); ?>
- </td>
- <td class="facts_value">
- <input type="text" name="gedcom_id" value="<?php echo PrintReady($gedcom_id); ?>" />
- </td>
- </tr>
- <tr>
- <td class="facts_label width20">
- <?php echo i18n::translate('Username'); ?>
- </td>
- <td class="facts_value">
- <input type="text" name="username" value="<?php echo PrintReady($username); ?>" />
- </td>
- </tr>
- <tr>
- <td class="facts_label width20">
- <?php echo i18n::translate('Password'); ?>
- </td>
- <td class="facts_value">
- <input type="password" name="password" />
- </td>
- </tr>
- <tr>
- <td class="facts_value" align="center" colspan="2">
- <input type="submit" value="<?php echo i18n::translate('Add'); ?>" />
- <input name="action" type="hidden" value="addServer"/>
-<?php
- if (!empty($errorServer)) {
- echo '<br /><br /><span class="warning">';
- echo $errorServer;
- echo '</span>';
- $errorServer = '';
- }
-?>
- </td>
- </tr>
- </table>
- </td>
-</tr>
-</table>
-</form>
-<?php
+echo '</table></td></tr></table></form></td></tr></table>';
print_footer();
diff --git a/modules/lightbox/functions/lightbox_print_media.php b/modules/lightbox/functions/lightbox_print_media.php
index 1e386922fc..58b574d84e 100644
--- a/modules/lightbox/functions/lightbox_print_media.php
+++ b/modules/lightbox/functions/lightbox_print_media.php
@@ -302,69 +302,34 @@ function lightbox_print_media($pid, $level=1, $related=false, $kind=1, $noedit=f
foreach ($current_objes as $media_id=>$value) {
while ($value>0) {
$objSubrec = array_pop($obje_links[$media_id]);
- //-- check if we need to get the object from a remote location
- $ct = preg_match("/(.*):(.*)/", $media_id, $match);
- if ($ct>0) {
- require_once WT_ROOT.'includes/classes/class_serviceclient.php';
- $client = ServiceClient::getInstance($match[1]);
- if (!is_null($client)) {
- $newrec = $client->getRemoteRecord($match[2]);
- $row['m_media'] = $media_id;
- $row['m_file'] = get_gedcom_value("FILE", 1, $newrec);
- $row['m_titl'] = get_gedcom_value("TITL", 1, $newrec);
- if (empty($row['m_titl'])) {
- $row['m_titl'] = get_gedcom_value("FILE:TITL", 1, $newrec);
- }
- $row['m_gedrec'] = $newrec;
- $et = preg_match("/(\.\w+)$/", $row['m_file'], $ematch);
- $ext = "";
- if ($et>0) $ext = substr(trim($ematch[1]), 1);
- $row['m_ext'] = $ext;
- $row['mm_gid'] = $pid;
- $row['mm_gedrec'] = get_sub_record($objSubrec{0}, $objSubrec, $gedrec);
- if ($newrec && isset($rowm['m_file'])) {
- // -----
- } else {
- echo "<li class=\"li_new\" >";
- echo "<center><table class=\"pic\" border=\"0\" ></center>";
- echo "<tr><td align=\"center\" colspan=\"4\">";
- echo $row['m_media'];
- echo "</td></tr>";
-
- $res = lightbox_print_media_row('new', $row, $pid);
- $media_found = $media_found || $res;
- }
- }
+ $row = array();
+ $newrec = find_gedcom_record($media_id, $ged_id, true);
+ $row['m_media'] = $media_id;
+ $row['m_file'] = get_gedcom_value("FILE", 1, $newrec);
+ $row['m_titl'] = get_gedcom_value("TITL", 1, $newrec);
+ if (empty($row['m_titl'])) {
+ $row['m_titl'] = get_gedcom_value("FILE:TITL", 1, $newrec);
+ }
+ $row['m_gedrec'] = $newrec;
+ $et = preg_match("/(\.\w+)$/", $row['m_file'], $ematch);
+ $ext = "";
+ if ($et>0) {
+ $ext = substr(trim($ematch[1]), 1);
+ }
+ $row['m_ext'] = $ext;
+ $row['mm_gid'] = $pid;
+ $row['mm_gedrec'] = get_sub_record($objSubrec{0}, $objSubrec, $gedrec);
+ if ($newrec && isset($rowm['m_file'])) {
+ // -----
} else {
- $row = array();
- $newrec = find_gedcom_record($media_id, $ged_id, true);
- $row['m_media'] = $media_id;
- $row['m_file'] = get_gedcom_value("FILE", 1, $newrec);
- $row['m_titl'] = get_gedcom_value("TITL", 1, $newrec);
- if (empty($row['m_titl'])) {
- $row['m_titl'] = get_gedcom_value("FILE:TITL", 1, $newrec);
- }
- $row['m_gedrec'] = $newrec;
- $et = preg_match("/(\.\w+)$/", $row['m_file'], $ematch);
- $ext = "";
- if ($et>0) {
- $ext = substr(trim($ematch[1]), 1);
- }
- $row['m_ext'] = $ext;
- $row['mm_gid'] = $pid;
- $row['mm_gedrec'] = get_sub_record($objSubrec{0}, $objSubrec, $gedrec);
- if ($newrec && isset($rowm['m_file'])) {
- // -----
- } else {
- echo "<li class=\"li_new\" >";
- echo "<center><table class=\"pic\" border=\"0\" ></center>";
- echo "<tr><td align=\"center\" colspan=\"4\">";
- echo $row['m_media'];
- echo "</td></tr>";
+ echo "<li class=\"li_new\" >";
+ echo "<center><table class=\"pic\" border=\"0\" ></center>";
+ echo "<tr><td align=\"center\" colspan=\"4\">";
+ echo $row['m_media'];
+ echo "</td></tr>";
- $res = lightbox_print_media_row('new', $row, $pid);
- $media_found = $media_found || $res;
- }
+ $res = lightbox_print_media_row('new', $row, $pid);
+ $media_found = $media_found || $res;
}
$value--;
}
diff --git a/modules/relatives/module.php b/modules/relatives/module.php
index cf84553837..dfa7077752 100644
--- a/modules/relatives/module.php
+++ b/modules/relatives/module.php
@@ -505,14 +505,6 @@ class relatives_WT_Module extends WT_Module implements WT_Module_Tab {
</td>
</tr>
<?php } ?>
- <?php if (WT_USER_GEDCOM_ADMIN) { ?>
- <tr>
- <td class="facts_value">
- <a href="javascript:;" onclick="return open_link_remote('<?php echo $this->controller->pid; ?>');"><?php echo i18n::translate('Link remote person'); ?></a>
- <?php echo help_link('link_remote'); ?>
- </td>
- </tr>
- <?php } ?>
</table>
<?php } ?>
<br />
diff --git a/pgv_to_wt.php b/pgv_to_wt.php
index 1a938f4bc3..2911cc8096 100644
--- a/pgv_to_wt.php
+++ b/pgv_to_wt.php
@@ -687,7 +687,6 @@ foreach (get_all_gedcoms() as $ged_id=>$gedcom) {
@set_gedcom_setting($ged_id, 'SHOW_MARRIED_NAMES', $SHOW_MARRIED_NAMES);
@set_gedcom_setting($ged_id, 'SHOW_MEDIA_DOWNLOAD', $SHOW_MEDIA_DOWNLOAD);
@set_gedcom_setting($ged_id, 'SHOW_MEDIA_FILENAME', $SHOW_MEDIA_FILENAME);
- @set_gedcom_setting($ged_id, 'SHOW_MULTISITE_SEARCH', $SHOW_MULTISITE_SEARCH);
@set_gedcom_setting($ged_id, 'SHOW_PARENTS_AGE', $SHOW_PARENTS_AGE);
@set_gedcom_setting($ged_id, 'SHOW_PEDIGREE_PLACES', $SHOW_PEDIGREE_PLACES);
@set_gedcom_setting($ged_id, 'SHOW_PRIVATE_RELATIONSHIPS', $SHOW_PRIVATE_RELATIONSHIPS);
@@ -1051,19 +1050,10 @@ WT_DB::prepare(
////////////////////////////////////////////////////////////////////////////////
-echo '<p>pgv_remotelinks => wt_remotelinks ...</p>'; ob_flush(); flush(); usleep(50000);
-WT_DB::prepare(
- "REPLACE INTO `##remotelinks` (r_gid, r_linkid, r_file)".
- " SELECT r_gid, r_linkid, r_file FROM `{$DBNAME}`.`{$TBLPREFIX}remotelinks`"
-)->execute();
-
-////////////////////////////////////////////////////////////////////////////////
-
echo '<p>pgv_sources => wt_sources ...</p>'; ob_flush(); flush(); usleep(50000);
WT_DB::prepare(
- "REPLACE INTO `##sources` (s_id, s_file, s_name, s_dbid, s_gedcom)".
- " SELECT s_id, s_file, s_name, s_dbid, ".
- " REPLACE(s_gedcom, '\n2 _PGVU ', '\n2 _WT_USER ')".
+ "REPLACE INTO `##sources` (s_id, s_file, s_name, s_gedcom)".
+ " SELECT s_id, s_file, s_name, REPLACE(s_gedcom, '\n2 _PGVU ', '\n2 _WT_USER ')".
" FROM `{$DBNAME}`.`{$TBLPREFIX}sources`"
)->execute();
diff --git a/search.php b/search.php
index bf035fc459..19ce46f467 100644
--- a/search.php
+++ b/search.php
@@ -121,16 +121,7 @@ if ($ENABLE_AUTOCOMPLETE) require WT_ROOT.'js/autocomplete.js.htm';
message = false;
if (dplace.length > 1)
message = false;
- if (message)
- {
- <?php if ($SHOW_MULTISITE_SEARCH >= WT_USER_ACCESS_LEVEL) { ?>
- if (gender.length < 1)
- {
- alert("<?php echo i18n::translate('Please enter one of the following: Name, Birth Date, Birth Place, Death Date, Death Place, and Gender '); ?>");
- return false;
- }
- alert("<?php echo i18n::translate('Please search again with more information than just gender'); ?>");
- <?php } ?>
+ if (message) {
return false;
}
}
@@ -138,11 +129,6 @@ if ($ENABLE_AUTOCOMPLETE) require WT_ROOT.'js/autocomplete.js.htm';
return true;
}
- function open_link(server, pid, indiName) {
- window.open("addsearchlink.php?server="+server+"&pid="+pid+"&indiName="+indiName, "_blank", "top=50,left=50,width=600,height=500,scrollbars=1,scrollable=1,resizable=1");
- return false;
- }
-
//-->
</script>
@@ -574,41 +560,17 @@ if ($controller->action == "general") {
if (WT_USER_CAN_EDIT) {
echo " | <a href='?action=replace'>".i18n::translate('Search and replace')."</a>";
}
- if ($SHOW_MULTISITE_SEARCH >= WT_USER_ACCESS_LEVEL) {
- if (count($controller->Sites) > 0) {
-
-
- echo " | <a href='?action=multisite'>".i18n::translate('Multi Site Search')."</a></td></tr>";
- }
- }
-}
-else if ($controller->action == "replace")
-{
+} else if ($controller->action == "replace") {
echo "<a href='?action=general'>".i18n::translate('General Search')."</a> | ";
echo "<a href='?action=soundex'>".i18n::translate('Soundex Search')."</a>";
echo " | <a href='search_advanced.php'>".i18n::translate('Advanced search')."</a>";
- if ($SHOW_MULTISITE_SEARCH >= WT_USER_ACCESS_LEVEL) {
- if (count($controller->Sites) > 0) {
-
- echo " | <a href='?action=multisite'>".i18n::translate('Multi Site Search')."</a></td></tr>";
- }
- }
-}
-else
- if ($controller->action == "soundex") {
+} else if ($controller->action == "soundex") {
echo "<a href='?action=general'>".i18n::translate('General Search')."</a>";
echo " | <a href='search_advanced.php'>".i18n::translate('Advanced search')."</a>";
- if (WT_USER_CAN_EDIT)
- {
+ if (WT_USER_CAN_EDIT) {
echo " | <a href='?action=replace'>".i18n::translate('Search and replace')."</a>";
}
- if ($SHOW_MULTISITE_SEARCH >= WT_USER_ACCESS_LEVEL) {
- if (count($controller->Sites) > 0) {
- echo " | <a href='?action=multisite'>".i18n::translate('Multi Site Search')."</a></td></tr>";
- }
- }
- }
- else
+ } else
if ($controller->action == "multisite")
{
if (WT_USER_CAN_EDIT)
diff --git a/serviceClientTest.php b/serviceClientTest.php
deleted file mode 100644
index 24917f5420..0000000000
--- a/serviceClientTest.php
+++ /dev/null
@@ -1,94 +0,0 @@
-<pre>
-<?php
-
-define('WT_SCRIPT_NAME', 'serviceClientTest.php');
-require './includes/session.php';
-
-ob_start();
-require_once './library/Zend/Soap/Client.php';
-
-//-- put your URL here
-$url = 'http://localhost/phpgedview/gen2service.php?wsdl';
-echo "Getting WSDL<br />";
-
-if (!class_exists('SoapClient')) {
- echo "Using Zend SOAP<br />";
- $soap = new Zend_Soap_Client($url,array('soap_version' => SOAP_1_1 ));
-}
-else {
- echo "Using SOAP Extension<br />";
- $soap = new SoapClient($url);
-}
-
-echo "Getting ServiceInfo<br />";
-$s = $soap->ServiceInfo();
-var_dump($s);
-echo "After ServiceInfo()<br />";
-
-$result = $soap->Authenticate('', '', '', '');
-var_dump($result);
-
-echo "After Authenticate<br />";
-
-$res = $soap->getPersonById($result->SID, "I2");
-var_dump($res);
-echo "After getPersonById<br />";
-
-$res = $soap->getGedcomRecord($result->SID, "I2");
-var_dump($res);
-echo "After getGedcomRecord<br />";
-
-//$family = $soap->getFamilyByID($result->SID, "F1");
-//print_r($family);
-
-//$ids = $soap->checkUpdates($result->SID, "01 JAN 2006");
-//print_r($ids);
-//
-//$s = $soap->search($result->item->SID, 'week', '0','100');
-//echo print_r($s,true);
-//
-//$res = $soap->getPersonById($result->SID, "I1");
-//print_r($res);
-//
-/*************************************** getVar TESTS *********************************************/
-/*$s = $soap->getVar($result->SID, 'GEDCOM');
-print_r($s);
-
-$s = $soap->getXref($result->SID, 'new', 'INDI');
-print_r($s);
-
-$s = $soap->checkUpdates($result->SID, '10 JAN 2005');
-print_r($s);
-*/
-//
-//$s = $soap->getVar($result->SID, 'CHARACTER_SET');
-//print_r($s);
-//
-//$s = $soap->getVar($result->SID, 'PEDIGREE_ROOT_ID');
-//print_r($s);
-//
-// The rest of these are examples that only work if you are
-// actually authenticated as a user first not anonymously
-//$s = $soap->getVar($result->SID, 'CALENDAR_FORMAT');
-//print_r($s);
-//
-//$s = $soap->getVar($result->SID, 'LANGUAGE');
-//print_r($s);
-//
-/************* THE REST OF THESE SCHOULD RETURN SOAP FAULTS SINCE THEY'RE NOT ALLOWED **********/
-//$s = $soap->getVar($result->SID, 'DBTYPE');
-//print_r($s);
-//
-//$s = $soap->getVar($result->SID, 'SERVER_URL');
-//print_r($s);
-/**************************************** END OF getVar TEST *************************************/
-//
-//$s = $soap->appendRecord($result->SID, 'RoyalBaseGarrett05.ged', $gedrec);
-//print_r($s);
-//
-//$s = $soap->deleteRecord($result->SID, 'RoyalBaseGarrett05.ged');
-//print_r($s);
-
-ob_end_flush();
-?>
-</pre>
diff --git a/setup.php b/setup.php
index e250c9cb6d..8022376d74 100644
--- a/setup.php
+++ b/setup.php
@@ -771,16 +771,6 @@ try {
") COLLATE utf8_unicode_ci ENGINE=InnoDB"
);
$dbh->exec(
- "CREATE TABLE IF NOT EXISTS `{$TBLPREFIX}remotelinks` (".
- " r_gid VARCHAR(20) NOT NULL,".
- " r_linkid VARCHAR(255) NULL,".
- " r_file INTEGER NOT NULL,".
- " KEY ix1 (r_gid),".
- " KEY ix2 (r_linkid),".
- " KEY ix3 (r_file)".
- ") COLLATE utf8_unicode_ci ENGINE=InnoDB"
- );
- $dbh->exec(
"CREATE TABLE IF NOT EXISTS `{$TBLPREFIX}media_mapping` (".
" mm_id INTEGER AUTO_INCREMENT NOT NULL,".
" mm_media VARCHAR(20) NOT NULL,".
@@ -819,11 +809,9 @@ try {
" s_file INTEGER NOT NULL,".
" s_name VARCHAR(255) NOT NULL,".
" s_gedcom MEDIUMTEXT NOT NULL,".
- " s_dbid ENUM('N', 'Y') NULL,".
" PRIMARY KEY (s_id, s_file),".
" UNIQUE KEY ux1 (s_file, s_id),".
- " KEY ix1 (s_name),".
- " KEY ix2 (s_dbid)".
+ " KEY ix1 (s_name)".
") COLLATE utf8_unicode_ci ENGINE=InnoDB"
);
$dbh->exec(