\n"; $eMsg .= "An error occured accessing the database.\n"; $eMsg .= "
\n"; } } else { $err = TRUE; $eMsg = "
\n"; $eMsg .= "Unable to select the database.\n"; $eMsg .= "
\n"; } // check for name/password found -- if so then // get user id and load permissions if ( (FALSE == $err) && ($i_result) && (0 < mysql_num_rows($i_result)) ) { $row = mysql_fetch_object($i_result); if ($row) { // user/password found, Get user name from database $FirstName = $row->FirstName; $LastName = $row->LastName; $SuperUser = "Y" == $row->Superuser ? TRUE : FALSE; $ValidUser = TRUE; $UserID = $row->UserID; if ($SuperUser) { $PermissionCount = 0; } else { // get specific permissions from database $sql = "SELECT * FROM Permissions WHERE UserID = ".$row->UserID; $p_result = mysql_query($sql,$connection); if (!$p_result) { $err = TRUE; $eMsg = "
\n"; $eMsg .= "An error occured accessing the database.\n"; $eMsg .= "
\n"; } if ( (FALSE == $err) && ($p_result) && (0 < mysql_num_rows($p_result)) ) { while ($permissions = mysql_fetch_object($p_result)) { $Company[] = $permissions->Company; $Project[] = $permissions->Project; } } $PermissionCount = count($Company); } } else { if ($connection) { if ($i_result) mysql_free_result($i_result); if ($p_result) mysql_free_result($p_result); mysql_close($connection); } header("Location: login.php3?ShowForm=YES&Error=YES&User=".$User."&ReturnURL=".$ReturnURL); exit; } } $Company[] = ""; $Project[] = ""; // // clean up // if ($i_result) mysql_free_result($i_result); if ($p_result) mysql_free_result($p_result); mysql_close($connection); } else { $err = TRUE; $eMsg = "
\n"; $eMsg .= "Unable to connect to the database.\n"; $eMsg .= "
\n"; } } include "cookies.inc"; ?> \n"; if (empty($ReturnURL)) $ReturnURL = "index.phtml"; if (empty($Error)) $Error = "NO"; if ("NO" != $ShowForm) { //------------------------------------------ // Original Entry //------------------------------------------ // set up the URL to return to after a good // log in response if (empty($User)) $User = ""; // now display the form echo "\n"; } else { if ($err) { echo $eMsg; } else { // display permissions in a table for users info if ($SuperUser) { echo "
| \n";
echo "Hello ".$FirstName." ".$LastName." \n"; echo "You have superuser status, access is granted to all areas of this site. \n"; echo " |
\n";
}
else
{
echo "User = ".$User."
\n";
echo "Password = ".$Password."
\n";
echo "You are ".$FirstName." ".$LastName."
\n"; if(!empty($sql)) echo $sql."
\n";
if (!empty($ValidUser))
{
echo "ValidUser = ".$ValidUser."
\n";
echo "SuperUser = ".$SuperUser."
\n";
echo "Password = ".$Password."
\n";
echo "FirstName = ".$FirstName."
\n";
echo "LastName = ".$LastName."
\n";
echo "User = ".$User."
\n";
echo "PermissionCount = ".$PermissionCount."
\n";
for ($i=0; $i < $PermissionCount; $i++)
{
echo "Company[$i] = ".$Company[$i]."
\n";
echo "Project[$i] = ".$Project[$i]."
\n";
}
}
echo "
| "; echo "Access settings for ".$FirstName." ".$LastName."\n"; echo " | |
|---|---|
| GROUP | AREA |
| ".$Company[$x]." | \n"; echo "".$Project[$x]." | \n"; echo "
\n";
echo "![]() \n"; echo " Contact info@valueeng.com to receive a password or to change your password or access settings. Please be sure to include your full name, company affiliation, and email address. |