Location: PHPKode > projects > ConPortal > conportal/redirects/perms_add.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($_POST['user']) && isset($_POST['first']) && isset($_POST['last']) &&
    isset($_POST['primary_group']) && isset($_POST['super'])) {
    if ($_POST['user'] && $_POST['first'] && $_POST['last'] &&
        $_POST['primary_group'] && $_POST['super']) {
        createUser($_POST['user'], $_POST['first'], $_POST['last'],
                   $_POST['primary_group'], $_POST['super'], $_POST['phone'],
                   $_POST['cell'], $_POST['sn'], $_POST['seniority']);
        if (isset($_POST['return_to_page']) && $_POST['return_to_page'])
            header("Location: " . BASE_URL .
                   "register_users.php");
        else
            header("Location: " . BASE_URL . 
                   "display_users.php");
        exit;
    } else {
        # Set session variables that something was missing
    }
}

if (isset($_POST['group_name']) && isset($_POST['group_desc'])) {
    if ($_POST['group_name'] && $_POST['group_desc']) {
        createGroup($_POST['group_name'], $_POST['group_desc'],
                  isset($_POST['primary_group']));
        header("Location: " . BASE_URL . 
               "permissions.php");
        exit;
    } else {

    }
}

if (isset($_POST['perm_name']) && isset($_POST['perm_desc'])) {
    if ($_POST['perm_name'] && $_POST['perm_desc']) {
        createPermission($_POST['perm_name'], $_POST['perm_desc']);
        header("Location: " . BASE_URL .
               "permissions.php");
        exit;
    } else {

    }
}

header("Location: ".$_SERVER['HTTP_REFERER']);
?>
Return current item: ConPortal