From 84f4988e5f562e5b5a96f532176742fb532f73f2 Mon Sep 17 00:00:00 2001 From: fisharebest Date: Fri, 4 Jun 2010 15:28:36 +0000 Subject: Remove global WT_STORE_MESSAGES. Fetch this setting whenever it is used. --- includes/authentication.php | 3 +-- includes/functions/functions_edit.php | 3 +-- includes/functions/functions_mail.php | 2 +- includes/session.php | 1 - 4 files changed, 3 insertions(+), 6 deletions(-) (limited to 'includes') diff --git a/includes/authentication.php b/includes/authentication.php index acbe680b20..6fd85c06d2 100644 --- a/includes/authentication.php +++ b/includes/authentication.php @@ -323,7 +323,6 @@ function AddToChangeLog($log_message, $ged_id=WT_GED_ID) { //----------------------------------- addMessage //-- stores a new message in the database function addMessage($message) { - global $WT_STORE_MESSAGES; global $TEXT_DIRECTION; global $WEBTREES_EMAIL; @@ -411,7 +410,7 @@ function addMessage($message) { } if (empty($message["created"])) $message["created"] = gmdate ("D, d M Y H:i:s T"); - if ($WT_STORE_MESSAGES && ($message["method"]!="messaging3" && $message["method"]!="mailto" && $message["method"]!="none")) { + if (get_site_setting('STORE_MESSAGES') && ($message["method"]!="messaging3" && $message["method"]!="mailto" && $message["method"]!="none")) { WT_DB::prepare("INSERT INTO `##message` (sender, ip_address, user_id, subject, body) VALUES (? ,? ,? ,? ,?)") ->execute(array($message["from"], $_SERVER['REMOTE_ADDR'], get_user_id($message["to"]), $message["subject"], $message["body"])); } diff --git a/includes/functions/functions_edit.php b/includes/functions/functions_edit.php index 141ddd8f90..baf8ca7d8a 100644 --- a/includes/functions/functions_edit.php +++ b/includes/functions/functions_edit.php @@ -136,7 +136,6 @@ function edit_field_log_frequency($name, $selected='', $extra='') { // Print an edit control for a contact method field function edit_field_contact($name, $selected='', $extra='') { - global $WT_STORE_MESSAGES; // Different ways to contact the users $CONTACT_METHODS=array( 'messaging' =>i18n::translate('webtrees internal messaging'), @@ -145,7 +144,7 @@ function edit_field_contact($name, $selected='', $extra='') { 'mailto' =>i18n::translate('Mailto link'), 'none' =>i18n::translate('No contact'), ); - if (!$WT_STORE_MESSAGES) { + if (!get_site_setting('STORE_MESSAGES')) { unset($CONTACT_METHODS['messaging'], $CONTACT_METHODS['messaging2']); } return select_edit_control($name, $CONTACT_METHODS, null, $selected, $extra); diff --git a/includes/functions/functions_mail.php b/includes/functions/functions_mail.php index 6b7e3b23f2..3fa5202a5d 100644 --- a/includes/functions/functions_mail.php +++ b/includes/functions/functions_mail.php @@ -50,7 +50,7 @@ function webtreesMail($to, $from, $subject, $message) { $SMTP_AUTH_USER=get_site_setting('SMTP_AUTH_USER'); $SMTP_AUTH_PASS=get_site_setting('SMTP_AUTH_PASS'); $SMTP_SSL =get_site_setting('SMTP_SSL'); - global $WT_STORE_MESSAGES, $TEXT_DIRECTION; + global $TEXT_DIRECTION; $mailFormat = "plain"; //$mailFormat = "html"; //$mailFormat = "multipart"; diff --git a/includes/session.php b/includes/session.php index 3f73524a70..b723daa835 100644 --- a/includes/session.php +++ b/includes/session.php @@ -231,7 +231,6 @@ try { // We'll tidy these up later. Some of them are used infrequently. $INDEX_DIRECTORY =get_site_setting('INDEX_DIRECTORY'); -$WT_STORE_MESSAGES =get_site_setting('STORE_MESSAGES'); $USE_REGISTRATION_MODULE =get_site_setting('USE_REGISTRATION_MODULE'); $REQUIRE_ADMIN_AUTH_REGISTRATION=get_site_setting('REQUIRE_ADMIN_AUTH_REGISTRATION'); $ALLOW_USER_THEMES =get_site_setting('ALLOW_USER_THEMES'); -- cgit v1.3