moo.php 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. <?PHP
  2. $error5="error5 Przykro nam, serwis jest dostepny wylacznie dla
  3. autoryzowanych uzytkownikow $REMOTE_ADDR";
  4. //$komputery="/home/www/netsatmedia_portal/abonenci/www/komputery";
  5. if(file_exists(".config.php")) include(".config.php");
  6. $czy_error_5=exec("cat $komputery |grep $REMOTE_ADDR");
  7. echo "\$czy_error = '$czy_error', \$komputery = '$komputery'\n";
  8. //echo "$REMOTE_ADDR $komputery $czy_error_5 <br>" ;
  9. if($czy_error_5) {
  10. $ADM_USER=$SQL_USER ;
  11. $ADM_USER_PASS=$SQL_USER_PASS ;
  12. $SQL_TABLE_USERS="USERS2";
  13. $SQL_TABLE_ADMIN_USERS="ADMIN_USERS";
  14. if($test) echo "OK"; else {
  15. $conn=mysql_pconnect($INTERFACE_ADDR,$ADM_USER,$ADM_USER_PASS);
  16. if (!$conn) die("ERROR podczas tworzenia polaczenia do bazy $SQL_DATABASE !\n");
  17. mysql_select_db($SQL_DATABASE) or die("ERROR podczas wyboru bazy!");
  18. $zapSQL="SELECT * FROM $SQL_TABLE_USERS where S_IP='$dana1' LIMIT 0,1 ;";
  19. //echo "$zapSQL";
  20. $result = mysql_query($zapSQL,$conn) or die("Blad zapytania!");
  21. // $user=mysql_fetch_object($result);
  22. // if ((mysql_num_rows($result)>0) && ($user->pass==$PHP_AUTH_PW))
  23. while ($h=mysql_fetch_object($result))
  24. {
  25. echo "$h->S_IP;";
  26. echo "$h->P_NAME;";
  27. echo "$h->S_HOST;";
  28. //echo "$h->S_HW;";
  29. //echo "$h->S_HW;";
  30. //S_HW
  31. if(strstr($h->S_HWSTAT,BLOCK)) echo "BLOCK $h->A_STATUS_INFO $h->S_HW;"; else {
  32. if(strstr($h->S_HW,BLOCK)) {
  33. echo "BLOCK;";
  34. } else {
  35. if(strstr($h->S_HW,FREE)) {
  36. echo "FREE;";
  37. } else echo "$h->S_HW;";
  38. }
  39. }
  40. //S_HWSTAT_DETECT
  41. //S_HW KONIEC
  42. echo "$h->S_ADDRESS_STREET;";
  43. //echo "$h->S_HWSTAT;";
  44. //echo "nowa";
  45. }
  46. }
  47. } else {
  48. echo $error5 ;
  49. }
  50. ?>