source: trunk/test_server/administration.php@ 647

Last change on this file since 647 was 647, checked in by barny, 15 years ago

Opraven test server web

File size: 53.2 KB
Line 
1<?php
2/*
3 Set your ReggAcc look from Internet browser
4 (c) 2008 Vladonix (reggacc.admin at gmail dot com) 03.04.2009
5 MultiRealm Support
6*/
7
8define('roSSECURE',true); // tested in configuration file
9
10define('CFG_FILE', "configuration.php"); // configuration file - change name
11
12if (is_file(CFG_FILE)) {
13 require_once(CFG_FILE); // main configuration - included must be first, because there is defined variable $lang used in lang.php
14}
15else { // create configuration file
16 $cf = @fopen(CFG_FILE, "a");
17
18 if ( $cf !== FALSE )
19 @fclose($cf);
20}
21
22// default
23if (!isset($img_base)) // show html page
24 $img_base = "img/";
25if (!isset($charset)) // show html page
26 $charset = "utf-8";
27if (!isset($cfg_sfile)) // must be - authentification
28 $cfg_sfile="sha1_datas.php";
29if (!isset($realm_num)) // num of realms
30 $realm_num = 1;
31
32if (!isset($layout) || !$layout) {
33 $layout = 0;
34 $lpath = "tbc/";
35}
36else {
37 $lpath = "wotlk/";
38}
39
40$lfile = "style".$lang.".css";
41
42require_once('lang.php'); // translations, zones, maps names, ranks
43
44if (isset($_REQUEST['nr']))
45 $gnr = $_REQUEST['nr'];
46else
47 $gnr = 0;
48
49?>
50<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
51<html>
52<head>
53<title>Your WEBConfig - ReggAcc</title>
54 <meta http-equiv="Content-type" content="text/html; charset=<?php print $charset; ?>">
55 <meta http-equiv="Cache-Control" content="no-cache">
56 <meta name="category" content="games">
57 <link href="<?php echo $lpath.$lfile ?>" type="text/css" rel=stylesheet>
58</head>
59<body>
60
61<?php
62
63function conf_create_new_autentif($name = '', $pwd = '')
64{
65 global $cfg_sfile;
66 $wdata = 0;
67 $dig = sha1(strtoupper($name)."##".strtoupper($pwd));
68
69 $to_write = "<?php // ".rand(0, 9).rand(0,9).rand(0,9).rand(0,9).rand(0,9).$dig." ?>\n";
70
71 for($i = 1; $i < rand(4, 6); $i++) {
72 $to_write .= "<?php // ";
73 for ($j = 0; $j < 45; $j++) {
74 $val = rand(0, 15);
75
76 switch ($val) {
77 case 10;
78 $to_write .= "a";
79 break;
80 case 11;
81 $to_write .= "b";
82 break;
83 case 12;
84 $to_write .= "c";
85 break;
86 case 13;
87 $to_write .= "d";
88 break;
89 case 14;
90 $to_write .= "e";
91 break;
92 case 15;
93 $to_write .= "f";
94 break;
95
96 default:
97 $to_write .= $val;
98 break;
99 }
100 }
101 $to_write .= " ?>\n";
102 }
103
104 if (@is_file($cfg_sfile)) {
105 $wdata = @file_put_contents($cfg_sfile, $to_write);
106 if ($wdata == 0 || $wdata === false)
107 return false;
108 }
109 else
110 return false;
111
112 return true;
113}
114
115 $fret = $ret = "";
116 if (empty($_POST['account']) || empty($_POST['passwd']))
117 $digest = "";
118 else
119 $digest = sha1(strtoupper($_POST['account'])."##".strtoupper($_POST['passwd'])); // create code
120
121 if (@is_file($cfg_sfile)) { // read coded from file
122 $fret = @file_get_contents($cfg_sfile);
123
124 $fret = explode(" ", $fret);
125
126 if (strlen($fret[2]) > 5) // there are 5 added chars on begining - remove them
127 $ret = substr($fret[2], 5);
128 }
129
130 // main info after succesfull autentification
131 $cfg_text_info = $text['cfg_info'];
132 $err = 0;
133
134 // uncomment, if you want to see your sha1 digests
135 //echo $ret.";".$digest.";";
136
137 if (!strlen($digest) || strcmp($digest, $ret)) {
138 echo "
139 <div id=\"acenter\">
140 <form action=\"administration.php\" method=post enctype=\"multipart/form-data\">
141 <div class=\"panellabel\">Your WEBConfig ReggAcc</div>
142 <div class=\"aram\">
143 <table align=center>
144 <tr>
145 <td class=\"td_left\"><span class=\"txt\">".$text['char'][0]."</span></td>
146 <td ><input type=\"text\" name=\"account\" id=\"account\" class=\"old_100\" value=\"\" maxlength=\"15\" tabindex=\"1\"></td>
147 <td class=\"td_left\"><span class=\"txt\">".$text['obligate']."</span></td>
148 </tr>
149 <tr>
150 <td class=\"td_left\" ><span class=\"txt\">".$text['password']."</span></td>
151 <td><input type=\"password\" name=\"passwd\" id=\"passwd\" class=\"old_100\" value=\"\" maxlength=\"15\" tabindex=\"2\"></td>
152 <td class=\"td_left\"><span class=\"txt\">".$text['obligate']."</span></td>
153 </tr>
154 </table>";
155
156 if (!empty($_POST['account']) || !empty($_POST['passwd']) || (!empty($_POST['flg']) && $_POST['flg'] == 2)) {
157 if (!empty($_POST['account']) && !empty($_POST['flg']) && $_POST['flg'] == 2)
158 write_log("1", $_POST['account'], "Update config failure"); // pokus o update so zle vyplnenym menom a heslom vo formulari
159 else if (!empty($_POST['account']))
160 write_log("1", $_POST['account'], "Login failure");
161
162 echo "<span class=\"error\">".$text['cfg_bad_data']."</span>";
163 }
164 else
165 echo "<span class=\"error\">&nbsp;</span>";
166
167 // hidden button flg - if 1, show config, if 2, write config
168 echo "
169 <div>
170 <input type=\"submit\" class=\"bsend\" tabindex=\"3\" title=\"Send\" value=\"\">
171 <input type=\"hidden\" name=\"flg\" id=\"flg\" value=\"1\">
172 <input type=\"hidden\" name=\"nr\" id=\"nr\" value=\"".$gnr."\">
173 </div>
174 </div>
175 </form>
176
177 <form action=\"world1.php\" method=post enctype=\"multipart/form-data\">
178 <input type=\"hidden\" name=\"nr\" value=\"".$gnr."\">
179 <input type=\"submit\" class=\"bback\" tabindex=\"4\" title=\"Send\" value=\"\">
180 </form>
181 </div>";
182 }
183 else { // equal strings - access allowed
184 $my_name = trim(strip_tags(htmlspecialchars($_POST['account'])));
185 $my_password = trim(strip_tags(htmlspecialchars($_POST['passwd'])));
186
187 // write new cfg
188 if (!empty($_POST['flg']) && $_POST['flg'] == 2) {
189 // check new name or password
190
191 // are new passwords equal ?
192 if ( (!empty($_POST['new_password1']) && !empty($_POST['new_password2'])
193 && strcmp($_POST['new_password1'], $_POST['new_password2']) )
194 || ( !empty($_POST['new_password1']) && empty($_POST['new_password2']))
195 || ( empty($_POST['new_password1']) && !empty($_POST['new_password2']))
196 || ( empty($_POST['new_account']) && !empty($_POST['new_password1']) && !empty($_POST['new_password2'])) )
197 $err = 1; // not equal pwds
198
199 // filled new name and/or new password?
200 if (!$err &&
201 ( !empty($_POST['new_account']) && !empty($_POST['new_password1']) && !empty($_POST['new_password2'])
202 && strcmp($_POST['new_password1'], $_POST['passwd']) ) ) {
203 if (!conf_create_new_autentif(trim(strip_tags(htmlspecialchars($_POST['new_account']))),
204 trim(strip_tags(htmlspecialchars($_POST['new_password1'])))) )
205 $err = 2; // unsuccessfull :(
206 else { // password changed, change into formular too
207 $my_password = trim(strip_tags(htmlspecialchars($_POST['new_password1'])));
208 $my_name = trim(strip_tags(htmlspecialchars($_POST['new_account'])));
209 write_log("2", $my_name, "Auh. file updated");
210 }
211 }
212
213 // write new configuration.php
214 if (!$err) {
215 $to_write = "<?php
216/* ReggAcc
217 * by (c) Vladonix (reggacc.admin at gmail dot com) 03.04.2009
218 *
219 * This file is automaticaly generated by ReggAcc administration script
220 * For better descriptions see configuration_example.php
221 */
222
223// secure option - don't display php code
224if (!defined('roSSECURE')): die('Acces denied!'); endif;
225
226#BASIC head and foot - if error occurs
227 \$basic_head = \"<!DOCTYPE HTML PUBLIC \\\"-//W3C//DTD HTML 4.0 Transitional//EN\\\" \\\"http://www.w3.org/TR/html4/loose.dtd\\\">
228 <html>
229 <head>
230 <title>Error - ReggAcc</title>
231 <meta HTTP-EQUIV=\\\"Pragma\\\" CONTENT=\\\"no-cache\\\">
232 <meta http-equiv=Content-Type content=\\\"text/html; charset=".$charset."\\\">
233 </head>
234 <body>\";
235
236 \$basic_foot = \"</body></html>\";\n\n";
237
238 // add new values here
239 // we save 1st realm here
240 $val_names = array('lang', 'charset',
241 'realmName', 'rid', 'mangosver',
242 'hostr', 'userr', 'passwordr', 'dbr',
243 'host', 'user', 'password', 'db',
244 'hostc', 'userc', 'passwordc', 'dbc',
245 'database_encoding','server','port',
246 'accountoption', 'onlineoption', 'online_show_max', 'lock_acc', 'lock_reg', 'show_gm',
247 'accountpreview', 'set_gm', 'change_pwd', 'cfg_statistics_show',
248 'img_base', 'layout',
249 'show_board', 'msg_file', 'msg_refresh', 'msg_big_ta_length',
250 'msg_max_length', 'msg_max_num', 'msg_max_long_word',
251 'msg_time_format', 'msg_separator', 'msg_reg_only', 'msg_ban_list',
252 'cfg_show_passwords', 'information', 'cfg_show_info','cfg_admin_nick',
253 'cfg_admin_ip', 'cfg_sfile', 'cfg_mail_need', 'cfg_ptable_refresh',
254 'cfg_pool_show', 'cfg_pool_q', 'cfg_pool_file', 'cfg_pool_answers',
255 'show_map', 'cfg_map_refresh', "exten",
256 'cfg_log_show', 'cfg_log_file', 'cfg_log_level', 'cfg_log_filter', 'cfg_log_expire', 'cfg_log_realm',
257 'show_counter', 'counter_file', 'counter_length', 'counter_expire',
258 'create_status_xml', 'xml_version', 'xml_owner', 'stat_file',
259
260 'realm_num', 'sitename', 'siteText',
261 'showTeleport', 'feeTeleport');
262
263 // save config values
264 for ($i = 0; $i < count($val_names); $i++) {
265 if (isset($_POST[$val_names[$i]])) {
266 $pvalue = trim($_POST[$val_names[$i]]);
267 }
268 else
269 $pvalue = "";
270
271 if (isset($_POST['mangosver']) && !strcmp($_POST['mangosver'], "on")) {
272 if (!strcmp($val_names[$i], "host") && isset($_POST["hostr"])) {
273 $pvalue = trim($_POST["hostr"]);
274 }
275 if (!strcmp($val_names[$i], "user") && isset($_POST["user"])) {
276 $pvalue = trim($_POST["userr"]);
277 }
278 if (!strcmp($val_names[$i], "password") && isset($_POST["passwordr"])) {
279 $pvalue = trim($_POST["passwordr"]);
280 }
281 if (!strcmp($val_names[$i], "db") && isset($_POST["dbr"])) {
282 $pvalue = trim($_POST["dbr"]);
283 }
284 }
285
286 // for information
287 if (!get_magic_quotes_gpc()) {
288 // replace " with \"
289 $pvalue = str_replace('"', '\\"', $pvalue);
290 }
291
292 $to_write .= "\$".$val_names[$i]."=\"".$pvalue."\";\n";
293 ${$val_names[$i]} = $pvalue;
294 }
295
296 // save pool answers - depends on $cfg_pool_answers
297 if (isset($cfg_pool_answers) && $cfg_pool_answers > 9) $cfg_pool_answers = 9; // max 9
298 if (!isset($cfg_pool_answers) || $cfg_pool_answers < 0)
299 $cfg_pool_answers = 0;
300
301 for ($i = 1; $i < $cfg_pool_answers+1; $i++) {
302 $value = "cfg_pool".$i;
303
304 if (isset ($_POST[$value]) && !empty($_POST[$value])) {
305 $to_write .= "\$".$value."=\"".trim(strip_tags(htmlspecialchars($_POST[$value])))."\";\n";
306 ${$value} = trim(strip_tags(htmlspecialchars($_POST[$value])));
307 }
308 else {
309 $to_write .= "\$".$value."=\"\";\n";
310 ${$value} = "";
311 }
312 }
313
314 // save multirealm settings - second, third, etc.
315 if (isset($realm_num)) {
316 if ($realm_num < 1) $realmnum = 1;
317 if ($realm_num > 9) $realmnum = 9;
318
319 if ($realm_num > 1) {
320 $realm_vars = array("realmName", "rid", "mangosver",
321 "hostr", "userr", "passwordr", "dbr",
322 "host", "user", "password", "db",
323 "hostc", "userc", "passwordc", "dbc",
324 "database_encoding", "server", "port",
325 "accountoption", "onlineoption", "online_show_max", "lock_acc",
326 "lock_reg", "show_gm", "accountpreview", "set_gm", "change_pwd",
327 "cfg_mail_need", "cfg_statistics_show",
328 "show_map", "cfg_map_refresh", "exten",
329 "showTeleport", "feeTeleport");
330
331 for ($s = 1; $s < $realm_num; $s++) {
332 for ($p = 0; $p < count($realm_vars); $p++) {
333 $tmpvar = $realm_vars[$p].$s;
334 $tmpmangosver = "mangosver".$s;
335 $pvalue = "";
336
337 if (isset ($_POST[$tmpvar]) && !empty($_POST[$tmpvar])) {
338 $pvalue = trim(strip_tags(htmlspecialchars($_POST[$tmpvar])));
339 }
340 else {
341 $pvalue = "";
342 }
343
344 if (isset($_POST[$tmpmangosver]) && !strcmp($_POST[$tmpmangosver], "on")
345 && (strstr($tmpvar, "host") || strstr($tmpvar, "user") || strstr($tmpvar, "password") || strstr($tmpvar, "db") ) ) {
346 $tmphost = "host".$s;
347 $tmphostr = "hostr".$s;
348 $tmpuser = "user".$s;
349 $tmpuserr = "userr".$s;
350
351 $tmppassword = "password".$s;
352 $tmppasswordr = "passwordr".$s;
353 $tmpdb = "db".$s;
354 $tmpdbr = "dbr".$s;
355
356 if (!strcmp($tmpvar, $tmphost) && isset($_POST[$tmphostr])) {
357 $pvalue = trim($_POST[$tmphostr]);
358 }
359
360 if (!strcmp($tmpvar, $tmpuser) && isset($_POST[$tmpuserr])) {
361 $pvalue = trim($_POST[$tmpuserr]);
362 }
363
364 if (!strcmp($tmpvar, $tmppassword) && isset($_POST[$tmppasswordr])) {
365 $pvalue = trim($_POST[$tmppasswordr]);
366 }
367
368 if (!strcmp($tmpvar, $tmpdb) && isset($_POST[$tmpdbr])) {
369 $pvalue = trim($_POST[$tmpdbr]);
370 }
371
372 }
373
374 $to_write .= "\$".$tmpvar."=\"".$pvalue."\";\n";
375 ${$tmpvar} = $pvalue;
376
377 }
378 }
379 }
380 }
381
382 $to_write .= "\n?>";
383
384 if (@is_file(CFG_FILE)) {
385 $wdata = @file_put_contents(CFG_FILE, $to_write);
386 if ($wdata == 0 || $wdata === false)
387 $err = 3;
388 else
389 write_log("2", $my_name, "Config file updated");
390 }
391 else $err = 3;
392 }
393
394 // write new pool question to pool store file
395 if (!$err && isset($cfg_pool_file)) {
396 if (@is_file($cfg_pool_file)) {
397 $fpool = file($cfg_pool_file);
398
399 // if empty file, write question
400 if ($fpool === FALSE || count($fpool) == 0
401 || (count($fpool) > 0 && !empty($cfg_pool_q) && !strstr($fpool[0], $cfg_pool_q))) {
402 $to_write = "<?php // ".$cfg_pool_q." ?>\n";
403 if (@file_put_contents($cfg_pool_file, $to_write))
404 write_log("2", $my_name, "Pool file updated");
405 else
406 $err = 4;
407 }
408 }
409 else
410 $err = 4; // cfg updated, pool store file not
411 }
412
413 $cfg_text_info = $cfg_errors[$err];
414 }
415
416 // show cfg page
417 if (!empty($_POST['flg']) && $_POST['flg'] > 0) {
418 if ($_POST['flg'] == 1)
419 write_log("2", $my_name, ""); // succesful login
420
421 echo "
422 <div>
423 <div class=\"panellabel\">Your WEBConfig ReggAcc</div>
424
425 <div>
426 <form action=\"world1.php\" method=post enctype=\"multipart/form-data\">
427 <input type=\"submit\" class=\"bback\" tabindex=\"1\" title=\"Send\" value=\"\">
428 <input type=\"hidden\" name=\"nr\" value=\"".$gnr."\">
429 </form>
430 </div>
431
432 <form action=\"administration.php\" method=post enctype=\"multipart/form-data\">
433 <div>
434 <input type=\"submit\" class=\"bsend\" tabindex=\"2\" title=\"Send\" value=\"\">
435 <input type=\"hidden\" name=\"flg\" id=\"flg\" value=\"2\">
436 <input type=\"hidden\" name=\"nr\" id=\"nr\" value=\"".$gnr."\">
437 </div>
438
439 <div class=\"top10\"><span class=\"row_hor\">".strftime("%H:%M:%S")." ".$cfg_text_info."</span></div>
440 <div><span class=\"txt\">".$text['cfg_info_warn']."</span></div>
441
442 <!-- name and pwd -->
443 <div class=\"top10\"><span class=\"txt\">".$text['cfg_name_set_label']."</span></div>
444 <div class=\"aram2\">
445 <table>
446 <tr>
447 <td class=\"txt\">".$text['char'][0]."</td>
448 <td ><input type=\"text\" name=\"account\" id=\"account\" class=\"old\" value=\"".$my_name."\" maxlength=\"15\"></td>
449 <td class=\"txt\">".$text['obligate']."</td>
450 </tr>
451 <tr>
452 <td class=\"txt\">".$text['password']."</td>
453 <td><input";
454 if (isset($cfg_show_passwords) && $cfg_show_passwords) echo " type=\"text\" "; else echo " type=\"password\" ";
455 echo "name=\"passwd\" id=\"passwd\" class=\"old_red\" value=\"".$my_password."\" maxlength=\"15\"></td>
456 <td class=\"txt\">".$text['obligate']."</td>
457 </tr>
458 <tr>
459 <td class=\"txt\">".$text['cfg_new_name']."</td>
460 <td colspan=2><input type=\"text\" name=\"new_account\" id=\"new_account\" class=\"old_red\" value=\"".$_POST['account']."\" maxlength=\"15\"></td>
461 </tr>
462 <tr>
463 <td class=\"txt\">".$text['cfg_new_pwd1']."</td>
464 <td colspan=2><input";
465 if (isset($cfg_show_passwords) && $cfg_show_passwords) echo " type=\"text\" "; else echo " type=\"password\" ";
466 echo "name=\"new_password1\" id=\"new_password1\" class=\"old_red\" value=\"\" maxlength=\"15\"></td>
467 </tr>
468 <tr>
469 <td class=\"txt\">".$text['cfg_new_pwd2']."</td>
470 <td colspan=2><input";
471 if (isset($cfg_show_passwords) && $cfg_show_passwords) echo " type=\"text\" "; else echo " type=\"password\" ";
472 echo "name=\"new_password2\" id=\"new_password2\" class=\"old_red\" value=\"\" maxlength=\"15\"></td>
473 </tr>
474 </table>
475 </div>
476
477 <!-- html options -->
478 <div class=\"top10\"><span class=\"txt\">".$text['cfg_page']."</span></div>
479 <div class=\"aram2\">
480 <table>
481 <tr>
482 <td class=\"txt\">".$text['cfg_language']."</td>
483 <td ><input type=\"text\" name=\"lang\" id=\"lang\" class=\"old\" value=\"".(isset($lang)?$lang:"en")."\" maxlength=\"12\"></td>
484 <td class=\"txt\">(default en) ".$text['cfg_new_lang']."</td>
485 </tr>
486 <tr>
487 <td class=\"txt\">".$text['cfg_charset']."</td>
488 <td><input type=\"text\" name=\"charset\" id=\"charset\" class=\"old\" value=\"".(isset($charset)?$charset:"utf-8")."\" maxlength=\"12\"></td>
489 <td class=\"txt\">(default utf-8)</td>
490 </tr>
491 </table>
492 </div>
493
494
495 <!-- multirealm settings -->
496 <div class=\"top10\"><span class=\"txt\">Realms</span></div>
497 <div class=\"aram2\">
498 <table>
499 <tr>
500 <td class=\"txt\">".$text['multi_num_r']."</td>
501 <td ><input type=\"text\" name=\"realm_num\" id=\"realm_num\" class=\"old\" value=\"".(isset($realm_num)?$realm_num:"1")."\" maxlength=\"1\"> <span class=\"txt\">(max. 9)</span></td>
502 <td class=\"txt\">&nbsp;</td>
503 </tr>
504 <tr>
505 <td class=\"txt\">".$text['multi_sitename']."</td>
506 <td><input type=\"text\" name=\"sitename\" id=\"sitename\" class=\"old\" value=\"".(isset($sitename)?$sitename:"")."\" maxlength=\"40\" style=\"width:300px\"></td>
507 <td class=\"txt\">&nbsp;</td>
508 </tr>
509 <tr>
510 <td class=\"txt\">".$text['multi_sitetext']."</td>
511 <td><input type=\"text\" name=\"siteText\" id=\"siteText\" class=\"old\" value=\"".(isset($siteText)?$siteText:"")."\" maxlength=\"100\" style=\"width:500px\"></td>
512 <td class=\"txt\">&nbsp;</td>
513 </tr>
514 </table>";
515
516 if ($realm_num < 1) $realmnum = 1;
517 if ($realm_num > 9) $realmnum = 9;
518
519 for ($s = 0; $s < $realm_num; $s++) {
520 // variables
521 $rena = "realmName".($s?$s:"");
522 $ridd = "rid".($s?$s:"");
523
524 $hh = "host".($s?$s:"");
525 $uu = "user".($s?$s:"");
526 $pp = "password".($s?$s:"");
527 $dd = "db".($s?$s:"");
528
529 $hhr = "hostr".($s?$s:"");
530 $uur = "userr".($s?$s:"");
531 $ppr = "passwordr".($s?$s:"");
532 $ddr = "dbr".($s?$s:"");
533
534 $hhc = "hostc".($s?$s:"");
535 $uuc = "userc".($s?$s:"");
536 $ppc = "passwordc".($s?$s:"");
537 $ddc = "dbc".($s?$s:"");
538
539 $dde = "database_encoding".($s?$s:"");
540 $srv = "server".($s?$s:"");
541 $prt = "port".($s?$s:"");
542
543 $ao = "accountoption".($s?$s:"");
544 $oop = "onlineoption".($s?$s:"");
545 $osm = "online_show_max".($s?$s:"");
546 $la = "lock_acc".($s?$s:"");
547 $lr = "lock_reg".($s?$s:"");
548 $shg = "show_gm".($s?$s:"");
549 $acp = "accountpreview".($s?$s:"");
550 $seg = "set_gm".($s?$s:"");
551 $chp = "change_pwd".($s?$s:"");
552
553 $cmd = "cfg_mail_need".($s?$s:"");
554 $css = "cfg_statistics_show".($s?$s:"");
555
556 $maps = "show_map".($s?$s:"");
557 $mapr = "cfg_map_refresh".($s?$s:"");
558
559 $ext = "exten".($s?$s:"");
560
561 $teleS = "showTeleport".($s?$s:"");
562 $teleF = "feeTeleport".($s?$s:"");
563
564 $mver = "mangosver".($s?$s:"");
565
566 $colors = array("red", "blue", "green", "yellow", "gray", "pink", "purple", "cyan", "brown", "white");
567
568 echo "
569 <div class=\"top10\"><span class=\"txt\">".($s+1).". realm</span></div>
570
571 <div class=\"aram2\" style=\"border-color:".$colors[$s].";\">
572 <table>
573 <tr>
574 <td class=\"txt\">".$text['char'][0]."</td>
575 <td>
576 <input type=\"text\" name=\"".$rena."\" id=\"".$rena."\" class=\"old\" value=\"".(isset(${$rena})?${$rena}:"W0W Server")."\" maxlength=\"40\" style=\"width:150px\">&nbsp;<span class=\"txt\"> (optional)</span>
577 </td>
578 </tr>
579
580 <tr>
581 <td class=\"txt\">Id</td>
582 <td>
583 <input type=\"text\" name=\"".$ridd."\" id=\"".$ridd."\" class=\"old\" value=\"".(isset(${$ridd})?${$ridd}:"1")."\" maxlength=\"2\" style=\"width:30px\">&nbsp;<span class=\"txt\"> (default 1)</span>
584 </td>
585 </tr>
586
587 <tr>
588 <td class=\"txt\">
589 <input type=\"checkbox\" name=\"".$mver."\" ".(!strcmp(${$mver}, "on")?"checked=\"checked\"":"")."/>
590 </td>
591 <td>
592 <span class=\"txt\"> ".$text['mangosver']."</span>
593 </td>
594 </tr>
595
596 </table>
597
598
599 <!-- database mangos -->
600 <div ".(!strcmp(${$mver}, "on")?"class=\"mangos_hide\"":"class=\"mangos_show\"").">
601 <div class=\"top10\"><span class=\"txt\">".$text['cfg_db_mangos']."</span></div>
602 <div class=\"aram2\">
603 <table>
604 <tr>
605 <td class=\"txt\">".$text['cfg_db_host']."</td>
606 <td ><input type=\"text\" name=\"".$hh."\" id=\"".$hh."\" class=\"old\" value=\"".(isset(${$hh})?${$hh}:"localhost")."\" style=\"width:200px\" maxlength=\"120\"></td>
607 <td class=\"txt\">(default localhost or 127.0.0.1)</td>
608 </tr>
609 <tr>
610 <td class=\"txt\">".$text['cfg_db_user']."</td>
611 <td><input type=\"text\" name=\"".$uu."\" id=\"".$uu."\" class=\"old\" value=\"".(isset(${$uu})?${$uu}:"root")."\" maxlength=\"15\"></td>
612 <td class=\"txt\">(default root)</td>
613 </tr>
614 <tr>
615 <td class=\"txt\">".$text['password']."</td>
616 <td colspan=2><input";
617 if (isset($cfg_show_passwords) && $cfg_show_passwords) echo " type=\"text\" "; else echo " type=\"password\" ";
618 echo "name=\"".$pp."\" id=\"".$pp."\" class=\"old\" value=\"".(isset(${$pp})?${$pp}:"mangos")."\" maxlength=\"15\"></td>
619 </tr>
620 <tr>
621 <td class=\"txt\">".$text['cfg_db_name']."</td>
622 <td><input type=\"text\" name=\"".$dd."\" id=\"".$dd."\" class=\"old\" value=\"".(isset(${$dd})?${$dd}:"mangos")."\" maxlength=\"20\"></td>
623 <td class=\"txt\">(default mangos)</td>
624 </tr>
625 </table>
626 </div>
627 </div>
628
629 <!-- database realmd -->
630 <div class=\"top10\"><span class=\"txt\">".$text['cfg_db_realmd']."</span></div>
631 <div class=\"aram2\">
632 <table>
633 <tr>
634 <td class=\"txt\">".$text['cfg_db_host']."</td>
635 <td ><input type=\"text\" name=\"".$hhr."\" id=\"".$hhr."\" class=\"old\" value=\"".(isset(${$hhr})?${$hhr}:"localhost")."\" style=\"width:200px\" maxlength=\"120\"></td>
636 <td class=\"txt\">(default localhost or 127.0.0.1)</td>
637 </tr>
638 <tr>
639 <td class=\"txt\">".$text['cfg_db_user']."</td>
640 <td><input type=\"text\" name=\"".$uur."\" id=\"".$uur."\" class=\"old\" value=\"".(isset(${$uur})?${$uur}:"root")."\" maxlength=\"15\"></td>
641 <td class=\"txt\">(default root)</td>
642 </tr>
643 <tr>
644 <td class=\"txt\">".$text['password']."</td>
645 <td colspan=2><input";
646 if (isset($cfg_show_passwords) && $cfg_show_passwords) echo " type=\"text\" "; else echo " type=\"password\" ";
647 echo "name=\"".$ppr."\" id=\"".$ppr."\" class=\"old\" value=\"".(isset(${$ppr})?${$ppr}:"realmd")."\" maxlength=\"15\"></td>
648 </tr>
649 <tr>
650 <td class=\"txt\">".$text['cfg_db_name']."</td>
651 <td><input type=\"text\" name=\"".$ddr."\" id=\"".$ddr."\" class=\"old\" value=\"".(isset(${$ddr})?${$ddr}:"realmd")."\" maxlength=\"20\"></td>
652 <td class=\"txt\">(default realmd)</td>
653 </tr>
654 </table>
655 </div>
656
657 <!-- database characters -->
658 <div class=\"top10\"><span class=\"txt\">".$text['cfg_db_chars']."</span></div>
659 <div class=\"aram2\">
660 <table>
661 <tr>
662 <td class=\"txt\">".$text['cfg_db_host']."</td>
663 <td ><input type=\"text\" name=\"".$hhc."\" id=\"".$hhc."\" class=\"old\" value=\"".(isset(${$hhc})?${$hhc}:"localhost")."\" style=\"width:200px\" maxlength=\"120\"></td>
664 <td class=\"txt\">(default localhost or 127.0.0.1)</td>
665 </tr>
666 <tr>
667 <td class=\"txt\">".$text['cfg_db_user']."</td>
668 <td><input type=\"text\" name=\"".$uuc."\" id=\"".$uuc."\" class=\"old\" value=\"".(isset(${$uuc})?${$uuc}:"root")."\" maxlength=\"15\"></td>
669 <td class=\"txt\">(default root)</td>
670 </tr>
671 <tr>
672 <td class=\"txt\">".$text['password']."</td>
673 <td colspan=2><input";
674 if (isset($cfg_show_passwords) && $cfg_show_passwords) echo " type=\"text\" "; else echo " type=\"password\" ";
675 echo "name=\"".$ppc."\" id=\"".$ppc."\" class=\"old\" value=\"".(isset(${$ppc})?${$ppc}:"characters")."\" maxlength=\"15\"></td>
676 </tr>
677 <tr>
678 <td class=\"txt\">".$text['cfg_db_name']."</td>
679 <td><input type=\"text\" name=\"".$ddc."\" id=\"".$ddc."\" class=\"old\" value=\"".(isset(${$ddc})?${$ddc}:"characters")."\" maxlength=\"20\"></td>
680 <td class=\"txt\">(default characters)</td>
681 </tr>
682 </table>
683 </div>
684
685 <!-- server options -->
686 <div class=\"top10\"><span class=\"txt\">".$text['cfg_server_other']."</span></div>
687 <div class=\"aram2\">
688 <table>
689 <tr>
690 <td class=\"txt\">".$text['cfg_db_enc']."</td>
691 <td ><input type=\"text\" name=\"".$dde."\" id=\"".$dde."\" class=\"old\" value=\"".(isset(${$dde})?${$dde}:"utf-8")."\" maxlength=\"10\"></td>
692 <td class=\"txt\">(default utf-8)</td>
693 </tr>
694 <tr>
695 <td class=\"txt\">".$text['cfg_server_host']."</td>
696 <td><input type=\"text\" name=\"".$srv."\" id=\"".$srv."\" class=\"old\" value=\"".(isset(${$srv})?${$srv}:"localhost")."\" maxlength=\"30\"></td>
697 <td class=\"txt\">(default localhost)</td>
698 </tr>
699 <tr>
700 <td class=\"txt\">".$text['cfg_server_port']."</td>
701 <td><input type=\"text\" name=\"".$prt."\" id=\"".$prt."\" class=\"old\" value=\"".(isset(${$prt})?${$prt}:"8085")."\" maxlength=\"5\"></td>
702 <td class=\"txt\">(default 8085)</td>
703 </tr>
704 </table>
705 </div>
706
707 <!-- registration options -->
708 <div class=\"top10\"><span class=\"txt\">".$text['cfg_account_opts']."</span></div>
709 <div class=\"aram2\">
710 <table>
711 <tr>
712 <td class=\"txt\">".$text['exten']."</td>
713 <td colspan=2 class=\"txt\">
714 <input class=\"radio\" type=\"radio\" name=\"".$ext."\" id=\"".$ext."\" value=\"1\" ".((!isset(${$ext}) || ${$ext} < 2)?"checked":"")."> 2.4.3 (TBC)
715 <input class=\"radio\" type=\"radio\" name=\"".$ext."\" value=\"2\" ".((isset(${$ext}) && ${$ext} == 2)?"checked":"").">3.0.3 (WotLK)
716 </td>
717 </tr>
718 <tr>
719 <td class=\"txt\">".$text['cfg_account_create']."</td>
720 <td colspan=2 class=\"txt\">
721 <input class=\"radio\" type=\"radio\" name=\"".$ao."\" id=\"".$ao."\" value=\"1\" ".((!isset(${$ao}) || ${$ao} < 2)?"checked":"").">".$text['label_yes']."
722 <input class=\"radio\" type=\"radio\" name=\"".$ao."\" value=\"2\" ".((isset(${$ao}) && ${$ao} == 2)?"checked":"").">".$text['label_no']."
723 </td>
724 </tr>
725 <tr>
726 <td class=\"txt\">".$text['cfg_account_show_online']."</td>
727 <td colspan=2 class=\"txt\">
728 <input class=\"radio\" type=\"radio\" name=\"".$oop."\" id=\"".$oop."\" value=\"1\" ".((!isset(${$oop}) || ${$oop} < 2)?"checked":"").">".$text['label_yes']."
729 <input class=\"radio\" type=\"radio\" name=\"".$oop."\" value=\"2\" ".((isset(${$oop}) && ${$oop} == 2)?"checked":"").">".$text['label_no']."
730 </td>
731 </tr>
732 <tr>
733 <td class=\"txt\">".$text['cfg_account_show_max']."</td>
734 <td>
735 <input type=\"text\" name=\"".$osm."\" id=\"".$osm."\" class=\"old\" value=\"".(isset(${$osm})?${$osm}:"0")."\" maxlength=\"5\">
736 </td>
737 <td class=\"txt\">(default 0)
738 </td>
739 </tr>
740 <tr>
741 <td class=\"txt\">".$text['cfg_account_lock_ip']."</td>
742 <td colspan=2 class=\"txt\">
743 <input class=\"radio\" type=\"radio\" name=\"".$la."\" id=\"".$la."\" value=\"1\" ".((isset(${$la}) && ${$la} > 0)?"checked":"").">".$text['label_yes']."
744 <input class=\"radio\" type=\"radio\" name=\"".$la."\" value=\"0\" ".((!isset(${$la}) || ${$la} == 0)?"checked":"").">".$text['label_no']."
745 </td>
746 </tr>
747 <tr>
748 <td class=\"txt\">".$text['cfg_account_num_ip']."</td>
749 <td><input type=\"text\" name=\"".$lr."\" id=\"".$lr."\" class=\"old\" value=\"".(isset(${$lr})?${$lr}:"5")."\" maxlength=\"10\"></td>
750 <td class=\"txt\">(default 5) </td>
751 </tr>
752 <tr>
753 <td class=\"txt\">".$text['cfg_show_gm']."</td>
754 <td><input type=\"text\" name=\"".$shg."\" id=\"".$shg."\" class=\"old\" value=\"".(isset(${$shg})?${$shg}:"3")."\" maxlength=\"1\" style=\"width:30px;\"></td>
755 <td class=\"txt\">(default 3) </td>
756 </tr>
757 <tr>
758 <td class=\"txt\">".$text['cfg_account_preview']."</td>
759 <td colspan=2 class=\"txt\">
760 <input class=\"radio\" type=\"radio\" name=\"".$acp."\" id=\"".$acp."\" value=\"1\" ".((isset(${$acp}) && ${$acp} == 1)?"checked":"").">".$text['label_yes']."
761 <input class=\"radio\" type=\"radio\" name=\"".$acp."\" value=\"0\" ".((!isset(${$acp}) || ${$acp} == 0)?"checked":"").">".$text['label_no']."
762 </td>
763 </tr>
764 <tr>
765 <td class=\"txt\">".$text['cfg_account_change_pwd']."</td>
766 <td colspan=2 class=\"txt\">
767 <input class=\"radio\" type=\"radio\" name=\"".$chp."\" id=\"".$chp."\" value=\"1\" ".((isset(${$chp}) && ${$chp} == 1)?"checked":"").">".$text['label_yes']."
768 <input class=\"radio\" type=\"radio\" name=\"".$chp."\" value=\"0\" ".((!isset(${$chp}) || ${$chp} == 0)?"checked":"").">".$text['label_no']."
769 </td>
770 </tr>
771 <tr>
772 <td class=\"txt\">".$text['cfg_set_gm']."</td>
773 <td><input type=\"text\" name=\"".$seg."\" id=\"".$seg."\" class=\"old\" value=\"".(isset(${$seg})?${$seg}:"0")."\" maxlength=\"1\" style=\"width:30px;\"></td>
774 <td class=\"txt\">(0 user, 1 moderator, 2 gamemaster, 3 administrator) </td>
775 </tr>
776 </table>
777 </div>
778
779 <!-- administration options -->
780 <div class=\"top10\"><span class=\"txt\">".$text['cfg_admin_optsL']."</span></div>
781 <div class=\"aram2\">
782 <table>
783 <tr>
784 <td class=\"txt\">".$text['cfg_mail_need']."</td>
785 <td colspan=2 class=\"txt\">
786 <input class=\"radio\" type=\"radio\" name=\"".$cmd."\" id=\"".$cmd."\" value=\"1\" ".((isset(${$cmd}) && ${$cmd} > 0)?"checked":"").">".$text['label_yes']."
787 <input class=\"radio\" type=\"radio\" name=\"".$cmd."\" value=\"0\" ".((!isset(${$cmd}) || ${$cmd} == 0)?"checked":"").">".$text['label_no']."
788 </td>
789 </tr>
790 <tr>
791 <td class=\"txt\">".$text['cfg_statistics_show']."</td>
792 <td colspan=2 class=\"txt\">
793 <input class=\"radio\" type=\"radio\" name=\"".$css."\" id=\"".$css."\" value=\"1\" ".((isset(${$css}) && ${$css} > 0)?"checked":"").">".$text['label_yes']."
794 <input class=\"radio\" type=\"radio\" name=\"".$css."\" value=\"0\" ".((!isset(${$css}) || ${$css} == 0)?"checked":"").">".$text['label_no']."
795 </td>
796 </tr>
797 </table>
798 </div>
799
800 <!-- map options -->
801 <div class=\"top10\"><span class=\"txt\">".$text['cfg_map_opts']."</span></div>
802 <div class=\"aram2\">
803 <table>
804 <tr>
805 <td class=\"txt\">".$text['cfg_map_show']."</td>
806 <td colspan=2 class=\"txt\">
807 <input class=\"radio\" type=\"radio\" name=\"".$maps."\" id=\"".$maps."\" value=\"1\" ".((isset(${$maps}) && ${$maps} > 0)?"checked":"").">".$text['label_yes']."
808 <input class=\"radio\" type=\"radio\" name=\"".$maps."\" value=\"0\" ".((!isset(${$maps}) || ${$maps} == 0)?"checked":"").">".$text['label_no']."
809 </td>
810 </tr>
811 <tr>
812 <td class=\"txt\">".$text['cfg_map_refresh']."</td>
813 <td><input type=\"text\" name=\"".$mapr."\" id=\"".$mapr."\" class=\"old\" value=\"".(isset(${$mapr})?${$mapr}:"60000")."\" maxlength=\"10\"></td>
814 <td class=\"txt\">(default 60000)</td>
815 </tr>
816 </table>
817 </div>
818
819 <!-- teleport options -->
820 <div class=\"top10\"><span class=\"txt\">".$text['cfg_tele_opts']."</span></div>
821 <div class=\"aram2\">
822 <table>
823 <tr>
824 <td class=\"txt\">".$text['cfg_tele_show']."</td>
825 <td colspan=2 class=\"txt\">
826 <input class=\"radio\" type=\"radio\" name=\"".$teleS."\" id=\"".$teleS."\" value=\"1\" ".((isset(${$teleS}) && ${$teleS} > 0)?"checked":"").">".$text['label_yes']."
827 <input class=\"radio\" type=\"radio\" name=\"".$teleS."\" value=\"0\" ".((!isset(${$teleS}) || ${$teleS} == 0)?"checked":"").">".$text['label_no']."
828 </td>
829 </tr>
830 <tr>
831 <td class=\"txt\">".$text['cfg_tele_fee']."</td>
832 <td><input type=\"text\" name=\"".$teleF."\" id=\"".$teleF."\" class=\"old\" value=\"".(isset(${$teleF})?${$teleF}:"500")."\" maxlength=\"10\"></td>
833 <td class=\"txt\">(default 500 gold)</td>
834 </tr>
835 </table>
836 </div>
837
838
839
840 </div>";
841 }
842// MULTIREALM END
843
844 echo "
845 </div>
846
847 <!-- template options -->
848 <div class=\"top10\"><span class=\"txt\">".$text['cfg_template_opts']."</span></div>
849 <div class=\"aram2\">
850 <table>
851 <tr>
852 <td class=\"txt\">".$text['cfg_template_choose']."</td>
853 <td colspan=2 class=\"txt\">
854 <input class=\"radio\" type=\"radio\" name=\"layout\" id=\"layout\" value=\"0\" ".((!isset($layout) || $layout == 0)?"checked":"").">tBC
855 <input class=\"radio\" type=\"radio\" name=\"layout\" value=\"1\" ".((isset($layout) && $layout > 0)?"checked":"").">WotLK
856 </td>
857 </tr>
858 <tr>
859 <td class=\"txt\">".$text['cfg_template_img']."</td>
860 <td ><input type=\"text\" name=\"img_base\" id=\"img_base\" class=\"old\" value=\"".(isset($img_base)?$img_base:"img/")."\" maxlength=\"20\"></td>
861 <td class=\"txt\">(default img/)</td>
862 </tr>
863 </table>
864 </div>
865
866 <!-- message board options -->
867 <div class=\"top10\"><span class=\"txt\">".$text['cfg_msg_opts']."</span></div>
868 <div class=\"aram2\">
869 <table>
870 <tr>
871 <td class=\"txt\">".$text['cfg_msg_show']."</td>
872 <td colspan=2 class=\"txt\">
873 <input class=\"radio\" type=\"radio\" name=\"show_board\" id=\"show_board\" value=\"1\" ".((isset($show_board) && $show_board > 0)?"checked":"").">".$text['label_yes']."
874 <input class=\"radio\" type=\"radio\" name=\"show_board\" value=\"0\" ".((!isset($show_board) || $show_board == 0)?"checked":"").">".$text['label_no']."
875 </td>
876 </tr>
877 <tr>
878 <td class=\"txt\">".$text['cfg_msg_file']."</td>
879 <td ><input type=\"text\" name=\"msg_file\" id=\"msg_file\" class=\"old_red\" value=\"".(isset($msg_file)?$msg_file:"minichat00.txt")."\" maxlength=\"30\"></td>
880 <td class=\"txt\">(default minichat00.txt)</td>
881 </tr>
882 <tr>
883 <td class=\"txt\">".$text['cfg_msg_refresh']."</td>
884 <td><input type=\"text\" name=\"msg_refresh\" id=\"msg_refresh\" class=\"old\" value=\"".(isset($msg_refresh)?$msg_refresh:"5000")."\" maxlength=\"10\"></td>
885 <td class=\"txt\">(default 5000)</td>
886 </tr>
887 <tr>
888 <td class=\"txt\">".$text['cfg_msg_height']."</td>
889 <td><input type=\"text\" name=\"msg_big_ta_length\" id=\"msg_big_ta_length\" class=\"old\" value=\"".(isset($msg_big_ta_length)?$msg_big_ta_length:"30")."\" maxlength=\"10\"></td>
890 <td class=\"txt\">(default 30)</td>
891 </tr>
892 <tr>
893 <td class=\"txt\">".$text['cfg_msg_max_length']."</td>
894 <td><input type=\"text\" name=\"msg_max_length\" id=\"msg_max_length\" class=\"old\" value=\"".(isset($msg_max_length)?$msg_max_length:"150")."\" maxlength=\"10\"></td>
895 <td class=\"txt\">(default 150)</td>
896 </tr>
897 <tr>
898 <td class=\"txt\">".$text['cfg_msg_max_all']."</td>
899 <td><input type=\"text\" name=\"msg_max_num\" id=\"msg_max_num\" class=\"old\" value=\"".(isset($msg_max_num)?$msg_max_num:"5000")."\" maxlength=\"12\"></td>
900 <td class=\"txt\">(default 5000)</td>
901 </tr>
902 <tr>
903 <td class=\"txt\">".$text['cfg_msg_max_word']."</td>
904 <td><input type=\"text\" name=\"msg_max_long_word\" id=\"msg_max_long_word\" class=\"old\" value=\"".(isset($msg_max_long_word)?$msg_max_long_word:"30")."\" maxlength=\"12\"></td>
905 <td class=\"txt\">(default 30)</td>
906 </tr>
907 <tr>
908 <td class=\"txt\">".$text['cfg_msg_time_format']."</td>
909 <td><input type=\"text\" name=\"msg_time_format\" id=\"msg_time_format\" class=\"old\" value=\"".(isset($msg_time_format)?$msg_time_format:"%H:%M")."\" maxlength=\"12\"></td>
910 <td class=\"txt\">(default %H:%M, example %A, %Y, %D)</td>
911 </tr>
912 <tr>
913 <td class=\"txt\">".$text['cfg_msg_separator']."</td>
914 <td><input type=\"text\" name=\"msg_separator\" id=\"msg_separator\" class=\"old\" value=\"".(isset($msg_separator)?$msg_separator:"---------------------------------")."\" maxlength=\"50\" style=\"width:200px\"></td>
915 <td class=\"txt\">(default ---------------------------------)</td>
916 </tr>
917 <tr>
918 <td class=\"txt\">".$text['cfg_msg_reg_only']."</td>
919 <td colspan=2 class=\"txt\">
920 <input class=\"radio\" type=\"radio\" name=\"msg_reg_only\" id=\"msg_reg_only\" value=\"1\" ".((isset($msg_reg_only) && $msg_reg_only > 0)?"checked":"").">".$text['label_yes']."
921 <input class=\"radio\" type=\"radio\" name=\"msg_reg_only\" value=\"0\" ".((!isset($msg_reg_only) || $msg_reg_only == 0)?"checked":"").">".$text['label_no']."
922 </td>
923 </tr>
924 <tr>
925 <td class=\"txt\">".$text['cfg_msg_ban_list']."</td>
926 <td ><textarea rows=\"4\" cols=\"41\" name=\"msg_ban_list\" id=\"msg_ban_list\" class=\"ta_black_little\" style=\"width:300px;height:50px;\">".(isset($msg_ban_list)?$msg_ban_list:"")."</textarea>
927 <td class=\"txt\">(separator ,)</td>
928 </tr>
929 </table>
930 </div>
931
932 <!-- global administration options -->
933 <div class=\"top10\"><span class=\"txt\">".$text['cfg_admin_opts']."</span></div>
934 <div class=\"aram2\">
935 <table>
936 <tr>
937 <td class=\"txt\">".$text['cfg_admin_show_pwd']."</td>
938 <td colspan=2 class=\"txt\">
939 <input class=\"radio\" type=\"radio\" name=\"cfg_show_passwords\" id=\"cfg_show_passwords\" value=\"1\" ".((isset($cfg_show_passwords) && $cfg_show_passwords > 0)?"checked":"").">".$text['label_yes']."
940 <input class=\"radio\" type=\"radio\" name=\"cfg_show_passwords\" value=\"0\" ".((!isset($cfg_show_passwords) || $cfg_show_passwords == 0)?"checked":"").">".$text['label_no']."
941 </td>
942 </tr>
943 <tr>
944 <td class=\"txt\">".$text['cfg_s_file']."</td>
945 <td><input type=\"text\" name=\"cfg_sfile\" id=\"cfg_sfile\" class=\"old_red\" value=\"".(isset($cfg_sfile)?$cfg_sfile:"sha1_datas.php")."\" maxlength=\"30\"></td>
946 <td class=\"txt\">(default sha1_datas.php)</td>
947 </tr>
948 <tr>
949 <td class=\"txt\">".$text['cfg_admin_show_info']."</td>
950 <td colspan=2 class=\"txt\">
951 <input class=\"radio\" type=\"radio\" name=\"cfg_show_info\" id=\"cfg_show_info\" value=\"1\" ".((isset($cfg_show_info) && $cfg_show_info > 0)?"checked":"").">".$text['label_yes']."
952 <input class=\"radio\" type=\"radio\" name=\"cfg_show_info\" value=\"0\" ".((!isset($cfg_show_info) || $cfg_show_info == 0)?"checked":"").">".$text['label_no']."
953 </td>
954 </tr>
955 <tr>
956 <td class=\"txt\">".$text['info_label']."</td>
957 <td colspan=2><textarea rows=\"4\" cols=\"41\" name=\"information\" id=\"information\" class=\"ta_black_little\" style=\"width:300px;height:50px;\">".(isset($information)?$information:"")."</textarea>
958 </tr>
959 <tr>
960 <td class=\"txt\">".$text['cfg_admin_nick']."</td>
961 <td><input type=\"text\" name=\"cfg_admin_nick\" id=\"cfg_admin_nick\" class=\"old\" value=\"".(isset($cfg_admin_nick)?$cfg_admin_nick:"@admin")."\" maxlength=\"15\"></td>
962 <td class=\"txt\">(default @admin)</td>
963 </tr>
964 <tr>
965 <td class=\"txt\">".$text['cfg_admin_ip']."</td>
966 <td><input type=\"text\" name=\"cfg_admin_ip\" id=\"cfg_admin_ip\" class=\"old\" value=\"".(isset($cfg_admin_ip)?$cfg_admin_ip:"*")."\" maxlength=\"15\"></td>
967 <td class=\"txt\">(default *) ".$text['msg_cur_ip'].": ".$_SERVER['REMOTE_ADDR']." </td>
968 </tr>
969 <tr>
970 <td class=\"txt\">".$text['cfg_ptable_refresh']."</td>
971 <td><input type=\"text\" name=\"cfg_ptable_refresh\" id=\"cfg_ptable_refresh\" class=\"old\" value=\"".(isset($cfg_ptable_refresh)?$cfg_ptable_refresh:"60000")."\" maxlength=\"13\"></td>
972 <td class=\"txt\">(default 60000)</td>
973 </tr>
974
975 </table>
976 </div>
977
978 <!-- pool options -->
979 <div class=\"top10\"><span class=\"txt\">".$text['cfg_pool_opts']."</span></div>
980 <div class=\"aram2\">
981 <table>
982 <tr>
983 <td class=\"txt\">".$text['cfg_pool_show']."</td>
984 <td colspan=2 class=\"txt\">
985 <input class=\"radio\" type=\"radio\" name=\"cfg_pool_show\" id=\"cfg_pool_show\" value=\"1\" ".((isset($cfg_pool_show) && $cfg_pool_show > 0)?"checked":"").">".$text['label_yes']."
986 <input class=\"radio\" type=\"radio\" name=\"cfg_pool_show\" value=\"0\" ".((!isset($cfg_pool_show) || $cfg_pool_show == 0)?"checked":"").">".$text['label_no']."
987 </td>
988 </tr>
989 <tr>
990 <td class=\"txt\">".$text['cfg_pool_file']."</td>
991 <td ><input type=\"text\" name=\"cfg_pool_file\" id=\"cfg_pool_file\" class=\"old_red\" value=\"".(isset($cfg_pool_file)?$cfg_pool_file:"pool00.php")."\" maxlength=\"30\"></td>
992 <td class=\"txt\">(default pool00.php)</td>
993 </tr>
994 <tr>
995 <td class=\"txt\">".$text['cfg_pool_q']."</td>
996 <td colspan=2><input type=\"text\" name=\"cfg_pool_q\" id=\"cfg_pool_q\" class=\"old\" value=\"".(isset($cfg_pool_q)?$cfg_pool_q:"")."\" maxlength=\"150\" style=\"width:300px\"></td>
997 </tr>
998 <tr>
999 <td class=\"txt\">".$text['cfg_pool_answers']."</td>
1000 <td colspan=2><input type=\"text\" name=\"cfg_pool_answers\" id=\"cfg_pool_answers\" class=\"old\" value=\"".(isset($cfg_pool_answers)?$cfg_pool_answers:"0")."\" maxlength=\"1\" style=\"width:20px\"></td>
1001 </tr>";
1002
1003 if (isset($cfg_pool_answers)) {
1004 if ($cfg_pool_answers > 9)
1005 $cfg_pool_answers = 9; // max 9
1006 }
1007 else
1008 $cfg_pool_answers = 0;
1009
1010 for ($k = 1; $k < $cfg_pool_answers+1; $k++) {
1011 $val = "cfg_pool".$k;
1012 if (isset(${$val})) {
1013 echo "
1014 <tr>
1015 <td class=\"txt\">".$text['cfg_pool_a'].$k."</td>
1016 <td colspan=2><input type=\"text\" name=\"cfg_pool".$k."\" id=\"cfg_pool".$k."\" class=\"old\" value=\"".${$val}."\" maxlength=\"30\" style=\"width:300px\"></td>
1017 </tr>";
1018 }
1019 }
1020
1021 echo "
1022 </table>
1023 </div>
1024
1025 <!-- counter options -->
1026 <div class=\"top10\"><span class=\"txt\">".$text['cfg_counter_opts']."</span></div>
1027 <div class=\"aram2\">
1028 <table>
1029 <tr>
1030 <td class=\"txt\">".$text['cfg_show_counter']."</td>
1031 <td colspan=2 class=\"txt\">
1032 <input class=\"radio\" type=\"radio\" name=\"show_counter\" id=\"show_counter\" value=\"1\" ".((isset($show_counter) && $show_counter > 0)?"checked":"").">".$text['label_yes']."
1033 <input class=\"radio\" type=\"radio\" name=\"show_counter\" value=\"0\" ".((!isset($show_counter) || $show_counter == 0)?"checked":"").">".$text['label_no']."
1034 </td>
1035 </tr>
1036 <tr>
1037 <td class=\"txt\">".$text['cfg_counter_file']."</td>
1038 <td ><input type=\"text\" name=\"counter_file\" id=\"counter_file\" class=\"old_red\" value=\"".(isset($counter_file)?$counter_file:"count00.php")."\" maxlength=\"30\"></td>
1039 <td class=\"txt\">(default count00.php)</td>
1040 </tr>
1041 <tr>
1042 <td class=\"txt\">".$text['cfg_counter_length']."</td>
1043 <td ><input type=\"text\" name=\"counter_length\" id=\"counter_length\" class=\"old\" value=\"".(isset($counter_length)?$counter_length:"6")."\" maxlength=\"2\" style=\"width:30px\"></td>
1044 <td class=\"txt\">(default 6)</td>
1045 </tr>
1046 <tr>
1047 <td class=\"txt\">".$text['cfg_counter_expire']."</td>
1048 <td><input type=\"text\" name=\"counter_expire\" id=\"counter_expire\" class=\"old\" value=\"".(isset($counter_expire)?$counter_expire:"1")."\" maxlength=\"3\" style=\"width:30px\"></td>
1049 <td class=\"txt\">(default 1)</td>
1050 </tr>
1051 </table>
1052 </div>
1053
1054 <!-- stat.xml options -->
1055 <div class=\"top10\"><span class=\"txt\">".$text['cfg_stat_opts']."</span></div>
1056 <div class=\"aram2\">
1057 <table>
1058 <tr>
1059 <td class=\"txt\">".$text['cfg_create_status_xml']."</td>
1060 <td colspan=2 class=\"txt\">
1061 <input class=\"radio\" type=\"radio\" name=\"create_status_xml\" id=\"create_status_xml\" value=\"1\" ".((isset($create_status_xml) && $create_status_xml > 0)?"checked":"").">".$text['label_yes']."
1062 <input class=\"radio\" type=\"radio\" name=\"create_status_xml\" value=\"0\" ".((!isset($create_status_xml) || $create_status_xml == 0)?"checked":"").">".$text['label_no']."
1063 </td>
1064 </tr>
1065 <tr>
1066 <td class=\"txt\">".$text['cfg_stat_file']."</td>
1067 <td ><input type=\"text\" name=\"stat_file\" id=\"stat_file\" class=\"old_red\" value=\"".(isset($stat_file)?$stat_file:"stat.xml")."\" maxlength=\"30\"></td>
1068 <td class=\"txt\">(default stat.xml)</td>
1069 </tr>
1070 <tr>
1071 <td class=\"txt\">".$text['cfg_xml_version']."</td>
1072 <td colspan=2><input type=\"text\" name=\"xml_version\" id=\"xml_version\" class=\"old\" value=\"".(isset($xml_version)?$xml_version:"2.4.3")."\" maxlength=\"30\" style=\"width:300px\"></td>
1073 </tr>
1074 <tr>
1075 <td class=\"txt\">".$text['cfg_xml_owner']."</td>
1076 <td colspan=2><input type=\"text\" name=\"xml_owner\" id=\"xml_owner\" class=\"old\" value=\"".(isset($xml_owner)?$xml_owner:"@admin")."\" maxlength=\"30\" style=\"width:300px\"></td>
1077 </tr>
1078 </table>
1079 </div>
1080
1081 <!-- log options -->
1082 <div class=\"top10\"><span class=\"txt\">".$text['cfg_log_opts']."</span></div>
1083 <div class=\"aram2\">
1084 <table>
1085 <tr>
1086 <td class=\"txt\">".$text['cfg_log_show']."</td>
1087 <td colspan=2 class=\"txt\">
1088 <input class=\"radio\" type=\"radio\" name=\"cfg_log_show\" id=\"cfg_log_show\" value=\"1\" ".((isset($cfg_log_show) && $cfg_log_show > 0)?"checked":"").">".$text['label_yes']."
1089 <input class=\"radio\" type=\"radio\" name=\"cfg_log_show\" value=\"0\" ".((!isset($cfg_log_show) || $cfg_log_show == 0)?"checked":"").">".$text['label_no']."
1090 </td>
1091 </tr>
1092 <tr>
1093 <td class=\"txt\">".$text['cfg_log_file']."</td>
1094 <td ><input type=\"text\" name=\"cfg_log_file\" id=\"cfg_log_file\" class=\"old_red\" value=\"".(isset($cfg_log_file)?$cfg_log_file:"log00.php")."\" maxlength=\"30\"></td>
1095 <td class=\"txt\">(default log00.php)</td>
1096 </tr>
1097 <tr>
1098 <td class=\"txt\">".$text['cfg_log_level']."</td>
1099 <td ><input type=\"text\" name=\"cfg_log_level\" id=\"cfg_log_level\" class=\"old\" value=\"".(isset($cfg_log_level)?$cfg_log_level:"12345678")."\" maxlength=\"8\"></td>
1100 <td class=\"txt\">(default 12345678)</td>
1101 </tr>
1102 <tr>
1103 <td class=\"txt\">".$text['cfg_log_filter']."</td>
1104 <td><input type=\"text\" name=\"cfg_log_filter\" id=\"cfg_log_filter\" class=\"old\" value=\"".(isset($cfg_log_filter)?$cfg_log_filter:"12345678")."\" maxlength=\"8\"></td>
1105 <td class=\"txt\">(default 12345678)</td>
1106 </tr>
1107 <tr>
1108 <td class=\"txt\">".$text['cfg_log_expire']."</td>
1109 <td><input type=\"text\" name=\"cfg_log_expire\" id=\"cfg_log_expire\" class=\"old\" value=\"".(isset($cfg_log_expire)?$cfg_log_expire:"14")."\" maxlength=\"8\"></td>
1110 <td class=\"txt\">(default 14)</td>
1111 </tr>
1112 <tr>
1113 <td class=\"txt\">".$text['cfg_log_realm']."</td>
1114 <td><input type=\"text\" name=\"cfg_log_realm\" id=\"cfg_log_realm\" class=\"old\" value=\"".(isset($cfg_log_realm)?$cfg_log_realm:"1")."\" maxlength=\"9\"></td>
1115 <td class=\"txt\">(default 1)</td>
1116 </tr>
1117
1118 </table>
1119 </div>
1120 </form>
1121 </div>";
1122
1123 if (isset($cfg_log_show) && isset($cfg_log_file) && isset($cfg_log_filter)
1124 && $cfg_log_show && @is_file($cfg_log_file) && strlen($cfg_log_filter)) {
1125 echo "
1126 <!-- logs -->
1127 <div class=\"top10\"><span class=\"txt\">Log</span></div>
1128 <div class=\"aram2\">
1129
1130 <table cellspacing=1 cellpadding=4 bgcolor=\"#7F7F7F\" align=center width=\"100%\">
1131 <tr class=\"tab_title\">
1132 <td class=\"txt\">".$log_table_label['date']."</td>
1133 <td class=\"txt\">".$log_table_label['ip']."</td>
1134 <td class=\"txt\">".$log_table_label['type']."</td>
1135 <td class=\"txt\">".$log_table_label['login']."</td>
1136 <td class=\"txt\">".$log_table_label['description']."</td>
1137 </tr>
1138 ";
1139 $alllog = @file($cfg_log_file);
1140 if (!count($alllog)) { // no exists
1141 echo "
1142 <tr class=\"row_hor\">
1143 <td class=\"txt\">".$txt['label_empty']."</td>
1144 </tr>";
1145 }
1146 else {
1147 $j = 0;
1148 for ($i = 0; $i < count($alllog); $i++) {
1149 $ll = explode(";", $alllog[$i]);
1150 if (count($ll) > 5 && strstr($cfg_log_filter, $ll[3])) {
1151 $j++;
1152 $color = "row_log";
1153 if ($ll[3] == 1 || $ll[3] == 4)
1154 $color = "row_hor";
1155 if ($ll[3] == 6 || $ll[3] == 8)
1156 $color = "row_ali";
1157
1158
1159 if ($ll[3] == 3) // new account
1160 $color = "newp";
1161
1162 echo "
1163 <tr class=\"".$color."\">
1164 <td >".strftime("%d-%m-%Y %H:%M:%S", $ll[1])."</td>
1165 <td >".$ll[2]."</td>
1166 <td >".$log_type[$ll[3]]."</td>
1167 <td >".$ll[4]."</td>
1168 <td >".$ll[5]."&nbsp;</td>
1169 </tr>";
1170 }
1171 }
1172
1173 if (!$j) // nie su vybrane zaznamy - podla filtra
1174 echo "
1175 <tr><td colspan=5 style=\"background-color:#040d1a\">".$text['label_empty']."</td></tr>";
1176
1177 }
1178 echo "
1179 </table>
1180 </div>";
1181 }
1182 }
1183 }
1184?>
1185
1186</body>
1187</html>
Note: See TracBrowser for help on using the repository browser.