diff --git a/htdocs/lib2/logic/user.class.php b/htdocs/lib2/logic/user.class.php index 14bbbb3e2..e5ac4085a 100644 --- a/htdocs/lib2/logic/user.class.php +++ b/htdocs/lib2/logic/user.class.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; } } -?> \ No newline at end of file +?> diff --git a/htdocs/myprofile.php b/htdocs/myprofile.php index 46cec6229..24efc7080 100644 --- a/htdocs/myprofile.php +++ b/htdocs/myprofile.php @@ -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()); } -?> \ No newline at end of file +?> diff --git a/htdocs/templates2/ocstyle/myprofile.tpl b/htdocs/templates2/ocstyle/myprofile.tpl index 9c6f4845c..15dadeb10 100644 --- a/htdocs/templates2/ocstyle/myprofile.tpl +++ b/htdocs/templates2/ocstyle/myprofile.tpl @@ -136,6 +136,24 @@