3 * Disable optional site mailings for account
5 * This page is accessed via URL present in site mailings
7 * Copyright 1999-2001 (c) VA Linux Systems
8 * Copyright 2010 (c) Franck Villaume
10 * This file is part of FusionForge. FusionForge is free software;
11 * you can redistribute it and/or modify it under the terms of the
12 * GNU General Public License as published by the Free Software
13 * Foundation; either version 2 of the Licence, or (at your option)
16 * FusionForge is distributed in the hope that it will be useful,
17 * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 * GNU General Public License for more details.
21 * You should have received a copy of the GNU General Public License along
22 * with FusionForge; if not, write to the Free Software Foundation, Inc.,
23 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
26 require_once('../env.inc.php');
27 require_once $gfcommon.'include/pre.php';
28 require_once $gfcommon.'include/account.php';
30 $confirm_hash = getStringFromRequest('confirm_hash');
33 $confirm_hash = getStringFromRequest('ch');
36 exit_missing_param('',array(_('Confirm Hash')),'my');
39 $confirm_hash = html_clean_hash_string($confirm_hash);
41 $res_user = db_query_params ('SELECT * FROM users WHERE confirm_hash=$1',
42 array($confirm_hash)) ;
44 if (db_numrows($res_user) > 1) {
45 exit_error(_('This confirm hash exists more than once.'),'my');
47 if (db_numrows($res_user) < 1) {
48 exit_error(_('Invalid confirmation hash.'),'my');
51 $row_user = db_fetch_array($res_user);
52 $user =& user_get_object($row_user['user_id'], $res_user);
53 if (!$user || !is_object($user)) {
54 exit_error(_('Could Not Get User'),'home');
55 } elseif ($user->isError()) {
56 exit_error($user->getErrorMessage(),'my');
59 $all=getStringFromRequest('all');
60 $user->unsubscribeFromMailings($all);
62 site_header(array('title'=>_("Unsubscription Complete")));
66 $what = sprintf(_('You have been unsubscribed from all %1$s mailings and notifications. In case you will want to re-activate your subscriptions in the future, login and visit your Account Maintenance page.'), forge_get_config ('forge_name'));
68 $what = sprintf(_('You have been unsubscribed from %1$s site mailings. In case you will want to re-activate your subscriptions in the future, login and visit your Account Maintenance page.'), forge_get_config ('forge_name'));
72 <h2>Unsubscription Complete</h2>
77 <p><?php echo util_make_link ("/", _('Return')); ?></p>