summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorfisharebest <fisharebest@gmail.com>2010-06-04 15:28:36 +0000
committerfisharebest <fisharebest@gmail.com>2010-06-04 15:28:36 +0000
commit84f4988e5f562e5b5a96f532176742fb532f73f2 (patch)
treee8a3decef0bba77e49683c1d6f5d3edb63544713
parent1746577e3bf2c8fbdeec1d8b9c3401c4580377ab (diff)
downloadwebtrees-84f4988e5f562e5b5a96f532176742fb532f73f2.tar.gz
webtrees-84f4988e5f562e5b5a96f532176742fb532f73f2.tar.bz2
webtrees-84f4988e5f562e5b5a96f532176742fb532f73f2.zip
Remove global WT_STORE_MESSAGES. Fetch this setting whenever it is used.
-rw-r--r--includes/authentication.php3
-rw-r--r--includes/functions/functions_edit.php3
-rw-r--r--includes/functions/functions_mail.php2
-rw-r--r--includes/session.php1
-rw-r--r--useradmin.php2
5 files changed, 4 insertions, 7 deletions
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');
diff --git a/useradmin.php b/useradmin.php
index 8402e88e05..2986008808 100644
--- a/useradmin.php
+++ b/useradmin.php
@@ -791,7 +791,7 @@ if ($action == "createform") {
<td class="descriptionbox wrap"><?php echo i18n::translate('Preferred contact method'), help_link('useradmin_user_contact'); ?></td>
<td class="optionbox wrap">
<?php
- echo edit_field_contact('new_contact_method', $WT_STORE_MESSAGES ? 'messaging2' : 'messaging3', 'tabindex="'.(++$tab).'"');
+ echo edit_field_contact('new_contact_method', get_site_setting('STORE_MESSAGES') ? 'messaging2' : 'messaging3', 'tabindex="'.(++$tab).'"');
?>
</td>
</tr>