Copyright (C) 2005 James Grant Copyright (C) 2007 David Grant This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; see the file COPYING. If not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ ?> {$user_what['volunteer']}"; //onClick=\"return confirm('Are you sure you want to also be a {$user_what[$type]}?')\" echo ''; return 1; } return 0; } if($action == 'add') { send_header("Select Additional Roles"); $u = user_load($_SESSION['users_id']); //only display the named greeting if we have their name echo i18n("Hello %1",array($_SESSION['name'])); echo "
"; echo "
"; echo i18n('Your account is currently in the following roles').':'; echo ''; echo i18n('Adding a role to your account WILL NOT delete anything in your account or any existing roles you have. It will only add a new role to your account.'); echo '

'; echo i18n('When you add a new role to your account you will be automatically logged out. To complete the process please log back in using your existing email and password.'); echo '

'; echo i18n('Select a Role to add to your account'); echo ':'; echo ''; send_footer(); exit; } if(count($u['types']) <= 1) { /* This user doesn't have multiple roles, send them to their * proper page */ header("location: {$_SESSION['users_type']}_main.php"); exit; } if($action == 'switch') { /* Validate the input */ $type = $_GET['type']; if(!in_array($type, $user_types)) { header("location: {$_SESSION['users_type']}_main.php"); exit; } /* Make sure the user is actually allowed to be in the * requested role */ if(!in_array($type, $u['types'])) { header('location: user_multirole.php'); exit; } /* Switch roles, and forward the user to the * appropriate mainpage */ $_SESSION['users_type'] = $type; header("location: {$type}_main.php"); exit; } send_header("Choose a Role"); switch($_GET['notice']) { case 'already_logged_in': echo error(i18n('You are already logged in, please use the [Logout] link in the upper right to logout before logging in as a different user')); break; } //only display the named greeting if we have their name echo i18n("Hello %1",array($_SESSION['name'])); echo "
"; echo "
"; echo i18n('Your account has more than one role associated with it, please select a role from the links below.'); echo "
"; echo "
"; foreach($user_types as $t) { if(in_array($t, $u['types'])) { echo "{$user_what[$t]}
"; echo "
"; } } send_footer(); ?>