1 | <?php
|
---|
2 |
|
---|
3 | session_start();
|
---|
4 | include('config.php');
|
---|
5 | include('databaseconection.php');
|
---|
6 |
|
---|
7 | //pøipojení do databáze
|
---|
8 | $Database = new Database($Config['Database']['Host'], $Config['Database']['User'], $Config['Database']['Password']);
|
---|
9 | $Database->SQLCommand('SET NAMES '.$Config['Database']['Charset']);
|
---|
10 | $Database->SelectDatabase('quests');
|
---|
11 |
|
---|
12 | //pøihlá¹ení
|
---|
13 | if (array_key_exists('LoginUser',$_POST)) {
|
---|
14 | $_SESSION['User'] = $_POST['LoginUser'];
|
---|
15 | $_SESSION['Pass'] = $_POST['LoginPass'];
|
---|
16 |
|
---|
17 | $Line = mysql_fetch_array($Database->SQLCommand("SELECT ID FROM user WHERE user = '".$_SESSION['User']."'"));
|
---|
18 | $_SESSION['UserID'] = $Line['ID'];
|
---|
19 | }
|
---|
20 | //odhlá¹ení
|
---|
21 | if (array_key_exists('Logout',$_GET)) {
|
---|
22 | $_SESSION['User'] = '';
|
---|
23 | $_SESSION['Pass'] = '';
|
---|
24 | $_SESSION['UserID'] = '';
|
---|
25 | }
|
---|
26 |
|
---|
27 | function Licence($Licence)
|
---|
28 | { // BEGIN function Licence
|
---|
29 | global $Database;
|
---|
30 | if (isset($_SESSION['User']) and $_SESSION['User'] <> '') {
|
---|
31 | $User = $_SESSION['User'];
|
---|
32 | $Pass = $_SESSION['Pass'];
|
---|
33 |
|
---|
34 | $Line = mysql_fetch_array($Database->SQLCommand("SELECT * FROM user WHERE user = '$User'"));
|
---|
35 | if (!$Line) {
|
---|
36 | return false;
|
---|
37 | } else {
|
---|
38 | if ($Licence == 1) {
|
---|
39 | if ($Line['gm'] == 1) {
|
---|
40 | return true;
|
---|
41 | } else return false;
|
---|
42 | }
|
---|
43 | If ($Line['pass'] == $Pass) {
|
---|
44 |
|
---|
45 | // zapsání poslení pou¾ité IP
|
---|
46 | // $Addres = $_SERVER['REMOTE_ADDR'];
|
---|
47 | // $Database->SQLCommand("UPDATE user SET LastLogin = now(), LastIP = '$Addres' WHERE user = '$User'");
|
---|
48 |
|
---|
49 | return True;
|
---|
50 | } else { return False;
|
---|
51 | // die('Nemáte zde pøístup, pøihla¹te se: <a href="'.$Config['Web']['BaseURL'].'">zde</a>');
|
---|
52 | }
|
---|
53 | }
|
---|
54 | } else { return False;
|
---|
55 | // die('Nemáte zde pøístup, pøihla¹te se: <a href="'.$Config['Web']['BaseURL'].'">zde</a>');
|
---|
56 | }
|
---|
57 |
|
---|
58 | } // END function Licence
|
---|
59 |
|
---|
60 |
|
---|
61 | $Texts = array(
|
---|
62 | // array('Title'),
|
---|
63 | array('Details'),
|
---|
64 | array('Objectives'),
|
---|
65 | array('OfferRewardText'),
|
---|
66 | array('RequestItemsText'),
|
---|
67 | array('EndText'),
|
---|
68 | array('ObjectiveText1'),
|
---|
69 | array('ObjectiveText2'),
|
---|
70 | array('ObjectiveText3'),
|
---|
71 | array('ObjectiveText4'),
|
---|
72 | );
|
---|
73 |
|
---|
74 |
|
---|
75 | echo '<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
|
---|
76 | <HTML>
|
---|
77 | <HEAD>
|
---|
78 | <META http-equiv="Content-Language" content="cs">
|
---|
79 | <META http-equiv="Content-Type" content="text/html; charset='.$Config['Web']['Charset'].'">
|
---|
80 | <META HTTP-EQUIV="Expires" CONTENT="Mon, 06 Jan 1990 00:00:01 GMT">
|
---|
81 | <link rel="SHORTCUT ICON" href="/images/favicon.ico">
|
---|
82 | <TITLE>WoW server Heroes of Fantasy - Projekt pøekládání Questù do CZ</TITLE>
|
---|
83 | </HEAD>
|
---|
84 | <body>
|
---|
85 | <table border="0" width="100%">
|
---|
86 | <tr>
|
---|
87 | <td width="150" valign="top">
|
---|
88 | <br /><br />
|
---|
89 | <b>Odkazy:</b><br />
|
---|
90 | <a href="index.php">Domù</a><br />
|
---|
91 | <a href="registrace.php" style="color: red">Registrace</a><br />
|
---|
92 | <a href="Options.php">Nastavení</a><br />
|
---|
93 | <a href="statistic.php">Statistika</a><br />
|
---|
94 | <a href="export.php">Export</a><br />
|
---|
95 | <br />
|
---|
96 | <a href="ListQuests.php?selection">Nepøelo¾ené questy</a><br />
|
---|
97 | <a href="ListQuests.php?Translate">Pøelo¾ené questy</a><br />
|
---|
98 | <a href="ListQuests.php?mydevelop">Rozepsané questy</a><br />
|
---|
99 | <a href="ListQuests.php?my">Moje questy</a><br />
|
---|
100 | <br />
|
---|
101 | <a href="http://wow.zdechov.net/forum/viewforum.php?f=22">Forum projektu</a><br />
|
---|
102 | <a href="http://wow.zdechov.net/">Web serveru</a><br /><br />
|
---|
103 |
|
---|
104 | <form action="action.php" method="get">
|
---|
105 | <input type="text" name="search" size="13"><br>
|
---|
106 | <input type="submit" value="Hledat">
|
---|
107 | </form>
|
---|
108 | ';
|
---|
109 |
|
---|
110 | if (Licence(0)) {
|
---|
111 | echo 'Jste pøihlá¹en jako: <b>'.$_SESSION['User'].'</b> <a href="index.php?Logout">Odhlásit</a>';
|
---|
112 | } else {
|
---|
113 | echo '
|
---|
114 | <b>Login:</b><br>
|
---|
115 | <form action="index.php" method="post">
|
---|
116 | <table>
|
---|
117 | <tr>
|
---|
118 | <td><input type="text" name="LoginUser" size="13"></td>
|
---|
119 | </tr>
|
---|
120 | <tr>
|
---|
121 | <td><input type="password" name="LoginPass" size="13"></td>
|
---|
122 | </tr>
|
---|
123 | <tr>
|
---|
124 | <th><input type="submit" value="Pøihlásit"></th>
|
---|
125 | </tr>
|
---|
126 | </table>
|
---|
127 | </form>
|
---|
128 | ';
|
---|
129 | }
|
---|
130 | echo '</td>
|
---|
131 | <td>';
|
---|
132 |
|
---|
133 |
|
---|
134 |
|
---|
135 |
|
---|
136 | function ShowFooter()
|
---|
137 | { // BEGIN function ShowFooter
|
---|
138 | global $Database;
|
---|
139 |
|
---|
140 | echo '
|
---|
141 | </td>
|
---|
142 | </tr>
|
---|
143 | <tr><td></td><td> <span style="color: grey">Program naprogramoval maron (maron2@cetrum.cz)</span> </td></tr>
|
---|
144 | </table>
|
---|
145 | </body>
|
---|
146 | </html>
|
---|
147 | ';
|
---|
148 |
|
---|
149 | $Database->Disconnect();
|
---|
150 | } // END function ShowFooter
|
---|
151 |
|
---|
152 | ?>
|
---|