]> git.wh0rd.org Git - tt-rss.git/blob - prefs.php
rework login process, drop http auth
[tt-rss.git] / prefs.php
1 <?php
2         require_once "functions.php"; 
3         require_once "sessions.php";
4         require_once "sanity_check.php";
5         require_once "version.php"; 
6         require_once "config.php";
7         require_once "db-prefs.php";
8
9         $link = db_connect(DB_HOST, DB_USER, DB_PASS, DB_NAME); 
10
11         login_sequence($link);
12
13         $dt_add = get_script_dt_add();
14
15 ?>
16 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
17         "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
18 <html>
19 <head>
20         <title>Tiny Tiny RSS : Preferences</title>
21         <link rel="stylesheet" href="tt-rss.css" type="text/css">
22
23         <?php   $user_theme = $_SESSION["theme"];
24                 if ($user_theme) { ?>
25                 <link rel="stylesheet" type="text/css" href="themes/<?php echo $user_theme ?>/theme.css">
26         <?php } ?>
27
28         <?php if ($user_theme) { $theme_image_path = "themes/$user_theme/"; } ?>
29         
30         <?php $user_css_url = get_pref($link, 'USER_STYLESHEET_URL'); ?>
31         <?php if ($user_css_url) { ?>
32                 <link type="text/css" href="<?php echo $user_css_url ?>"/> 
33         <?php } ?>
34
35         <link rel="shortcut icon" type="image/png" href="images/favicon.png">
36
37         <script type="text/javascript" src="prototype.js"></script>
38
39         <script type="text/javascript" src="functions.js?<?php echo $dt_add ?>"></script>
40         <script type="text/javascript" src="prefs.js?<?php echo $dt_add ?>"></script>
41
42         <div id="infoBoxShadow"><div id="infoBox">BAH</div></div>
43
44         <!--[if gte IE 5.5000]>
45                 <script type="text/javascript" src="pngfix.js"></script>
46                 <link rel="stylesheet" type="text/css" href="tt-rss-ie.css">
47         <![endif]-->
48         <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
49
50         <script type="text/javascript">
51                 if (navigator.userAgent.match("Opera")) {
52                         document.write('<link rel="stylesheet" type="text/css" href="opera.css">');
53                 }
54                 if (navigator.userAgent.match("Gecko") && !navigator.userAgent.match("KHTML")) {
55                         document.write('<link rel="stylesheet" type="text/css" href="gecko.css">');
56                 }
57         </script>
58 </head>
59
60 <body>
61
62 <div id="piggie">&nbsp;</div>
63
64 <iframe id="backReqBox"></iframe>
65
66 <script type="text/javascript">
67 if (document.addEventListener) {
68         document.addEventListener("DOMContentLoaded", init, null);
69 }
70 window.onload = init;
71 </script>
72
73 <ul id="debug_output"></ul>
74
75 <div id="notify" class="notify"><span id="notify_body">&nbsp;</span></div>
76
77 <div id="fatal_error"><div id="fatal_error_inner">
78         <h1>Fatal Error</h1>
79         <div id="fatal_error_msg"><?php echo _('Unknown Error') ?></div>
80 </div></div>
81
82 <div id="prefHeader">
83         <?php if (!SINGLE_USER_MODE) { ?>
84                 <div style="float : right">
85                         <?php echo _('Hello,') ?> <b><?php echo $_SESSION["name"] ?></b>
86                         (<a href="javascript:logoutUser()">Logout</a>)
87                 </div>
88         <?php } ?>
89         <img src="<?php echo $theme_image_path ?>images/ttrss_logo.png" alt="Tiny Tiny RSS"/>   
90 </div>
91
92                 <div class="return">
93                         <a href="#" onclick="gotoMain()">Exit preferences</a>
94                 </div>
95
96                 <div class="firstTab">&nbsp;</div>
97
98                 <div id="genConfigTab" class="prefsTab" 
99                         onclick="selectTab('genConfig')"><?php echo _('Preferences') ?></div>
100                 <div id="feedConfigTab" class="prefsTab" 
101                         onclick="selectTab('feedConfig')"><?php echo _('My Feeds') ?></div>
102                 <?php if (ENABLE_FEED_BROWSER && !SINGLE_USER_MODE) { ?>
103                 <div id="feedBrowserTab" class="prefsTab" 
104                         onclick="selectTab('feedBrowser')"><?php echo _('Other Feeds') ?></div>
105                 <?php } ?>
106                 <div id="filterConfigTab" class="prefsTab" 
107                         onclick="selectTab('filterConfig')"><?php echo _('Content Filtering') ?></div>
108                 <?php if (get_pref($link, 'ENABLE_LABELS')) { ?>
109                 <div id="labelConfigTab" class="prefsTab" 
110                         onclick="selectTab('labelConfig')"><?php echo _('Label Editor') ?></div>
111                 <?php } ?>
112                 <?php if ($_SESSION["access_level"] >= 10) { ?>
113                 <div id="userConfigTab" class="prefsTab" 
114                         onclick="selectTab('userConfig')"><?php echo _('User Manager') ?></div>
115                 <?php } ?>              
116
117 <div id="prefContent">
118         <p><?php echo _('Loading, please wait...') ?></p>
119         <noscript>
120                 <div class="error">
121                 <?php echo _("Your browser doesn't support Javascript, which is required
122                 for this application to function properly. Please check your
123                 browser settings.") ?></div>
124         </noscript>
125 </div>
126
127 <div id="prefFooter">
128         <?php if (defined('_DEBUG_USER_SWITCH')) { ?>
129                 <select id="userSwitch" onchange="userSwitch()">
130                 <?php 
131                         foreach (array('admin', 'fox', 'test') as $u) {
132                                 $op_sel = ($u == $_SESSION["name"]) ? "selected" : "";
133                                 print "<option $op_sel>$u</option>";
134                         }
135                 ?>
136                 </select>
137         <?php } ?>
138         <a href="http://tt-rss.spb.ru/">Tiny Tiny RSS</a> v<?php echo VERSION ?> &copy; 2005-2007 <a href="http://bah.org.ru/">Andrew Dolgov</a>
139 </div>
140
141 <?php db_close($link); ?>
142
143 <script type="text/javascript">
144         /* for IE */
145         function statechange() {
146                 if (document.readyState == "interactive") init();
147         }
148
149         if (document.readyState) {      
150                 if (document.readyState == "interactive" || document.readyState == "complete") {
151                         init();
152                 } else {
153                         document.onreadystatechange = statechange;
154                 }
155         }
156 </script>
157
158 </body>
159 </html>