3 * User's Self-removal Page
5 * Confirmation page for users' removing themselves from project.
7 * Copyright 1999-2001 (c) VA Linux Systems
9 * This file is part of FusionForge. FusionForge is free software;
10 * you can redistribute it and/or modify it under the terms of the
11 * GNU General Public License as published by the Free Software
12 * Foundation; either version 2 of the Licence, or (at your option)
15 * FusionForge is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 * GNU General Public License for more details.
20 * You should have received a copy of the GNU General Public License along
21 * with FusionForge; if not, write to the Free Software Foundation, Inc.,
22 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
25 require_once '../env.inc.php';
26 require_once $gfcommon.'include/pre.php';
28 if (!session_loggedin()) {
32 $group_id = getIntFromRequest('group_id');
34 $group = group_get_object($group_id);
35 if (!$group || !is_object($group)) {
37 } elseif ($group->isError()) {
38 exit_error($group->getErrorMessage(),'my');
45 $roles = RBACEngine::getInstance()->getAvailableRolesForUser (session_get_user()) ;
48 foreach ($roles as $r) {
49 if ($r instanceof RoleExplicit
50 && $r->getHomeProject() != NULL
51 && $r->getHomeProject()->getID() == $group_id
52 && $r->hasPermission ('project_admin', $group_id)) {
59 sprintf (_('You cannot remove yourself from this project, because you are admin of it. You should ask other admin to reset your admin privilege first. If you are the only admin of the project, please consider posting availability notice to <a href="%s">Help Wanted Board</a> and be ready to pass admin privilege to interested party.'),
60 util_make_url ("/people/")
64 if (getStringFromRequest('confirm')) {
66 $user_id = user_getid();
68 if (!$group->removeUser($user_id)) {
69 exit_error($group->getErrorMessage(),'my');
71 session_redirect("/my/");
76 site_user_header(array('title'=>_('Quitting Project')));
79 <h3>'._('Quitting Project').' </h3>
81 '._('You are about to remove yourself from the project. Please confirm your action:').'
87 <form action="'.getStringFromServer('PHP_SELF').'" method="post">
88 <input type="hidden" name="confirm" value="1" />
89 <input type="hidden" name="group_id" value="'.$group_id.'" />
90 <input type="submit" value="'._('Remove').'" />
95 <form action="/my/" method="get">
96 <input type="submit" value="'._('Cancel').'" />
103 site_user_footer(array());
107 // c-file-style: "bsd"