Skip to content
Permalink
Browse files

328: useroption for mailings

  • Loading branch information...
Schrottie authored and bohrsty committed Oct 10, 2013
1 parent c297bbc commit 67ddf1af2057183c5d468f89b48045b5d75c35d8
Showing with 39 additions and 4 deletions.
  1. +11 −2 htdocs/lib2/logic/user.class.php
  2. +7 −1 htdocs/myprofile.php
  3. +18 −0 htdocs/templates2/ocstyle/myprofile.tpl
  4. +3 −1 htdocs/viewprofile.php
@@ -62,6 +62,7 @@ function __construct($nNewUserId=ID_NEW)
$this->reUser->addString('last_name', '', false);
$this->reUser->addString('first_name', '', false);
$this->reUser->addString('country', null, true);
$this->reUser->addBoolean('accept_mailing', false, false);
$this->reUser->addBoolean('pmr_flag', false, false);
$this->reUser->addString('new_pw_code', null, true);
$this->reUser->addDate('new_pw_date', null, true);
@@ -255,6 +256,14 @@ function setPermanentLogin($value)
{
return $this->reUser->setValue('permanent_login_flag', $value);
}
function getAccMailing()
{
return $this->reUser->getValue('accept_mailing');
}
function setAccMailing($value)
{
return $this->reUser->setValue('accept_mailing', $value);
}
function getNoHTMLEditor()
{
return $this->reUser->getValue('no_htmledit_flag');
@@ -731,7 +740,7 @@ function disable()
sql("UPDATE `user` SET `password`=NULL, `email`=NULL,
`is_active_flag`=0,
`latitude`=0, `longitude`=0,
`last_name`='', `first_name`='', `country`=NULL, `pmr_flag`=0,
`last_name`='', `first_name`='', `country`=NULL, `accept_mailing`=0, `pmr_flag`=0,
`new_pw_code`=NULL, `new_pw_date`=NULL,
`new_email`=NULL, `new_email_code`=NULL, `new_email_date`=NULL,
`email_problems`=0, `first_email_problem`=NULL, `last_email_problem`=NULL,
@@ -1296,4 +1305,4 @@ function showStatFounds()
return false;
}
}
?>
?>
@@ -128,6 +128,10 @@ function change()
}
}
$bAccMailing = isset($_REQUEST['save']) ? isset($_REQUEST['accMailing']) : $user->getAccMailing();
$tpl->assign('accMailing', $bAccMailing);
$user->setAccMailing($bAccMailing);
$bUsePMR = isset($_REQUEST['save']) ? isset($_REQUEST['usePMR']) : $user->getUsePMR();
$tpl->assign('usePMR', $bUsePMR);
$user->setUsePMR($bUsePMR);
@@ -213,9 +217,11 @@ function assignFromUser($user)
$tpl->assign('registeredSince', $user->getDateRegistered());
$tpl->assign('accMailing', $user->getAccMailing());
$tpl->assign('usePMR', $user->getUsePMR());
$tpl->assign('permanentLogin', $user->getPermanentLogin());
$tpl->assign('noHTMLEditor', $user->getNoHTMLEditor());
}
?>
?>
@@ -136,6 +136,24 @@
</td>
</tr>
<tr><td class="spacer" colspan="2"></td></tr>

<tr>
<td valign="top">{t}Newsletter:{/t}</td>
<td valign="top">
{if $edit==true}
<input type="checkbox" name="accMailing" value="1" {if $accMailing==true}checked="checked"{/if} id="acc_Mailing" class="checkbox" />
<label for="acc_Mailing">{t}Please send me mailings about news and actions on opencaching.de. (max. 2-5 per year){/t}</label>
<br />
{else}
{if $accMailing==true}
{t}Yes, I want to recieve mailings about news and actions on opencaching.de. (max. 2-5 per year){/t}<br />
{else}
{t}No, I dont't want any mailings about news and actions on opencaching.de.{/t}
{/if}
{/if}
</td>
</tr>
<tr><td class="spacer" colspan="2"></td></tr>

{if $edit || $usePMR || $permanentLogin || $noHTMLEditor}
<tr>
@@ -32,6 +32,7 @@
// user data and basic statistics
$rs = sql("SELECT `user`.`username`,
`user`.`last_login`,
`user`.`accept_mailing`,
`user`.`pmr_flag`,
`user`.`date_created`,
`user`.`password`,
@@ -328,7 +329,8 @@
$tpl->assign('license_actively_declined', $record['data_license'] == NEW_DATA_LICENSE_ACTIVELY_DECLINED);
$tpl->assign('license_passively_declined', $record['data_license'] == NEW_DATA_LICENSE_PASSIVELY_DECLINED);
$tpl->assign('accMailing', $record['accept_mailing']);
$tpl->assign('pmr', $record['pmr_flag']);
$tpl->display();
?>
?>

0 comments on commit 67ddf1a

Please sign in to comment.
You can’t perform that action at this time.