author | Dan |
Thu, 17 Jan 2008 09:39:56 -0500 | |
changeset 350 | dd7cbc97f681 |
parent 348 | 87e08a6e4fec |
child 352 | 9d7225c0db6d |
permissions | -rw-r--r-- |
1 | 1 |
<?php |
2 |
||
3 |
/* |
|
4 |
* Enano - an open-source CMS capable of wiki functions, Drupal-like sidebar blocks, and everything in between |
|
322
5f1cd51bf1be
Many changes. Installer with PostgreSQL is broken badly and will be for some time.
Dan
parents:
293
diff
changeset
|
5 |
* Version 1.0.3 (Dyrad) |
1 | 6 |
* Copyright (C) 2006-2007 Dan Fuhry |
7 |
* constants.php - important defines used Enano-wide |
|
8 |
* |
|
9 |
* This program is Free Software; you can redistribute and/or modify it under the terms of the GNU General Public License |
|
10 |
* as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. |
|
11 |
* |
|
12 |
* This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied |
|
13 |
* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for details. |
|
14 |
*/ |
|
15 |
||
16 |
// Ban types |
|
17 |
||
18 |
define('BAN_IP', 1); |
|
19 |
define('BAN_USER', 2); |
|
20 |
define('BAN_EMAIL', 3); |
|
21 |
||
22 |
// ACL permission types |
|
23 |
define('AUTH_ALLOW', 4); |
|
24 |
define('AUTH_WIKIMODE', 3); // User can do this if wiki mode is enabled |
|
25 |
define('AUTH_DISALLOW', 2); |
|
26 |
define('AUTH_DENY', 1); // A Deny setting overrides *everything* |
|
27 |
||
28 |
define('ACL_TYPE_GROUP', 1); |
|
29 |
define('ACL_TYPE_USER', 2); |
|
30 |
define('ACL_TYPE_PRESET', 3); |
|
31 |
||
32 |
// System groups |
|
33 |
define('GROUP_ID_ADMIN', 2); |
|
34 |
define('GROUP_ID_MOD', 3); |
|
35 |
||
73
0a74676a2f2f
Made the move to Loch Ness, and got some basic page grouping functionality working. TODO: fix some UI issues in Javascript ACL editor and change non-JS ACL editor to work with page groups too
Dan
parents:
21
diff
changeset
|
36 |
// Page group types |
0a74676a2f2f
Made the move to Loch Ness, and got some basic page grouping functionality working. TODO: fix some UI issues in Javascript ACL editor and change non-JS ACL editor to work with page groups too
Dan
parents:
21
diff
changeset
|
37 |
define('PAGE_GRP_CATLINK', 1); |
0a74676a2f2f
Made the move to Loch Ness, and got some basic page grouping functionality working. TODO: fix some UI issues in Javascript ACL editor and change non-JS ACL editor to work with page groups too
Dan
parents:
21
diff
changeset
|
38 |
define('PAGE_GRP_TAGGED', 2); |
0a74676a2f2f
Made the move to Loch Ness, and got some basic page grouping functionality working. TODO: fix some UI issues in Javascript ACL editor and change non-JS ACL editor to work with page groups too
Dan
parents:
21
diff
changeset
|
39 |
define('PAGE_GRP_NORMAL', 3); |
156
edbff85d43e8
Feature add: new page group type: regular expression match (PCRE)
Dan
parents:
142
diff
changeset
|
40 |
define('PAGE_GRP_REGEX', 4); |
73
0a74676a2f2f
Made the move to Loch Ness, and got some basic page grouping functionality working. TODO: fix some UI issues in Javascript ACL editor and change non-JS ACL editor to work with page groups too
Dan
parents:
21
diff
changeset
|
41 |
|
205 | 42 |
// Identifier for the default meta-language |
43 |
define('LANG_DEFAULT', 0); |
|
44 |
||
1 | 45 |
// |
46 |
// User types - don't touch these |
|
47 |
// |
|
48 |
||
49 |
// User can do absolutely everything |
|
50 |
define('USER_LEVEL_ADMIN', 9); |
|
51 |
||
52 |
// User can edit/[un]approve comments and do some basic administration |
|
53 |
define('USER_LEVEL_MOD', 5); |
|
54 |
||
55 |
// Default for members. When authed at this level, the user can change his/her password. |
|
56 |
define('USER_LEVEL_CHPREF', 3); |
|
57 |
||
58 |
// The level that you will be running at most of the time |
|
59 |
define('USER_LEVEL_MEMBER', 2); |
|
60 |
||
61 |
// Special level for guests |
|
62 |
define('USER_LEVEL_GUEST', 1); |
|
63 |
||
64 |
// Group status |
|
65 |
||
66 |
define('GROUP_CLOSED', 1); |
|
67 |
define('GROUP_REQUEST', 2); |
|
68 |
define('GROUP_HIDDEN', 3); |
|
69 |
define('GROUP_OPEN', 4); |
|
70 |
||
334
c72b545f1304
More localization work. Resolved major issue with JSON parser not parsing files over ~50KB. Switched JSON parser to the one from the Zend Framework (BSD licensed). Forced to split enano.json into five different files.
Dan
parents:
328
diff
changeset
|
71 |
// Private message flags |
c72b545f1304
More localization work. Resolved major issue with JSON parser not parsing files over ~50KB. Switched JSON parser to the one from the Zend Framework (BSD licensed). Forced to split enano.json into five different files.
Dan
parents:
328
diff
changeset
|
72 |
define('PM_UNREAD', 1); |
c72b545f1304
More localization work. Resolved major issue with JSON parser not parsing files over ~50KB. Switched JSON parser to the one from the Zend Framework (BSD licensed). Forced to split enano.json into five different files.
Dan
parents:
328
diff
changeset
|
73 |
define('PM_STARRED', 2); |
c72b545f1304
More localization work. Resolved major issue with JSON parser not parsing files over ~50KB. Switched JSON parser to the one from the Zend Framework (BSD licensed). Forced to split enano.json into five different files.
Dan
parents:
328
diff
changeset
|
74 |
define('PM_SENT', 4); |
c72b545f1304
More localization work. Resolved major issue with JSON parser not parsing files over ~50KB. Switched JSON parser to the one from the Zend Framework (BSD licensed). Forced to split enano.json into five different files.
Dan
parents:
328
diff
changeset
|
75 |
define('PM_DRAFT', 8); |
c72b545f1304
More localization work. Resolved major issue with JSON parser not parsing files over ~50KB. Switched JSON parser to the one from the Zend Framework (BSD licensed). Forced to split enano.json into five different files.
Dan
parents:
328
diff
changeset
|
76 |
define('PM_ARCHIVE', 16); |
c72b545f1304
More localization work. Resolved major issue with JSON parser not parsing files over ~50KB. Switched JSON parser to the one from the Zend Framework (BSD licensed). Forced to split enano.json into five different files.
Dan
parents:
328
diff
changeset
|
77 |
define('PM_TRASH', 32); |
c72b545f1304
More localization work. Resolved major issue with JSON parser not parsing files over ~50KB. Switched JSON parser to the one from the Zend Framework (BSD licensed). Forced to split enano.json into five different files.
Dan
parents:
328
diff
changeset
|
78 |
define('PM_DELIVERED', 64); |
c72b545f1304
More localization work. Resolved major issue with JSON parser not parsing files over ~50KB. Switched JSON parser to the one from the Zend Framework (BSD licensed). Forced to split enano.json into five different files.
Dan
parents:
328
diff
changeset
|
79 |
|
1 | 80 |
// Other stuff |
81 |
||
82 |
define('MAX_PMS_PER_BATCH', 7); // The maximum number of users that users can send PMs to in one go; restriction does not apply to users with mod_misc rights |
|
83 |
define('SEARCH_RESULTS_PER_PAGE', 10); |
|
84 |
define('MYSQL_MAX_PACKET_SIZE', 1048576); // 1MB; this is the default in MySQL 4.x I think |
|
328
dc838fd61a06
Added initial avatar support. Currently rather feature complete except for admin controls for avatar.
Dan
parents:
326
diff
changeset
|
85 |
define('ENANO_SUPPORT_AVATARS', 1); |
1 | 86 |
|
87 |
// Sidebar |
|
88 |
||
89 |
define('BLOCK_WIKIFORMAT', 0); |
|
90 |
define('BLOCK_TEMPLATEFORMAT', 1); |
|
91 |
define('BLOCK_HTML', 2); |
|
92 |
define('BLOCK_PHP', 3); |
|
93 |
define('BLOCK_PLUGIN', 4); |
|
94 |
define('SIDEBAR_LEFT', 1); |
|
95 |
define('SIDEBAR_RIGHT', 2); |
|
96 |
||
97 |
define('GENERAL_ERROR', 'General error'); |
|
98 |
define('GENERAL_NOTICE', 'Information'); |
|
99 |
define('CRITICAL_ERROR', 'Critical error'); |
|
100 |
||
345
4ccdfeee9a11
WiP commit for admin panel localization. All modules up to Admin:UserManager (working down the list) are localized except Admin:ThemeManager, which is due for a rewrite
Dan
parents:
334
diff
changeset
|
101 |
// |
4ccdfeee9a11
WiP commit for admin panel localization. All modules up to Admin:UserManager (working down the list) are localized except Admin:ThemeManager, which is due for a rewrite
Dan
parents:
334
diff
changeset
|
102 |
// Enano versions progress |
4ccdfeee9a11
WiP commit for admin panel localization. All modules up to Admin:UserManager (working down the list) are localized except Admin:ThemeManager, which is due for a rewrite
Dan
parents:
334
diff
changeset
|
103 |
// |
4ccdfeee9a11
WiP commit for admin panel localization. All modules up to Admin:UserManager (working down the list) are localized except Admin:ThemeManager, which is due for a rewrite
Dan
parents:
334
diff
changeset
|
104 |
|
4ccdfeee9a11
WiP commit for admin panel localization. All modules up to Admin:UserManager (working down the list) are localized except Admin:ThemeManager, which is due for a rewrite
Dan
parents:
334
diff
changeset
|
105 |
// These constants are used to perform "at least version X" type logic in plugins. Constants should |
4ccdfeee9a11
WiP commit for admin panel localization. All modules up to Admin:UserManager (working down the list) are localized except Admin:ThemeManager, which is due for a rewrite
Dan
parents:
334
diff
changeset
|
106 |
// be defined as ENANO_ATLEAST_<major version>_<minor version>, and they should match the version of |
4ccdfeee9a11
WiP commit for admin panel localization. All modules up to Admin:UserManager (working down the list) are localized except Admin:ThemeManager, which is due for a rewrite
Dan
parents:
334
diff
changeset
|
107 |
// the Enano API, not any forked version. This is to ensure that plugins know what features to enable |
4ccdfeee9a11
WiP commit for admin panel localization. All modules up to Admin:UserManager (working down the list) are localized except Admin:ThemeManager, which is due for a rewrite
Dan
parents:
334
diff
changeset
|
108 |
// and disable for compatibility with both branches. |
4ccdfeee9a11
WiP commit for admin panel localization. All modules up to Admin:UserManager (working down the list) are localized except Admin:ThemeManager, which is due for a rewrite
Dan
parents:
334
diff
changeset
|
109 |
|
4ccdfeee9a11
WiP commit for admin panel localization. All modules up to Admin:UserManager (working down the list) are localized except Admin:ThemeManager, which is due for a rewrite
Dan
parents:
334
diff
changeset
|
110 |
define('ENANO_ATLEAST_1_0', ''); |
4ccdfeee9a11
WiP commit for admin panel localization. All modules up to Admin:UserManager (working down the list) are localized except Admin:ThemeManager, which is due for a rewrite
Dan
parents:
334
diff
changeset
|
111 |
define('ENANO_ATLEAST_1_1', ''); |
4ccdfeee9a11
WiP commit for admin panel localization. All modules up to Admin:UserManager (working down the list) are localized except Admin:ThemeManager, which is due for a rewrite
Dan
parents:
334
diff
changeset
|
112 |
|
1 | 113 |
// You can un-comment the next line to require database backups to be encrypted using the site's unique key. |
114 |
// This keeps the file safe in transit, but also prevents any type of editing to the file. This is NOT |
|
115 |
// recommended except for tiny sites because encrypting an average of 2MB of data will take a while. |
|
116 |
// define('SQL_BACKUP_CRYPT', ''); |
|
117 |
||
118 |
// Security |
|
119 |
||
98
6457a9b983c6
Fixed non-object reference in databaseless template, added locking for Javascript paginator, made comments on AES key size more clear in constants, and disallowed "anonymous" and IP addresses for admin username in install.php; Loch Ness release candidate
Dan
parents:
73
diff
changeset
|
120 |
// AES cipher strength - defaults to 192 and cannot be changed after installation. |
6457a9b983c6
Fixed non-object reference in databaseless template, added locking for Javascript paginator, made comments on AES key size more clear in constants, and disallowed "anonymous" and IP addresses for admin username in install.php; Loch Ness release candidate
Dan
parents:
73
diff
changeset
|
121 |
// This can be 128, 192, or 256. |
6457a9b983c6
Fixed non-object reference in databaseless template, added locking for Javascript paginator, made comments on AES key size more clear in constants, and disallowed "anonymous" and IP addresses for admin username in install.php; Loch Ness release candidate
Dan
parents:
73
diff
changeset
|
122 |
define('AES_BITS', 192); |
1 | 123 |
|
124 |
// Define this to enable Mcrypt support which makes encryption work faster. This is only triggered if Mcrypt support is detected. |
|
125 |
// THIS IS DISABLED BECAUSE MCRYPT DOES NOT SEEM TO SUPPORT THE AES BLOCK SIZES THAT ENANO USES. |
|
126 |
//define('MCRYPT_ACCEL', ''); |
|
127 |
||
128 |
//if(defined('MCRYPT_RIJNDAEL_' . AES_BITS)) |
|
129 |
//{ |
|
130 |
// eval('$bs = MCRYPT_RIJNDAEL_' . AES_BITS . ';'); |
|
131 |
// $bs = mcrypt_module_get_algo_block_size($bs); |
|
132 |
// $bs = $bs * 8; |
|
133 |
// define('AES_BLOCKSIZE', $bs); |
|
134 |
//} |
|
135 |
// else |
|
136 |
// { |
|
137 |
// define('AES_BLOCKSIZE', AES_BITS); |
|
138 |
// } |
|
139 |
||
348
87e08a6e4fec
Welcome to the new Enano installer. Much distance still to be covered but the basics are there.
Dan
parents:
345
diff
changeset
|
140 |
// You probably don't want to change the block size because it will cause the Javascript test vectors to fail. Changing it doesn't |
87e08a6e4fec
Welcome to the new Enano installer. Much distance still to be covered but the basics are there.
Dan
parents:
345
diff
changeset
|
141 |
// significantly increase encryption strength either. |
1 | 142 |
define('AES_BLOCKSIZE', 128); |
143 |
||
144 |
/* |
|
145 |
* MIMETYPES |
|
146 |
* |
|
147 |
* This array defines the 166 known MIME types used by the Enano file-extension filter. Whether extensions are allowed or not is |
|
148 |
* determined by a bitfield in the config table. |
|
149 |
*/ |
|
150 |
||
151 |
global $mime_types, $mimetype_exps, $mimetype_extlist; |
|
152 |
||
153 |
// IMPORTANT: this array can NEVER have items removed from it or key indexes changed |
|
154 |
$mime_types = Array ( |
|
155 |
'ai' => 'application/postscript', |
|
156 |
'aif' => 'audio/x-aiff', |
|
157 |
'aifc' => 'audio/x-aiff', |
|
158 |
'aiff' => 'audio/x-aiff', |
|
159 |
'au' => 'audio/basic', |
|
160 |
'avi' => 'video/x-msvideo', |
|
161 |
'bcpio' => 'application/x-bcpio', |
|
162 |
'bin' => 'application/octet-stream', |
|
163 |
'bmp' => 'image/bmp', |
|
164 |
'bz2' => 'application/x-bzip', |
|
165 |
'cdf' => 'application/x-netcdf', |
|
166 |
'cgm' => 'image/cgm', |
|
167 |
'class' => 'application/octet-stream', |
|
168 |
'cpio' => 'application/x-cpio', |
|
169 |
'cpt' => 'application/mac-compactpro', |
|
170 |
'csh' => 'application/x-csh', |
|
171 |
'css' => 'text/css', |
|
172 |
'dcr' => 'application/x-director', |
|
173 |
'dir' => 'application/x-director', |
|
174 |
'djv' => 'image/vnd.djvu', |
|
175 |
'djvu' => 'image/vnd.djvu', |
|
176 |
'dll' => 'application/octet-stream', |
|
177 |
'dms' => 'application/octet-stream', |
|
178 |
'doc' => 'application/msword', |
|
179 |
'dtd' => 'application/xml-dtd', |
|
180 |
'dvi' => 'application/x-dvi', |
|
181 |
'dxr' => 'application/x-director', |
|
182 |
'eps' => 'application/postscript', |
|
183 |
'etx' => 'text/x-setext', |
|
184 |
'exe' => 'application/octet-stream', |
|
185 |
'ez' => 'application/andrew-inset', |
|
186 |
'gif' => 'image/gif', |
|
187 |
'gram' => 'application/srgs', |
|
188 |
'grxml' => 'application/srgs+xml', |
|
189 |
'gtar' => 'application/x-gtar', |
|
190 |
'gz' => 'application/x-gzip', |
|
191 |
'hdf' => 'application/x-hdf', |
|
192 |
'hqx' => 'application/mac-binhex40', |
|
193 |
'htm' => 'text/html', |
|
194 |
'html' => 'text/html', |
|
195 |
'ice' => 'x-conference/x-cooltalk', |
|
196 |
'ico' => 'image/x-icon', |
|
197 |
'ics' => 'text/calendar', |
|
198 |
'ief' => 'image/ief', |
|
199 |
'ifb' => 'text/calendar', |
|
200 |
'iges' => 'model/iges', |
|
201 |
'igs' => 'model/iges', |
|
202 |
'jar' => 'application/zip', |
|
203 |
'jpe' => 'image/jpeg', |
|
204 |
'jpeg' => 'image/jpeg', |
|
205 |
'jpg' => 'image/jpeg', |
|
206 |
'js' => 'application/x-javascript', |
|
207 |
'kar' => 'audio/midi', |
|
208 |
'latex' => 'application/x-latex', |
|
209 |
'lha' => 'application/octet-stream', |
|
210 |
'lzh' => 'application/octet-stream', |
|
211 |
'm3u' => 'audio/x-mpegurl', |
|
212 |
'man' => 'application/x-troff-man', |
|
213 |
'mathml' => 'application/mathml+xml', |
|
214 |
'me' => 'application/x-troff-me', |
|
215 |
'mesh' => 'model/mesh', |
|
216 |
'mid' => 'audio/midi', |
|
217 |
'midi' => 'audio/midi', |
|
218 |
'mif' => 'application/vnd.mif', |
|
219 |
'mov' => 'video/quicktime', |
|
220 |
'movie' => 'video/x-sgi-movie', |
|
221 |
'mp2' => 'audio/mpeg', |
|
222 |
'mp3' => 'audio/mpeg', |
|
223 |
'mpe' => 'video/mpeg', |
|
224 |
'mpeg' => 'video/mpeg', |
|
225 |
'mpg' => 'video/mpeg', |
|
226 |
'mpga' => 'audio/mpeg', |
|
227 |
'ms' => 'application/x-troff-ms', |
|
228 |
'msh' => 'model/mesh', |
|
229 |
'mxu' => 'video/vnd.mpegurl', |
|
230 |
'nc' => 'application/x-netcdf', |
|
231 |
'oda' => 'application/oda', |
|
232 |
'ogg' => 'application/ogg', |
|
233 |
'ogm' => 'application/ogg', |
|
234 |
'pbm' => 'image/x-portable-bitmap', |
|
235 |
'pdb' => 'chemical/x-pdb', |
|
236 |
'pdf' => 'application/pdf', |
|
237 |
'pgm' => 'image/x-portable-graymap', |
|
238 |
'pgn' => 'application/x-chess-pgn', |
|
239 |
'png' => 'image/png', |
|
240 |
'pnm' => 'image/x-portable-anymap', |
|
241 |
'ppm' => 'image/x-portable-pixmap', |
|
242 |
'ppt' => 'application/vnd.ms-powerpoint', |
|
243 |
'ps' => 'application/postscript', |
|
244 |
'psd' => 'image/x-photoshop', |
|
245 |
'qt' => 'video/quicktime', |
|
246 |
'ra' => 'audio/x-realaudio', |
|
247 |
'ram' => 'audio/x-pn-realaudio', |
|
248 |
'ras' => 'image/x-cmu-raster', |
|
249 |
'rdf' => 'text/xml', |
|
250 |
'rgb' => 'image/x-rgb', |
|
251 |
'rm' => 'audio/x-pn-realaudio', |
|
252 |
'roff' => 'application/x-troff', |
|
253 |
'rpm' => 'audio/x-pn-realaudio-plugin', |
|
254 |
'rss' => 'text/xml', |
|
255 |
'rtf' => 'text/rtf', |
|
256 |
'rtx' => 'text/richtext', |
|
257 |
'sgm' => 'text/sgml', |
|
258 |
'sgml' => 'text/sgml', |
|
259 |
'sh' => 'application/x-sh', |
|
260 |
'shar' => 'application/x-shar', |
|
261 |
'silo' => 'model/mesh', |
|
262 |
'sit' => 'application/x-stuffit', |
|
263 |
'skd' => 'application/x-koan', |
|
264 |
'skm' => 'application/x-koan', |
|
265 |
'skp' => 'application/x-koan', |
|
266 |
'skt' => 'application/x-koan', |
|
267 |
'smi' => 'application/smil', |
|
268 |
'smil' => 'application/smil', |
|
269 |
'snd' => 'audio/basic', |
|
270 |
'so' => 'application/octet-stream', |
|
271 |
'spl' => 'application/x-futuresplash', |
|
272 |
'src' => 'application/x-wais-source', |
|
273 |
'stc' => 'application/zip', |
|
274 |
'std' => 'application/zip', |
|
275 |
'sti' => 'application/zip', |
|
276 |
'stm' => 'application/zip', |
|
277 |
'stw' => 'application/zip', |
|
278 |
'sv4cpio' => 'application/x-sv4cpio', |
|
279 |
'sv4crc' => 'application/x-sv4crc', |
|
280 |
'svg' => 'image/svg+xml', |
|
281 |
'swf' => 'application/x-shockwave-flash', |
|
282 |
'sxc' => 'application/zip', |
|
283 |
'sxd' => 'application/zip', |
|
284 |
'sxi' => 'application/zip', |
|
285 |
'sxm' => 'application/zip', |
|
286 |
'sxw' => 'application/zip', |
|
287 |
't' => 'application/x-troff', |
|
288 |
'tar' => 'application/x-tar', |
|
289 |
'tcl' => 'application/x-tcl', |
|
290 |
'tex' => 'application/x-tex', |
|
291 |
'texi' => 'application/x-texinfo', |
|
292 |
'texinfo' => 'application/x-texinfo', |
|
293 |
'tif' => 'image/tiff', |
|
294 |
'tiff' => 'image/tiff', |
|
295 |
'tr' => 'application/x-troff', |
|
296 |
'tsv' => 'text/tab-separated-values', |
|
297 |
'txt' => 'text/plain', |
|
298 |
'ustar' => 'application/x-ustar', |
|
299 |
'vcd' => 'application/x-cdlink', |
|
300 |
'vrml' => 'model/vrml', |
|
301 |
'vxml' => 'application/voicexml+xml', |
|
302 |
'wav' => 'audio/x-wav', |
|
303 |
'wbmp' => 'image/vnd.wap.wbmp', |
|
304 |
'wbxml' => 'application/vnd.wap.wbxml', |
|
305 |
'wml' => 'text/vnd.wap.wml', |
|
306 |
'wmlc' => 'application/vnd.wap.wmlc', |
|
307 |
'wmls' => 'text/vnd.wap.wmlscript', |
|
308 |
'wmlsc' => 'application/vnd.wap.wmlscriptc', |
|
309 |
'wrl' => 'model/vrml', |
|
310 |
'xbm' => 'image/x-xbitmap', |
|
311 |
'xcf' => 'image/xcf', |
|
312 |
'xht' => 'application/xhtml+xml', |
|
313 |
'xhtml' => 'application/xhtml+xml', |
|
314 |
'xls' => 'application/vnd.ms-excel', |
|
315 |
'xml' => 'text/xml', |
|
316 |
'xpi' => 'application/zip', |
|
317 |
'xpm' => 'image/x-xpixmap', |
|
318 |
'xsl' => 'text/xml', |
|
319 |
'xslt' => 'text/xml', |
|
320 |
'xwd' => 'image/x-xwindowdump', |
|
321 |
'xyz' => 'chemical/x-xyz', |
|
322 |
'zip' => 'application/zip', |
|
293
3f98d4ba1e33
Added OpenDocument MIME types and extensions; make sql_report page show total time taken for SQL queries
Dan
parents:
272
diff
changeset
|
323 |
'odt' => 'application/vnd.oasis.opendocument.text', |
3f98d4ba1e33
Added OpenDocument MIME types and extensions; make sql_report page show total time taken for SQL queries
Dan
parents:
272
diff
changeset
|
324 |
'ott' => 'application/vnd.oasis.opendocument.text-template', |
3f98d4ba1e33
Added OpenDocument MIME types and extensions; make sql_report page show total time taken for SQL queries
Dan
parents:
272
diff
changeset
|
325 |
'odg' => 'application/vnd.oasis.opendocument.graphics', |
3f98d4ba1e33
Added OpenDocument MIME types and extensions; make sql_report page show total time taken for SQL queries
Dan
parents:
272
diff
changeset
|
326 |
'otg' => 'application/vnd.oasis.opendocument.graphics-template', |
3f98d4ba1e33
Added OpenDocument MIME types and extensions; make sql_report page show total time taken for SQL queries
Dan
parents:
272
diff
changeset
|
327 |
'odp' => 'application/vnd.oasis.opendocument.presentation', |
3f98d4ba1e33
Added OpenDocument MIME types and extensions; make sql_report page show total time taken for SQL queries
Dan
parents:
272
diff
changeset
|
328 |
'otp' => 'application/vnd.oasis.opendocument.presentation-template', |
3f98d4ba1e33
Added OpenDocument MIME types and extensions; make sql_report page show total time taken for SQL queries
Dan
parents:
272
diff
changeset
|
329 |
'ods' => 'application/vnd.oasis.opendocument.spreadsheet', |
3f98d4ba1e33
Added OpenDocument MIME types and extensions; make sql_report page show total time taken for SQL queries
Dan
parents:
272
diff
changeset
|
330 |
'ots' => 'application/vnd.oasis.opendocument.spreadsheet-template', |
3f98d4ba1e33
Added OpenDocument MIME types and extensions; make sql_report page show total time taken for SQL queries
Dan
parents:
272
diff
changeset
|
331 |
'odc' => 'application/vnd.oasis.opendocument.chart', |
3f98d4ba1e33
Added OpenDocument MIME types and extensions; make sql_report page show total time taken for SQL queries
Dan
parents:
272
diff
changeset
|
332 |
'otc' => 'application/vnd.oasis.opendocument.chart-template', |
3f98d4ba1e33
Added OpenDocument MIME types and extensions; make sql_report page show total time taken for SQL queries
Dan
parents:
272
diff
changeset
|
333 |
'odi' => 'application/vnd.oasis.opendocument.image', |
3f98d4ba1e33
Added OpenDocument MIME types and extensions; make sql_report page show total time taken for SQL queries
Dan
parents:
272
diff
changeset
|
334 |
'oti' => 'application/vnd.oasis.opendocument.image-template', |
3f98d4ba1e33
Added OpenDocument MIME types and extensions; make sql_report page show total time taken for SQL queries
Dan
parents:
272
diff
changeset
|
335 |
'odf' => 'application/vnd.oasis.opendocument.formula', |
3f98d4ba1e33
Added OpenDocument MIME types and extensions; make sql_report page show total time taken for SQL queries
Dan
parents:
272
diff
changeset
|
336 |
'otf' => 'application/vnd.oasis.opendocument.formula-template', |
3f98d4ba1e33
Added OpenDocument MIME types and extensions; make sql_report page show total time taken for SQL queries
Dan
parents:
272
diff
changeset
|
337 |
'odm' => 'application/vnd.oasis.opendocument.text-master', |
3f98d4ba1e33
Added OpenDocument MIME types and extensions; make sql_report page show total time taken for SQL queries
Dan
parents:
272
diff
changeset
|
338 |
'oth' => 'application/vnd.oasis.opendocument.text-web' |
1 | 339 |
); |
340 |
||
341 |
$mimetype_extlist = Array( |
|
342 |
'application/andrew-inset'=>'ez', |
|
343 |
'application/mac-binhex40'=>'hqx', |
|
344 |
'application/mac-compactpro'=>'cpt', |
|
345 |
'application/mathml+xml'=>'mathml', |
|
346 |
'application/msword'=>'doc', |
|
347 |
'application/octet-stream'=>'bin dms lha lzh exe class so dll', |
|
348 |
'application/oda'=>'oda', |
|
349 |
'application/ogg'=>'ogg ogm', |
|
350 |
'application/pdf'=>'pdf', |
|
351 |
'application/postscript'=>'ai eps ps', |
|
352 |
'application/rdf+xml'=>'rdf', |
|
353 |
'application/smil'=>'smi smil', |
|
354 |
'application/srgs'=>'gram', |
|
355 |
'application/srgs+xml'=>'grxml', |
|
356 |
'application/vnd.mif'=>'mif', |
|
357 |
'application/vnd.ms-excel'=>'xls', |
|
358 |
'application/vnd.ms-powerpoint'=>'ppt', |
|
359 |
'application/vnd.wap.wbxml'=>'wbxml', |
|
360 |
'application/vnd.wap.wmlc'=>'wmlc', |
|
361 |
'application/vnd.wap.wmlscriptc'=>'wmlsc', |
|
362 |
'application/voicexml+xml'=>'vxml', |
|
363 |
'application/x-bcpio'=>'bcpio', |
|
364 |
'application/x-bzip'=>'gz bz2', |
|
365 |
'application/x-cdlink'=>'vcd', |
|
366 |
'application/x-chess-pgn'=>'pgn', |
|
367 |
'application/x-cpio'=>'cpio', |
|
368 |
'application/x-csh'=>'csh', |
|
369 |
'application/x-director'=>'dcr dir dxr', |
|
370 |
'application/x-dvi'=>'dvi', |
|
371 |
'application/x-futuresplash'=>'spl', |
|
372 |
'application/x-gtar'=>'gtar tar', |
|
373 |
'application/x-gzip'=>'gz', |
|
374 |
'application/x-hdf'=>'hdf', |
|
375 |
'application/x-jar'=>'jar', |
|
376 |
'application/x-javascript'=>'js', |
|
377 |
'application/x-koan'=>'skp skd skt skm', |
|
378 |
'application/x-latex'=>'latex', |
|
379 |
'application/x-netcdf'=>'nc cdf', |
|
380 |
'application/x-sh'=>'sh', |
|
381 |
'application/x-shar'=>'shar', |
|
382 |
'application/x-shockwave-flash'=>'swf', |
|
383 |
'application/x-stuffit'=>'sit', |
|
384 |
'application/x-sv4cpio'=>'sv4cpio', |
|
385 |
'application/x-sv4crc'=>'sv4crc', |
|
386 |
'application/x-tar'=>'tar', |
|
387 |
'application/x-tcl'=>'tcl', |
|
388 |
'application/x-tex'=>'tex', |
|
389 |
'application/x-texinfo'=>'texinfo texi', |
|
390 |
'application/x-troff'=>'t tr roff', |
|
391 |
'application/x-troff-man'=>'man', |
|
392 |
'application/x-troff-me'=>'me', |
|
393 |
'application/x-troff-ms'=>'ms', |
|
394 |
'application/x-ustar'=>'ustar', |
|
395 |
'application/x-wais-source'=>'src', |
|
396 |
'application/x-xpinstall'=>'xpi', |
|
397 |
'application/xhtml+xml'=>'xhtml xht', |
|
398 |
'application/xslt+xml'=>'xslt', |
|
399 |
'application/xml'=>'xml xsl', |
|
400 |
'application/xml-dtd'=>'dtd', |
|
401 |
'application/zip'=>'zip jar xpi sxc stc sxd std sxi sti sxm stm sxw stw ', |
|
402 |
'audio/basic'=>'au snd', |
|
403 |
'audio/midi'=>'mid midi kar', |
|
404 |
'audio/mpeg'=>'mpga mp2 mp3', |
|
405 |
'audio/ogg'=>'ogg ', |
|
406 |
'audio/x-aiff'=>'aif aiff aifc', |
|
407 |
'audio/x-mpegurl'=>'m3u', |
|
408 |
'audio/x-ogg'=>'ogg ', |
|
409 |
'audio/x-pn-realaudio'=>'ram rm', |
|
410 |
'audio/x-pn-realaudio-plugin'=>'rpm', |
|
411 |
'audio/x-realaudio'=>'ra', |
|
412 |
'audio/x-wav'=>'wav', |
|
413 |
'chemical/x-pdb'=>'pdb', |
|
414 |
'chemical/x-xyz'=>'xyz', |
|
415 |
'image/bmp'=>'bmp', |
|
416 |
'image/cgm'=>'cgm', |
|
417 |
'image/gif'=>'gif', |
|
418 |
'image/ief'=>'ief', |
|
419 |
'image/jpeg'=>'jpeg jpg jpe', |
|
420 |
'image/png'=>'png', |
|
421 |
'image/svg+xml'=>'svg', |
|
422 |
'image/tiff'=>'tiff tif', |
|
423 |
'image/vnd.djvu'=>'djvu djv', |
|
424 |
'image/vnd.wap.wbmp'=>'wbmp', |
|
425 |
'image/x-cmu-raster'=>'ras', |
|
426 |
'image/x-icon'=>'ico', |
|
427 |
'image/x-portable-anymap'=>'pnm', |
|
428 |
'image/x-portable-bitmap'=>'pbm', |
|
429 |
'image/x-portable-graymap'=>'pgm', |
|
430 |
'image/x-portable-pixmap'=>'ppm', |
|
431 |
'image/x-rgb'=>'rgb', |
|
432 |
'image/x-photoshop'=>'psd', |
|
433 |
'image/x-xbitmap'=>'xbm', |
|
434 |
'image/x-xpixmap'=>'xpm', |
|
435 |
'image/x-xwindowdump'=>'xwd', |
|
436 |
'model/iges'=>'igs iges', |
|
437 |
'model/mesh'=>'msh mesh silo', |
|
438 |
'model/vrml'=>'wrl vrml', |
|
439 |
'text/calendar'=>'ics ifb', |
|
440 |
'text/css'=>'css', |
|
441 |
'text/html'=>'html htm', |
|
442 |
'text/plain'=>'txt', |
|
443 |
'text/richtext'=>'rtx', |
|
444 |
'text/rtf'=>'rtf', |
|
445 |
'text/sgml'=>'sgml sgm', |
|
446 |
'text/tab-separated-values'=>'tsv', |
|
447 |
'text/vnd.wap.wml'=>'wml', |
|
448 |
'text/vnd.wap.wmlscript'=>'wmls', |
|
449 |
'text/xml'=>'xml xsl xslt rss rdf', |
|
450 |
'text/x-setext'=>'etx', |
|
451 |
'video/mpeg'=>'mpeg mpg mpe', |
|
452 |
'video/ogg'=>'ogm ogg', |
|
453 |
'video/quicktime'=>'qt mov', |
|
454 |
'video/vnd.mpegurl'=>'mxu', |
|
455 |
'video/x-msvideo'=>'avi', |
|
456 |
'video/x-ogg'=>'ogm ogg', |
|
457 |
'video/x-sgi-movie'=>'movie', |
|
458 |
'x-conference/x-cooltalk'=>'ice', |
|
459 |
// Added for Enano |
|
460 |
'image/xcf' => 'xcf xcfbz2 xcf.bz2', |
|
293
3f98d4ba1e33
Added OpenDocument MIME types and extensions; make sql_report page show total time taken for SQL queries
Dan
parents:
272
diff
changeset
|
461 |
'application/vnd.oasis.opendocument.text' => 'odt', |
3f98d4ba1e33
Added OpenDocument MIME types and extensions; make sql_report page show total time taken for SQL queries
Dan
parents:
272
diff
changeset
|
462 |
'application/vnd.oasis.opendocument.text-template' => 'ott', |
3f98d4ba1e33
Added OpenDocument MIME types and extensions; make sql_report page show total time taken for SQL queries
Dan
parents:
272
diff
changeset
|
463 |
'application/vnd.oasis.opendocument.graphics' => 'odg', |
3f98d4ba1e33
Added OpenDocument MIME types and extensions; make sql_report page show total time taken for SQL queries
Dan
parents:
272
diff
changeset
|
464 |
'application/vnd.oasis.opendocument.graphics-template' => 'otg', |
3f98d4ba1e33
Added OpenDocument MIME types and extensions; make sql_report page show total time taken for SQL queries
Dan
parents:
272
diff
changeset
|
465 |
'application/vnd.oasis.opendocument.presentation' => 'odp', |
3f98d4ba1e33
Added OpenDocument MIME types and extensions; make sql_report page show total time taken for SQL queries
Dan
parents:
272
diff
changeset
|
466 |
'application/vnd.oasis.opendocument.presentation-template' => 'otp', |
3f98d4ba1e33
Added OpenDocument MIME types and extensions; make sql_report page show total time taken for SQL queries
Dan
parents:
272
diff
changeset
|
467 |
'application/vnd.oasis.opendocument.spreadsheet' => 'ods', |
3f98d4ba1e33
Added OpenDocument MIME types and extensions; make sql_report page show total time taken for SQL queries
Dan
parents:
272
diff
changeset
|
468 |
'application/vnd.oasis.opendocument.spreadsheet-template' => 'ots', |
3f98d4ba1e33
Added OpenDocument MIME types and extensions; make sql_report page show total time taken for SQL queries
Dan
parents:
272
diff
changeset
|
469 |
'application/vnd.oasis.opendocument.chart' => 'odc', |
3f98d4ba1e33
Added OpenDocument MIME types and extensions; make sql_report page show total time taken for SQL queries
Dan
parents:
272
diff
changeset
|
470 |
'application/vnd.oasis.opendocument.chart-template' => 'otc', |
3f98d4ba1e33
Added OpenDocument MIME types and extensions; make sql_report page show total time taken for SQL queries
Dan
parents:
272
diff
changeset
|
471 |
'application/vnd.oasis.opendocument.image' => 'odi', |
3f98d4ba1e33
Added OpenDocument MIME types and extensions; make sql_report page show total time taken for SQL queries
Dan
parents:
272
diff
changeset
|
472 |
'application/vnd.oasis.opendocument.image-template' => 'oti', |
3f98d4ba1e33
Added OpenDocument MIME types and extensions; make sql_report page show total time taken for SQL queries
Dan
parents:
272
diff
changeset
|
473 |
'application/vnd.oasis.opendocument.formula' => 'odf', |
3f98d4ba1e33
Added OpenDocument MIME types and extensions; make sql_report page show total time taken for SQL queries
Dan
parents:
272
diff
changeset
|
474 |
'application/vnd.oasis.opendocument.formula-template' => 'otf', |
3f98d4ba1e33
Added OpenDocument MIME types and extensions; make sql_report page show total time taken for SQL queries
Dan
parents:
272
diff
changeset
|
475 |
'application/vnd.oasis.opendocument.text-master' => 'odm', |
3f98d4ba1e33
Added OpenDocument MIME types and extensions; make sql_report page show total time taken for SQL queries
Dan
parents:
272
diff
changeset
|
476 |
'application/vnd.oasis.opendocument.text-web' => 'oth' |
1 | 477 |
); |
478 |
||
479 |
$k = array_keys($mime_types); |
|
480 |
$mimetype_exps = Array(); |
|
481 |
foreach($k as $s => $x) |
|
482 |
{ |
|
483 |
$mimetype_exps[$x] = pow(2, $s); |
|
484 |
} |
|
485 |
||
486 |
unset($k, $s, $x); |
|
328
dc838fd61a06
Added initial avatar support. Currently rather feature complete except for admin controls for avatar.
Dan
parents:
326
diff
changeset
|
487 |
|
dc838fd61a06
Added initial avatar support. Currently rather feature complete except for admin controls for avatar.
Dan
parents:
326
diff
changeset
|
488 |
/****************************************************************************** |
dc838fd61a06
Added initial avatar support. Currently rather feature complete except for admin controls for avatar.
Dan
parents:
326
diff
changeset
|
489 |
* Global Variable: JPEG_Segment_Names |
dc838fd61a06
Added initial avatar support. Currently rather feature complete except for admin controls for avatar.
Dan
parents:
326
diff
changeset
|
490 |
* |
dc838fd61a06
Added initial avatar support. Currently rather feature complete except for admin controls for avatar.
Dan
parents:
326
diff
changeset
|
491 |
* Contents: The names of the JPEG segment markers, indexed by their marker number. This data is from the PHP JPEG Metadata Toolkit. Licensed under the GPLv2 or later. |
dc838fd61a06
Added initial avatar support. Currently rather feature complete except for admin controls for avatar.
Dan
parents:
326
diff
changeset
|
492 |
* |
dc838fd61a06
Added initial avatar support. Currently rather feature complete except for admin controls for avatar.
Dan
parents:
326
diff
changeset
|
493 |
******************************************************************************/ |
dc838fd61a06
Added initial avatar support. Currently rather feature complete except for admin controls for avatar.
Dan
parents:
326
diff
changeset
|
494 |
|
dc838fd61a06
Added initial avatar support. Currently rather feature complete except for admin controls for avatar.
Dan
parents:
326
diff
changeset
|
495 |
$GLOBALS[ "JPEG_Segment_Names" ] = array( |
dc838fd61a06
Added initial avatar support. Currently rather feature complete except for admin controls for avatar.
Dan
parents:
326
diff
changeset
|
496 |
0xC0 => "SOF0", 0xC1 => "SOF1", 0xC2 => "SOF2", 0xC3 => "SOF4", |
dc838fd61a06
Added initial avatar support. Currently rather feature complete except for admin controls for avatar.
Dan
parents:
326
diff
changeset
|
497 |
0xC5 => "SOF5", 0xC6 => "SOF6", 0xC7 => "SOF7", 0xC8 => "JPG", |
dc838fd61a06
Added initial avatar support. Currently rather feature complete except for admin controls for avatar.
Dan
parents:
326
diff
changeset
|
498 |
0xC9 => "SOF9", 0xCA => "SOF10", 0xCB => "SOF11", 0xCD => "SOF13", |
dc838fd61a06
Added initial avatar support. Currently rather feature complete except for admin controls for avatar.
Dan
parents:
326
diff
changeset
|
499 |
0xCE => "SOF14", 0xCF => "SOF15", |
dc838fd61a06
Added initial avatar support. Currently rather feature complete except for admin controls for avatar.
Dan
parents:
326
diff
changeset
|
500 |
0xC4 => "DHT", 0xCC => "DAC", |
dc838fd61a06
Added initial avatar support. Currently rather feature complete except for admin controls for avatar.
Dan
parents:
326
diff
changeset
|
501 |
|
dc838fd61a06
Added initial avatar support. Currently rather feature complete except for admin controls for avatar.
Dan
parents:
326
diff
changeset
|
502 |
0xD0 => "RST0", 0xD1 => "RST1", 0xD2 => "RST2", 0xD3 => "RST3", |
dc838fd61a06
Added initial avatar support. Currently rather feature complete except for admin controls for avatar.
Dan
parents:
326
diff
changeset
|
503 |
0xD4 => "RST4", 0xD5 => "RST5", 0xD6 => "RST6", 0xD7 => "RST7", |
dc838fd61a06
Added initial avatar support. Currently rather feature complete except for admin controls for avatar.
Dan
parents:
326
diff
changeset
|
504 |
|
dc838fd61a06
Added initial avatar support. Currently rather feature complete except for admin controls for avatar.
Dan
parents:
326
diff
changeset
|
505 |
0xD8 => "SOI", 0xD9 => "EOI", 0xDA => "SOS", 0xDB => "DQT", |
dc838fd61a06
Added initial avatar support. Currently rather feature complete except for admin controls for avatar.
Dan
parents:
326
diff
changeset
|
506 |
0xDC => "DNL", 0xDD => "DRI", 0xDE => "DHP", 0xDF => "EXP", |
dc838fd61a06
Added initial avatar support. Currently rather feature complete except for admin controls for avatar.
Dan
parents:
326
diff
changeset
|
507 |
|
dc838fd61a06
Added initial avatar support. Currently rather feature complete except for admin controls for avatar.
Dan
parents:
326
diff
changeset
|
508 |
0xE0 => "APP0", 0xE1 => "APP1", 0xE2 => "APP2", 0xE3 => "APP3", |
dc838fd61a06
Added initial avatar support. Currently rather feature complete except for admin controls for avatar.
Dan
parents:
326
diff
changeset
|
509 |
0xE4 => "APP4", 0xE5 => "APP5", 0xE6 => "APP6", 0xE7 => "APP7", |
dc838fd61a06
Added initial avatar support. Currently rather feature complete except for admin controls for avatar.
Dan
parents:
326
diff
changeset
|
510 |
0xE8 => "APP8", 0xE9 => "APP9", 0xEA => "APP10", 0xEB => "APP11", |
dc838fd61a06
Added initial avatar support. Currently rather feature complete except for admin controls for avatar.
Dan
parents:
326
diff
changeset
|
511 |
0xEC => "APP12", 0xED => "APP13", 0xEE => "APP14", 0xEF => "APP15", |
dc838fd61a06
Added initial avatar support. Currently rather feature complete except for admin controls for avatar.
Dan
parents:
326
diff
changeset
|
512 |
|
dc838fd61a06
Added initial avatar support. Currently rather feature complete except for admin controls for avatar.
Dan
parents:
326
diff
changeset
|
513 |
|
dc838fd61a06
Added initial avatar support. Currently rather feature complete except for admin controls for avatar.
Dan
parents:
326
diff
changeset
|
514 |
0xF0 => "JPG0", 0xF1 => "JPG1", 0xF2 => "JPG2", 0xF3 => "JPG3", |
dc838fd61a06
Added initial avatar support. Currently rather feature complete except for admin controls for avatar.
Dan
parents:
326
diff
changeset
|
515 |
0xF4 => "JPG4", 0xF5 => "JPG5", 0xF6 => "JPG6", 0xF7 => "JPG7", |
dc838fd61a06
Added initial avatar support. Currently rather feature complete except for admin controls for avatar.
Dan
parents:
326
diff
changeset
|
516 |
0xF8 => "JPG8", 0xF9 => "JPG9", 0xFA => "JPG10", 0xFB => "JPG11", |
dc838fd61a06
Added initial avatar support. Currently rather feature complete except for admin controls for avatar.
Dan
parents:
326
diff
changeset
|
517 |
0xFC => "JPG12", 0xFD => "JPG13", |
dc838fd61a06
Added initial avatar support. Currently rather feature complete except for admin controls for avatar.
Dan
parents:
326
diff
changeset
|
518 |
|
dc838fd61a06
Added initial avatar support. Currently rather feature complete except for admin controls for avatar.
Dan
parents:
326
diff
changeset
|
519 |
0xFE => "COM", 0x01 => "TEM", 0x02 => "RES", |
dc838fd61a06
Added initial avatar support. Currently rather feature complete except for admin controls for avatar.
Dan
parents:
326
diff
changeset
|
520 |
); |
dc838fd61a06
Added initial avatar support. Currently rather feature complete except for admin controls for avatar.
Dan
parents:
326
diff
changeset
|
521 |