Location: PHPKode > projects > ConPortal > conportal/user_modify.php
<?php
/*
 *  ConPortal - Pomona College ITS scheduling appplication
 *  Copyright (C) 2005-2006  Pomona College
 *
 *  This program is free software; you can redistribute it and/or modify
 *  it under the terms of version 2 of the GNU General Public License
 *  as published by the Free Software Foundation.
 *
 *  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; if not, write to the Free Software
 *  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
 */
require_once('standard.php');

if (!isset($_GET['user']) || !intval($_GET['user'])) {
    header("Location: " . BASE_URL . "permissions.php");
    exit;
}

xhtml_header_privileged("Modifying Permissions", 'manage_perms');

$user = intval($_GET['user']);
$info = getUserDetails($user);
?>
<h1 class='center'><?= $info['name'] ?></h1>
<p>On this page, you can change the group memberships of the above user.
 Consultant Groups are <b>*not*</b> displayed on this page. Each user can
 be a member of only one consultant group.</p>
<p>Click 'Modify...' to apply your changes when you're done.</p>
<form method='post' action='redirects/perms_modify.php' onsubmit='selectAll()'>
<div class='center'>
    <input type='hidden' name='user' value='<?=$user?>' />
    <h3>Groups</h3>
<?
    $all = getSecurityGroups();
    if (!$all) {
?>  
<p>There are no security groups defined.
   <a href='group_add.php'>Add groups</a></p>
<?
    } else {
        $all = array_diff($all, array($info['primary_group']));

        $groups = getGroupsForUser($user);
        $other_groups = array_diff($all, $groups);
        draw_dual_selects('groups', $other_groups, $groups,
                          'getGroupDetails', 'sortGroupsByName');
    }
?>

<br />
<input type='submit' name='mod_user' value='Modify...' />&nbsp;&nbsp;
<button onclick='javascript:window.location = "<?= BASE_URL ?>display_users.php"; return false;'>Return to User Management</button>
</div>
</form>
<?
xhtml_footer();
?>
Return current item: ConPortal