HEX
Server: Apache
System: Linux msm5694.mjhst.com 3.10.0-1160.119.1.el7.x86_64 #1 SMP Tue Jun 4 14:43:51 UTC 2024 x86_64
User: camjab_ssh (1000)
PHP: 5.3.29
Disabled: NONE
Upload Files
File: //home/httpd/mech_ftp/baretube.com/billers/epoch_usermanagement.php
<?
include('../admin/db.php');

if(!$epochPostbackEnabled) { 
	exit("Please enable Epoch postback in script configuration"); 
}

$log = print_r($_REQUEST,true);
file_put_contents($basepath.'/cache/epoch_log.txt',$log."\n\n\r\r",FILE_APPEND);
$_REQUEST = mysql_real_escape_array($_REQUEST); 
$request   = $_POST['command'];

switch($request)
{
	case 'ADD':
		$result = mysqli_query($dblink,"SELECT * FROM users WHERE username = '$_REQUEST[username]'");
		if(mysqli_num_rows($result) > 0) {
			if(mysqli_query($dblink,"UPDATE users SET premium = 1, password = md5('$_POST[password]'), salt = '' WHERE username = '$_REQUEST[username]'")) {
				exit("ADDED $_REQUEST[username]");
			}
			else {
				exit("ERROR"); 
			}
		}
		else {
			if(mysqli_query($dblink,"INSERT INTO users (username, password, premium) VALUES ('$_REQUEST[username]', md5('$_REQUEST[password]'),1)")) {
				exit("ADDED $_REQUEST[username]");	
			}
			else {
				exit("ERROR"); 
			}
		}
	break;
	
	case 'DELETE':
		if(mysqli_query($dblink,"DELETE FROM users username = '$_REQUEST[username]'")) {
			exit("DELETED $_REQUEST[username]");
		}
		else {
			exit("ERROR"); 
		}
	break;
	
	case 'CHECK':
		exit("NOT FOUND");
	break;
	
	default:
		print "Command not recognized.";
	break;
}
?>