]> git.wh0rd.org - tt-rss.git/blame - tt-rss.php
fix http basic authentication
[tt-rss.git] / tt-rss.php
CommitLineData
4062022e 1<?
0cc89acb 2 session_start();
1c7f75ed 3
4062022e
AD
4 require_once "version.php";
5 require_once "config.php";
6 require_once "db-prefs.php";
ff485f1d 7 require_once "functions.php";
da5d0d09 8
4062022e 9 $link = db_connect(DB_HOST, DB_USER, DB_PASS, DB_NAME);
c93f38c4 10
7d4c898a
AD
11 if (!SINGLE_USER_MODE) {
12
13 if (!USE_HTTP_AUTH) {
14 if (!$_SESSION["uid"]) {
f6d0ab14 15 header("Location: login.php?rt=tt-rss.php");
7d4c898a
AD
16 exit;
17 }
18 } else {
8cb74804
AD
19 $force_logout = $_POST["ForceLogout"];
20 http_authenticate_user($link, $force_logout == "yes");
c8437f35
AD
21 }
22 } else {
7d4c898a
AD
23 $_SESSION["uid"] = 1;
24 $_SESSION["name"] = "admin";
c8437f35 25 }
ff485f1d 26
4062022e 27?>
1cd17194
AD
28<html>
29<head>
30 <title>Tiny Tiny RSS</title>
da5d0d09 31
430bf183
AD
32 <link rel="stylesheet" type="text/css" href="tt-rss.css">
33
4062022e 34 <? if (get_pref($link, 'USE_COMPACT_STYLESHEET')) { ?>
da5d0d09 35
430bf183 36 <link rel="stylesheet" href="tt-rss_compact.css" type="text/css">
da5d0d09
AD
37
38 <? } else { ?>
39
430bf183
AD
40 <link title="Compact Stylesheet" rel="alternate stylesheet"
41 type="text/css" href="tt-rss_compact.css"/>
da5d0d09
AD
42
43 <? } ?>
628eb1bd 44
331900c6 45 <script type="text/javascript" src="functions.js"></script>
1cd17194 46 <script type="text/javascript" src="tt-rss.js"></script>
d5224f0d
AD
47 <!--[if gte IE 5.5000]>
48 <script type="text/javascript" src="pngfix.js"></script>
49 <![endif]-->
d76a3b03 50 <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
1cd17194
AD
51</head>
52
53<body onload="init()">
54
4062022e 55<? if (get_pref($link, 'ENABLE_SPLASH')) { ?>
2f587484
AD
56<div id="splash">
57 <table width='100%' height='100%'><tr>
58 <td class="innerSplash" valign="middle" align="center">
59 <img src="images/ttrss_logo.png" alt="logo">
60 <p>Loading, please wait...</p>
61 </td></tr></table>
62</div>
63<? } ?>
64
828a8ecc 65<table width="100%" height="100%" cellspacing="0" cellpadding="0" class="main">
4062022e 66<? if (get_pref($link, 'DISPLAY_HEADER')) { ?>
1cd17194 67<tr>
c93f38c4 68 <td colspan="2">
828a8ecc 69 <table cellspacing="0" cellpadding="0" width="100%"><tr>
c93f38c4 70 <td rowspan="2" class="header" valign="middle">
828a8ecc
AD
71 <img src="images/ttrss_logo.png" alt="logo">
72 </td>
73 <td align="right" valign="top">
74 <div id="notify"><span id="notify_body"></div>
75 </td>
69919a24
AD
76
77 <div id="userDlg">&nbsp;</div>
78
c93f38c4 79 </tr><tr><td class="welcomePrompt">
7d4c898a 80 <? if (!SINGLE_USER_MODE) { ?>
8cb74804
AD
81 <? if (USE_HTTP_AUTH) { ?>
82 <table align="right"><tr>
83 <td class="httpWelcomePrompt">Hello, <b><?= $_SESSION["name"] ?></b></td>
84 <td><form action="tt-rss.php" method="POST">
85 <input type="hidden" name="ForceLogout" value="yes">
86 <input type="submit" class="button" value="Logout">
87 </form>
88 </td></tr></table>
89 <? } else { ?>
90 Hello, <b><?= $_SESSION["name"] ?></b>(<a href="logout.php">Logout</a>)
91 <? } ?>
92 </td>
7d4c898a 93 <? } ?>
828a8ecc 94 </tr></table>
2c1dd701
AD
95 </td>
96</tr>
69919a24
AD
97<? } else { ?>
98 <div id="userDlg">&nbsp;</div>
da5d0d09 99<? } ?>
1cd17194 100<tr>
f0601b87 101 <td valign="top" rowspan="3" class="feeds">
caa4e57f 102
1a66d16e
AD
103 <!-- <div id="feeds">&nbsp;</div> -->
104
8143ae1f
AD
105 <div id="dispSwitch">
106 <a id="dispSwitchPrompt" href="javascript:toggleTags()">display tags</a>
107 </div>
108
5bfef089 109 <iframe frameborder="0"
6adbdbee 110 src="backend.php?op=error&msg=Loading,%20please wait..."
5bfef089 111 id="feeds-frame" name="feeds-frame" class="feedsFrame"> </iframe>
7a991cac 112
4062022e 113 <? if (get_pref($link, 'DISPLAY_FEEDLIST_ACTIONS')) { ?>
7a991cac 114
3745788e 115 <div align="center">All feeds:
caa4e57f 116
3745788e
AD
117 <select id="allFeedsChooser">
118 <option>Update</option>
119 <option>Mark as read</option>
cbe45fa8 120 <option>Show only unread</option>
3745788e
AD
121 </select>
122
123 <input type="submit" class="button" onclick="allFeedsMenuGo()" value="Go">
27be66c3 124
3745788e 125 </div>
caa4e57f 126
7a991cac
AD
127 <? } ?>
128
1cd17194 129 </td>
f0601b87 130 <td valign="top" class="headlinesToolbarBox">
e828e31e 131 <table width="100%" cellpadding="0" cellspacing="0">
ac43eba1 132
ac43eba1 133 <tr><td class="headlinesToolbar" id="headlinesToolbar">
4ce19859 134 <input id="searchbox"
f0601b87
AD
135 onblur="javascript:enableHotkeys()" onfocus="javascript:disableHotkeys()"
136 onchange="javascript:search()">
52b51244
AD
137 <select id="searchmodebox">
138 <option>This feed</option>
139 <option>All feeds</option>
140 </select>
141
ac43eba1 142 <input type="submit"
4ce19859 143 class="button" onclick="javascript:search()" value="Search">
f0601b87 144
033e47e0
AD
145 &nbsp;
146
147 View:
f0601b87
AD
148
149 <select id="viewbox" onchange="javascript:viewCurrentFeed(0, '')">
d6f55ce8 150 <option>All Articles</option>
f0601b87 151 <option>Starred</option>
ac43eba1 152 <option selected>Unread</option>
b5aa95e7 153 <option>Unread or Starred</option>
bdd01d3f 154 <option>Unread or Updated</option>
f0601b87
AD
155 </select>
156
cb1083a1
AD
157 &nbsp;Limit:
158
159 <select id="limitbox" onchange="javascript:viewCurrentFeed(0, '')">
f1b9a8ee
AD
160
161 <?
162 $limits = array(15 => 15, 30 => 30, 60 => 60);
163
4062022e
AD
164 $def_art_limit = get_pref($link, 'DEFAULT_ARTICLE_LIMIT');
165
166 print $def_art_limit;
167
168 if ($def_art_limit >= 0) {
169 $limits[$def_art_limit] = $def_art_limit;
f1b9a8ee
AD
170 }
171
172 asort($limits);
173
174 array_push($limits, 0);
175
176 foreach ($limits as $key) {
177 print "<option";
4062022e 178 if ($key == $def_art_limit) { print " selected"; }
f1b9a8ee
AD
179 print ">";
180
181 if ($limits[$key] == 0) { print "All"; } else { print $limits[$key]; }
182
183 print "</option>";
184 } ?>
4062022e 185
cb1083a1
AD
186 </select>
187
ac43eba1
AD
188 &nbsp;Feed: <input class="button" type="submit"
189 onclick="javascript:viewCurrentFeed(0, 'ForceUpdate')" value="Update">
f0601b87 190
a7de14fc 191 <input class="button" type="submit" id="btnMarkFeedAsRead"
ac43eba1 192 onclick="javascript:viewCurrentFeed(0, 'MarkAllRead')" value="Mark as read">
f0601b87 193
a14f82f2
AD
194 </td>
195 <td align="right">
6de5d056 196 Actions: <select id="quickMenuChooser">
cbe45fa8 197 <option id="qmcPrefs" selected>Preferences...</option>
7a991cac
AD
198 <option disabled>--------</option>
199 <option style="color : #5050aa" disabled>Feed actions:</option>
cbe45fa8
AD
200 <option id="qmcAddFeed">&nbsp;&nbsp;Add new feed</option>
201 <option id="qmcRemoveFeed">&nbsp;&nbsp;Remove this feed</option>
e2f8f7b4 202 <!-- <option>Edit this feed</option> -->
7a991cac
AD
203 <option disabled>--------</option>
204 <option style="color : #5050aa" disabled>All feeds:</option>
cbe45fa8
AD
205 <option id="qmcUpdateFeeds">&nbsp;&nbsp;Update</option>
206 <option id="qmcCatchupAll">&nbsp;&nbsp;Mark as read</option>
207 <option id="qmcShowOnlyUnread">&nbsp;&nbsp;Show only unread</option>
e2f8f7b4
AD
208 </select>
209 <input type="submit" class="button" onclick="quickMenuGo()" value="Go">
a14f82f2
AD
210 </td>
211 </tr>
f0601b87
AD
212 </table>
213 </td>
214</tr><tr>
1cd17194 215 <td id="headlines" class="headlines" valign="top">
5bfef089 216 <iframe frameborder="0" name="headlines-frame"
e828e31e
AD
217 id="headlines-frame" class="headlinesFrame"
218 src="backend.php?op=error&msg=No%20feed%20selected."></iframe>
1cd17194 219 </td>
bb7cface 220</tr><tr>
1cd17194 221 <td class="content" id="content" valign="top">
5bfef089
AD
222 <iframe frameborder="0" name="content-frame"
223 id="content-frame" class="contentFrame"> </iframe>
1cd17194
AD
224 </td>
225</tr>
4062022e 226<? if (get_pref($link, 'DISPLAY_FOOTER')) { ?>
1cd17194 227<tr>
e828e31e 228 <td colspan="2" class="footer">
7936e979 229 <a href="http://bah.spb.su/~fox/tt-rss/">Tiny-Tiny RSS</a> v<?= VERSION ?> &copy; 2005 Andrew Dolgov
0b615681
AD
230 <? if (WEB_DEMO_MODE) { ?>
231 <br>Running in demo mode, some functionality is disabled.
232 <? } ?>
1cd17194
AD
233 </td>
234</td>
da5d0d09 235<? } ?>
1cd17194
AD
236</table>
237
ab49d368 238<? db_close($link); ?>
1cd17194
AD
239
240</body>
241</html>