Skip to content

Commit 6bafcbe

Browse files
committed
XCS Multi Management of XPanel
0 parents  commit 6bafcbe

File tree

178 files changed

+100503
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

178 files changed

+100503
-0
lines changed

.idea/workspace.xml

Lines changed: 43 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Web Panel/.idea/.gitignore

Lines changed: 8 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Web Panel/.idea/Xcs-Multi-Management-XPanel.iml

Lines changed: 8 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Web Panel/.idea/modules.xml

Lines changed: 8 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Web Panel/index.php

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
2+
<!DOCTYPE html>
3+
<html lang="en">
4+
<head>
5+
<meta charset="utf-8">
6+
<meta name="viewport" content="width=device-width, initial-scale=1">
7+
8+
<title>Not Found</title>
9+
10+
<!-- Fonts -->
11+
<link rel="preconnect" href="https://fonts.gstatic.com">
12+
<link href="https://fonts.googleapis.com/css2?family=Nunito&display=swap" rel="stylesheet">
13+
14+
<style>
15+
/*! normalize.css v8.0.1 | MIT License | github.com/necolas/normalize.css */html{line-height:1.15;-webkit-text-size-adjust:100%}body{margin:0}a{background-color:transparent}code{font-family:monospace,monospace;font-size:1em}[hidden]{display:none}html{font-family:system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;line-height:1.5}*,:after,:before{box-sizing:border-box;border:0 solid #e2e8f0}a{color:inherit;text-decoration:inherit}code{font-family:Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace}svg,video{display:block;vertical-align:middle}video{max-width:100%;height:auto}.bg-white{--bg-opacity:1;background-color:#fff;background-color:rgba(255,255,255,var(--bg-opacity))}.bg-gray-100{--bg-opacity:1;background-color:#f7fafc;background-color:rgba(247,250,252,var(--bg-opacity))}.border-gray-200{--border-opacity:1;border-color:#edf2f7;border-color:rgba(237,242,247,var(--border-opacity))}.border-gray-400{--border-opacity:1;border-color:#cbd5e0;border-color:rgba(203,213,224,var(--border-opacity))}.border-t{border-top-width:1px}.border-r{border-right-width:1px}.flex{display:flex}.grid{display:grid}.hidden{display:none}.items-center{align-items:center}.justify-center{justify-content:center}.font-semibold{font-weight:600}.h-5{height:1.25rem}.h-8{height:2rem}.h-16{height:4rem}.text-sm{font-size:.875rem}.text-lg{font-size:1.125rem}.leading-7{line-height:1.75rem}.mx-auto{margin-left:auto;margin-right:auto}.ml-1{margin-left:.25rem}.mt-2{margin-top:.5rem}.mr-2{margin-right:.5rem}.ml-2{margin-left:.5rem}.mt-4{margin-top:1rem}.ml-4{margin-left:1rem}.mt-8{margin-top:2rem}.ml-12{margin-left:3rem}.-mt-px{margin-top:-1px}.max-w-xl{max-width:36rem}.max-w-6xl{max-width:72rem}.min-h-screen{min-height:100vh}.overflow-hidden{overflow:hidden}.p-6{padding:1.5rem}.py-4{padding-top:1rem;padding-bottom:1rem}.px-4{padding-left:1rem;padding-right:1rem}.px-6{padding-left:1.5rem;padding-right:1.5rem}.pt-8{padding-top:2rem}.fixed{position:fixed}.relative{position:relative}.top-0{top:0}.right-0{right:0}.shadow{box-shadow:0 1px 3px 0 rgba(0,0,0,.1),0 1px 2px 0 rgba(0,0,0,.06)}.text-center{text-align:center}.text-gray-200{--text-opacity:1;color:#edf2f7;color:rgba(237,242,247,var(--text-opacity))}.text-gray-300{--text-opacity:1;color:#e2e8f0;color:rgba(226,232,240,var(--text-opacity))}.text-gray-400{--text-opacity:1;color:#cbd5e0;color:rgba(203,213,224,var(--text-opacity))}.text-gray-500{--text-opacity:1;color:#a0aec0;color:rgba(160,174,192,var(--text-opacity))}.text-gray-600{--text-opacity:1;color:#718096;color:rgba(113,128,150,var(--text-opacity))}.text-gray-700{--text-opacity:1;color:#4a5568;color:rgba(74,85,104,var(--text-opacity))}.text-gray-900{--text-opacity:1;color:#1a202c;color:rgba(26,32,44,var(--text-opacity))}.uppercase{text-transform:uppercase}.underline{text-decoration:underline}.antialiased{-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.tracking-wider{letter-spacing:.05em}.w-5{width:1.25rem}.w-8{width:2rem}.w-auto{width:auto}.grid-cols-1{grid-template-columns:repeat(1,minmax(0,1fr))}@-webkit-keyframes spin{0%{transform:rotate(0deg)}to{transform:rotate(1turn)}}@keyframes spin{0%{transform:rotate(0deg)}to{transform:rotate(1turn)}}@-webkit-keyframes ping{0%{transform:scale(1);opacity:1}75%,to{transform:scale(2);opacity:0}}@keyframes ping{0%{transform:scale(1);opacity:1}75%,to{transform:scale(2);opacity:0}}@-webkit-keyframes pulse{0%,to{opacity:1}50%{opacity:.5}}@keyframes pulse{0%,to{opacity:1}50%{opacity:.5}}@-webkit-keyframes bounce{0%,to{transform:translateY(-25%);-webkit-animation-timing-function:cubic-bezier(.8,0,1,1);animation-timing-function:cubic-bezier(.8,0,1,1)}50%{transform:translateY(0);-webkit-animation-timing-function:cubic-bezier(0,0,.2,1);animation-timing-function:cubic-bezier(0,0,.2,1)}}@keyframes bounce{0%,to{transform:translateY(-25%);-webkit-animation-timing-function:cubic-bezier(.8,0,1,1);animation-timing-function:cubic-bezier(.8,0,1,1)}50%{transform:translateY(0);-webkit-animation-timing-function:cubic-bezier(0,0,.2,1);animation-timing-function:cubic-bezier(0,0,.2,1)}}@media (min-width:640px){.sm\:rounded-lg{border-radius:.5rem}.sm\:block{display:block}.sm\:items-center{align-items:center}.sm\:justify-start{justify-content:flex-start}.sm\:justify-between{justify-content:space-between}.sm\:h-20{height:5rem}.sm\:ml-0{margin-left:0}.sm\:px-6{padding-left:1.5rem;padding-right:1.5rem}.sm\:pt-0{padding-top:0}.sm\:text-left{text-align:left}.sm\:text-right{text-align:right}}@media (min-width:768px){.md\:border-t-0{border-top-width:0}.md\:border-l{border-left-width:1px}.md\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}}@media (min-width:1024px){.lg\:px-8{padding-left:2rem;padding-right:2rem}}@media (prefers-color-scheme:dark){.dark\:bg-gray-800{--bg-opacity:1;background-color:#2d3748;background-color:rgba(45,55,72,var(--bg-opacity))}.dark\:bg-gray-900{--bg-opacity:1;background-color:#1a202c;background-color:rgba(26,32,44,var(--bg-opacity))}.dark\:border-gray-700{--border-opacity:1;border-color:#4a5568;border-color:rgba(74,85,104,var(--border-opacity))}.dark\:text-white{--text-opacity:1;color:#fff;color:rgba(255,255,255,var(--text-opacity))}.dark\:text-gray-400{--text-opacity:1;color:#cbd5e0;color:rgba(203,213,224,var(--text-opacity))}}
16+
</style>
17+
18+
<style>
19+
body {
20+
font-family: 'Nunito', sans-serif;
21+
}
22+
</style>
23+
</head>
24+
<body class="antialiased">
25+
<div class="relative flex items-top justify-center min-h-screen bg-gray-100 dark:bg-gray-900 sm:items-center sm:pt-0">
26+
<div class="max-w-xl mx-auto sm:px-6 lg:px-8">
27+
<div class="flex items-center pt-8 sm:justify-start sm:pt-0">
28+
<div class="px-4 text-lg text-gray-500 border-r border-gray-400 tracking-wider">
29+
403</div>
30+
31+
<div class="ml-4 text-lg text-gray-500 uppercase tracking-wider">limited access</div>
32+
</div>
33+
</div>
34+
</div>
35+
</body>
36+
</html>

Web Panel/panel/.htaccess

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
Options +FollowSymLinks
2+
RewriteEngine on
3+
Options -indexes
4+
RewriteCond %{REQUEST_FILENAME} !-d
5+
RewriteCond %{REQUEST_FILENAME} !-f
6+
RewriteCond %{REQUEST_FILENAME} !-l
7+
8+
RewriteRule ^(.+)$ index.php?url=$1 "[B= ?,L]"
9+
10+
11+
#<Filesmatch ".(php)$" >
12+
#order deny,allow
13+
#deny from all
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
<?php
2+
$port = "22";
3+
$username = "admin";
4+
$password = "123456";
5+
$dbname = "XPanel";
6+
$lang = "fa-ir";
7+
8+
define("DB_TYPE", "mysql");
9+
define("DB_HOST", "127.0.0.1");
10+
define("DB_NAME", $dbname);
11+
define("DB_USER", $username);
12+
define("DB_PASS", $password);
13+
define("PORT", $port);
14+
define("LANG", $lang);
15+
date_default_timezone_set("Asia/Tehran");

Web Panel/panel/Config/define.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
<?php
2+
$protocol = isset($_SERVER['HTTPS']) ? 'https' : 'http';
3+
$http_host=$_SERVER['HTTP_HOST'];
4+
define('path', $protocol.'://'.$http_host.'/');
5+
$fakeurl = "https://google.com";
6+
define('fakeurl', $fakeurl);
Lines changed: 155 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,155 @@
1+
<?php
2+
include_once("Models/Api_Model.php");
3+
class Api extends Controller
4+
{
5+
public function __construct()
6+
{
7+
parent::__construct();
8+
9+
$this->model = new Api_Model();
10+
$key = htmlentities($_GET['key']);
11+
$token = $this->model->check_token($key);
12+
if($token == 'allowed'){
13+
$this->index();
14+
}else{
15+
16+
echo 'invalid api key';
17+
18+
}
19+
20+
}
21+
public function index()
22+
{
23+
//list user
24+
if(isset($_GET['method']) && $_GET['method'] == "listuser"){
25+
$list_user = $this->model->list_user();
26+
$this->response($list_user) ;
27+
}
28+
29+
//sort status user
30+
if(isset($_GET['method']) && $_GET['method'] == "users" && !empty($_GET['status'])){
31+
$status_user = $this->model->status_user($_GET['status']);
32+
$this->response($status_user) ;
33+
}
34+
35+
//add user
36+
if(isset($_GET['method']) && $_GET['method'] == "adduser"){
37+
$username = htmlentities($_POST['username']);
38+
$password = htmlentities($_POST['password']);
39+
$email = htmlentities($_POST['email']);
40+
$mobile = htmlentities($_POST['mobile']);
41+
$multiuser = htmlentities("1") ;
42+
if(isset($_POST['multiuser'])){
43+
$multiuser = htmlentities($_POST['multiuser']);
44+
}
45+
$connection_start = htmlentities($_POST['connection_start']);
46+
$traffic = htmlentities('0');
47+
if(isset($_POST['traffic'])){
48+
$traffic = htmlentities($_POST['traffic']);
49+
}
50+
$type_traffic = htmlentities($_POST['type_traffic']);
51+
$expdate = htmlentities($_POST['expdate']);
52+
$desc = htmlentities($_POST['desc']);
53+
if(!empty($connection_start)) { $st_date=''; }
54+
else { $st_date=date("Y-m-d"); }
55+
if ($type_traffic == "gb") {
56+
$traffic = $traffic * 1024;
57+
} else {
58+
$traffic = $traffic;
59+
}
60+
if(!empty($username) and !empty($password)) {
61+
$data_sybmit = array(
62+
'username' => $username,
63+
'password' => $password,
64+
'email' => $email,
65+
'mobile' => $mobile,
66+
'multiuser' => $multiuser,
67+
'startdate' => $st_date,
68+
'finishdate' => $expdate,
69+
'finishdate_one_connect' => $connection_start,
70+
'enable' => 'true',
71+
'traffic' => $traffic,
72+
'referral' => '',
73+
'info' => $desc
74+
);
75+
$this->model->submit_index($data_sybmit);
76+
}
77+
else
78+
{
79+
echo "invalid empty username and password";
80+
}
81+
82+
}
83+
84+
//show user
85+
if(isset($_GET['method']) && $_GET['method'] == "user" && !empty($_GET['username'])){
86+
$usernme = htmlentities($_GET['username']);
87+
$show_user = $this->model->show_user($usernme);
88+
$this->response($show_user) ;
89+
}
90+
//edit user
91+
if(isset($_GET['method']) && $_GET['method'] == "edituser"){
92+
$username = htmlentities($_POST['username']);
93+
$password = htmlentities($_POST['password']);
94+
$email = htmlentities($_POST['email']);
95+
$mobile = htmlentities($_POST['mobile']);
96+
$multiuser = htmlentities($_POST['multiuser']);
97+
$traffic = htmlentities($_POST['traffic']);
98+
$type_traffic = htmlentities($_POST['type_traffic']);
99+
$expdate = htmlentities($_POST['expdate']);
100+
$desc = htmlentities($_POST['desc']);
101+
if ($type_traffic == "gb") {
102+
$traffic = $traffic * 1024;
103+
} else {
104+
$traffic = $traffic;
105+
}
106+
if(!empty($username) && !empty($password)) {
107+
$data_sybmit = array(
108+
'username' => $username,
109+
'password' => $password,
110+
'email' => $email,
111+
'mobile' => $mobile,
112+
'multiuser' => $multiuser,
113+
'finishdate' => $expdate,
114+
'traffic' => $traffic,
115+
'info' => $desc
116+
);
117+
$edit_user = $this->model->edit_user($data_sybmit);
118+
$this->response($edit_user);
119+
}
120+
else
121+
{
122+
echo "invalid empty username and password";
123+
}
124+
}
125+
// delete user
126+
if(isset($_GET['method']) && $_GET['method'] == "deleteuser"){
127+
$usernme = htmlentities($_POST['username']);
128+
if(!empty($usernme)) {
129+
$data_sybmit = array(
130+
'username' => $usernme
131+
);
132+
$this->model->delete_user($data_sybmit);
133+
}
134+
else
135+
{
136+
echo "invalid empty username";
137+
}
138+
}
139+
140+
141+
}
142+
143+
function response($data){
144+
145+
$res= [
146+
'status' => 200,
147+
'data' => $data
148+
149+
];
150+
header('Content-Type: application/json; charset=utf-8');
151+
echo json_encode($res, JSON_PRETTY_PRINT | JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES);
152+
153+
}
154+
155+
}
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
<?php
2+
include_once("Models/Index_Model.php");
3+
4+
class Checkip extends Controller
5+
{
6+
function __construct()
7+
{
8+
parent::__construct();
9+
$this->model = new Index_Model();
10+
11+
$this->view->Render("Checkip/index");
12+
}
13+
}

0 commit comments

Comments
 (0)