-
Notifications
You must be signed in to change notification settings - Fork 0
/
sys.vars.php
executable file
·243 lines (219 loc) · 7.34 KB
/
sys.vars.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
<?php
/**
* ProjectSend system constants
*
* This file includes the most basic system options that cannot be
* changed through the web interface, such as the version number,
* php directives and the user and password length values.
*
* @package ProjectSend
* @subpackage Core
*/
session_start();
/**
* Current version.
* Updated only when releasing a new downloadable complete version.
*/
define('CURRENT_VERSION', 'r1053');
/**
* Required software versions
*/
define('REQUIRED_VERSION_PHP', '5.2');
define('REQUIRED_VERSION_MYSQL', '5.0');
/**
* Fix for including external files when on HTTPS.
* Contribution by Scott Wright on
* http://code.google.com/p/clients-oriented-ftp/issues/detail?id=230
*/
define('PROTOCOL', empty($_SERVER['HTTPS'])? 'http' : 'https');
/**
* DEBUG constant effects:
* - Changes the error_reporting php value
* - Enables the PDOEX extension (on the database class) to count queries
*/
define('DEBUG', false);
/**
* IS_DEV is set to true during development to show a sitewide remainder
* of the app unreleased status.
*/
define('IS_DEV', false);
/**
* Turn off reporting of PHP errors, warnings and notices.
* On a development environment, it should be set to E_ALL for
* complete debugging.
*
* @link http://www.php.net/manual/en/function.error-reporting.php
*/
if ( DEBUG === true ) {
error_reporting(E_ALL);
}
else {
error_reporting(0);
}
define('GLOBAL_TIME_LIMIT', 240*60);
define('UPLOAD_TIME_LIMIT', 120*60);
@set_time_limit(GLOBAL_TIME_LIMIT);
/**
* Define the RSS url to use on the home news list.
*/
define('NEWS_FEED_URI','https://www.projectsend.org/feed/');
/**
* Define the Feed from where to take the latest version
* number.
*/
define('UPDATES_FEED_URI','https://projectsend.org/updates/versions.xml');
/**
* Check if the personal configuration file exists
* Otherwise will start a configuration page
*
* @see sys.config.sample.php
*/
if ( !file_exists(ROOT_DIR.'/includes/sys.config.php') ) {
if ( !defined( 'IS_MAKE_CONFIG' ) ) {
// the following script returns only after the creation of the configuration file
if ( defined('IS_INSTALL') ) {
header('Location:make-config.php');
}
else {
header('Location:install/make-config.php');
}
}
}
else {
include(ROOT_DIR.'/includes/sys.config.php');
}
/**
* Database connection driver
*/
if (!defined('DB_DRIVER')) {
define('DB_DRIVER', 'mysql');
}
/**
* Check for PDO extensions
*/
$pdo_available_drivers = PDO::getAvailableDrivers();
if( (DB_DRIVER == 'mysql') && !defined('PDO::MYSQL_ATTR_INIT_COMMAND') ) {
echo '<h1>Missing a required extension</h1>';
echo "<p>The system couldn't find the configuration the <strong>PDO extension for mysql</strong>.</p>
<p>This extension is required for database comunication.</p>
<p>You can install this extension via the package manager of your linux distro, most likely with one of these commands:</p>
<ul>
<li>sudo apt-get install php5-mysql <strong># debian/ubuntu</strong></li>
<li>sudo yum install php-mysql <strong># centos/fedora</strong></li>
</ul>
<p>You also need to restart the webserver after the installation of PDO_mysql.</p>";
exit;
}
if( (DB_DRIVER == 'mssql') && !in_array('dblib', $pdo_available_drivers) ) {
echo '<h1>Missing a required extension</h1>';
echo "<p>The system couldn't find the configuration the <strong>PDO extension for MS SQL Server</strong>.</p>
<p>This extension is required for database comunication.</p>
<p>You can install this extension via the package manager of your linux distro, most likely with one of these commands:</p>
<ul>
<li>sudo apt-get install php5-sybase <strong># debian/ubuntu</strong></li>
<li>sudo yum install php-mssql <strong># centos/fedora (you need EPEL)</strong></li>
</ul>
<p>You also need to restart the webserver after the installation of PDO_mssql.</p>";
exit;
}
/**
* Define the tables names
*/
if (!defined('TABLES_PREFIX')) {
define('TABLES_PREFIX', 'tbl_');
}
define('TABLE_FILES', TABLES_PREFIX . 'files');
define('TABLE_FILES_RELATIONS', TABLES_PREFIX . 'files_relations');
define('TABLE_DOWNLOADS', TABLES_PREFIX . 'downloads');
define('TABLE_NOTIFICATIONS', TABLES_PREFIX . 'notifications');
define('TABLE_OPTIONS', TABLES_PREFIX . 'options');
define('TABLE_USERS', TABLES_PREFIX . 'users');
define('TABLE_GROUPS', TABLES_PREFIX . 'groups');
define('TABLE_MEMBERS', TABLES_PREFIX . 'members');
define('TABLE_MEMBERS_REQUESTS', TABLES_PREFIX . 'members_requests');
define('TABLE_FOLDERS', TABLES_PREFIX . 'folders');
define('TABLE_CATEGORIES', TABLES_PREFIX . 'categories');
define('TABLE_CATEGORIES_RELATIONS', TABLES_PREFIX . 'categories_relations');
define('TABLE_LOG', TABLES_PREFIX . 'actions_log');
define('TABLE_PASSWORD_RESET', TABLES_PREFIX . 'password_reset');
$original_basic_tables = array(
TABLE_FILES,
TABLE_OPTIONS,
TABLE_USERS
);
$all_system_tables = array(
'files',
'files_relations',
'downloads',
'notifications',
'options',
'users',
'groups',
'members',
'members_requests',
'folders',
'categories',
'categories_relations',
'actions_log',
'password_reset',
);
//$current_tables = array(TABLE_FILES,TABLE_FILES_RELATIONS,TABLE_OPTIONS,TABLE_USERS,TABLE_GROUPS,TABLE_MEMBERS,TABLE_FOLDERS,TABLES_PREFIX,TABLE_LOG,TABLE_CATEGORIES,TABLE_CATEGORIES_RELATIONS);
/**
* This values affect both validation methods (client and server side)
* and also the maxlength value of the form fields.
*/
define('MIN_USER_CHARS', 5);
define('MAX_USER_CHARS', 60);
define('MIN_PASS_CHARS', 5);
define('MAX_PASS_CHARS', 60);
define('MIN_GENERATE_PASS_CHARS', 10);
define('MAX_GENERATE_PASS_CHARS', 20);
/*
* Cookie expiration time (in seconds).
* Set by default to 30 days (60*60*24*30).
*/
define('COOKIE_EXP_TIME', 60*60*24*30);
/**
* Time (in seconds) after which the session becomes invalid.
* Default is disabled and time is set to a huge value (1 month)
* Case uses must be analyzed before enabling this function
*/
define('SESSION_TIMEOUT_EXPIRE', true);
$session_expire_time = 31*24*60*60; // 31 days * 24 hours * 60 minutes * 60 seconds
define('SESSION_EXPIRE_TIME', $session_expire_time);
/**
* Define the folder where uploaded files will reside
*/
define('UPLOADED_FILES_FOLDER', ROOT_DIR.'/upload/files/');
define('UPLOADED_FILES_URL', 'upload/files/');
/**
* Define the folder where the uploaded files are stored before
* being assigned to any client.
*
* Also, this is the folder where files are searched for when
* using the Import from FTP feature.
*
* @ Deprecated
*/
define('USER_UPLOADS_TEMP_FOLDER', ROOT_DIR.'/upload/temp');
define('CLIENT_UPLOADS_TEMP_FOLDER', ROOT_DIR.'/upload/temp');
/**
* Define the system name, and the information that will be used
* on the footer blocks.
*
*/
define('SYSTEM_URI','https://www.projectsend.org/');
define('SYSTEM_URI_LABEL','ProjectSend on github');
define('DONATIONS_URL','https://www.projectsend.org/donations/');
/** Previously cFTP */
define('SYSTEM_NAME','ProjectSend');
define('LOGO_FOLDER',ROOT_DIR.'/img/custom/logo/');
define('LOGO_THUMB_FOLDER',ROOT_DIR.'/img/custom/thumbs/');
/** phpass */
define('HASH_COST_LOG2', 8);
define('HASH_PORTABLE', false);
/**
* External links
*/
define('LINK_DOC_RECAPTCHA', 'https://developers.google.com/recaptcha/docs/start');
define('LINK_DOC_GOOGLE_SIGN_IN', 'https://developers.google.com/identity/protocols/OpenIDConnect');