Version: , by Atian
Developer Last Online: Dec 2002
Version: Unknown
Rating:
Released: 03-27-2002
Last Update: Never
Installs: 0
No support by the author.
<?php
$usergroupida = 6 ;
$usergroupidb = 7 ;
$usergroupidc = 5 ;
if(!isset($PHP_AUTH_USER)) {
header("WWW-Authenticate: Basic realm=\"Karma Login\"");
header("HTTP/1.0 401 Unauthorized");
echo "Sorry no instant windows network login cancel authority allowed\n";
exit;
} else {
$link = mysql_connect("localhost", "peerbooks_zack", "rpm123123") //mysql server address , login name , password
or die ("Could not connect");
print ("Connected successfully");
echo "<br>";
mysql_select_db ("ffu_vb") //this shouldn't need changing unless you have it in a different database
or die ("Could not select database");
$query = ("SELECT password FROM user WHERE username='$PHP_AUTH_USER'");
$result = mysql_query ($query)
or die ("Query failed");
while ($line = mysql_fetch_array($result)) {
while(list($col_name, $col_value) = each($line)) {
$password = $col_value ;
}
}
if ($password != $PHP_AUTH_PW) {
echo "You must enter a valid login ID and password to access this
resource\n";
exit;
}
else {
mysql_free_result ($result);
$query = "SELECT usergroupid FROM user WHERE username='$PHP_AUTH_USER'";
$result = mysql_query ($query)
or die ("Query failed");
while ($line = mysql_fetch_array($result)) {
while(list($col_name, $col_value) = each($line)) {
$turkpower = $col_value ;
}
}
}
mysql_free_result ($result);
if ($turkpower = 1) {
echo "You are not permitted to do this action. Please go back.\n";
exit;
}
else {
if ($turkpower = 2) {
echo "You are not permitted to do this action. Please go back.\n";
exit;
}
else {
if ($turkpower = 3) {
echo "You are not permitted to do this action. Please go back.\n";
exit;
}
else {
if ($turkpower = 4) {
echo "You are not permitted to do this action. Please go back.\n";
exit;
}
else {
if ($turkpower = 5) {
echo "</p>Welcome: $PHP_AUTH_USER<br>";
}
}
mysql_close ($link);
echo "<form action=\"karma2.php\" method=\"post\">";
echo "<input type=\"hidden\" name=\"auth\" value=\"'yes'\">";
echo "<input type=\"text\" name=\"username\"><br>";
echo "<input type=\"submit\">";
echo "</form>";
}
else {
if ($turkpower = 6) {
echo "</p>Welcome: $PHP_AUTH_USER<br>";
}
}
mysql_close ($link);
echo "<form action=\"karma2.php\" method=\"post\">";
echo "<input type=\"hidden\" name=\"auth\" value=\"'yes'\">";
echo "<input type=\"text\" name=\"username\"><br>";
echo "<input type=\"submit\">";
echo "</form>";
}
else {
if ($turkpower = 6) {
echo "</p>Welcome: $PHP_AUTH_USER<br>";
}
}
mysql_close ($link);
echo "<form action=\"karma2.php\" method=\"post\">";
echo "<input type=\"hidden\" name=\"auth\" value=\"'yes'\">";
echo "<input type=\"text\" name=\"username\"><br>";
echo "<input type=\"submit\">";
echo "</form>";
}
?>
does it work??
Show Your Support
This modification may not be copied, reproduced or published elsewhere without author's permission.