<?php
# ---------------------------------------------------------------------
# truc is a tool for requirement and use case tracking
# Copyright (C) 2006 ASDIS - http://sf.net/projects/truc
#
# (rth) Initial truc version based on rth
#       Copyright (C) 2005 George Holbrook - rth@lists.sourceforge.net
#
# This program is distributed under the terms and conditions of the GPL
# See the README and LICENSE files for details
#----------------------------------------------------------------------

# Access global object g_timer for debug
global $g_timer;

# Check if user is logged in
auth_authenticate_user();

# connect to users project db
$db = ADONewConnection(DB_TYPE);
$db->debug = false;

$s_project_properties = session_get_project_properties();
//$s_db_name = $s_project_properties['dbname'];
$s_db_name = 'TMS';

if ( empty($s_db_name) ) {

	trigger_error(PROJECT_DB_NOT_SET, E_USER_ERROR);
}

$g_timer->mark_time( "Connect to " . $s_db_name . " database" );

$db->Connect(DB_HOST, DB_LOGIN, DB_PWORD, $s_db_name);

$g_timer->mark_time( "Finished connect to " . $s_db_name . " database" );
?>