">
"; } } else if(isset($_GET['notify'])) { $notify = $_GET['notify']; if($notify=="1") { echo "Error: User not found"; } else if($notify=="2") { echo "Error: Incorrect password provided"; } else if($notify=="3") { echo "Error: Please fill out all the text boxes"; } else if($notify=="4") { echo "Error: The provided passwords did not match"; } else if($notify=="5") { echo "Error: Special characters cannot be used in your username"; } else if($notify=="6") { echo "Error: This username is already in use"; } else { echo "Error: unknown error... this is quite unusual..."; } } else if(isset($_GET['do'])) { $do = $_GET['do']; // Server admin can just delete ssb_db /*if($do=="clean") { if($_POST['password']!="" && $_POST['password']==$pw) { $db_content = glob("ssb_db/" . '*', GLOB_MARK); foreach($db_content as $file) { unlink($file); } rmdir("ssb_db"); echo "Database Cleaned
"; } else { echo "ERROR: Wrong Password
"; } }*/ // grab session values and send friend request functions. if($do=="create-medium") { if (!isset($_SESSION['svmm-user']) || !isset($_SESSION['svmm-pass'])) { loginForm(); } else { include("svmm_db/users/$username.php"); if(!file_exists("svmm_db/disks/$userid.img")) { if(!copy("svmm_db/disks/alpine.img", "svmm_db/disks/$userid.img")) { echo "Error copying new disk image to user location... Please contact the system administrator!"; } else { // Trigger event to start VM! file_put_contents("svmm_db/events/$userid", "./machine start-medium $userid"); file_put_contents("ssvm_db/users/$userid.type", "medium"); echo "VM created! Refer to the user management panel for start / up info."; } } else { echo "Error: VM exists, please click "Manage" to start / stop your VM or to download a disk backup."; } } } // For real VMs if($do=="create-mini") { if (!isset($_SESSION['svmm-user']) || !isset($_SESSION['svmm-pass'])) { loginForm(); } else { include("svmm_db/users/$username.php"); if(!file_exists("svmm_db/disks/$userid.img")) { if(!copy("svmm_db/disks/slitaz.img", "svmm_db/disks/$userid.img")) { echo "Error copying new disk image to user location... Please contact the system administrator!"; } else { // Trigger event to start VM! file_put_contents("svmm_db/events/$userid", "./machine start-mini $userid"); file_put_contents("svmm_db/users/$userid.type", "mini"); echo "VM created! Refer to the user management panel for start / up info."; } } else { echo "Error: VM exists, please click "Manage" to start / stop your VM or to download a disk backup."; } } } if($do=="start") { if (!isset($_SESSION['svmm-user']) || !isset($_SESSION['svmm-pass'])) { loginForm(); } else { include("svmm_db/users/$username.php"); if(file_exists("svmm_db/disks/$userid.img")) { if(!file_exists("svmm_db/users/$userid.pid.statuscode")) { echo "Pending: VM is pending creation, this process shouldn't take longer than 30 seconds..."; } else { $vmstatus = file_get_contents("svmm_db/users/$userid.pid.statuscode"); if($vmstatus == "false") { $vmtype = file_get_contents("svmm_db/users/$userid.type"); if(!file_exists("svmm_db/users/$userid.type") || $vmtype == "medium") { file_put_contents("svmm_db/events/$userid", "./machine start-medium $userid"); } else if($vmtype == "mini") { file_put_contents("svmm_db/events/$userid", "./machine start-mini $userid"); } header("Location: index.php?do=manage"); } else { echo "VM already running..."; } } } else { echo "ERROR: VM not found!"; } } } if($do=="stop") { if (!isset($_SESSION['svmm-user']) || !isset($_SESSION['svmm-pass'])) { loginForm(); } else { include("svmm_db/users/$username.php"); if(file_exists("svmm_db/disks/$userid.img")) { if(!file_exists("svmm_db/users/$userid.pid.statuscode")) { echo "Pending: VM is pending creation, this process shouldn't take longer than 30 seconds..."; } else { $vmstatus = file_get_contents("svmm_db/users/$userid.pid.statuscode"); if($vmstatus == "true") { file_put_contents("svmm_db/events/$userid", "./machine stop $userid"); header("Location: index.php?do=manage"); } else { echo "VM already stopped..."; } } } else { echo "ERROR: VM not found!"; } } } if($do=="delete") { if (!isset($_SESSION['svmm-user']) || !isset($_SESSION['svmm-pass'])) { loginForm(); } else { include("svmm_db/users/$username.php"); if(file_exists("svmm_db/disks/$userid.img")) { $vmstatus = file_get_contents("svmm_db/users/$userid.pid.statuscode"); if($vmstatus == "true") { file_put_contents("svmm_db/events/$userid", "./machine del $userid"); sleep(2); unlink("svmm_db/users/$userid.pid.status"); unlink("svmm_db/users/$userid.pid.statuscode"); header("Location: index.php"); } else { unlink("svmm_db/users/$userid.pid.status"); unlink("svmm_db/users/$userid.pid.statuscode"); unlink("svmm_db/pids/$userid.pid"); unlink("svmm_db/disks/$userid.img"); header("Location: index.php"); } } else { echo "ERROR: VM not found!"; } } } if($do=="manage") { if (!isset($_SESSION['svmm-user']) || !isset($_SESSION['svmm-pass'])) { loginForm(); } else { include("svmm_db/users/$username.php"); if(file_exists("svmm_db/disks/$userid.img")) { if(!file_exists("svmm_db/users/$userid.pid.status")) { echo "Please wait: VM is being created, this process shouldn't take longer than 30 seconds..."; // Refresh the page every 5 seconds for updates on the VM status. echo ""; } else { echo $username . "'s VM
VM status: "; $vmstatus = file_get_contents("svmm_db/users/$userid.pid.status"); echo $vmstatus; echo "
Start Stop Delete
"; echo "The VM manipulation functions above take time to process, the page will update within 1 minute"; echo "

"; echo "Connection information (Via SSH):
"; echo ""; echo ""; echo ""; echo "
IP/Port: cddo.cf/" . $userid . "22
Default username: user
Default user password: user
Default root password: root

"; echo "Available ports for use:"; echo ""; echo ""; echo ""; echo ""; //echo ""; echo ""; echo ""; echo "
Server side portExternal port (viewable)
21" . $userid . "21
22" . $userid . "22
80" . $userid . "80
25565" . $userid . "65
6666" . $userid . "66
6667" . $userid . "67
"; // Refresh the page every 5 seconds for updates on the VM status. echo ""; } } else { echo "ERROR: VM not found!"; } } } if($do=="about") { echo "

About

"; echo "

" . $desc; echo "
If anyone runs into any issues with the FreeBox services, or wants to request a registration code; please reach out at cddo [at] riseup [dot] net.
"; echo "
If you enjoy the FreeBox services, please consider donating!"; echo '

'; } if($do=="login") { $username = $_POST['username']; if(file_exists("svmm_db/users/$username.php")) { include_once("svmm_db/users/$username.php"); if($user_password==sha1(md5($_POST['password']))) { $pass = $user_password; $user = $username; $color = $user_color; $_SESSION['svmm-user'] = $user; $_SESSION['svmm-pass'] = $pass; header("Location: index.php"); } else { echo "Wrong password!"; } } else { echo "User $username not found!"; } } if($do=="logout") { $_SESSION['svmm-user'] = null; $_SESSION['svmm-pass'] = null; header("Location: index.php?forms=login"); } if($do=="register") { if($_POST['username']!="" && $_POST['password']!="" && $_POST['password-again']!="" && $_POST['fullname']!="" && isset($_POST['email']) && $_POST['email']!="") { if($_POST['password']==$_POST['password-again']) { if(!preg_match('/[^a-z0-9]/i', $_POST['username'])) { if(!file_exists("svmm_db/users/" . $_POST['username'] . ".php")) { $vpscount = file_get_contents("svmm_db/users/usercount"); if($vpscount < $maxvm) { if(filter_var($_POST['email'], FILTER_VALIDATE_EMAIL)) { if(stripslashes(htmlentities($_POST['codeword'])) == $panelpass) { $vpscount = $vpscount + 1; file_put_contents("svmm_db/users/usercount", $vpscount); file_put_contents("svmm_db/users/" . stripslashes(htmlentities($_POST['username'])) . ".php", ""); header("Location: index.php"); } else { echo "ERROR: Registration code incorrect, please try again!"; } } else { echo "ERROR: Email is invalid!"; } } else { echo "ERROR: VPS cap reached!"; } } else { header("Location: index.php?notify=6"); } } else { header("Location: index.php?notify=5"); } } else { header("Location: index.php?notify=4"); } } else { header("Location: index.php?notify=3"); } } } else if (!isset($_SESSION['svmm-user']) || !isset($_SESSION['svmm-pass'])) { header("Location: index.php?do=about"); } else { include("svmm_db/users/$username.php"); if(!file_exists("svmm_db/disks/$userid.img")) { echo "

Free VPS creation

"; echo "

Each user will have the ability to create a VM, and will have a consistent uptime unless FreeBox ends up being disabled due to malicious users improperly using the virtual machines.

"; echo "
Best VM for IRC bouncers / session idling CLI IRC clients. Great for small websites and some development.

"; echo "
  • CPU: 10% of 1x Xeon E5649 core
  • RAM: 48MB dedicated
  • Disk: 500MB dedicated space
  • OS: SliTaz GNU/Linux
  • Network: 10mbps down + 5mbps upload
  • Select available ports for server operation
"; echo ""; echo "
Best VM for development / IRC server hosting / FTP server hosting. Awesome for hosting source tarballs, websites, forums, git repo, and more!"; echo "
  • CPU: 25% of 1x Xeon E5649 core
  • RAM: 192MB dedicated
  • Disk: 10GB dedicated space
  • OS: Alpine GNU/Linux
  • Network: 10mbps down + 5mbps upload
  • Select available ports for server operation
"; echo ""; echo "
"; } else { echo "

You've been assigned a VPS, click "Manage" for more information on your server.

"; } } ?>

Powered By SVMM