added profile setting for default of 'send my e-mail address', updates #333

This commit is contained in:
following 2015-05-24 20:47:31 +02:00
parent 89d4645e17
commit 8fe2d4e0c2
8 changed files with 44 additions and 6 deletions

View File

@ -365,6 +365,14 @@
}
}
function dbv_122() // add user profile flag for default setting of send-my-email option
{
if (!sql_field_exists('user','usermail_send_addr'))
{
sql("ALTER TABLE `user` ADD COLUMN `usermail_send_addr` tinyint(1) NOT NULL default '0' AFTER `accept_mailing`");
}
}
// When adding new mutations, take care that they behave well if run multiple
// times. This improves robustness of database versioning.

View File

@ -1567,7 +1567,7 @@ INSERT INTO `sys_trans` (`id`, `text`, `last_modified`) VALUES ('687', 'Send E-M
INSERT INTO `sys_trans` (`id`, `text`, `last_modified`) VALUES ('688', 'You have to enter a subject!', '2010-08-28 11:48:04');
INSERT INTO `sys_trans` (`id`, `text`, `last_modified`) VALUES ('689', 'You have to enter a content!', '2010-08-28 11:48:04');
INSERT INTO `sys_trans` (`id`, `text`, `last_modified`) VALUES ('690', 'Send my E-Mail address with this message', '2010-08-28 11:48:04');
INSERT INTO `sys_trans` (`id`, `text`, `last_modified`) VALUES ('691', 'This enables the receiver to answer your E-Mail directly with his E-Mail agent.', '2010-08-28 11:48:04');
INSERT INTO `sys_trans` (`id`, `text`, `last_modified`) VALUES ('691', 'This enables the receiver to answer your E-Mail directly with his E-Mail agent. You may enable this option by default in your <a href=\"myprofile.php\">user profile</a>.', '2010-08-28 11:48:04');
INSERT INTO `sys_trans` (`id`, `text`, `last_modified`) VALUES ('692', 'To protect you and us from abuse:', '2010-08-28 11:48:04');
INSERT INTO `sys_trans` (`id`, `text`, `last_modified`) VALUES ('693', 'Only E-Mail that regards Geocaching are allowed. Spaming is not allowed!', '2010-08-28 11:48:04');
INSERT INTO `sys_trans` (`id`, `text`, `last_modified`) VALUES ('694', 'All relevant informations will be logged (date/time, sender/receiver and IP address)', '2010-08-28 11:48:04');
@ -2599,6 +2599,7 @@ INSERT INTO `sys_trans` (`id`, `text`, `last_modified`) VALUES ('2171', 'Please
INSERT INTO `sys_trans` (`id`, `text`, `last_modified`) VALUES ('2172', 'Yes, I want to recieve mailings about news and actions on opencaching.de. (max. 2-5 per year)', '2013-11-03 10:09:14');
INSERT INTO `sys_trans` (`id`, `text`, `last_modified`) VALUES ('2173', 'No, I dont\'t want any mailings about news and actions on opencaching.de.', '2013-11-03 10:09:14');
INSERT INTO `sys_trans` (`id`, `text`, `last_modified`) VALUES ('2174', 'Newsletter:', '2013-11-03 10:09:14');
INSERT INTO `sys_trans` (`id`, `text`, `last_modified`) VALUES ('2175', 'Disclose my e-mail address by default when sending e-mails to other users.', '2015-05-25 19:50:00');
-- Table sys_trans_ref
SET NAMES 'utf8';
@ -5656,7 +5657,7 @@ INSERT INTO `sys_trans_text` (`trans_id`, `lang`, `text`, `last_modified`) VALUE
INSERT INTO `sys_trans_text` (`trans_id`, `lang`, `text`, `last_modified`) VALUES ('688', 'DE', 'Du musst einen Betreff angeben!', '2010-08-28 11:48:06');
INSERT INTO `sys_trans_text` (`trans_id`, `lang`, `text`, `last_modified`) VALUES ('689', 'DE', 'Du musst einen Inhalt eingeben!', '2010-08-28 11:48:06');
INSERT INTO `sys_trans_text` (`trans_id`, `lang`, `text`, `last_modified`) VALUES ('690', 'DE', 'Meine E-Mail-Adresse soll mit dieser E-Mail mitgesendet werden', '2010-08-28 11:48:06');
INSERT INTO `sys_trans_text` (`trans_id`, `lang`, `text`, `last_modified`) VALUES ('691', 'DE', 'Damit kennt der Empfänger deine E-Mail-Adresse und hat die Möglichkeit, direkt auf die E-Mail zu antworten.', '2010-08-28 11:48:06');
INSERT INTO `sys_trans_text` (`trans_id`, `lang`, `text`, `last_modified`) VALUES ('691', 'DE', 'Damit kennt der Empfänger deine E-Mail-Adresse und hat die Möglichkeit, direkt auf die E-Mail zu antworten. Diese Option kannst du in deinem <a href=\"myprofile.php\">Benutzerprofil</a> standardmäßig einschalten.', '2010-08-28 11:48:06');
INSERT INTO `sys_trans_text` (`trans_id`, `lang`, `text`, `last_modified`) VALUES ('692', 'DE', 'Um Missbrauch zu verhindern, müssen wir zu eurem und auch unserem Schutz folgende Maßnahmen treffen:', '2010-08-28 11:48:06');
INSERT INTO `sys_trans_text` (`trans_id`, `lang`, `text`, `last_modified`) VALUES ('693', 'DE', 'Es dürfen nur Emails zum Thema versendet werden; jede Form nicht notwendiger Belästigung \&ndash; z.B. Spam \&ndash; ist nicht erlaubt.', '2010-08-28 11:48:06');
INSERT INTO `sys_trans_text` (`trans_id`, `lang`, `text`, `last_modified`) VALUES ('694', 'DE', 'Es werden alle relevanten Informationen protokolliert (Datum/Uhrzeit, Absender/Empfänger und IP-Adresse).', '2010-08-28 11:48:06');
@ -6687,6 +6688,7 @@ INSERT INTO `sys_trans_text` (`trans_id`, `lang`, `text`, `last_modified`) VALUE
INSERT INTO `sys_trans_text` (`trans_id`, `lang`, `text`, `last_modified`) VALUES ('2172', 'DE', 'Ja, ich möchte Informationen zu Neuigkeiten und Aktionen auf opencaching.de per Email erhalten. (max. 2-5 pro Jahr)', '2013-11-03 10:09:14');
INSERT INTO `sys_trans_text` (`trans_id`, `lang`, `text`, `last_modified`) VALUES ('2173', 'DE', 'Nein, ich möchte keine Informationen zu Neuigkeiten und Aktionen auf opencaching.de per Email erhalten.', '2013-11-03 10:09:14');
INSERT INTO `sys_trans_text` (`trans_id`, `lang`, `text`, `last_modified`) VALUES ('2174', 'DE', 'Newsletter:', '2013-11-03 10:09:14');
INSERT INTO `sys_trans_text` (`trans_id`, `lang`, `text`, `last_modified`) VALUES ('2175', 'DE', 'Wenn ich andere Benutzer anschreibe, wird standardmäßig meine E-Mail-Adresse mitgeschickt.', '2015-05-25 19:50:00');
INSERT INTO `sys_trans_text` (`trans_id`, `lang`, `text`, `last_modified`) VALUES ('1', 'EN', 'Reorder IDs', '2010-09-02 00:15:30');
INSERT INTO `sys_trans_text` (`trans_id`, `lang`, `text`, `last_modified`) VALUES ('2', 'EN', 'The database could not be reconnected.', '2010-08-28 11:48:07');
INSERT INTO `sys_trans_text` (`trans_id`, `lang`, `text`, `last_modified`) VALUES ('3', 'EN', 'Testing please do not login', '2010-08-28 11:48:07');
@ -7347,7 +7349,7 @@ INSERT INTO `sys_trans_text` (`trans_id`, `lang`, `text`, `last_modified`) VALUE
INSERT INTO `sys_trans_text` (`trans_id`, `lang`, `text`, `last_modified`) VALUES ('688', 'EN', 'You have to enter a subject!', '2010-08-28 11:48:08');
INSERT INTO `sys_trans_text` (`trans_id`, `lang`, `text`, `last_modified`) VALUES ('689', 'EN', 'You have to enter a content!', '2010-08-28 11:48:08');
INSERT INTO `sys_trans_text` (`trans_id`, `lang`, `text`, `last_modified`) VALUES ('690', 'EN', 'Send my e-mail address with this message', '2010-08-28 11:48:08');
INSERT INTO `sys_trans_text` (`trans_id`, `lang`, `text`, `last_modified`) VALUES ('691', 'EN', 'This enables the receiver to answer your e-mail directly using his e-mail client.', '2010-08-28 11:48:08');
INSERT INTO `sys_trans_text` (`trans_id`, `lang`, `text`, `last_modified`) VALUES ('691', 'EN', 'This enables the receiver to answer your e-mail directly using his e-mail client. You may enable this option by default in your <a href="myprofile.php">user profile</a>.', '2010-08-28 11:48:08');
INSERT INTO `sys_trans_text` (`trans_id`, `lang`, `text`, `last_modified`) VALUES ('692', 'EN', 'To protect you and us from abuse:', '2010-08-28 11:48:08');
INSERT INTO `sys_trans_text` (`trans_id`, `lang`, `text`, `last_modified`) VALUES ('693', 'EN', 'Only e-mails concerning geocaching are allowed. Spamming is prohibited!', '2010-08-28 11:48:08');
INSERT INTO `sys_trans_text` (`trans_id`, `lang`, `text`, `last_modified`) VALUES ('694', 'EN', 'All relevant information will be logged (date/time, sender/receiver and IP address).', '2010-08-28 11:48:08');
@ -8345,6 +8347,7 @@ INSERT INTO `sys_trans_text` (`trans_id`, `lang`, `text`, `last_modified`) VALUE
INSERT INTO `sys_trans_text` (`trans_id`, `lang`, `text`, `last_modified`) VALUES ('2150', 'EN', 'This geocache is probably placed within the following protection areas:', '2011-05-23 22:19:23');
INSERT INTO `sys_trans_text` (`trans_id`, `lang`, `text`, `last_modified`) VALUES ('2151', 'EN', 'Also listed as', '2011-05-23 22:19:23');
INSERT INTO `sys_trans_text` (`trans_id`, `lang`, `text`, `last_modified`) VALUES ('2162', 'EN', 'Your log entries', '2010-08-28 11:48:07');
INSERT INTO `sys_trans_text` (`trans_id`, `lang`, `text`, `last_modified`) VALUES ('2175', 'EN', 'Disclose my e-mail address by default when sending e-mails to other users.', '2015-05-25 19:50:00');
INSERT INTO `sys_trans_text` (`trans_id`, `lang`, `text`, `last_modified`) VALUES ('1', 'ES', 'Reordenar ID', '2010-12-09 00:17:55');
INSERT INTO `sys_trans_text` (`trans_id`, `lang`, `text`, `last_modified`) VALUES ('2', 'ES', 'La base de datos no se pudo conectar.', '2010-12-09 00:17:55');
INSERT INTO `sys_trans_text` (`trans_id`, `lang`, `text`, `last_modified`) VALUES ('3', 'ES', 'En pruebas - por favor, no entre.', '2010-12-09 00:17:55');

View File

@ -15,6 +15,7 @@ CREATE TABLE `user` (
`last_email_problem` datetime default NULL,
`mailing_problems` int(10) unsigned NOT NULL default '0',
`accept_mailing` tinyint(1) NOT NULL default '1',
`usermail_send_addr` tinyint(1) unsigned NOT NULL default '0',
`latitude` double NOT NULL,
`longitude` double NOT NULL,
`is_active_flag` tinyint(1) NOT NULL,

View File

@ -78,6 +78,7 @@ class user
$this->reUser->addInt('watchmail_day', 0, false);
$this->reUser->addString('activation_code', '', false);
$this->reUser->addBoolean('no_htmledit_flag', false, false);
$this->reUser->addBoolean('usermail_send_addr', false, false);
$this->reUser->addInt('notify_radius', 0, false);
$this->reUser->addInt('notify_oconly', 1, false);
$this->reUser->addInt('admin', 0, false);
@ -264,6 +265,14 @@ class user
{
return $this->reUser->setValue('accept_mailing', $value);
}
function getUsermailSendAddress()
{
return $this->reUser->getValue('usermail_send_addr');
}
function setUsermailSendAddress($value)
{
return $this->reUser->setValue('usermail_send_addr', $value);
}
function getNoHTMLEditor()
{
return $this->reUser->getValue('no_htmledit_flag');

View File

@ -27,7 +27,10 @@
$subject = isset($_REQUEST['subject']) ? $_REQUEST['subject'] : '';
$text = isset($_REQUEST['text']) ? $_REQUEST['text'] : '';
$bEmailaddress = isset($_REQUEST['emailaddress']) ? ($_REQUEST['emailaddress']==1) : false;
if (isset($_REQUEST['emailaddress']))
$bEmailaddress = ($_REQUEST['emailaddress']==1);
else
$bEmailaddress = $user->getUsermailSendAddress();
if (isset($_REQUEST['ok']))
{

View File

@ -144,6 +144,10 @@ function change()
$tpl->assign('noHTMLEditor', $bNoHTMLEditor);
$user->setNoHTMLEditor($bNoHTMLEditor);
$bUsermailSendAddress = isset($_REQUEST['save']) ? isset($_REQUEST['sendUsermailAddress']) : $user->getUsermailSendAddress();
$tpl->assign('sendUsermailAddress', $bUsermailSendAddress);
$user->setUsermailSendAddress($bUsermailSendAddress);
if (!$bError && isset($_REQUEST['save']))
{
if ($user->getAnyChanged())
@ -222,6 +226,7 @@ function assignFromUser($user)
$tpl->assign('usePMR', $user->getUsePMR());
$tpl->assign('permanentLogin', $user->getPermanentLogin());
$tpl->assign('noHTMLEditor', $user->getNoHTMLEditor());
$tpl->assign('sendUsermailAddress', $user->getUsermailSendAddress());
}
?>

View File

@ -76,7 +76,7 @@
<tr>
<td class="help" colspan="2">
<img src="resource2/{$opt.template.style}/images/misc/hint.gif" border="0" width="15" height="11" align="middle" />
{t}This enables the receiver to answer your E-Mail directly with his E-Mail agent.{/t}<br />
{t}This enables the receiver to answer your E-Mail directly with his E-Mail agent. You may enable this option by default in your <a href="myprofile.php">user profile</a>.{/t}<br />
<div style="padding: 10px 0 10px 0">
<img src="resource2/{$opt.template.style}/images/misc/hint.gif" border="0" width="15" height="11" align="middle" />
<span class="smalltext">{t}To protect you and us from abuse:{/t}</span>

View File

@ -155,7 +155,7 @@
</tr>
<tr><td class="spacer" colspan="2"></td></tr>
{if $edit || $usePMR || $permanentLogin || $noHTMLEditor}
{if $edit || $usePMR || $permanentLogin || $noHTMLEditor || $sendUsermailAddress }
<tr>
<td valign="top">{t}Others:{/t}</td>
<td valign="top">
@ -190,6 +190,15 @@
{t}Don't use an HTML editor by default.{/t}
{/if}
{/if}
{if $edit==true}
<input type="checkbox" name="sendUsermailAddress" value="1" {if $sendUsermailAddress==true}checked="checked"{/if} id="l_send_usermail_address" class="checkbox" />
<label for="l_send_usermail_address">{t}Disclose my e-mail address by default when sending e-mails to other users.{/t}</label>
<br />
{else}
{if $sendUsermailAddress}
{t}Disclose my e-mail address by default when sending e-mails to other users.{/t}
{/if}
{/if}
</td>
</tr>
<tr><td class="spacer" colspan="2"></td></tr>