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