]> git.wh0rd.org - tt-rss.git/blame - prefs.php
login system tweaks
[tt-rss.git] / prefs.php
CommitLineData
1d3a17c7 1<?php
7ae65adf 2 require_once "functions.php";
a885f0ec 3// require_once "sessions.php";
66581886 4 require_once "sanity_check.php";
ab49d368
AD
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);
c93f38c4 10
b8aa49bc 11 login_sequence($link);
53515ff1 12
1b758780 13 $dt_add = get_script_dt_add();
53515ff1 14
ab49d368 15?>
3f59e8cd
AD
16<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
17 "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
007bda35
AD
18<html>
19<head>
e828e31e 20 <title>Tiny Tiny RSS : Preferences</title>
007bda35 21 <link rel="stylesheet" href="tt-rss.css" type="text/css">
ab49d368 22
1d3a17c7 23 <?php $user_theme = $_SESSION["theme"];
503eb349 24 if ($user_theme) { ?>
1d3a17c7
AD
25 <link rel="stylesheet" type="text/css" href="themes/<?php echo $user_theme ?>/theme.css">
26 <?php } ?>
503eb349 27
1d3a17c7 28 <?php if ($user_theme) { $theme_image_path = "themes/$user_theme/"; } ?>
5d35cdcd 29
1d3a17c7
AD
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 } ?>
386d7b5b 34
c0266b88
AD
35 <link rel="shortcut icon" type="image/png" href="images/favicon.png">
36
14f69488
AD
37 <script type="text/javascript" src="prototype.js"></script>
38
1d3a17c7
AD
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>
b1895692 41
59a543f0
AD
42 <div id="infoBoxShadow"><div id="infoBox">BAH</div></div>
43
25cb5736
AD
44 <!--[if gte IE 5.5000]>
45 <script type="text/javascript" src="pngfix.js"></script>
d1793994 46 <link rel="stylesheet" type="text/css" href="tt-rss-ie.css">
25cb5736 47 <![endif]-->
007bda35 48 <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
362698ad
AD
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 }
6b9bf6c2
AD
54 if (navigator.userAgent.match("Gecko") && !navigator.userAgent.match("KHTML")) {
55 document.write('<link rel="stylesheet" type="text/css" href="gecko.css">');
56 }
362698ad 57 </script>
007bda35
AD
58</head>
59
97dcd654
AD
60<body>
61
d437c8cf 62<div id="piggie">&nbsp;</div>
1cac3c31 63
48c6406b
AD
64<iframe id="backReqBox"></iframe>
65
97dcd654
AD
66<script type="text/javascript">
67if (document.addEventListener) {
68 document.addEventListener("DOMContentLoaded", init, null);
69}
70window.onload = init;
71</script>
007bda35 72
a7565293
AD
73<ul id="debug_output"></ul>
74
3f59e8cd
AD
75<div id="notify" class="notify"><span id="notify_body">&nbsp;</span></div>
76
a7565293
AD
77<div id="fatal_error"><div id="fatal_error_inner">
78 <h1>Fatal Error</h1>
d3f24242 79 <div id="fatal_error_msg"><?php echo _('Unknown Error') ?></div>
a7565293
AD
80</div></div>
81
3f59e8cd
AD
82<div id="prefHeader">
83 <?php if (!SINGLE_USER_MODE) { ?>
84 <div style="float : right">
d3f24242 85 <?php echo _('Hello,') ?> <b><?php echo $_SESSION["name"] ?></b>
e6720996 86 (<a href="logout.php">Logout</a>)
3f59e8cd
AD
87 </div>
88 <?php } ?>
89 <img src="<?php echo $theme_image_path ?>images/ttrss_logo.png" alt="Tiny Tiny RSS"/>
90</div>
91
3f59e8cd
AD
92 <div class="return">
93 <a href="#" onclick="gotoMain()">Exit preferences</a>
94 </div>
95
656f4b6c
AD
96 <div class="firstTab">&nbsp;</div>
97
98 <div id="genConfigTab" class="prefsTab"
d3f24242 99 onclick="selectTab('genConfig')"><?php echo _('Preferences') ?></div>
656f4b6c 100 <div id="feedConfigTab" class="prefsTab"
d3f24242 101 onclick="selectTab('feedConfig')"><?php echo _('My Feeds') ?></div>
1d3a17c7 102 <?php if (ENABLE_FEED_BROWSER && !SINGLE_USER_MODE) { ?>
656f4b6c 103 <div id="feedBrowserTab" class="prefsTab"
d3f24242 104 onclick="selectTab('feedBrowser')"><?php echo _('Other Feeds') ?></div>
1d3a17c7 105 <?php } ?>
656f4b6c 106 <div id="filterConfigTab" class="prefsTab"
d3f24242 107 onclick="selectTab('filterConfig')"><?php echo _('Content Filtering') ?></div>
1d3a17c7 108 <?php if (get_pref($link, 'ENABLE_LABELS')) { ?>
656f4b6c 109 <div id="labelConfigTab" class="prefsTab"
d3f24242 110 onclick="selectTab('labelConfig')"><?php echo _('Label Editor') ?></div>
1d3a17c7
AD
111 <?php } ?>
112 <?php if ($_SESSION["access_level"] >= 10) { ?>
656f4b6c 113 <div id="userConfigTab" class="prefsTab"
d3f24242 114 onclick="selectTab('userConfig')"><?php echo _('User Manager') ?></div>
1d3a17c7 115 <?php } ?>
3f59e8cd
AD
116
117<div id="prefContent">
d3f24242 118 <p><?php echo _('Loading, please wait...') ?></p>
84916243
AD
119 <noscript>
120 <div class="error">
d3f24242 121 <?php echo _("Your browser doesn't support Javascript, which is required
84916243 122 for this application to function properly. Please check your
d3f24242 123 browser settings.") ?></div>
84916243 124 </noscript>
3f59e8cd 125</div>
007bda35 126
23c2a4e7
AD
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>
aff31ecf 137 <?php } ?>
17b3e8e6 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>
23c2a4e7
AD
139</div>
140
1d3a17c7 141<?php db_close($link); ?>
007bda35 142
97dcd654
AD
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
007bda35
AD
158</body>
159</html>