So basicly i have a custom php site,
Followed the steps of the intergration tutorial
All users stay as guest after loging in
Login Page
<?php // *******************************
// accesscontrol.php
//
// Login control for site
// *******************************
session_cache_expire( 360 );
if( session_id() == "" ) session_start();
include 'common.php';
include 'db.php';
include 'globals.inc.php';
if( !isset($_SESSION['UID']) & $_POST['username'] == "") {
?><!--==========================FreiChatX===START========================--><!-- For uninstalling ME , first remove/comment all FreiChatX related code i.e below code
Then remove FreiChatX tables frei_session & frei_chat if necessary
The best/recommended way is using the module for installation --><?php $ses=$_SESSION['UID'];
if(!function_exists("freichatx_get_hash")){
function freichatx_get_hash($ses){
if(is_file("/home/buncombe/public_html/freichat/hardcode.php")){
require "/home/buncombe/public_html/freichat/hardcode.php";
$temp_id = $ses . $uid;
return md5($temp_id);
}
else
{
echo "<script>alert('module freichatx says: hardcode.php file not
found!');";
}
return 0;
}
}
?>
<script type="text/javascript" language="javascipt" src="http://buncombenotifier.us/freichat/client/main.php?id=<?php%20echo%20%24ses;?>&xhash=<?php%20echo%20freichatx_get_hash(%24ses);%20?>">
</script><link rel="stylesheet" href="http://buncombenotifier.us/freichat/client/jquery/freichat_themes/freichatcss.php" type="text/css"><!--===========================FreiChatX====END=========================--><title><?php echo $global_title; ?></title><meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"><h1 align="center">Login Required</h1>
<p align="center">You must log in to access this area of the site.</p>
<p>
</p><form method="post" action="<?%20echo%20%24_SERVER%5B'PHP_SELF'%5D?>">
<table align="center"><tr><td align="right">User ID:</td>
<td><input type="text" name="username" size="8"></td>
</tr><tr><td align="right">Password:</td>
<td><input type="password" name="password" size="8"></td>
</tr><tr><td></td>
<td><input type="submit" value=" Log in "></td>
</tr></table></form>
<?php exit;
}
if( !isset($_SESSION['UID']) ) {
$_SESSION['UID'] = $_POST['username'];
$_SESSION['PWD'] = $_POST['password'];
$uid = $_SESSION['UID'];
$pwd = $_SESSION['PWD'];
} else {
$uid = $_SESSION['UID'];
$pwd = $_SESSION['PWD'];
}
dbConnect( $global_dbdata );
$sql = "select * from tblCADUser where cadUsername = '$uid' and cadPassword = md5('$pwd')";
$result = mysql_query($sql);
if (!$result) {
error("A database error occurred while checking your login details. If this error persists, please contact your administrator .");
}
if (mysql_num_rows($result) == 0) {
unset($_SESSION['UID']);
unset($_SESSION['PWD']);
?><title>
<?php echo $global_title; ?> - Access Denied</title>
Access Denied
Your user ID or password is incorrect, or you are not a registered user on this site. To try logging in again, click
here.
<?php exit;
}
$data = mysql_fetch_object($result);
$username = $data->cadUsername;
$accessLevel = $data->cadAccessLevel;
$_SESSION['id']= $data->id;
?>
Index Page
<?php // *******************************
// index.php
//
// Main index
// *******************************
include 'functions.php';
include 'accesscontrol.php';
include_once 'globals.inc.php';
include_once 'common.php';
if (!isset($_GET['class'])) $class = "";
else $class = $_GET['class'];
if (!isset($_GET['function'])) $function = "";
else $function = $_GET['function'];
?><!--==========================FreiChatX===START========================--><!-- For uninstalling ME , first remove/comment all FreiChatX related code i.e below code
Then remove FreiChatX tables frei_session & frei_chat if necessary
The best/recommended way is using the module for installation --><?php $ses=$_SESSION['UID'];
if(!function_exists("freichatx_get_hash")){
function freichatx_get_hash($ses){
if(is_file("/home/buncombe/public_html/freichat/hardcode.php")){
require "/home/buncombe/public_html/freichat/hardcode.php";
$temp_id = $ses . $uid;
return md5($temp_id);
}
else
{
echo "<script>alert('module freichatx says: hardcode.php file not
found!');";
}
return 0;
}
}
?>
<script type="text/javascript" language="javascipt" src="http://buncombenotifier.us/freichat/client/main.php?id=<?php%20echo%20%24ses;?>&xhash=<?php%20echo%20freichatx_get_hash(%24ses);%20?>">
</script><link rel="stylesheet" href="http://buncombenotifier.us/freichat/client/jquery/freichat_themes/freichatcss.php" type="text/css"><!--===========================FreiChatX====END=========================--><title><?php if( $class == "calls" & $function == "manage" && isset($_GET['id']) ) {
include_once 'dbaccess.inc.php';
include_once 'error_process.inc.php';
$id = $_GET['id'];
echo "$global_title - ";
$sql = "select * from tblCallUnits join tblUnit on (tblCallUnits.callUnitsAssigned = tblUnit.unitID) where callUnitsCall = $id ";
$sql .= "and callUnitsActive = 1";
$result = mysql_query( $sql, $db );
if( !$result ) error_process( $db );
for( $x = 0; $x < mysql_num_rows( $result ); $x++ ) {
$data = mysql_fetch_object( $result );
echo "$data->unitCallSign ";
}
} else {
echo $global_title;
}
?>
</title><link rel="StyleSheet" href="dtree.css" type="text/css"><script type="text/javascript" src="dtree.js"></script><table align="center" cellspacing="3" width="100%"><tr><td width="20%" align="center">
<a href="index.php"><?php //<img src="img/logo.jpg" alt="Logo" border=0>?></a>
</td>
<td width="80%">
<h1 align="center"><?php echo $global_title; ?> Administration</h1>
</td>
</tr><tr><td width="20%" valign="top">
<?php include 'menu.inc.php'; ?></td>
<td width="80%" valign="top">
<?php if( $class == "inquiry" & $accessLevel >= 0 ) include 'inquiry.php';
if( $class == "calls" && $accessLevel >= 1 ) include 'calls.php';
if( $class == "address" && $accessLevel >= 2 ) include 'address.php';
if( $class == "reports" && $accessLevel >= 2 ) include 'reports.php';
if( $class == "system" && $accessLevel >= 3 ) include 'system.php';
if( $class == "logout" && $accessLevel >= 0 ) include 'logout.php';
?>
</td>
</tr></table><?php echo $_SESSION['id'] ?>
Any ideas
Thanks in advanced
!!!!