Location: PHPKode > projects > Meeting Request Scheduling and Booking System > mrsbs/php/lib/mrsbs.inc
<?PHP

   // Common include file
   //
   // Version: $Revision: 1.9 $
   // Date: $Date: 2008/06/17 23:42:53 $
   //
   // Copyright (c) 2006 - 2008 Benjamin Oshrin
   // License restrictions apply, see LICENSE for details.

// Set the package version

$pkgvers = "1.1.1";

// Determine include directory

$topdir = dirname(__FILE__) . "/";

// Get configurations
include($topdir.'config.inc');

// Get message texts
include($topdir.'texts.'.$config['lang'].'.inc');

// Get functions
include($topdir.'functions.php');

// Get database stuff
include($topdir.'database.inc');

// ICS utility
ini_set('include_path',ini_get('include_path').':' . $topdir . '../bennu/lib:');
include($topdir.'../bennu/lib/bennu.inc.php');

// Mail utility
require_once($topdir.'Mail.php');

// Start session -- database stuff must be included first!

if(!isset($cli_mode))
{
  include_once($topdir.'../adodb/session/adodb-session2.php');
  $session_options['table'] = 'mrsbs_session_info';
  ADOdb_Session::config($config['db'],
			$config['dbhost'],
			$config['dbuser'],
			$config['dbpass'],
			$config['dbname'],
			$session_options);

  session_start();
}

// Setup auth stuff
include($topdir.'auth.'.$config['auth'].'.inc');

// If auth is required, invoke it now
if(isset($auth_required) && $auth_required == 1)
{
  if(!isset($_SESSION['contactid']))
  {
    // Depending on how auth_handler works, we might get here with
    // some but not all session variables set.  If we have a mail
    // address but not a contactid, skip auth_handler and lookup
    // the user.
    
    if(($_SESSION['mail'] != "")
       || auth_handler())
    {
      // We need to find the contactid for this user

      if(isset($_SESSION['mail']))
      {
	$u = lookup_user_by_email($_SESSION['mail']);
	
	if($u)
	{
	  $_SESSION['contactid'] = $u['contactid'];
	  $_SESSION['givenname'] = $u['givenname'];
	  $_SESSION['sn'] = $u['sn'];
	}
	else
	  exit($tx['ct.err.notfound']);
      }
      else
	exit($tx['op.err.badparam']);
    }
    else
      exit($tx['op.err.perm']);
  }
}

// Get style sheets
if(!isset($cli_mode) && !isset($noheader_mode))
  include($topdir.'style.css');

// Import GET or POST variables.  This removes the need to figure out if
// we were accessed via one or the other.  We could also add <c>ookies.
// The later letters take precedence.
import_request_variables("gp", "rvar_");

?>
Return current item: Meeting Request Scheduling and Booking System