1 | <?php
|
---|
2 |
|
---|
3 | include('global.php');
|
---|
4 |
|
---|
5 | class Index extends Page
|
---|
6 | {
|
---|
7 | var $FullTitle = 'Seznam serverů';
|
---|
8 | var $ShortTitle = 'Seznam serverů';
|
---|
9 |
|
---|
10 | function ShowServerListOnRow($Row)
|
---|
11 | {
|
---|
12 | $Row['NetworkPortRealmd'] = '<a href="realmlist.php?Id='.$Row['Id'].'">'.$Row['NetworkPortRealmd'].'</a>';
|
---|
13 | if($Row['Homepage'] != '') $Row['Name'] = '<a href="'.$Row['Homepage'].'">'.$Row['Name'].'</a>';
|
---|
14 | unset($Row['Homepage']);
|
---|
15 | return($Row);
|
---|
16 | }
|
---|
17 |
|
---|
18 | function ShowServerList()
|
---|
19 | {
|
---|
20 | global $Config;
|
---|
21 |
|
---|
22 | $Server = new Server($this->Database, 0);
|
---|
23 | $Server->UpdateServerList();
|
---|
24 | $Output = '<h4>Seznam serverů</h4>';
|
---|
25 | $Table = new Table('ServerList');
|
---|
26 | $Table->OnRow = array($this, 'ShowServerListOnRow');
|
---|
27 | $Table->Definition['Items']['Id'] = array('Type' => 'Hidden', 'Caption' => '', 'Default' => '');
|
---|
28 | $Table->LoadValuesFromDatabase($this->Database);
|
---|
29 | $Table->Definition['Items']['Actions'] = array('Type' => 'String', 'Caption' => '', 'Default' => '');
|
---|
30 | foreach($Table->Values as $Index => $Item)
|
---|
31 | {
|
---|
32 | $Table->Values[$Index]['Actions'] = '<a href="?Action=ServerShow&Id='.$Item['Id'].'">Podrobnosti</a>';
|
---|
33 | unset($Table->Values[$Index]['Id']);
|
---|
34 | }
|
---|
35 | $Output .= $Table->Show();
|
---|
36 | if($this->System->Modules['User']->User['Role'] >= USER_ROLE_USER)
|
---|
37 | {
|
---|
38 | $DbResult = $this->Database->query('SELECT COUNT(*) FROM Server');
|
---|
39 | $DbRow = $DbResult->fetch_row();
|
---|
40 | $ServerCount = $DbRow[0];
|
---|
41 | $DbResult = $this->Database->query('SELECT COUNT(*) FROM Server WHERE User='.$this->System->Modules['User']->User['Id']);
|
---|
42 | $DbRow = $DbResult->fetch_row();
|
---|
43 | if(($ServerCount < $Config['MaxServerCount']) and ($DbRow[0] == 0))
|
---|
44 | $Output .= '<br /><div style="text-align: center;"><a href="?Action=ServerAdd">Vytvořit nový server</a></dev>';
|
---|
45 | }
|
---|
46 | return($Output);
|
---|
47 | }
|
---|
48 |
|
---|
49 | function ShowServer($Id)
|
---|
50 | {
|
---|
51 | $Server = new Server($this->Database, $Id);
|
---|
52 | $Output = '<h4>Podrobnosti serveru</h4>';
|
---|
53 | $Form = new Form('EditServer');
|
---|
54 | $Form->LoadValuesFromDatabase($Id);
|
---|
55 | $Output .= $Form->ShowTable();
|
---|
56 | $Output .= '<div style="text-align: center">';
|
---|
57 | if((($this->System->Modules['User']->User['Role'] >= USER_ROLE_USER) and ($this->System->Modules['User']->User['Id'] == $Server->Server['User'])) or ($this->System->Modules['User']->User['Role'] >= USER_ROLE_ADMINISTRATOR))
|
---|
58 | {
|
---|
59 | $Output .= '<br /><a href="http://'.$this->System->Config['Web']['Host'].'/mysql/">Správa databáze</a> ';
|
---|
60 | if(array_key_exists('Id', $Server->Server['Database']))
|
---|
61 | {
|
---|
62 | $ServerStatus = $Server->GetState();
|
---|
63 | if($ServerStatus['RealmdPortState'] == true) $Output .= ' <a href="?Action=ServerStop&Id='.$Server->Id.'">Zastavit</a> <a href="?Action=ServerRestart&Id='.$Server->Id.'">Restartovat</a>';
|
---|
64 | else $Output .= ' <a href="?Action=ServerStart&Id='.$Server->Id.'">Spustit</a>';
|
---|
65 | }
|
---|
66 | $Output .= ' <a href="?Action=ServerEdit&Id='.$Server->Id.'">Upravit</a>';
|
---|
67 | $Output .= ' <a href="?Action=ServerDatabaseImport&Id='.$Server->Id.'">Načtení čisté databáze</a>';
|
---|
68 | }
|
---|
69 | $Output .= ' <a href="?Action=GameAccountRegister&Id='.$Server->Id.'">Vytvoření herního účtu</a>';
|
---|
70 | $Output .= '</div>';
|
---|
71 | return($Output);
|
---|
72 | }
|
---|
73 |
|
---|
74 | function ShowEmulatorList()
|
---|
75 | {
|
---|
76 | global $Config;
|
---|
77 |
|
---|
78 | $Output = '<h4>Seznam verzí emulátoru</h4>';
|
---|
79 | $Table = new Table('EmulatorList');
|
---|
80 | $Table->Definition['Items']['Id'] = array('Type' => 'Hidden', 'Caption' => '', 'Default' => '');
|
---|
81 | $Table->LoadValuesFromDatabase($this->Database);
|
---|
82 | $Table->Definition['Items']['Actions'] = array('Type' => 'String', 'Caption' => '', 'Default' => '');
|
---|
83 | foreach($Table->Values as $Index => $Item)
|
---|
84 | {
|
---|
85 | $Table->Values[$Index]['Actions'] = '<a href="?Action=EmulatorShow&Id='.$Item['Id'].'">Podrobnosti</a>';
|
---|
86 | unset($Table->Values[$Index]['Id']);
|
---|
87 | }
|
---|
88 | $Output .= $Table->Show();
|
---|
89 | if($this->System->Modules['User']->User['Role'] >= USER_ROLE_ADMINISTRATOR)
|
---|
90 | {
|
---|
91 | $Output .= '<br /><div style="text-align: center;"><a href="?Action=EmulatorAdd">Přidat emulátor</a></dev>';
|
---|
92 | }
|
---|
93 | return($Output);
|
---|
94 | }
|
---|
95 |
|
---|
96 | function ShowUpdateList($ServerId)
|
---|
97 | {
|
---|
98 | global $Config;
|
---|
99 |
|
---|
100 | if($this->System->Modules['User']->User['Role'] >= USER_ROLE_USER)
|
---|
101 | {
|
---|
102 | $Server = new Server($this->Database, $_GET['Id']);
|
---|
103 | if(($this->System->Modules['User']->User['Id'] == $Server->Server['User']) or ($this->System->Modules['User']->User['Role'] >= USER_ROLE_ADMINISTRATOR))
|
---|
104 | {
|
---|
105 | $Server = new Server($this->Database, $ServerId);
|
---|
106 | $Output = '<h4>Seznam dostupných aktulizací</h4>';
|
---|
107 | $Output .= 'Před provedením aktualizace bude server zastaven a provedena záloha databáze.';
|
---|
108 | $Table = new Table('EmulatorList');
|
---|
109 | $Table->Definition['Table'] = substr($Table->Definition['Table'], 0, -1).' WHERE Revision > '.$Server->Server['Database']['Emulator']['Revision'].' ORDER BY Revision)';
|
---|
110 | $Table->Definition['Items']['Id'] = array('Type' => 'Hidden', 'Caption' => '', 'Default' => '');
|
---|
111 | $Table->LoadValuesFromDatabase($this->Database);
|
---|
112 | $Table->Definition['Items']['Actions'] = array('Type' => 'String', 'Caption' => '', 'Default' => '');
|
---|
113 | foreach($Table->Values as $Index => $Item)
|
---|
114 | {
|
---|
115 | $Table->Values[$Index]['Actions'] = '<a href="?Action=EmulatorShow&Id='.$Item['Id'].'">Podprobnosti</a>';
|
---|
116 | $Table->Values[$Index]['Actions'] .= ' <a href="?Action=Update&Server='.$ServerId.'&Update='.$Item['Id'].'">Aktualizovat</a>';
|
---|
117 | unset($Table->Values[$Index]['Id']);
|
---|
118 | }
|
---|
119 | $Output .= $Table->Show();
|
---|
120 | } else $this->SystemMessage('Dostupné aktualizace', 'Nemáte oprávnění');
|
---|
121 | } else $Output .= USER_BAD_ROLE;
|
---|
122 | return($Output);
|
---|
123 | }
|
---|
124 |
|
---|
125 | function EmulatorShow($Id)
|
---|
126 | {
|
---|
127 | //$Server = new Server($this->Database, $Id);
|
---|
128 | $Output = '<h4>Podrobnosti emulátoru</h4>';
|
---|
129 | $Form = new Form('EmulatorItem');
|
---|
130 | $Form->LoadValuesFromDatabase($Id);
|
---|
131 | $Output .= $Form->ShowTable();
|
---|
132 | $Output .= '<div style="text-align: center">';
|
---|
133 | if($this->System->Modules['User']->User['Role'] >= USER_ROLE_ADMINISTRATOR)
|
---|
134 | {
|
---|
135 | $Output .= ' <a href="?Action=EmulatorDownload&Id='.$Id.'">Stáhnout</a>';
|
---|
136 | $Output .= ' <a href="?Action=EmulatorCompile&Id='.$Id.'">Přeložit</a>';
|
---|
137 | }
|
---|
138 | $Output .= '</div>';
|
---|
139 | return($Output);
|
---|
140 | }
|
---|
141 |
|
---|
142 | function ShowBackupListOnRow($Row)
|
---|
143 | {
|
---|
144 | //$Row['Name'] = '<a href="?Action=EmulatorShow&Id='.$Row['Id'].'">'.$Row['Name'].'</a>';
|
---|
145 | return($Row);
|
---|
146 | }
|
---|
147 |
|
---|
148 | function ShowBackupList($ServerId)
|
---|
149 | {
|
---|
150 | global $Config;
|
---|
151 |
|
---|
152 | if($this->System->Modules['User']->User['Role'] >= USER_ROLE_USER)
|
---|
153 | {
|
---|
154 | $Server = new Server($this->Database, $_GET['Id']);
|
---|
155 | if(($this->System->Modules['User']->User['Id'] == $Server->Server['User']) or ($this->System->Modules['User']->User['Role'] >= USER_ROLE_ADMINISTRATOR))
|
---|
156 | {
|
---|
157 | $Output = '<h4>Dostupné zálohy</h4>';
|
---|
158 | $Table = new Table('BackupList');
|
---|
159 | $Table->OnRow = array($this, 'ShowBackupListOnRow');
|
---|
160 | $Table->Table = '(SELECT * FROM `Backup` WHERE `Server` = '.$ServerId.')';
|
---|
161 | $Table->Definition['Items']['Id'] = array('Type' => 'Hidden', 'Caption' => 'Id', 'Default' => '');
|
---|
162 | $Table->LoadValuesFromDatabase($this->Database);
|
---|
163 | $Table->Definition['Items']['Actions'] = array('Type' => 'String', 'Caption' => '', 'Default' => '');
|
---|
164 | foreach($Table->Values as $Index => $Value)
|
---|
165 | {
|
---|
166 | $Table->Values[$Index]['Actions'] = '<a href="?Action=BackupDownload&Id='.$Value['Id'].'">Stáhnout</a>';
|
---|
167 | $Table->Values[$Index]['Actions'] .= ' <a href="?Action=BackupRestore&Id='.$Value['Id'].'">Obnovit</a>';
|
---|
168 | unset($Table->Values[$Index]['Id']);
|
---|
169 | }
|
---|
170 | $Output .= $Table->Show();
|
---|
171 | if($this->System->Modules['User']->User['Role'] >= USER_ROLE_ADMINISTRATOR)
|
---|
172 | {
|
---|
173 | $Output .= '<br /><div style="text-align: center;"><a href="?Action=BackupAdd&Id='.$ServerId.'">Zálohovat</a></dev>';
|
---|
174 | }
|
---|
175 | } else $this->SystemMessage('Zastavení serveru', 'Nemáte oprávnění');
|
---|
176 | } else $Output .= USER_BAD_ROLE;
|
---|
177 | return($Output);
|
---|
178 | }
|
---|
179 |
|
---|
180 | function ShowClientListOnRow($Row)
|
---|
181 | {
|
---|
182 | $Row['Version'] = '<a href="http://www.wowwiki.com/Patch_'.$Row['Version'].'">'.$Row['Version'].'</a>';
|
---|
183 | return($Row);
|
---|
184 | }
|
---|
185 |
|
---|
186 | function ShowClientList()
|
---|
187 | {
|
---|
188 | global $Config;
|
---|
189 |
|
---|
190 | $Output = '<h4>Verze herního klienta</h4>';
|
---|
191 | $Table = new Table('ClientList');
|
---|
192 | $Table->OnRow = array($this, 'ShowClientListOnRow');
|
---|
193 | $Table->LoadValuesFromDatabase($this->Database);
|
---|
194 | $Output .= $Table->Show();
|
---|
195 | if($this->System->Modules['User']->User['Role'] >= USER_ROLE_ADMINISTRATOR)
|
---|
196 | {
|
---|
197 | //$Output .= '<br /><div style="text-align: center;"><a href="?Action=BackupAdd">Zálohovat</a></dev>';
|
---|
198 | }
|
---|
199 | return($Output);
|
---|
200 | }
|
---|
201 |
|
---|
202 | function ShowTaskList()
|
---|
203 | {
|
---|
204 | global $Config;
|
---|
205 |
|
---|
206 | if($this->System->Modules['User']->User['Role'] >= USER_ROLE_USER)
|
---|
207 | {
|
---|
208 | $Output = '<h4>Fronta úloh</h4>';
|
---|
209 | $Table = new Table('TaskList');
|
---|
210 | $Table->Definition['Table'] = '(SELECT Time, Title, State FROM Task WHERE User='.$this->System->Modules['User']->User['Id'].' ORDER BY Id DESC)';
|
---|
211 | $Table->LoadValuesFromDatabase($this->Database);
|
---|
212 | $Output .= $Table->Show();
|
---|
213 | $Output .= '<br /><div style="text-align: center;"><a href="?Action=TaskList">Obnovit pohled</a></dev>';
|
---|
214 | } else $Output .= USER_BAD_ROLE;
|
---|
215 | return($Output);
|
---|
216 | }
|
---|
217 |
|
---|
218 | function ShowDebugListOnRow($Row)
|
---|
219 | {
|
---|
220 | $Row['Time'] = '<a href="?Action=ServerDebug&Id='.$Row['Id'].'&Show=Backtrace">'.str_replace(' ', ' ', $Row['Time']).'</a>';
|
---|
221 | $Row['Uptime'] = TimeToHumanTime($Row['Uptime']);
|
---|
222 | return($Row);
|
---|
223 | }
|
---|
224 |
|
---|
225 | function ShowDebugList()
|
---|
226 | {
|
---|
227 | global $Config;
|
---|
228 |
|
---|
229 | if($this->System->Modules['User']->User['Role'] >= USER_ROLE_USER)
|
---|
230 | {
|
---|
231 | $Server = new Server($this->Database, $_GET['Id']);
|
---|
232 | if(($this->System->Modules['User']->User['Id'] == $Server->Server['User']) or ($this->System->Modules['User']->User['Role'] >= USER_ROLE_ADMINISTRATOR))
|
---|
233 | {
|
---|
234 | $Output = '<h4>Ladící záznamy restartů</h4>';
|
---|
235 | $Table = new Table('DebugList');
|
---|
236 | $Table->OnRow = array($this, 'ShowDebugListOnRow');
|
---|
237 | $Table->Definition['Table'] = '(SELECT * FROM Debug WHERE Server='.$_GET['Id'].')';
|
---|
238 | $Table->LoadValuesFromDatabase($this->Database);
|
---|
239 | $Output .= $Table->Show();
|
---|
240 | if($this->System->Modules['User']->User['Role'] >= USER_ROLE_ADMINISTRATOR)
|
---|
241 | {
|
---|
242 | //$Output .= '<br /><div style="text-align: center;"><a href="?Action=BackupAdd">Zálohovat</a></dev>';
|
---|
243 | }
|
---|
244 | } else $this->SystemMessage('Ladící záznamy', 'Nemáte oprávnění');
|
---|
245 | } else $Output .= USER_BAD_ROLE;
|
---|
246 | return($Output);
|
---|
247 | }
|
---|
248 |
|
---|
249 | function ShowLoginForm()
|
---|
250 | {
|
---|
251 | $Form = new Form('UserLogin');
|
---|
252 | $Form->OnSubmit = '?Action=Login';
|
---|
253 | $Output = $Form->ShowEditForm();
|
---|
254 | $Output .= '<div class="Centred"><a href="?Action=UserRegister">Registrovat se</a> '.
|
---|
255 | '<a href="?Action=PasswordRecovery">Obnova zapomenutého hesla</a></div>';
|
---|
256 | return($Output);
|
---|
257 | }
|
---|
258 |
|
---|
259 | function ImportDatabase()
|
---|
260 | {
|
---|
261 | if($this->System->Modules['User']->User['Role'] >= USER_ROLE_USER)
|
---|
262 | {
|
---|
263 | $Server = new Server($this->Database, $_GET['Id']);
|
---|
264 | if(($this->System->Modules['User']->User['Id'] == $Server->Server['User']) or ($this->System->Modules['User']->User['Role'] >= USER_ROLE_ADMINISTRATOR))
|
---|
265 | {
|
---|
266 | $Server->ImportDatabase(true);
|
---|
267 | $Output .= $this->SystemMessage('Import čisté databáze', 'Úloha zařazena do fronty');
|
---|
268 | $Output .= $this->ShowTaskList();
|
---|
269 | } else $this->SystemMessage('Import databáze', 'Nemáte oprávnění');
|
---|
270 | } else $Output .= USER_BAD_ROLE;
|
---|
271 | }
|
---|
272 |
|
---|
273 | function ShowWelcome()
|
---|
274 | {
|
---|
275 | $Output = '<p>Vítejte v projektu zaměřeném na free hosting WoW serverů.</p>'.
|
---|
276 | '<strong>Použité technologie:</strong><br />'.
|
---|
277 | '<ul>'.
|
---|
278 | '<li><a href="http://www.worldofwarcraft.com/">World of Warcraft</a> - fantasy MMORPG</li>'.
|
---|
279 | '<li><a href="http://www.getmangos.com/">MaNGOS</a> - MMORPG server</li>'.
|
---|
280 | '<li><a href="http://www.udbforums.org/">UDB</a> - databáze pro MaNGOS</li>'.
|
---|
281 | '<li><a href="http://www.scriptdev2.com/">ScriptDev2</a> - doplňkový skriptovací systém pro MaNGOS</li>'.
|
---|
282 | '</ul>';
|
---|
283 | return($Output);
|
---|
284 | }
|
---|
285 |
|
---|
286 | function UserMenu()
|
---|
287 | {
|
---|
288 | $Output = '<strong>Uživatelské menu</strong><br />';
|
---|
289 | if($this->System->Modules['User']->User['Id'] != $this->System->Modules['User']->AnonymousUserId)
|
---|
290 | {
|
---|
291 | $DbResult = $this->Database->query('SELECT COUNT(*) FROM Server WHERE User='.$this->System->Modules['User']->User['Id']);
|
---|
292 | $DbRow = $DbResult->fetch_row();
|
---|
293 | if($DbRow[0] > 0)
|
---|
294 | {
|
---|
295 | $DbResult = $this->Database->query('SELECT Id FROM Server WHERE User='.$this->System->Modules['User']->User['Id']);
|
---|
296 | $Server = $DbResult->fetch_assoc();
|
---|
297 | $Output .= '<div><a href="?Action=ServerShow&Id='.$Server['Id'].'">Můj server</a></div>';
|
---|
298 | $Output .= '<div><a href="?Action=DebugList&Id='.$Server['Id'].'">Ladící záznamy</a></div>';
|
---|
299 | $Output .= '<div><a href="?Action=BackupList&Id='.$Server['Id'].'">Zálohy</a></div>';
|
---|
300 | $Output .= '<div><a href="?Action=TaskList">Fronta úloh</a></div>';
|
---|
301 | $Output .= '<div><a href="?Action=UpdateList&Id='.$Server['Id'].'">Dostupné aktualizace</a></div>';
|
---|
302 | } else $Output .= '<div><a href="?Action=ServerAdd">Vytvořit vlastní server</a></div>';
|
---|
303 | if($this->System->Modules['User']->User['Role'] == USER_ROLE_ADMINISTRATOR)
|
---|
304 | {
|
---|
305 | $Output .= '<div><a href="?Action=NewsAdd">Přidat aktualitu</a></div>';
|
---|
306 | }
|
---|
307 | }
|
---|
308 | return($Output);
|
---|
309 | }
|
---|
310 |
|
---|
311 | function ShowInfo()
|
---|
312 | {
|
---|
313 | global $Config;
|
---|
314 |
|
---|
315 | $Output = '<h4>Informace</h4>'.
|
---|
316 | '<p>Tento free hosting WoW serverů vám nabízí zdarma vytvoření vlastního malého serveru. Vytvoření a správa serveru nikdy nebyly jednodušší.</p>'.
|
---|
317 | '<strong>Pro koho je hosting určen?</strong>'.
|
---|
318 | '<ul>'.
|
---|
319 | '<li>Pro ty, kteří se chtějí starat o vlastní server, ale nemají dostatek financí nebo prostoru pro jeho provozování.</li>'.
|
---|
320 | '<li>Pro ty, kteří si chtějí vyzkoušet, jaké je to být administrátorem či GM na svém serveru.</li>'.
|
---|
321 | '</ul><br />'.
|
---|
322 | '<strong>Co získáte registrací?</strong>'.
|
---|
323 | '<ul>'.
|
---|
324 | '<li>Přístup k vlastnímu nepřetržitě běžícímu WoW serveru.</li>'.
|
---|
325 | '<li>Možnost si vybrat jednu z nabízených kombinací verze emulátoru, databáze a klienta.</li>'.
|
---|
326 | '<li>Možnost provádět aktualizace serveru na pár kliknutí.</li>'.
|
---|
327 | '<li>Periodické noční zálohování a možnost ruční obnovy.</li>'.
|
---|
328 | '<li>Max. 50 online hrajících hráčů.</li>'.
|
---|
329 | '<li>Neomezený počet účtů a postav.</li>'.
|
---|
330 | '<li>Možnost stáhnout si celou databázi serveru a v případě zájmů hráčů tak přejít na vlastní výkonější vyhrazený server.</li>'.
|
---|
331 | '<li>Automatické restartování serveru při selhání a automatický záznam ladících informací o pádu.</li>'.
|
---|
332 | '</ul><br />'.
|
---|
333 | '<p>Vámi vytvořený server může být bez předchozího upozornění smazán, např. pokud nebude již využíván nebo bude potřeba snížit vytížení hostingu.</p>'.
|
---|
334 | 'Technická podpora: '.$Config['Web']['AdminEmail'];
|
---|
335 | return($Output);
|
---|
336 | }
|
---|
337 |
|
---|
338 | function Show()
|
---|
339 | {
|
---|
340 | global $Config;
|
---|
341 |
|
---|
342 | $Output = '';
|
---|
343 | if(array_key_exists('Action', $_GET))
|
---|
344 | {
|
---|
345 | if($_GET['Action'] == 'LoginForm')
|
---|
346 | {
|
---|
347 | $Output .= $this->ShowLoginForm();
|
---|
348 | } else
|
---|
349 | if($_GET['Action'] == 'Login')
|
---|
350 | {
|
---|
351 | $Form = new Form('UserLogin');
|
---|
352 | $Form->OnSubmit = '?Action=Login';
|
---|
353 | $Form->LoadValuesFromForm();
|
---|
354 | $Result = $this->System->Modules['User']->Login($Form->Values['Username'], $Form->Values['Password']);
|
---|
355 | $Output = $this->SystemMessage('Přihlášení', $Result);
|
---|
356 | if($Result <> USER_LOGGED_IN)
|
---|
357 | {
|
---|
358 | $Form->Values['Password'] = '';
|
---|
359 | $Output .= $Form->ShowEditForm();
|
---|
360 | $Output .= '<div class="Centred"><a href="?Action=UserRegister">Registrovat se</a> '.
|
---|
361 | '<a href="?Action=PasswordRecovery">Obnova zapomenutého hesla</a></div>';
|
---|
362 | }
|
---|
363 | } else
|
---|
364 | if($_GET['Action'] == 'Logout')
|
---|
365 | {
|
---|
366 | $Output .= $this->SystemMessage('Odhlášení', $this->System->Modules['User']->Logout());
|
---|
367 | $Output .= $this->ShowLoginForm();
|
---|
368 | } else
|
---|
369 | if($_GET['Action'] == 'UserOptions')
|
---|
370 | {
|
---|
371 | $UserOptions = new Form('UserOptions');
|
---|
372 | $UserOptions->LoadValuesFromDatabase($this->System->Modules['User']->User['Id']);
|
---|
373 | $UserOptions->OnSubmit = '?Action=UserOptionsSave';
|
---|
374 | $Output .= $UserOptions->ShowEditForm();
|
---|
375 | } else
|
---|
376 | if($_GET['Action'] == 'UserOptionsSave')
|
---|
377 | {
|
---|
378 | $UserOptions = new Form('UserOptions', array());
|
---|
379 | $UserOptions->LoadValuesFromForm();
|
---|
380 | $UserOptions->SaveValuesToDatabase($this->System->Modules['User']->User['Id']);
|
---|
381 | $Output .= $this->SystemMessage('Nastavení', 'Nastavení uloženo.');
|
---|
382 | $this->System->Modules['Log']->NewRecord('User', 'Nastavení uživatele změněno', $UserOptions->Values['Name']);
|
---|
383 | $UserOptions->LoadValuesFromDatabase($this->System->Modules['User']->User['Id']);
|
---|
384 | $UserOptions->OnSubmit = '?Action=UserOptionsSave';
|
---|
385 | $Output .= $UserOptions->ShowEditForm();
|
---|
386 | } else
|
---|
387 | if($_GET['Action'] == 'UserRegister')
|
---|
388 | {
|
---|
389 | $Form = new Form('UserRegister');
|
---|
390 | $Form->LoadValuesFromForm();
|
---|
391 | $Form->OnSubmit = '?Action=UserRegisterSave';
|
---|
392 | $Output = 'Vyplňte správně požadované údaje. Na zadaný email vám bude zaslán aktivační email.';
|
---|
393 | $Output .= $Form->ShowEditForm();
|
---|
394 | } else
|
---|
395 | if($_GET['Action'] == 'UserRegisterConfirm')
|
---|
396 | {
|
---|
397 | $Output .= $this->SystemMessage('Potvrzení registrace', $this->System->Modules['User']->RegisterConfirm($_GET['User'], $_GET['H']));
|
---|
398 | $Output .= $this->ShowLoginForm();
|
---|
399 | } else
|
---|
400 | if($_GET['Action'] == 'PasswordRecovery')
|
---|
401 | {
|
---|
402 | $Form = new Form('PasswordRecovery');
|
---|
403 | $Form->OnSubmit = '?Action=PasswordRecovery2';
|
---|
404 | $Output .= $Form->ShowEditForm();
|
---|
405 | } else
|
---|
406 | if($_GET['Action'] == 'PasswordRecovery2')
|
---|
407 | {
|
---|
408 | $Form = new Form('PasswordRecovery');
|
---|
409 | $Form->LoadValuesFromForm();
|
---|
410 | $Result = $this->System->Modules['User']->PasswordRecoveryRequest($Form->Values['Name'], $Form->Values['Email']);
|
---|
411 | $Output .= $this->SystemMessage('Obnova hesla', $Result);
|
---|
412 | if($Result <> USER_PASSWORD_RECOVERY_SUCCESS)
|
---|
413 | {
|
---|
414 | $Output .= $Form->ShowEditForm();
|
---|
415 | }
|
---|
416 | } else
|
---|
417 | if($_GET['Action'] == 'PasswordRecoveryConfirm')
|
---|
418 | {
|
---|
419 | $Output .= $this->SystemMessage('Obnova hesla', $this->System->Modules['User']->PasswordRecoveryConfirm($_GET['User'], $_GET['H'], $_GET['P']));
|
---|
420 | $Output .= $this->ShowLoginForm();
|
---|
421 | } else
|
---|
422 | if($_GET['Action'] == 'UserRegisterSave')
|
---|
423 | {
|
---|
424 | $Form = new Form('UserRegister', array());
|
---|
425 | $Form->LoadValuesFromForm();
|
---|
426 | $Result = $this->System->Modules['User']->Register($Form->Values['Login'], $Form->Values['Password'], $Form->Values['Password2'], $Form->Values['Email'], $Form->Values['Name']);
|
---|
427 | $Output .= $this->SystemMessage('Registrace nového účtu', $Result);
|
---|
428 | if($Result <> USER_REGISTRATED)
|
---|
429 | {
|
---|
430 | $Form->OnSubmit = '?Action=UserRegisterSave';
|
---|
431 | $Output .= $Form->ShowEditForm();
|
---|
432 | }
|
---|
433 | } else
|
---|
434 | if($_GET['Action'] == 'ServerAdd')
|
---|
435 | {
|
---|
436 | if($this->System->Modules['User']->User['Role'] >= USER_ROLE_USER)
|
---|
437 | {
|
---|
438 | $DbResult = $this->Database->query('SELECT COUNT(*) FROM Server');
|
---|
439 | $DbRow = $DbResult->fetch_row();
|
---|
440 | $ServerCount = $DbRow[0];
|
---|
441 | if($ServerCount < $Config['MaxServerCount'])
|
---|
442 | {
|
---|
443 | $DbResult = $this->Database->query('SELECT COUNT(*) FROM Server WHERE User='.$this->System->Modules['User']->User['Id']);
|
---|
444 | $DbRow = $DbResult->fetch_row();
|
---|
445 | if($DbRow[0] > 0) $Output .= $this->SystemMessage('Nový server', 'Lze vytvořit pouze jeden server pro každý uživatelský účet.');
|
---|
446 | else
|
---|
447 | {
|
---|
448 | $Form = new Form('NewServer');
|
---|
449 | $Form->LoadValuesFromForm();
|
---|
450 | $Form->OnSubmit = '?Action=ServerCreate';
|
---|
451 | $Output .= 'Tento formulář vám umožní si vytvořit nový server. Pečlivě vyplňte požadované údaje.';
|
---|
452 | $Output .= $Form->ShowEditForm();
|
---|
453 | }
|
---|
454 | } else $Output .= $this->SystemMessage('Nový serve', 'Nelze vytvářet další servery');
|
---|
455 | } else $Output .= USER_BAD_ROLE;
|
---|
456 | } else
|
---|
457 | if($_GET['Action'] == 'ServerCreate')
|
---|
458 | {
|
---|
459 | if($this->System->Modules['User']->User['Role'] >= USER_ROLE_USER)
|
---|
460 | {
|
---|
461 | $DbResult = $this->Database->query('SELECT COUNT(*) FROM Server WHERE User='.$this->System->Modules['User']->User['Id']);
|
---|
462 | $DbRow = $DbResult->fetch_row();
|
---|
463 | if($DbRow[0] > 0) $Output .= $this->SystemMessage('Nový server', 'Lze vytvořit pouze jeden server pro každý uživatelský účet.');
|
---|
464 | else
|
---|
465 | {
|
---|
466 | $DbResult = $this->Database->query('SELECT MAX(NetworkPortRealmd), MAX(NetworkPortWorldd) FROM Server');
|
---|
467 | $DbRow = $DbResult->fetch_row();
|
---|
468 | $NewPortRealmd = $DbRow[0] + 1;
|
---|
469 | if($NewPortRealmd < $Config['BaseNetworkPortRealmd']) $NewPortRealmd = $Config['BaseNetworkPortRealmd'];
|
---|
470 | $NewPortWorldd = $DbRow[1] + 1;
|
---|
471 | if($NewPortWorldd < $Config['BaseNetworkPortWorldd']) $NewPortWorldd = $Config['BaseNetworkPortWorldd'];
|
---|
472 |
|
---|
473 | $Form = new Form('NewServer', array());
|
---|
474 | $Form->LoadValuesFromForm();
|
---|
475 | $this->Database->insert('Server', array('Name' => $Form->Values['Name'], 'Description' => $Form->Values['Description'], 'User' => $this->System->Modules['User']->User['Id'], 'Motd' => $Form->Values['Motd'], 'Homepage' => $Form->Values['Homepage'], 'Type' => $Form->Values['Type'], 'Database' => 1, 'NetworkPortWorldd' => $NewPortWorldd, 'NetworkPortRealmd' => $NewPortRealmd));
|
---|
476 | $LastInsertId = $this->Database->insert_id;
|
---|
477 | $Server = new Server($this->Database, $LastInsertId);
|
---|
478 | $Server->CreateDatabase();
|
---|
479 | $Server->ImportDatabase(true);
|
---|
480 | $Output .= $this->SystemMessage('Vytvoření serveru', 'Úloha načtení nové databáze zařazena do fronty');
|
---|
481 | $Output .= $this->ShowTaskList();
|
---|
482 | //$UserOptions->LoadValuesFromDatabase($this->System->Modules['User']->User['Id']);
|
---|
483 | //$Form->OnSubmit = '?Action=ServerCreate';
|
---|
484 | //$Output .= $Form->ShowEditForm();
|
---|
485 | }
|
---|
486 | } else $Output .= USER_BAD_ROLE;
|
---|
487 | } else
|
---|
488 | if($_GET['Action'] == 'ServerShow')
|
---|
489 | {
|
---|
490 | if(array_key_exists('Id', $_GET)) $Output .= $this->ShowServer($_GET['Id']);
|
---|
491 | else $this->SystemMessage('Zobrazení serveru', 'Nebylo zadáno Id');
|
---|
492 | } else
|
---|
493 | if($_GET['Action'] == 'ServerEdit')
|
---|
494 | {
|
---|
495 | $Server = new Server($this->Database, $_GET['Id']);
|
---|
496 | if(($this->System->Modules['User']->User['Id'] == $Server->Server['User']) or ($this->System->Modules['User']->User['Role'] >= USER_ROLE_ADMINISTRATOR))
|
---|
497 | {
|
---|
498 | $Form = new Form('EditServer');
|
---|
499 | $Form->LoadValuesFromDatabase($_GET['Id']);
|
---|
500 | $Form->Values['ServerId'] = $_GET['Id'];
|
---|
501 | $Form->OnSubmit = '?Action=ServerSave';
|
---|
502 | $Output .= $Form->ShowEditForm();
|
---|
503 | } else $this->SystemMessage('Nastavení serveru', 'Nemáte oprávnění');
|
---|
504 | } else
|
---|
505 | if($_GET['Action'] == 'ServerSave')
|
---|
506 | {
|
---|
507 | $Server = new Server($this->Database, $_POST['ServerId']);
|
---|
508 | if(($this->System->Modules['User']->User['Id'] == $Server->Server['User']) or ($this->System->Modules['User']->User['Role'] >= USER_ROLE_ADMINISTRATOR))
|
---|
509 | {
|
---|
510 | $Form = new Form('EditServer', array());
|
---|
511 | $Form->LoadValuesFromForm();
|
---|
512 | $ServerId = $_POST['ServerId'];
|
---|
513 | unset($Form->Values['ServerId']);
|
---|
514 | $Output .= $this->SystemMessage('Upravit server', 'Nastavení serveru uloženo.');
|
---|
515 | $Form->SaveValuesToDatabase($_POST['ServerId']);
|
---|
516 | $Form->OnSubmit = '?Action=ServerSave';
|
---|
517 |
|
---|
518 | $Server = new Server($this->Database, $_POST['ServerId']);
|
---|
519 | $Server->SaveConfiguration();
|
---|
520 | $Form->Values['ServerId'] = $ServerId;
|
---|
521 | $Output .= $Form->ShowEditForm();
|
---|
522 | } else $this->SystemMessage('Nastavení serveru', 'Nemáte oprávnění');
|
---|
523 | } else
|
---|
524 | if($_GET['Action'] == 'ServerStart')
|
---|
525 | {
|
---|
526 | if($this->System->Modules['User']->User['Role'] >= USER_ROLE_USER)
|
---|
527 | {
|
---|
528 | $Server = new Server($this->Database, $_GET['Id']);
|
---|
529 | if(($this->System->Modules['User']->User['Id'] == $Server->Server['User']) or ($this->System->Modules['User']->User['Role'] >= USER_ROLE_ADMINISTRATOR))
|
---|
530 | {
|
---|
531 | $Output .= $this->SystemMessage('Spuštění serveru', $Server->Start());
|
---|
532 | $Output .= $this->ShowTaskList();
|
---|
533 | } else $this->SystemMessage('Spuštění serveru', 'Nemáte oprávnění');
|
---|
534 | } else $Output .= USER_BAD_ROLE;
|
---|
535 | } else
|
---|
536 | if($_GET['Action'] == 'ServerStop')
|
---|
537 | {
|
---|
538 | if($this->System->Modules['User']->User['Role'] >= USER_ROLE_USER)
|
---|
539 | {
|
---|
540 | $Server = new Server($this->Database, $_GET['Id']);
|
---|
541 | if(($this->System->Modules['User']->User['Id'] == $Server->Server['User']) or ($this->System->Modules['User']->User['Role'] >= USER_ROLE_ADMINISTRATOR))
|
---|
542 | {
|
---|
543 | $Output .= $this->SystemMessage('Zastavení serveru', $Server->Stop());
|
---|
544 | $Output .= $this->ShowTaskList();
|
---|
545 | } else $this->SystemMessage('Zastavení serveru', 'Nemáte oprávnění');
|
---|
546 | } else $Output .= USER_BAD_ROLE;
|
---|
547 | } else
|
---|
548 | if($_GET['Action'] == 'ServerDatabaseImport')
|
---|
549 | {
|
---|
550 | $this->ImportDatabase();
|
---|
551 | } else
|
---|
552 | if($_GET['Action'] == 'EmulatorShow')
|
---|
553 | {
|
---|
554 | if(array_key_exists('Id', $_GET))
|
---|
555 | {
|
---|
556 | $Output .= $this->EmulatorShow($_GET['Id']);
|
---|
557 | } else $Output .= $this->SystemMessage('Překlad emulátoru', 'Nebylo zadáno Id');
|
---|
558 | } else
|
---|
559 | if($_GET['Action'] == 'EmulatorList')
|
---|
560 | {
|
---|
561 | $Output .= $this->ShowEmulatorList();
|
---|
562 | } else
|
---|
563 | if($_GET['Action'] == 'EmulatorCompile')
|
---|
564 | {
|
---|
565 | if(array_key_exists('Id', $_GET))
|
---|
566 | {
|
---|
567 | $Emulator = new Emulator($this->Database, $_GET['Id']);
|
---|
568 | $Emulator->Compile();
|
---|
569 | $Output .= $this->SystemMessage('Překlad emulátoru', 'Úloha zařazena do fronty');
|
---|
570 | $Output .= $this->ShowTaskList();
|
---|
571 | } else $Output .= $this->SystemMessage('Překlad emulátoru', 'Nebylo zadáno Id');
|
---|
572 | } else
|
---|
573 | if($_GET['Action'] == 'EmulatorDownload')
|
---|
574 | {
|
---|
575 | if(array_key_exists('Id', $_GET))
|
---|
576 | {
|
---|
577 | $Emulator = new Emulator($this->Database, $_GET['Id']);
|
---|
578 | $Emulator->Download();
|
---|
579 | $Output .= $this->SystemMessage('Stažení emulátoru', 'Úloha zařazena do fronty');
|
---|
580 | $Output .= $this->ShowTaskList();
|
---|
581 | } else $Output .= $this->SystemMessage('Stažení emulátoru', 'Nebylo zadáno Id');
|
---|
582 | } else
|
---|
583 | if($_GET['Action'] == 'ServerDebug')
|
---|
584 | {
|
---|
585 | if($this->System->Modules['User']->User['Role'] >= USER_ROLE_USER)
|
---|
586 | {
|
---|
587 | $Server = new Server($this->Database, $_GET['Id']);
|
---|
588 | if(($this->System->Modules['User']->User['Id'] == $Server->Server['User']) or ($this->System->Modules['User']->User['Role'] >= USER_ROLE_ADMINISTRATOR))
|
---|
589 | {
|
---|
590 | $Output .= '<div>Ladící informace serveru</div>';
|
---|
591 | $MangosDebug = new MangosDebug($this->Database);
|
---|
592 | $Output .= $MangosDebug->Show($Server->Id);
|
---|
593 | } else $this->SystemMessage('Ladící informace', 'Nemáte oprávnění');
|
---|
594 | } else $Output .= USER_BAD_ROLE;
|
---|
595 | } else
|
---|
596 | if($_GET['Action'] == 'ClientList')
|
---|
597 | {
|
---|
598 | $Output .= $this->ShowClientList();
|
---|
599 | } else
|
---|
600 | if($_GET['Action'] == 'BackupList')
|
---|
601 | {
|
---|
602 | $Output .= $this->ShowBackupList($_GET['Id']);
|
---|
603 | } else
|
---|
604 | if($_GET['Action'] == 'DebugList')
|
---|
605 | {
|
---|
606 | $Output .= $this->ShowDebugList($_GET['Id']);
|
---|
607 | } else
|
---|
608 | if($_GET['Action'] == 'UpdateList')
|
---|
609 | {
|
---|
610 | $Output .= $this->ShowUpdateList($_GET['Id']);
|
---|
611 | } else
|
---|
612 | if($_GET['Action'] == 'GameAccountRegister')
|
---|
613 | {
|
---|
614 | $Form = new Form('GameAccountNew', $_GET['Id']);
|
---|
615 | $Form->LoadValuesFromForm();
|
---|
616 | $Form->Values['ServerId'] = $_GET['Id'];
|
---|
617 | $Form->OnSubmit = '?Action=GameAccountRegister2';
|
---|
618 | $Output .= $Form->ShowEditForm();
|
---|
619 | } else
|
---|
620 | if($_GET['Action'] == 'GameAccountRegister2')
|
---|
621 | {
|
---|
622 | $Form = new Form('GameAccountNew');
|
---|
623 | $Form->LoadValuesFromForm();
|
---|
624 | $Server = new Server($this->Database, $Form->Values['ServerId']);
|
---|
625 | $Output .= $this->SystemMessage('Vytvoření herního účtu', $Server->NewAccount($Form->Values['Name'], $Form->Values['Password'], $Form->Values['Password2'], $Form->Values['Email'], $Form->Values['Expansion']));
|
---|
626 | $Output .= '<a href="?Action=GameAccountRegister&Id='.$Form->Values['ServerId'].'">Zpět k zadání údajů</a>';
|
---|
627 | } else
|
---|
628 | if($_GET['Action'] == 'Info')
|
---|
629 | {
|
---|
630 | $Output = $this->ShowInfo();
|
---|
631 | } else
|
---|
632 | if($_GET['Action'] == 'BackupAdd')
|
---|
633 | {
|
---|
634 | if(!array_key_exists('Id', $_GET)) $Output .= $this->SystemMessage('Ladící informace', 'Nebylo zadáno Id serveru');
|
---|
635 | else if($this->System->Modules['User']->User['Role'] >= USER_ROLE_USER)
|
---|
636 | {
|
---|
637 | $Server = new Server($this->Database, $_GET['Id']);
|
---|
638 | if(($this->System->Modules['User']->User['Id'] == $Server->Server['User']) or ($this->System->Modules['User']->User['Role'] >= USER_ROLE_ADMINISTRATOR))
|
---|
639 | {
|
---|
640 | $Backup = new Backup($this->Database, 0);
|
---|
641 | $Output .= $this->SystemMessage('Ruční zálohování', $Backup->Create($Server->Id));
|
---|
642 | $Output .= $this->ShowTaskList();
|
---|
643 | } else $this->SystemMessage('Ladící informace', 'Nemáte oprávnění');
|
---|
644 | } else $Output .= USER_BAD_ROLE;
|
---|
645 | } else
|
---|
646 | if($_GET['Action'] == 'BackupRestore')
|
---|
647 | {
|
---|
648 | if(!array_key_exists('Id', $_GET)) $Output .= $this->SystemMessage('Obnovení ze zálohy', 'Nebylo zadáno Id zálohy');
|
---|
649 | else if($this->System->Modules['User']->User['Role'] >= USER_ROLE_USER)
|
---|
650 | {
|
---|
651 | $Backup = new Backup($this->Database, $_GET['Id']);
|
---|
652 | $Server = new Server($this->Database, $Backup->Backup['Server']);
|
---|
653 | if(($this->System->Modules['User']->User['Id'] == $Server->Server['User']) or ($this->System->Modules['User']->User['Role'] >= USER_ROLE_ADMINISTRATOR))
|
---|
654 | {
|
---|
655 | $Output .= $this->SystemMessage('Obnovení ze zálohy', $Backup->Restore());
|
---|
656 | $Output .= $this->ShowTaskList();
|
---|
657 | } else $this->SystemMessage('Obnovení ze zálohy', 'Nemáte oprávnění');
|
---|
658 | } else $Output .= USER_BAD_ROLE;
|
---|
659 | } else
|
---|
660 | if($_GET['Action'] == 'BackupDownload')
|
---|
661 | {
|
---|
662 | if(!array_key_exists('Id', $_GET)) $Output .= $this->SystemMessage('Stažení souboru zálohy', 'Nebylo zadáno Id zálohy');
|
---|
663 | else if($this->System->Modules['User']->User['Role'] >= USER_ROLE_USER)
|
---|
664 | {
|
---|
665 | $Backup = new Backup($this->Database, $_GET['Id']);
|
---|
666 | $Server = new Server($this->Database, $Backup->Backup['Server']);
|
---|
667 | if(($this->System->Modules['User']->User['Id'] == $Server->Server['User']) or ($this->System->Modules['User']->User['Role'] >= USER_ROLE_ADMINISTRATOR))
|
---|
668 | {
|
---|
669 | Header('Content-Type: application/x-tar-gz');
|
---|
670 | Header('Content-Disposition: attachment; filename="wowhosting-'.$Backup->Id.'.tar.bz2"');
|
---|
671 | echo(file_get_contents('../backup/wowhosting-'.$Backup->Id.'.tar.bz2'));
|
---|
672 | exit;
|
---|
673 | } else $this->SystemMessage('Stažení souboru zálohy', 'Nemáte oprávnění');
|
---|
674 | } else $Output .= USER_BAD_ROLE;
|
---|
675 | } else
|
---|
676 | if($_GET['Action'] == 'TaskList')
|
---|
677 | {
|
---|
678 | $Output .= $this->ShowTaskList();
|
---|
679 | } else
|
---|
680 | if($_GET['Action'] == 'Update')
|
---|
681 | {
|
---|
682 | if(!array_key_exists('Server', $_GET)) $Output .= $this->SystemMessage('Aktualizace serveru', 'Nebylo zadáno Id serveru');
|
---|
683 | else if(!array_key_exists('Update', $_GET)) $Output .= $this->SystemMessage('Aktualizace serveru', 'Nebylo zadáno Id aktualizace');
|
---|
684 | else if($this->System->Modules['User']->User['Role'] >= USER_ROLE_USER)
|
---|
685 | {
|
---|
686 | $Server = new Server($this->Database, $_GET['Server']);
|
---|
687 | if(($this->System->Modules['User']->User['Id'] == $Server->Server['User']) or ($this->System->Modules['User']->User['Role'] >= USER_ROLE_ADMINISTRATOR))
|
---|
688 | {
|
---|
689 | $Output .= $this->SystemMessage('Aktualizace serveru', $Server->Update($_GET['Update']));
|
---|
690 | $Output .= $this->ShowTaskList();
|
---|
691 | } else $this->SystemMessage('Aktualizace serveru', 'Nemáte oprávnění');
|
---|
692 | } else $Output .= USER_BAD_ROLE;
|
---|
693 | } else
|
---|
694 | if($_GET['Action'] == 'NewsAdd')
|
---|
695 | {
|
---|
696 | if($this->System->Modules['User']->User['Role'] >= USER_ROLE_ADMINISTRATOR)
|
---|
697 | {
|
---|
698 | $Form = new Form('News');
|
---|
699 | $Form->OnSubmit = '?Action=NewsAdd2';
|
---|
700 | $Output = $Form->ShowEditForm();
|
---|
701 | } else $Output .= USER_BAD_ROLE;
|
---|
702 | } else
|
---|
703 | if($_GET['Action'] == 'NewsAdd2')
|
---|
704 | {
|
---|
705 | if($this->System->Modules['User']->User['Role'] >= USER_ROLE_ADMINISTRATOR)
|
---|
706 | {
|
---|
707 | $Form = new Form('News');
|
---|
708 | $Form->LoadValuesFromForm();
|
---|
709 | $Form->Values['Time'] = 'NOW()';
|
---|
710 | $Form->Values['User'] = $this->System->Modules['User']->User['Id'];
|
---|
711 | $Form->SaveValuesToDatabase(0);
|
---|
712 | $Output = $this->SystemMessage('Nová aktualita', 'Přidáno');
|
---|
713 | } else $Output .= USER_BAD_ROLE;
|
---|
714 | } else
|
---|
715 | if($_GET['Action'] == 'State')
|
---|
716 | {
|
---|
717 | $Platform = new Platform($this->Database);
|
---|
718 | $State = $Platform->State();
|
---|
719 | $Output = '<h4>Stav systému</h4>'.
|
---|
720 | '<table class="WideTable">'.
|
---|
721 | '<tr><th>Veličina</th><th>Hodnota</th></tr>'.
|
---|
722 | '<tr><td>Doba běhu serveru</td><td>'.$this->System->AddPrefixMultipliers($State['Uptime'], '', 4, 'Time').'</td></tr>'.
|
---|
723 | '<tr><td>Použitá/celková paměť</td><td>'.$this->System->AddPrefixMultipliers($State['MemoryUsed'], 'B', 4, 'Binary').' / '.$this->System->AddPrefixMultipliers($State['MemoryTotal'], 'B', 4, 'Binary').'</td></tr>'.
|
---|
724 | '<tr><td>Počet serverů aktivních/všech/maxiální</td><td>'.$State['ServerOnlineCount'].' / '.$State['ServerCount'].' / '.$State['ServerMaxCount'].'</td></tr>'.
|
---|
725 | '<tr><td>Počet emulátorů</td><td>'.$State['EmulatorCount'].'</td></tr>'.
|
---|
726 | '<tr><td>Počet uživatelů</td><td>'.$State['UserCount'].'</td></tr>'.
|
---|
727 | '<tr><td>Počet záloh</td><td>'.$State['BackupCount'].'</td></tr>'.
|
---|
728 | '<tr><td>Čekajících/všech úloh ve frontě</td><td>'.$State['TaskQueued'].' / '.$State['TaskCount'].'</td></tr>'.
|
---|
729 | '</table>';
|
---|
730 | } else
|
---|
731 | if($_GET['Action'] == 'Test')
|
---|
732 | {
|
---|
733 | //$Emulator = new Emulator($this->Database, 2);
|
---|
734 | // $Emulator->Compile();
|
---|
735 | //$Server = new Server($this->Database, 1);
|
---|
736 | //$Output .= $Server->ImportDatabase();
|
---|
737 | //$Config = new MangosConfigurationFile($this->Database);
|
---|
738 | //$Config->Load('../emu/mangos/7681/etc/mangosd.conf');
|
---|
739 | //$Config->Save('../server/1/etc/mangosd.conf');
|
---|
740 | } else
|
---|
741 | {
|
---|
742 | $Output .= $this->ShowWelcome();
|
---|
743 | }
|
---|
744 | } else
|
---|
745 | {
|
---|
746 | $Output .= $this->ShowWelcome();
|
---|
747 | }
|
---|
748 | $Content = $Output;
|
---|
749 | $Output = '<table class="BasicTable"><tr>';
|
---|
750 | if($this->System->Modules['User']->User['Id'] != $this->System->Modules['User']->AnonymousUserId)
|
---|
751 | $Output .= '<td class="UserMenu">'.$this->UserMenu().'</td>';
|
---|
752 | $Output .= '<td class="Content">'.$Content.'</td>';
|
---|
753 | if(!array_key_exists('Action', $_GET))
|
---|
754 | {
|
---|
755 | $Output .= '<td class="News"><strong>Aktuálně:</strong><br />';
|
---|
756 | $DbResult = $this->Database->query('SELECT * FROM News');
|
---|
757 | while($DbRow = $DbResult->fetch_assoc())
|
---|
758 | {
|
---|
759 | $Output .= '<div><strong>'.$DbRow['Title'].'</strong>('.HumanDate($DbRow['Time']).')<br />'.$DbRow['Content'].'</div>';
|
---|
760 | }
|
---|
761 | $Output .= '</td>';
|
---|
762 | }
|
---|
763 | $Output .= '</tr></table>';
|
---|
764 | return($Output);
|
---|
765 | }
|
---|
766 | }
|
---|
767 |
|
---|
768 | $System->AddModule(new Index());
|
---|
769 | $System->Modules['Index']->GetOutput();
|
---|
770 |
|
---|
771 | ?>
|
---|