SHARE
TWEET

Untitled

a guest Jun 5th, 2017 49 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #!/usr/bin/php
  2. <?php
  3.         ## CONFIG
  4. ## SET LOGIN TO MYSQL HERE
  5. $dbhost = 'localhost';
  6. $dbuser = 'login';
  7. $dbpass = 'pass';
  8. $dbname = 'nickdb';
  9. $nickdbtable = "UserNames";
  10. $conn = @mysql_connect($dbhost, $dbuser, $dbpass);
  11.  
  12. $select = @mysql_select_db($dbname);
  13. if(!$conn) {
  14.     print "Cant Build Connection Database!!";
  15.     exit();
  16. }
  17. if(!$select) {
  18.     print "Check Database Selection!!";
  19.     exit();
  20. }
  21.        
  22.        
  23.        
  24.    
  25. ######DONT EDIT BELOW HERE, UNLESS YOU KNOW WHAT YOU ARE DOING ########################
  26. $arg = $argv[1];     // argument from tcl
  27. if(empty($arg)) {
  28. echo "You missing name here\n";
  29. exit();
  30. } else {
  31.     $getgrp     = "SELECT * FROM ".$nickdbtable." WHERE ftpUser ='$arg'";
  32.     $query      = @mysql_query($getgrp);
  33.     $rows       = @mysql_num_rows($query);
  34.     if($rows == 0) {
  35.         $getgrp     = "SELECT * FROM ".$nickdbtable." WHERE ircUser ='$arg'";
  36.     $query      = @mysql_query($getgrp);
  37.     $rows       = @mysql_num_rows($query);
  38.         if($rows == 0) {
  39.         echo "Cant find either $arg registered as username or ircname\n";
  40.         exit();
  41.  
  42.     }
  43. }
  44.  
  45.     $value = @mysql_fetch_array($query);
  46.     $ftpUser = $value['ftpUser'];
  47.     $ircUser = $value['ircUser'];
  48.     $groups = $value['groups'];
  49.     $flags = $value['flags'];
  50.     $time = $value['time'];
  51.     $time = @date("d M Y H:i",$time);
  52.     $output = "\0038FTP\003 \002".$ftpUser."\002 \0035::\003 \0038IRC\003 \002".$ircUser."\002 \0035::\003 \0038GROUP\003 \002".$groups."\002 \0035::\003 \0038FLAGS\003 \002".$flags."\002 \0035::\003 \0038LAST INVITE\003 \002".$time."\002\n";
  53.     echo $output;
  54. }
  55.  
  56. ?>
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top