Location: PHPKode > projects > ConPortal > conportal/perm_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['perm']) || !intval($_GET['perm'])) {
    header("Location: " . BASE_URL . "permissions.php");
    exit;
}

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

$perm = intval($_GET['perm']);
$info = getPermissionDetails($perm);
?>

<div class='center'>
<h1><?= $info['description'] ?></h1>
<p>Modify the groups that have the privileges bestowed by this permission.</p>
<p>Click 'Modify...' to apply your changes when you're done.</p>
<div style='margin: 1em 0'></div>
<form method='post' action='redirects/perms_modify.php' onsubmit='selectAll()'>
<div>
    <input type='hidden' name='perm' value='<?=$perm?>' />
    <h3>Groups</h3>
<?
    $all = getAllGroups();
    if (!$all) {
?>
<p class='warn'>There are no groups defined.
    <a href='group_add.php'>Add groups</a></p>
<?
    } else {
        $groups = getGroupsForPermission($perm);
        $other_groups = array_diff($all, $groups);
        draw_dual_selects('groups', $other_groups, $groups,
                          'getGroupDetails', 'sortGroupsByName');
    }
?>

<br />
<input type='submit' name='mod_perm' value='Modify...' />
</div>
</form>

<button onclick='javascript:window.history.back()'>Go back a page</button>
</div>

<? xhtml_footer() ?>
Return current item: ConPortal