ELITE
> Authenticate
////////////////////////////////////////////////////////////////////////////
// calendar.php
// $Id: calendar.php 28 2006-04-01 23:38:13Z mootinator $
//
// ltwCalendar 'switchboard'
// This file is the one exposed to the web and has minimal functionality
// built in
////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////
// include the configuration file and core classes.
// note the classes file is included AFTER 'include_dir' is defined
// by the config file.
///////////////////////////////////////////////////////////////////////
//the following lines are added for backwards compatibility for pre 4.1.0 PHP versions..
if ( !isset($_POST) ) $_POST = $HTTP_POST_VARS;
if ( !isset($_REQUEST) ) $_REQUEST = $HTTP_GET_VARS;
//end backward compatibility
// Set the default up to a display of this month
if ( !isset($_REQUEST['display']) ) $_REQUEST['display'] = "month";
if ( !isset($_REQUEST['timestamp']) ) $_REQUEST['timestamp'] = time();
validate_number($_REQUEST['timestamp'], 'timestamp');
switch( $_REQUEST['display'] ){
case 'admin':
// All Admin tasks here
switch( $_REQUEST['task'] ){
case 'changepw':
require_once($ltw_config['include_dir'].'/ltwpwmgr.php');
$pw = new ltwPwMgr;
$pw->manage();
break;
case 'delete':
require_once($ltw_config['include_dir'].'/ltweventmgr.php');
$event = new ltwEventMgr($_REQUEST['timestamp']);
$event->delete($_REQUEST['id']);
break;
case 'edit':
require_once($ltw_config['include_dir'].'/ltweventmgr.php');
$event = new ltwEventMgr($_REQUEST['timestamp']);
$event->edit($_REQUEST['id']);
break;
case 'login':
$auth = new ltwAuth;
$auth->login();
break;
case 'logout':
$auth = new ltwAuth;
$auth->logout();
break;
case 'users':
require_once($ltw_config['include_dir'].'/ltwusermgr.php');
$users = new ltwUserMgr;
$users->manage();
break;
} //end admin switch($task)
break;
default:
header('location:index.php');
}//end switch
//Flush output buffer
ob_end_flush();
//Simple integer input validation
function validate_number($untrusted_input, $variable_name)
{
if (!preg_match('/^\d{0,10}$/', trim($untrusted_input)))
{
die ("Unable to display calendar due to bad input :" . $variable_name . " -> " . htmlentities($untrusted_input));
}
}
?>
include('panel/footerpanel.php'); ?>
|