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
9 * This file is part of GForge.
11 * GForge is free software; you can redistribute it and/or modify
12 * it under the terms of the GNU General Public License as published by
13 * the Free Software Foundation; either version 2 of the License, or
14 * (at your option) any later version.
16 * GForge 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
22 * along with GForge; if not, write to the Free Software
23 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
26 require_once('../env.inc.php');
27 require_once $gfwww.'include/pre.php';
28 require_once $gfcommon.'include/account.php';
30 $confirm_hash = getStringFromRequest('confirm_hash');
33 // XXX ogi: What's $ch?
34 $confirm_hash = getStringFromRequest('ch');
40 $confirm_hash = html_clean_hash_string($confirm_hash);
42 $res_user = db_query_params ('SELECT * FROM users WHERE confirm_hash=$1',
43 array($confirm_hash)) ;
45 if (db_numrows($res_user) > 1) {
46 exit_error("Error","This confirm hash exists more than once.");
48 if (db_numrows($res_user) < 1) {
49 exit_error("Error","Invalid confirmation hash.");
52 $row_user = db_fetch_array($res_user);
53 $user =& user_get_object($row_user['user_id'], $res_user);
54 if (!$user || !is_object($user)) {
55 exit_error('Error','Could Not Get User');
56 } elseif ($user->isError()) {
57 exit_error('Error',$user->getErrorMessage());
60 $all=getStringFromRequest('all');
61 $user->unsubscribeFromMailings($all);
63 site_header(array('title'=>_("Unsubscription Complete")));
67 $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'));
69 $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'));
73 <h2>Unsubscription Complete</h2>
78 <p><?php echo util_make_link ("/", _('Return')); ?></p>