"; }
}
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 "Available ports for use:"; echo "
";
// Refresh the page every 5 seconds for updates on the VM status.
echo "";
}
} else {
echo "ERROR: VM not found!";
}
}
}
if($do=="about")
{
echo "
";
}
else
{
echo "
"; } 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 "
IP/Port: | cddo.cf/" . $userid . "22 |
Default username: | user |
Default user password: | user |
Default root password: | root |
"; echo "Available ports for use:"; echo "
Server side port | External port (viewable) |
21 | " . $userid . "21 |
22 | " . $userid . "22 |
80 | " . $userid . "80 |
25565 | " . $userid . "65 |
6666 | " . $userid . "66 |
6667 | " . $userid . "67 |
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 '
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 "
| Best VM for development / IRC server hosting / FTP server hosting. Awesome for hosting source tarballs, websites, forums, git repo, and more!";
echo "
|
You've been assigned a VPS, click "Manage" for more information on your server.
"; } } ?>Powered By SVMM