Location: PHPKode > projects > ConPortal > conportal/permissions.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');
xhtml_header_privileged('Adding Groups/Permissions', 'manage_perms');

$perms  = getPermissions();
foreach($perms as $key => $perm)
	$perms[$key] = getPermissionDetails($perm);
$perms = sortPermissionsByName($perms);

$groups = getAllGroups();
foreach ($groups as $key => $group)
	$groups[$key] = getGroupDetails($group);
$groups = sortGroupsByName($groups);

?>
<div class='center'>
<h1>Groups</h1>
<?
if (!count($groups))
    echo "    <div class='impt'>None</div>\n";
else {
?>
<table class='permsTable'>
    <tr><th>Group Name</th><th>Description</th></tr>
<?
    $i = 0;
    foreach ($groups as $group)
	{
        echo "<tr class='d".($i++ % 2)."'>".
             "<td><a href='group_modify.php?group=".$group['pid']."'>".
                $group['name']."</a></td>".
             "<td>".$group['description']."</td>".
             "<td class='noBorder'>".
                "<a href='group_delete.php?group=".$group['pid']."'>".
                "Delete</a></td>".
             "</tr>\n";
    }
?>
</table>
<?
}
?>
<a href='group_add.php'>New Group</a>
</div>

<br /><hr /><br />

<div class='center'>
<h1>Permissions</h1>
<?
if (!count($perms))
    echo "    <div class='impt'>None</div>\n";
else {
?>
<table class='permsTable'>
    <tr><th>short name</th><th>Description</th></tr>
<?
    $i = 0;
    foreach ($perms as $perm)
	{
        echo "    <tr class='d".($i++%2)."'>".
             "<td><a href='perm_modify.php?perm=".$perm['pid']."'>".
                $perm['name']."</a></td>".
             "<td>".$perm['description']."</td>".
             "<td class='noBorder'>".
                "<a href='perm_delete.php?perm=".$perm['pid']."'>".
                "Delete</a></td>".
             "</tr>\n";
    }
?>
</table>
<?
}
?>
<a href='perm_add.php'>New Permission</a>
</div>

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