Location: PHPKode > projects > Course/control Reserves Mgmt. System > cc-0.7/coursecontrol/index.php
<?php
/*
course/control is a reserves management system

Copyright (c) 2002 Emory University General Libraries

Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:

The above copyright notice and this permission notice shall be included
in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Created by Ross Singer (hide@address.com)

course/control is located at:
http://coursecontrol.sourceforge.net/

This is version:
    0.7
*/

// Our Authentication sets the user name.

if (!empty($_SERVER["REMOTE_USER"])) {
	$user = $_SERVER["REMOTE_USER"];

// Load the configuration file.
require('/usr/local/apache/conf/coursecontrol_configuration.php');

// Load the functions needed to function at a basic level
require('classes/common.class');
$common = new Common;

// Connect to the reserves database
$conn = $common->dbConnect("on", "wwwuser");

// Get the basic vars needed at a fundamental level.
list($command, $role, $skin) = $common->globalizer(array("command", "role", "skin"));

?>
<head>
<title>c o u r s e c o n t r o l : r e s e r v e s  m a n a g e m e n t</title>

</head>

<html>


<?php

if($command == "userEdit") {
    $common->userEdit();
}

// Staff are located in a different table.
if($role == "staff") {
    list($myId, $fname, $lname, $skin) = $common->staffExists();
} else {
    list($myId, $fname, $lname) = $common->userExists();
}

// Set a "default" skin if none is specified	
if(!$skin) {
    $skin = "default";
}

// Call the header	
include("skins/$skin/header.html");

    
$fullname = $fname . " " . $lname;


?>

<TABLE WIDTH=100% CELLPADDING=3 CELLSPACING=0>
<TR>
<TD>
<TABLE WIDTH=100%>
<?

// Create the navbar.
$common->topNav();

?>
</TABLE>
</TD>
</TR>
</TD>
<TD VALIGN=TOP>
<?
if(!$command) {
    // Show the default page view for faculty or staff
    if($role == "staff") {
	include('objects/staff.object');
    } else {
	include ('objects/main.object');
    }

} else {
    // Call the proper page view for requested command.
    include ('objects/' . $command . '.object');

}
?>
</TD></TR>
</TABLE>

<?
// Call the footer.
include("skins/$skin/footer.html");

} else {
// No Auth, no course/control.
include("skins/default/header.html");

echo("<p ALIGN=CENTER><b>You are not authorized to use course/control</b><p>\n");

include("skins/default/footer.html");


}
?>
Return current item: Course/control Reserves Mgmt. System