Advertisement
Guest User

Untitled

a guest
Jun 21st, 2017
72
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.28 KB | None | 0 0
  1. <?php
  2.     error_reporting(E_ALL & ~E_NOTICE);
  3.     $bannedgroups = array(1, 3, 4, 35, 41);
  4.    
  5.     require_once('./global.php');
  6.     require_once(DIR . '/includes/functions_forumdisplay.php');
  7.    
  8.     if($_GET['message'] == "")
  9.     {
  10.         die('');
  11.     }
  12.    
  13.     if (!empty($blockgroups))
  14.     {
  15.         if (is_member_of($vbulletin->userinfo, $blockgroups))
  16.         {
  17.             die("Authentication Failed");
  18.         }
  19.     }
  20.    
  21.     $usr_userid = $_COOKIE['dv_userid'];
  22.    
  23.     $sv_name = "localhost";
  24.     $username = "USERNAME";
  25.     $password = "Pa$$w0rd";
  26.    
  27.     $db_name = "DATABASE_NAME";
  28.     $table_name = "vb_user";
  29.    
  30.     $con = mysql_connect($sv_name, $username, $password) or die(mysql_error());
  31.     mysql_select_db($db_name, $con) or die(mysql_error());
  32.    
  33.     $query = "SELECT * FROM " . $table_name . " WHERE userid='" . $usr_userid . "'";
  34.    
  35.     $result = mysql_query($query, $con) or die(mysql_error());
  36.     $row = mysql_fetch_array($result);
  37.     mysql_close($con);
  38.    
  39.     if($row['username'] == "")
  40.     {
  41.         die('Authentication Failed');
  42.     }
  43.    
  44.     for($i=0; $i<count($bannedgroups); $i++)
  45.     {
  46.         if($row['usergroupid'] == $bannedgroups[$i])
  47.         {
  48.             die('Authentication Failed');
  49.         }
  50.     }
  51.    
  52.     $fh = fopen("/tmp/sendlog.txt", "a");
  53.     fwrite($fh, str_replace(" ", "^", $row['username']) . " " . str_replace(array(" ", "\n"), "%%^%", $_GET['message']) . "\n");
  54.     fclose($fh);
  55. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement