array(1=>"DopeKid Server 1","123.456.789","DopeKid","5"), */ $server_lists_array=array( 1=>array(1=>"BlackVPN","xxxxxxxxx","saC090988lanun","3"), ); /* Service Variables */ $port_ssh= '22, 143, 90'; // SSH Ports $port_dropbear= '109, 110, 442'; // Dropbear Ports $port_ssl= '444'; // SSL Ports $port_squid= '3128, 8080, 8000, 3128'; // Squid Ports $ovpn_client= ''.$hosts.'/black.ovpn'; // OpenVPN Client Config /* Dont Edit Anything After This Line*/ for ($row = 1; $row < 101; $row++) { if ( $_POST['server'] == $server_lists_array[$row][1] ) { $hosts= $server_lists_array[$row][2]; $root_pass= $server_lists_array[$row][3]; $expiration= $server_lists_array[$row][4]; break; } } $error = false; if (isset($_POST['user'])) { $username = trim($_POST['user']); $username = strip_tags($username); $username = htmlspecialchars($username); $password1 = trim($_POST['password']); $password1 = strip_tags($password1); $password1 = htmlspecialchars($password1); $nDays = $expiration; $datess = date('m/d/y', strtotime('+'.$nDays.' days')); $password = escapeshellarg( crypt($password1) ); if (empty($username)) { $error = true; $nameError = "Please Enter A Username"; } else if (strlen($username) < 3) { $error = true; $nameError = "Name Must Have Atleast 3 Characters."; } if (empty($password1)) { $error = true; $passError = "Please Enter A Password."; } else if(strlen($password1) < 3) { $error = true; $passError = "Password Must Have Atleast 3 Characters."; } if($username == $password1) { $error = true; $ConfirmError = "Username and Password Should Not Be The Same "; } if( !$error) { date_default_timezone_set('UTC'); date_default_timezone_set("Asia/Kuala_Lumpur"); $my_date = date("Y-m-d H:i:s"); $connection = ssh2_connect($hosts, 22); if (ssh2_auth_password($connection, 'root', $root_pass)) { $check_user = ssh2_exec($connection, "id -u $username"); $check_user_error = ssh2_fetch_stream($check_user, SSH2_STREAM_STDERR); stream_set_blocking($check_user_error, true); stream_set_blocking($check_user, true); $stream_check_user_error = stream_get_contents($check_user_error); $stream_check_user = stream_get_contents($check_user); if ( !empty($stream_check_user)) { $ServerError = "Username Already Taken"; } elseif ( !empty($stream_check_user_error)) { $check_daily_limit = ssh2_exec($connection, "wc -l < /home/vps/public_html/daily_user_limit.txt"); $check_daily_limit_error = ssh2_fetch_stream($check_user, SSH2_STREAM_STDERR); stream_set_blocking($check_daily_limit_error, true); stream_set_blocking($check_daily_limit, true); $stream_check_daily_limit_error = stream_get_contents($check_daily_limit_error); $stream_check_daily_limit = stream_get_contents($check_daily_limit); if ($stream_check_daily_limit >= $daily_limit_user) { $ServerError = "Server Full, Try Again Tomorrow"; } else { $show = true; ssh2_exec($connection, "useradd $username -m -p $password -e $datess -d /tmp/$username -s /bin/false"); ssh2_exec($connection, 'echo "====================" >> /home/vps/public_html/daily_user_limit.txt'); } } } else { die('Connection Failed...'); } } } ?>