]> git.wh0rd.org - tt-rss.git/blob - sanity_check.php
outputFeedList: add some CRs
[tt-rss.git] / sanity_check.php
1 <?php
2 require_once "functions.php";
3
4 define('EXPECTED_CONFIG_VERSION', 7);
5
6 if (!file_exists("config.php")) {
7 print __("<b>Fatal Error</b>: You forgot to copy
8 <b>config.php-dist</b> to <b>config.php</b> and edit it.\n");
9 exit;
10 }
11
12 require_once "config.php";
13
14 if (CONFIG_VERSION != EXPECTED_CONFIG_VERSION) {
15 $err_msg = __("config: your config file version is incorrect. See config.php-dist.\n");
16 }
17
18 if (defined('RSS_BACKEND_TYPE')) {
19 print __("<b>Fatal error</b>: RSS_BACKEND_TYPE is deprecated. Please remove this
20 option from config.php\n");
21 exit;
22 }
23
24 if (file_exists("xml-export.php") || file_exists("xml-import.php")) {
25 print __("<b>Fatal Error</b>: XML Import/Export tools (<b>xml-export.php</b>
26 and <b>xml-import.php</b>) could be used maliciously. Please remove them
27 from your TT-RSS instance.\n");
28 exit;
29 }
30
31 if (SINGLE_USER_MODE && DAEMON_UPDATE_LOGIN_LIMIT > 0) {
32 print __("<b>Fatal Error</b>: Please set DAEMON_UPDATE_LOGIN_LIMIT
33 to 0 in single user mode.\n");
34 exit;
35 }
36
37 if (USE_CURL_FOR_ICONS && ! function_exists("curl_init")) {
38 print __("<b>Fatal Error</b>: You have enabled USE_CURL_FOR_ICONS, but your PHP
39 doesn't seem to support CURL functions.");
40 exit;
41 }
42
43 if (!defined('SESSION_EXPIRE_TIME')) {
44 $err_msg = __("config: SESSION_EXPIRE_TIME is undefined");
45 }
46
47 if (SESSION_EXPIRE_TIME < 60) {
48 $err_msg = __("config: SESSION_EXPIRE_TIME is too low (less than 60)");
49 }
50
51 if (SESSION_EXPIRE_TIME < SESSION_COOKIE_LIFETIME) {
52 $err_msg = __("config: SESSION_EXPIRE_TIME should be greater or equal to" .
53 "SESSION_COOKIE_LIFETIME");
54 }
55
56 /* if (defined('DISABLE_SESSIONS')) {
57 $err_msg = "config: you have enabled DISABLE_SESSIONS. Please disable this option.";
58 } */
59
60 if (DATABASE_BACKED_SESSIONS && SINGLE_USER_MODE) {
61 $err_msg = __("config: DATABASE_BACKED_SESSIONS is incompatible with SINGLE_USER_MODE");
62 }
63
64 if (DATABASE_BACKED_SESSIONS && DB_TYPE == "mysql") {
65 $err_msg = __("config: DATABASE_BACKED_SESSIONS are currently broken with MySQL");
66 }
67
68 if ($err_msg) {
69 print "<b>".__("Fatal Error")."</b>: $err_msg\n";
70 exit;
71 }
72
73 ?>