328: useroption for mailings
This commit is contained in:
@@ -62,6 +62,7 @@ class user
|
||||
$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 @@ class user
|
||||
{
|
||||
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 @@ class user
|
||||
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 @@ class user
|
||||
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();
|
||||
?>
|
||||
?>
|
||||
|
Reference in New Issue
Block a user