isError()) { exit_error($group->getErrorMessage(),'my'); } /* Main code */ $roles = RBACEngine::getInstance()->getAvailableRolesForUser (session_get_user()) ; $isadmin = false ; foreach ($roles as $r) { if ($r instanceof RoleExplicit && $r->getHomeProject() != NULL && $r->getHomeProject()->getID() == $group_id && $r->hasPermission ('project_admin', $group_id)) { $isadmin = true ; } } if ($isadmin) { exit_error( 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 Help Wanted Board and be ready to pass admin privilege to interested party.'), util_make_url ("/people/") ) ,'my'); } if (getStringFromRequest('confirm')) { $user_id = user_getid(); if (!$group->removeUser($user_id)) { exit_error($group->getErrorMessage(),'my'); } else { session_redirect("/my/"); } } site_user_header(array('title'=>_('Quitting Project'))); echo '
'._('You are about to remove yourself from the project. Please confirm your action:').'