]> git.wh0rd.org Git - tt-rss.git/blob - prefs.php
fix http basic authentication
[tt-rss.git] / prefs.php
1 <?
2         session_start();
3
4         require_once "version.php"; 
5         require_once "config.php";
6         require_once "db-prefs.php";
7         require_once "functions.php"; 
8
9         $link = db_connect(DB_HOST, DB_USER, DB_PASS, DB_NAME); 
10
11         if (!SINGLE_USER_MODE) {
12
13                 if (!USE_HTTP_AUTH) {
14                         if (!$_SESSION["uid"]) {
15                                 header("Location: login.php?rt=tt-rss.php");
16                                 exit;
17                         }
18                 } else {
19                         $force_logout = $_POST["ForceLogout"];
20                         http_authenticate_user($link, $force_logout == "yes");
21                 }
22         } else {
23                 $_SESSION["uid"] = 1;
24                 $_SESSION["name"] = "admin";
25         }
26
27 ?>
28 <html>
29 <head>
30         <title>Tiny Tiny RSS : Preferences</title>
31         <link rel="stylesheet" href="tt-rss.css" type="text/css">
32
33         <? if (get_pref($link, 'USE_COMPACT_STYLESHEET')) { ?>
34
35                 <link rel="stylesheet" href="tt-rss_compact.css" type="text/css">
36
37         <? } else { ?>
38
39                 <link title="Compact Stylesheet" rel="alternate stylesheet" 
40                         type="text/css" href="tt-rss_compact.css"/> 
41
42         <? } ?>
43
44         
45         <script type="text/javascript" src="functions.js"></script>
46         <script type="text/javascript" src="prefs.js"></script>
47
48         <!--[if gte IE 5.5000]>
49                 <script type="text/javascript" src="pngfix.js"></script>
50         <![endif]-->
51         <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
52 </head>
53
54 <body onload="init()">
55
56 <table width="100%" height="100%" cellspacing="0" cellpadding="0" class="main">
57 <? if (get_pref($link, 'DISPLAY_HEADER')) { ?>
58 <tr>
59         <td colspan="2">
60                 <table cellspacing="0" cellpadding="0" width="100%"><tr>
61                         <td rowspan="2" class="header" valign="middle"> 
62                                 <img src="images/ttrss_logo.png" alt="logo">    
63                         </td>
64                         <td align="right" valign="top">
65                                 <div id="notify"><span id="notify_body"></div>
66                         </td>
67                 </tr><tr><td class="welcomePrompt">
68                         <? if (!SINGLE_USER_MODE) { ?>
69                         Hello, <b><?= $_SESSION["name"] ?></b> (<a href="logout.php">Logout</a>)</td>
70                         <? } ?>
71                 </tr></table>
72         </td>
73 </tr>
74 <? } ?>
75 <tr>
76         <td class="prefsTabs" align="left" valign="bottom">
77                 <input id="genConfigTab" class="prefsTab" type="submit" value="Preferences"
78                         onclick="selectTab('genConfig')">
79                 <input id="feedConfigTab" class="prefsTab" type="submit" value="Feed Configuration"
80                         onclick="selectTab('feedConfig')">
81                 <input id="filterConfigTab" class="prefsTab" type="submit" value="Content Filtering"
82                         onclick="selectTab('filterConfig')">
83                 <? if (get_pref($link, 'ENABLE_LABELS')) { ?>
84                 <input id="labelConfigTab" class="prefsTab" type="submit" value="Label Editor"
85                         onclick="selectTab('labelConfig')">
86                 <? } ?>
87                 <? if ($_SESSION["access_level"] >= 10) { ?>
88                 <input id="userConfigTab" class="prefsTab" type="submit" value="User Manager"
89                         onclick="selectTab('userConfig')">
90                 <? } ?>         
91         </td>
92         <td class="prefsToolbar" valign="middle" align="right"> 
93                 <input type="submit" onclick="gotoMain()" class="button" value="Return to main">
94         </td>
95         </tr>
96 </tr>
97         <td id="prefContent" class="prefContent" valign="top" colspan="2">
98
99                 <p>Loading, please wait...</p>
100
101         </td>
102 </tr>
103 <? if (get_pref($link, 'DISPLAY_FOOTER')) { ?>
104 <tr>
105         <td class="footer" colspan="2">
106                 <a href="http://bah.spb.su/~fox/tt-rss/">Tiny-Tiny RSS</a> v<?= VERSION ?> &copy; 2005 Andrew Dolgov
107                 <? if (WEB_DEMO_MODE) { ?>
108                 <br>Running in demo mode, some functionality is disabled.
109                 <? } ?>
110         </td>
111 </td>
112 <? } ?>
113 </table>
114
115 <? db_close($link); ?>
116
117 </body>
118 </html>