Complex Server Manager [In-Progress]

Status
Not open for further replies.

EscuderoKevin

Well-Known Member
Jul 2, 2015
380
181
130
Hi friends

im from Argentina, i not good coder but i try.

New Panel for R4p3 users.

Complex Server Manager.

Login System ( Reset Password , email Validation)
Based in MYSQL (PDO)

Dashboard
  • Simple Table Viewer
  • Account Details
Server
  • Edit Details
  • Viewer HTML
  • Global Message
  • Ban List (Can Remove)
Clients
  • Kick 1
  • Kick All
  • Send Message
  • Ban Client
  • Client List
  • Edit Client (Server Groups & Description)
Channels
  • Create Channel (Can Spacer)
  • Delete Channel
  • Channel List (Can edit)
Tokens & ServerGroups
  • Generate Token
  • Token List
  • ServerGroups List

This Panel its made for User , vip & Admin.

Vip Area (VIP FEATURES)
  • Backup System
  • Generate Backup
  • Restore Backup
  • Reset Server (05/08/2016)
  • Support Tickets
  • Support Chat
  • TSDNS System
  • Change Host Banner & URL
  • Adverstiments in lobby channel
  • More Than 50 Slots
Admin Area:
  • Dashboard
  • Servers List
  • Total Clients
  • Uptime
  • Client List ( PANEL )
  • Edit Client ( PANEL )
  • Create Server
  • Edit Server
  • Delete Server
  • Create Client & Server
  • Delete Client & Server
  • Global Message
  • Server Message
  • Cron Message
  • Support Area (Can Response )
  • Chat (Can Chat)

I08yNcx.png

fERcFZN.png


  1. [*]Server Transfer Thanks @JetFox I gonna create Complex Multi-Serv Manager
  2. Server Reset In Backup Zone. Thanks @Alligatoras
Credits:
TSStatus: Teamspeak 3 viewer for php5 * @author Sebastien Gerard
Theme: Almsaeed Studio
Developer: EscuderoKevin & R4P3 users.

I will finish soon. -.-

Ideas and suggestions are open to all.

Thanks.


EDIT 22/09

I post all files. HERE IN MY GITHUB

Its not finish but i continue working there.

SQL:

Code:
-- phpMyAdmin SQL Dump
-- version 4.0.10.14
-- http://www.phpmyadmin.net
--
-- Servidor: localhost:3306
-- Tiempo de generación: 22-09-2016 a las 03:56:49
-- Versión del servidor: 5.6.31
-- Versión de PHP: 5.6.20

SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";


/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8 */;

CREATE TABLE IF NOT EXISTS `tbl_users` (
  `userID` int(11) NOT NULL AUTO_INCREMENT,
  `userName` varchar(100) NOT NULL,
  `userEmail` varchar(100) NOT NULL,
  `userPass` varchar(100) NOT NULL,
  `userStatus` enum('Y','N') NOT NULL DEFAULT 'N',
  `tokenCode` varchar(100) NOT NULL,
  `port` varchar(65) NOT NULL DEFAULT '9987',
  `vip` int(11) NOT NULL DEFAULT '1',
  `admin` int(11) NOT NULL DEFAULT '1',
  `slots` int(32) NOT NULL DEFAULT '32',
  `voa` int(1) NOT NULL DEFAULT '0',
  `date` date DEFAULT NULL,
  `registerIP` varchar(264) NOT NULL,
  PRIMARY KEY (`userID`),
  UNIQUE KEY `userEmail` (`userEmail`)
) ENGINE=InnoDB  DEFAULT CHARSET=latin1 AUTO_INCREMENT=5 ;

--
-- Volcado de datos para la tabla `tbl_users`
--

INSERT INTO `tbl_users` (`userID`, `userName`, `userEmail`, `userPass`, `userStatus`, `tokenCode`, `port`, `vip`, `admin`, `slots`, `voa`, `date`, `registerIP`) VALUES
(4, 'EscuderoKevin', '[email protected]', 'a796e80ac3e27000bc1c8d4b56989af6', 'Y', '4d8460bc3d757c9e1379cd563346aec9', '9965', 1, 1, 80, 0, '2016-08-01', '');

/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;

User: [email protected]
pass: 1234lol

rRb1gvJ.png

UserID: ID
UserName: Only Name.
UserEmail: Login & Email.
UserPass: MD5 ENCODED.
UserStatus: Y - ACTIVE (EMAIL VALIDATE) N - INACTIVE CANT LOGIN - EMAIL NOT VALIDATED.
tokenCode: For Validate Email.
Port: SERVER PORT
Vip: 1 or 0 , ITS VIP OR NO.
Admin: 1 or 0 , ITS ADMIN OR NO
Voa: Future Use.
Date: Register Date. (Future Use)
RegisterIP: Register IP. (Future Use)


for Test: edit all files in configs and class.user & class.user.sub in functions.

Sorry about that , i will finish this Week :) i gonna update im my github , then Upload Finish here in forum.
 
Last edited:

JetFox

Active Member
Sep 25, 2015
175
76
73
Nice job!
Suggestion: Try to make a server transfer.
Note: Looks from pictures its based off a 1-IP Configuration server? (Only seeing port not IP in server details)
 

JetFox

Active Member
Sep 25, 2015
175
76
73
Nice idea. its not easy but not impossible -.-
Might be able to make my code better, some reason it wouldn't work without a little sleep delay.

Code:
 public static function transferServer($transferIP)
  {
      require_once("Commands/libraries/TeamSpeak3/TeamSpeak3.php");
      ## Connect for first variables
        $sql = self::$dbh->prepare("SELECT `ip`, `query`, `user`, `password`  FROM `". self::$config['db']['servers'] ."` WHERE `ip`=:ip");
        $sql->bindValue(":ip", $transferIP);
        $sql->execute();
        if($sql->rowCount() == 0){
          echo "<h3>Error : Server Not Found</h3>";
          $curStatus = "userNotFound"; // The user with the identity given was not found in the users database
        }else{
          $rows  = $sql->fetch(\PDO::FETCH_ASSOC);
          $ip = $rows['ip'];
          $query   = $rows['query'];
          $user    = $rows['user'];
          $password = $rows['password'];
      
      ## First Variables -> This is where we are going
      $ts3_ServerInstance2 = \TeamSpeak3::factory("serverquery://" . $user . ":" . $password . "@" . $ip . ":" . $query . "/");
        }
      
      $created = $max = \Fr\LS::getUserID();
  
      $sql = self::$dbh->prepare("SELECT `ip`, `port`  FROM `". self::$config['db']['userservers'] ."` WHERE `user_id`=:id");
      $sql->bindValue(":id", $created);
      $sql->execute();
      if($sql->rowCount() == 0){
          #echo "<h3>Error : User Server Not Found</h3>";
          #$curStatus = "userNotFound"; // The user with the identity given was not found in the users database
        }else{
          $rowss  = $sql->fetch(\PDO::FETCH_ASSOC);
          $ipp = $rowss['ip'];
          $port   = $rowss['port'];
      #Attempt to find server username and password
          $sql = self::$dbh->prepare("SELECT `ip`, `query`, `user`, `password`  FROM `". self::$config['db']['servers'] ."` WHERE `ip`=:ip");
        $sql->bindValue(":ip", $ipp);
        $sql->execute();
        if($sql->rowCount() == 0){
         # echo "<h3>Error : Server Not Found</h3>";
         # $curStatus = "userNotFound"; // The user with the identity given was not found in the users database
        }else{
          $rowss  = $sql->fetch(\PDO::FETCH_ASSOC);
          $ippp = $rowss['ip'];
          $queryy   = $rowss['query'];
          $userr    = $rowss['user'];
          $passwordd = $rowss['password'];
      
      
      ## Second Variable -> This is where we currently are
      $ts3_ServerInstance = \TeamSpeak3::factory("serverquery://" . $userr . ":" . $passwordd . "@" . $ippp . ":" . $queryy . "/");
      
\TeamSpeak3::init();

$max = \Fr\LS::maxSlots();

   // create a virtual server and get its ID
   $new_sid = $ts3_ServerInstance2->serverCreate(array(
     "virtualserver_name"               => "Transfer In Progress",
     "virtualserver_maxclients"         => $max,
     "virtualserver_port"                => $port,
     "virtualserver_hostbutton_tooltip" => "FreeTs3",
     "virtualserver_hostbutton_url"     => "http://www.MyFreeTeamspeak.tk",
   ));
   sleep(5);
  
  
        $ts3 = \TeamSpeak3::factory("serverquery://" . $user . ":" . $password . "@" . $ip . ":" . $query . "/?server_port={$port}");
    $ts3transfer = \TeamSpeak3::factory("serverquery://" . $userr . ":" . $passwordd . "@" . $ippp . ":" . $queryy . "/?server_port={$port}");
  
    $serversnapshot=$ts3transfer->SnapshotCreate();
  
    $ts3transfer->message("By request of a cPanel command, This server is being moved to {$transferIP}:{$port}");
sleep(5);
$serverRestoreShot=$ts3->Snapshotdeploy($serversnapshot);
sleep(5);
$getlovelyid = $ts3transfer->getId();
$ts3transfer->serverStop($getlovelyid);
$deleteserver = $ts3_ServerInstance->serverDelete($getlovelyid);


     $sql = self::$dbh->prepare("UPDATE `". self::$config['db']['userservers'] ."` SET `ip` = :ip WHERE `user_id` = :userid");
     $sql->bindValue(":ip", $ip);
      $sql->bindValue(":userid", $created);
      $sql->execute();
      ##
    
    
        }
    }
}
 

EscuderoKevin

Well-Known Member
Jul 2, 2015
380
181
130
Might be able to make my code better, some reason it wouldn't work without a little sleep delay.

Code:
 public static function transferServer($transferIP)
  {
      require_once("Commands/libraries/TeamSpeak3/TeamSpeak3.php");
      ## Connect for first variables
        $sql = self::$dbh->prepare("SELECT `ip`, `query`, `user`, `password`  FROM `". self::$config['db']['servers'] ."` WHERE `ip`=:ip");
        $sql->bindValue(":ip", $transferIP);
        $sql->execute();
        if($sql->rowCount() == 0){
          echo "<h3>Error : Server Not Found</h3>";
          $curStatus = "userNotFound"; // The user with the identity given was not found in the users database
        }else{
          $rows  = $sql->fetch(\PDO::FETCH_ASSOC);
          $ip = $rows['ip'];
          $query   = $rows['query'];
          $user    = $rows['user'];
          $password = $rows['password'];
     
      ## First Variables -> This is where we are going
      $ts3_ServerInstance2 = \TeamSpeak3::factory("serverquery://" . $user . ":" . $password . "@" . $ip . ":" . $query . "/");
        }
     
      $created = $max = \Fr\LS::getUserID();
 
      $sql = self::$dbh->prepare("SELECT `ip`, `port`  FROM `". self::$config['db']['userservers'] ."` WHERE `user_id`=:id");
      $sql->bindValue(":id", $created);
      $sql->execute();
      if($sql->rowCount() == 0){
          #echo "<h3>Error : User Server Not Found</h3>";
          #$curStatus = "userNotFound"; // The user with the identity given was not found in the users database
        }else{
          $rowss  = $sql->fetch(\PDO::FETCH_ASSOC);
          $ipp = $rowss['ip'];
          $port   = $rowss['port'];
      #Attempt to find server username and password
          $sql = self::$dbh->prepare("SELECT `ip`, `query`, `user`, `password`  FROM `". self::$config['db']['servers'] ."` WHERE `ip`=:ip");
        $sql->bindValue(":ip", $ipp);
        $sql->execute();
        if($sql->rowCount() == 0){
         # echo "<h3>Error : Server Not Found</h3>";
         # $curStatus = "userNotFound"; // The user with the identity given was not found in the users database
        }else{
          $rowss  = $sql->fetch(\PDO::FETCH_ASSOC);
          $ippp = $rowss['ip'];
          $queryy   = $rowss['query'];
          $userr    = $rowss['user'];
          $passwordd = $rowss['password'];
     
     
      ## Second Variable -> This is where we currently are
      $ts3_ServerInstance = \TeamSpeak3::factory("serverquery://" . $userr . ":" . $passwordd . "@" . $ippp . ":" . $queryy . "/");
     
\TeamSpeak3::init();

$max = \Fr\LS::maxSlots();

   // create a virtual server and get its ID
   $new_sid = $ts3_ServerInstance2->serverCreate(array(
     "virtualserver_name"               => "Transfer In Progress",
     "virtualserver_maxclients"         => $max,
     "virtualserver_port"                => $port,
     "virtualserver_hostbutton_tooltip" => "FreeTs3",
     "virtualserver_hostbutton_url"     => "http://www.MyFreeTeamspeak.tk",
   ));
   sleep(5);
 
 
        $ts3 = \TeamSpeak3::factory("serverquery://" . $user . ":" . $password . "@" . $ip . ":" . $query . "/?server_port={$port}");
    $ts3transfer = \TeamSpeak3::factory("serverquery://" . $userr . ":" . $passwordd . "@" . $ippp . ":" . $queryy . "/?server_port={$port}");
 
    $serversnapshot=$ts3transfer->SnapshotCreate();
 
    $ts3transfer->message("By request of a cPanel command, This server is being moved to {$transferIP}:{$port}");
sleep(5);
$serverRestoreShot=$ts3->Snapshotdeploy($serversnapshot);
sleep(5);
$getlovelyid = $ts3transfer->getId();
$ts3transfer->serverStop($getlovelyid);
$deleteserver = $ts3_ServerInstance->serverDelete($getlovelyid);


     $sql = self::$dbh->prepare("UPDATE `". self::$config['db']['userservers'] ."` SET `ip` = :ip WHERE `user_id` = :userid");
     $sql->bindValue(":ip", $ip);
      $sql->bindValue(":userid", $created);
      $sql->execute();
      ##
   
   
        }
    }
}

Added To Do List. Thx.
 

EscuderoKevin

Well-Known Member
Jul 2, 2015
380
181
130
Nice job!
Suggestion: Try to make a server transfer.
Note: Looks from pictures its based off a 1-IP Configuration server? (Only seeing port not IP in server details)

Yep i do only for 1 Server.

When i finish all , i gonna do Complex Multi-Server Manager xd.
 
Status
Not open for further replies.
Top