3 * Copyright 2011, Sabri LABBENE - Institut Télécom
6 * This file is part of FusionForge.
8 * FusionForge is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License as published by
10 * the Free Software Foundation; either version 2 of the License, or
11 * (at your option) any later version.
13 * FusionForge is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
18 * You should have received a copy of the GNU General Public License along
19 * with this program; if not, write to the Free Software Foundation, Inc.,
20 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
23 require_once '../../../env.inc.php';
24 require_once $gfwww.'include/pre.php';
26 $account_id = getStringFromRequest('account_id');
27 $user_id = getStringFromRequest('user_id');
29 $user = session_get_user();
30 if($user->getID() != $user_id) {
31 session_redirect( '/plugins/globaldashboard/admin/manage_accounts.php?type=user&id='.$user_id.'&pluginname=globaldashboard&error_msg='. urlencode(_('You can remove only YOUR remote accounts !!!')));
34 $t_account_table = "plugin_globaldashboard_user_forge_account";
35 $t_query = "DELETE FROM $t_account_table WHERE account_id=$1 AND user_id=$2";
37 $result = db_query_params($t_query, array($account_id, $user_id));
39 session_redirect( '/plugins/globaldashboard/admin/manage_accounts.php?type=user&id='.$user_id.'&pluginname=globaldashboard&feedback='. urlencode(_('Remote Account successfully deleted')));
41 session_redirect( '/plugins/globaldashboard/admin/manage_accounts.php?type=user&id='.$user_id.'&pluginname=globaldashboard&error_msg='. urlencode(_('Unable to delete remote account: ').db_error()));