-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathaceptareula.php
157 lines (127 loc) · 6.76 KB
/
aceptareula.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
<?php
/*
This file is part of McWebPanel.
Copyright (C) 2020-2024 DEV-MCWEBPANEL
McWebPanel is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
McWebPanel is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with McWebPanel. If not, see <https://www.gnu.org/licenses/>.
*/
require_once "../template/session.php";
require_once "../template/errorreport.php";
require_once "../config/confopciones.php";
function test_input($data)
{
if (isset($data)) {
$data = trim($data);
$data = stripslashes($data);
$data = htmlspecialchars($data);
return $data;
}
}
//COMPROBAR SI SESSION EXISTE SINO CREARLA CON NO
if (!isset($_SESSION['VALIDADO']) || !isset($_SESSION['KEYSECRETA'])) {
$_SESSION['VALIDADO'] = "NO";
$_SESSION['KEYSECRETA'] = "0";
}
//VALIDAMOS SESSION
if ($_SESSION['VALIDADO'] == $_SESSION['KEYSECRETA']) {
if (isset($_POST['action']) && !empty($_POST['action'])) {
$retorno = "";
$lakey = CONFIGSESSIONKEY;
$elnombreservidor = CONFIGNOMBRESERVER;
$eldirectorio = CONFIGDIRECTORIO;
$elpuerto = CONFIGPUERTO;
$laram = CONFIGRAM;
$eltiposerver = CONFIGTIPOSERVER;
$ellistadojars = CONFIGARCHIVOJAR;
$eleulaminecraft = 1;
$elmaxupload = CONFIGMAXUPLOAD;
$elgarbagecolector = CONFIGOPTIONGARBAGE;
$elforseupgrade = CONFIGOPTIONFORCEUPGRADE;
$elerasecache = CONFIGOPTIONERASECACHE;
$eljavaselect = CONFIGJAVASELECT;
$eljavaname = CONFIGJAVANAME;
$eljavamanual = CONFIGJAVAMANUAL;
$ellimitbackfoldersize = CONFIGFOLDERBACKUPSIZE;
$ellimitminefoldersize = CONFIGFOLDERMINECRAFTSIZE;
$elnumerolineaconsola = CONFIGLINEASCONSOLA;
$elbufferlimit = CONFIGBUFFERLIMIT;
$elmostrarsizecarpeta = CONFIGSHOWSIZEFOLDERS;
$elbootconfig = CONFIGBOOTSYSTEM;
$elignorarlimitram = CONFIGIGNORERAMLIMIT;
$elmantenimiento = CONFIGMANTENIMIENTO;
$elargmanualinicio = CONFIGARGMANUALINI;
$elargmanualfinal = CONFIGARGMANUALFINAL;
$eltypeconsola = CONFIGCONSOLETYPE;
$elxmsram = CONFIGXMSRAM;
$elbackupmulti = CONFIGBACKUPMULTI;
$elbackupcompress = CONFIGBACKUPCOMPRESS;
$elbackuphilos = CONFIGBACKUPHILOS;
$elbackuprotate = CONFIGBACKUROTATE;
//OBTENER RUTA DONDE TIENE QUE ESTAR LA CARPETA CONFIG
$dirconfig = "";
$dirconfig = dirname(getcwd()) . PHP_EOL;
$dirconfig = trim($dirconfig);
$dirconfig .= "/config";
clearstatcache();
if (file_exists($dirconfig)) {
//COMPROBAR SI SE PUEDE ESCRIBIR
clearstatcache();
if (is_writable($dirconfig)) {
//CREAR RUTA FICHERO CONFOPCIONES.PHP
$rutaescribir = $dirconfig;
$rutaescribir .= "/confopciones.php";
//GUARDAR FICHERO CONFOPCIONES.PHP
$file = fopen($rutaescribir, "w");
fwrite($file, "<?php " . PHP_EOL);
fwrite($file, 'define("CONFIGSESSIONKEY", "' . $lakey . '");' . PHP_EOL);
fwrite($file, 'define("CONFIGNOMBRESERVER", "' . $elnombreservidor . '");' . PHP_EOL);
fwrite($file, 'define("CONFIGDIRECTORIO", "' . $eldirectorio . '");' . PHP_EOL);
fwrite($file, 'define("CONFIGPUERTO", "' . $elpuerto . '");' . PHP_EOL);
fwrite($file, 'define("CONFIGRAM", "' . $laram . '");' . PHP_EOL);
fwrite($file, 'define("CONFIGTIPOSERVER", "' . $eltiposerver . '");' . PHP_EOL);
fwrite($file, 'define("CONFIGARCHIVOJAR", "' . $ellistadojars . '");' . PHP_EOL);
fwrite($file, 'define("CONFIGEULAMINECRAFT", "' . $eleulaminecraft . '");' . PHP_EOL);
fwrite($file, 'define("CONFIGMAXUPLOAD", "' . $elmaxupload . '");' . PHP_EOL);
fwrite($file, 'define("CONFIGOPTIONGARBAGE", "' . $elgarbagecolector . '");' . PHP_EOL);
fwrite($file, 'define("CONFIGOPTIONFORCEUPGRADE", "' . $elforseupgrade . '");' . PHP_EOL);
fwrite($file, 'define("CONFIGOPTIONERASECACHE", "' . $elerasecache . '");' . PHP_EOL);
fwrite($file, 'define("CONFIGJAVASELECT", "' . $eljavaselect . '");' . PHP_EOL);
fwrite($file, 'define("CONFIGJAVANAME", "' . $eljavaname . '");' . PHP_EOL);
fwrite($file, 'define("CONFIGJAVAMANUAL", "' . $eljavamanual . '");' . PHP_EOL);
fwrite($file, 'define("CONFIGFOLDERBACKUPSIZE", "' . $ellimitbackfoldersize . '");' . PHP_EOL);
fwrite($file, 'define("CONFIGFOLDERMINECRAFTSIZE", "' . $ellimitminefoldersize . '");' . PHP_EOL);
fwrite($file, 'define("CONFIGLINEASCONSOLA", "' . $elnumerolineaconsola . '");' . PHP_EOL);
fwrite($file, 'define("CONFIGSHOWSIZEFOLDERS", "' . $elmostrarsizecarpeta . '");' . PHP_EOL);
fwrite($file, 'define("CONFIGBOOTSYSTEM", "' . $elbootconfig . '");' . PHP_EOL);
fwrite($file, 'define("CONFIGIGNORERAMLIMIT", "' . $elignorarlimitram . '");' . PHP_EOL);
fwrite($file, 'define("CONFIGMANTENIMIENTO", "' . $elmantenimiento . '");' . PHP_EOL);
fwrite($file, 'define("CONFIGBUFFERLIMIT", "' . $elbufferlimit . '");' . PHP_EOL);
fwrite($file, 'define("CONFIGARGMANUALINI", "' . $elargmanualinicio . '");' . PHP_EOL);
fwrite($file, 'define("CONFIGARGMANUALFINAL", "' . $elargmanualfinal . '");' . PHP_EOL);
fwrite($file, 'define("CONFIGCONSOLETYPE", "' . $eltypeconsola . '");' . PHP_EOL);
fwrite($file, 'define("CONFIGXMSRAM", "' . $elxmsram . '");' . PHP_EOL);
fwrite($file, 'define("CONFIGBACKUPMULTI", "' . $elbackupmulti . '");' . PHP_EOL);
fwrite($file, 'define("CONFIGBACKUPCOMPRESS", "' . $elbackupcompress . '");' . PHP_EOL);
fwrite($file, 'define("CONFIGBACKUPHILOS", "' . $elbackuphilos . '");' . PHP_EOL);
fwrite($file, 'define("CONFIGBACKUROTATE", "' . $elbackuprotate . '");' . PHP_EOL);
fwrite($file, "?>" . PHP_EOL);
fclose($file);
sleep(2);
$retorno = "ok";
} else {
$retorno = "no";
}
} else {
$retorno = "no";
}
echo $retorno;
}
}