author | Dan |
Sun, 11 Jan 2009 21:37:49 -0500 | |
changeset 811 | 5c807fe77020 |
parent 801 | eb8b23f11744 |
child 825 | 9d5c04c1414f |
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 |
|
801
eb8b23f11744
Two big commits in one day I know, but redid password storage to use HMAC-SHA1. Consolidated much AES processing to three core methods in session that should handle everything automagically. Installation works; upgrades should. Rebranded as 1.1.6.
Dan
parents:
771
diff
changeset
|
5 |
* Version 1.1.6 (Caoineag beta 1) |
536 | 6 |
* Copyright (C) 2006-2008 Dan Fuhry |
1 | 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 |
define('BAN_IP', 1); |
|
18 |
define('BAN_USER', 2); |
|
19 |
define('BAN_EMAIL', 3); |
|
20 |
||
21 |
// ACL permission types |
|
22 |
define('AUTH_ALLOW', 4); |
|
23 |
define('AUTH_WIKIMODE', 3); // User can do this if wiki mode is enabled |
|
24 |
define('AUTH_DISALLOW', 2); |
|
25 |
define('AUTH_DENY', 1); // A Deny setting overrides *everything* |
|
26 |
||
27 |
define('ACL_TYPE_GROUP', 1); |
|
28 |
define('ACL_TYPE_USER', 2); |
|
29 |
define('ACL_TYPE_PRESET', 3); |
|
30 |
||
554
e87390b1f9b0
Revamped some ACL code and added effective permissions calculation code into session manager
Dan
parents:
541
diff
changeset
|
31 |
// ACL inheritance debugging info |
556
63e131c38876
More work done on effective permissions API, namely reporting of page group and usergroup names
Dan
parents:
554
diff
changeset
|
32 |
define('ACL_INHERIT_ENANO_DEFAULT', 10); |
554
e87390b1f9b0
Revamped some ACL code and added effective permissions calculation code into session manager
Dan
parents:
541
diff
changeset
|
33 |
define('ACL_INHERIT_GLOBAL_EVERYONE', 9); |
e87390b1f9b0
Revamped some ACL code and added effective permissions calculation code into session manager
Dan
parents:
541
diff
changeset
|
34 |
define('ACL_INHERIT_GLOBAL_GROUP', 8); |
e87390b1f9b0
Revamped some ACL code and added effective permissions calculation code into session manager
Dan
parents:
541
diff
changeset
|
35 |
define('ACL_INHERIT_GLOBAL_USER', 7); |
e87390b1f9b0
Revamped some ACL code and added effective permissions calculation code into session manager
Dan
parents:
541
diff
changeset
|
36 |
define('ACL_INHERIT_PG_EVERYONE', 6); |
e87390b1f9b0
Revamped some ACL code and added effective permissions calculation code into session manager
Dan
parents:
541
diff
changeset
|
37 |
define('ACL_INHERIT_PG_GROUP', 5); |
e87390b1f9b0
Revamped some ACL code and added effective permissions calculation code into session manager
Dan
parents:
541
diff
changeset
|
38 |
define('ACL_INHERIT_PG_USER', 4); |
e87390b1f9b0
Revamped some ACL code and added effective permissions calculation code into session manager
Dan
parents:
541
diff
changeset
|
39 |
define('ACL_INHERIT_LOCAL_EVERYONE', 3); |
e87390b1f9b0
Revamped some ACL code and added effective permissions calculation code into session manager
Dan
parents:
541
diff
changeset
|
40 |
define('ACL_INHERIT_LOCAL_GROUP', 2); |
e87390b1f9b0
Revamped some ACL code and added effective permissions calculation code into session manager
Dan
parents:
541
diff
changeset
|
41 |
define('ACL_INHERIT_LOCAL_USER', 1); |
e87390b1f9b0
Revamped some ACL code and added effective permissions calculation code into session manager
Dan
parents:
541
diff
changeset
|
42 |
|
513 | 43 |
// ACL color scale minimal shade for red and green ends |
44 |
// The lower, the more saturated the color on the scale. |
|
45 |
// Purely cosmetic. 0x0 - 0xFF, 0xFF will basically disable the scale |
|
46 |
define('ACL_SCALE_MINIMAL_SHADE', 0xA8); |
|
47 |
||
511
f88c8c79d784
Made some improvements to ACL system including: warning on setting Deny for Everyone on the entire site, added ACL_ALWAYS_ALLOW_ADMIN_EDIT_ACL, and changed behavior as noted in the docs so that Deny for Everyone is no longer able to be overridden
Dan
parents:
507
diff
changeset
|
48 |
// ACL switch |
f88c8c79d784
Made some improvements to ACL system including: warning on setting Deny for Everyone on the entire site, added ACL_ALWAYS_ALLOW_ADMIN_EDIT_ACL, and changed behavior as noted in the docs so that Deny for Everyone is no longer able to be overridden
Dan
parents:
507
diff
changeset
|
49 |
// If this is defined, administrators can edit ACLs regardless of current |
f88c8c79d784
Made some improvements to ACL system including: warning on setting Deny for Everyone on the entire site, added ACL_ALWAYS_ALLOW_ADMIN_EDIT_ACL, and changed behavior as noted in the docs so that Deny for Everyone is no longer able to be overridden
Dan
parents:
507
diff
changeset
|
50 |
// permissions. This is enabled by default. |
f88c8c79d784
Made some improvements to ACL system including: warning on setting Deny for Everyone on the entire site, added ACL_ALWAYS_ALLOW_ADMIN_EDIT_ACL, and changed behavior as noted in the docs so that Deny for Everyone is no longer able to be overridden
Dan
parents:
507
diff
changeset
|
51 |
define('ACL_ALWAYS_ALLOW_ADMIN_EDIT_ACL', 1); |
f88c8c79d784
Made some improvements to ACL system including: warning on setting Deny for Everyone on the entire site, added ACL_ALWAYS_ALLOW_ADMIN_EDIT_ACL, and changed behavior as noted in the docs so that Deny for Everyone is no longer able to be overridden
Dan
parents:
507
diff
changeset
|
52 |
|
1 | 53 |
// System groups |
541
acb7e23b6ffa
Massive commit with various changes. Added user ranks system (no admin interface yet) and ability for users to have custom user titles. Made cron framework accept fractions of hours through floating-point intervals. Modifed ACL editor to use miniPrompt framework for close confirmation box. Made avatar system use a special page as opposed to fetching the files directly for caching reasons.
Dan
parents:
536
diff
changeset
|
54 |
define('GROUP_ID_EVERYONE', 1); |
1 | 55 |
define('GROUP_ID_ADMIN', 2); |
56 |
define('GROUP_ID_MOD', 3); |
|
57 |
||
541
acb7e23b6ffa
Massive commit with various changes. Added user ranks system (no admin interface yet) and ability for users to have custom user titles. Made cron framework accept fractions of hours through floating-point intervals. Modifed ACL editor to use miniPrompt framework for close confirmation box. Made avatar system use a special page as opposed to fetching the files directly for caching reasons.
Dan
parents:
536
diff
changeset
|
58 |
// System ranks |
acb7e23b6ffa
Massive commit with various changes. Added user ranks system (no admin interface yet) and ability for users to have custom user titles. Made cron framework accept fractions of hours through floating-point intervals. Modifed ACL editor to use miniPrompt framework for close confirmation box. Made avatar system use a special page as opposed to fetching the files directly for caching reasons.
Dan
parents:
536
diff
changeset
|
59 |
define('RANK_ID_MEMBER', 1); |
acb7e23b6ffa
Massive commit with various changes. Added user ranks system (no admin interface yet) and ability for users to have custom user titles. Made cron framework accept fractions of hours through floating-point intervals. Modifed ACL editor to use miniPrompt framework for close confirmation box. Made avatar system use a special page as opposed to fetching the files directly for caching reasons.
Dan
parents:
536
diff
changeset
|
60 |
define('RANK_ID_MOD', 2); |
acb7e23b6ffa
Massive commit with various changes. Added user ranks system (no admin interface yet) and ability for users to have custom user titles. Made cron framework accept fractions of hours through floating-point intervals. Modifed ACL editor to use miniPrompt framework for close confirmation box. Made avatar system use a special page as opposed to fetching the files directly for caching reasons.
Dan
parents:
536
diff
changeset
|
61 |
define('RANK_ID_ADMIN', 3); |
acb7e23b6ffa
Massive commit with various changes. Added user ranks system (no admin interface yet) and ability for users to have custom user titles. Made cron framework accept fractions of hours through floating-point intervals. Modifed ACL editor to use miniPrompt framework for close confirmation box. Made avatar system use a special page as opposed to fetching the files directly for caching reasons.
Dan
parents:
536
diff
changeset
|
62 |
define('RANK_ID_GUEST', 4); |
acb7e23b6ffa
Massive commit with various changes. Added user ranks system (no admin interface yet) and ability for users to have custom user titles. Made cron framework accept fractions of hours through floating-point intervals. Modifed ACL editor to use miniPrompt framework for close confirmation box. Made avatar system use a special page as opposed to fetching the files directly for caching reasons.
Dan
parents:
536
diff
changeset
|
63 |
|
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
|
64 |
// 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
|
65 |
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
|
66 |
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
|
67 |
define('PAGE_GRP_NORMAL', 3); |
156
edbff85d43e8
Feature add: new page group type: regular expression match (PCRE)
Dan
parents:
142
diff
changeset
|
68 |
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
|
69 |
|
688
f2a824ce5f18
Added customizable parameters for session length and the long-missing "remember me" option (or rather, the ability to turn it off and make sessions temporary)
Dan
parents:
685
diff
changeset
|
70 |
// Session key types |
f2a824ce5f18
Added customizable parameters for session length and the long-missing "remember me" option (or rather, the ability to turn it off and make sessions temporary)
Dan
parents:
685
diff
changeset
|
71 |
// Short keys last for getConfig('session_short_time', '720'); in minutes and auto-renew. |
f2a824ce5f18
Added customizable parameters for session length and the long-missing "remember me" option (or rather, the ability to turn it off and make sessions temporary)
Dan
parents:
685
diff
changeset
|
72 |
// Long keys last for getConfig('session_remember_time', '30'); in days and do NOT auto-renew. |
f2a824ce5f18
Added customizable parameters for session length and the long-missing "remember me" option (or rather, the ability to turn it off and make sessions temporary)
Dan
parents:
685
diff
changeset
|
73 |
// Elevated keys have a hard-coded 15-minute limit for security reasons and because |
f2a824ce5f18
Added customizable parameters for session length and the long-missing "remember me" option (or rather, the ability to turn it off and make sessions temporary)
Dan
parents:
685
diff
changeset
|
74 |
// that's how Enano's done it since before beta 1. |
f2a824ce5f18
Added customizable parameters for session length and the long-missing "remember me" option (or rather, the ability to turn it off and make sessions temporary)
Dan
parents:
685
diff
changeset
|
75 |
define('SK_SHORT', 0); |
f2a824ce5f18
Added customizable parameters for session length and the long-missing "remember me" option (or rather, the ability to turn it off and make sessions temporary)
Dan
parents:
685
diff
changeset
|
76 |
define('SK_LONG', 1); |
f2a824ce5f18
Added customizable parameters for session length and the long-missing "remember me" option (or rather, the ability to turn it off and make sessions temporary)
Dan
parents:
685
diff
changeset
|
77 |
define('SK_ELEV', 2); |
f2a824ce5f18
Added customizable parameters for session length and the long-missing "remember me" option (or rather, the ability to turn it off and make sessions temporary)
Dan
parents:
685
diff
changeset
|
78 |
|
511
f88c8c79d784
Made some improvements to ACL system including: warning on setting Deny for Everyone on the entire site, added ACL_ALWAYS_ALLOW_ADMIN_EDIT_ACL, and changed behavior as noted in the docs so that Deny for Everyone is no longer able to be overridden
Dan
parents:
507
diff
changeset
|
79 |
// Identifier for the default pseudo-language |
205 | 80 |
define('LANG_DEFAULT', 0); |
81 |
||
541
acb7e23b6ffa
Massive commit with various changes. Added user ranks system (no admin interface yet) and ability for users to have custom user titles. Made cron framework accept fractions of hours through floating-point intervals. Modifed ACL editor to use miniPrompt framework for close confirmation box. Made avatar system use a special page as opposed to fetching the files directly for caching reasons.
Dan
parents:
536
diff
changeset
|
82 |
// Image types |
acb7e23b6ffa
Massive commit with various changes. Added user ranks system (no admin interface yet) and ability for users to have custom user titles. Made cron framework accept fractions of hours through floating-point intervals. Modifed ACL editor to use miniPrompt framework for close confirmation box. Made avatar system use a special page as opposed to fetching the files directly for caching reasons.
Dan
parents:
536
diff
changeset
|
83 |
define('IMAGE_TYPE_PNG', 1); |
acb7e23b6ffa
Massive commit with various changes. Added user ranks system (no admin interface yet) and ability for users to have custom user titles. Made cron framework accept fractions of hours through floating-point intervals. Modifed ACL editor to use miniPrompt framework for close confirmation box. Made avatar system use a special page as opposed to fetching the files directly for caching reasons.
Dan
parents:
536
diff
changeset
|
84 |
define('IMAGE_TYPE_GIF', 2); |
acb7e23b6ffa
Massive commit with various changes. Added user ranks system (no admin interface yet) and ability for users to have custom user titles. Made cron framework accept fractions of hours through floating-point intervals. Modifed ACL editor to use miniPrompt framework for close confirmation box. Made avatar system use a special page as opposed to fetching the files directly for caching reasons.
Dan
parents:
536
diff
changeset
|
85 |
define('IMAGE_TYPE_JPG', 3); |
621
68f8a9cc0a18
Added Gravatar support! And it's really configurable too.
Dan
parents:
592
diff
changeset
|
86 |
define('IMAGE_TYPE_GRV', 4); |
541
acb7e23b6ffa
Massive commit with various changes. Added user ranks system (no admin interface yet) and ability for users to have custom user titles. Made cron framework accept fractions of hours through floating-point intervals. Modifed ACL editor to use miniPrompt framework for close confirmation box. Made avatar system use a special page as opposed to fetching the files directly for caching reasons.
Dan
parents:
536
diff
changeset
|
87 |
|
592 | 88 |
// token types |
89 |
define('TOKEN_VARIABLE', 1); |
|
90 |
define('TOKEN_BOOLOP', 2); |
|
91 |
define('TOKEN_PARENTHLEFT', 3); |
|
92 |
define('TOKEN_PARENTHRIGHT', 4); |
|
93 |
define('TOKEN_NOT', 5); |
|
94 |
||
711
f70d764aab33
Added initial support for DST. Rules are defined in constants.php and are extensible.
Dan
parents:
692
diff
changeset
|
95 |
// DST constants |
f70d764aab33
Added initial support for DST. Rules are defined in constants.php and are extensible.
Dan
parents:
692
diff
changeset
|
96 |
define('FIRST_SUNDAY', 1); |
f70d764aab33
Added initial support for DST. Rules are defined in constants.php and are extensible.
Dan
parents:
692
diff
changeset
|
97 |
define('SECOND_SUNDAY', 2); |
f70d764aab33
Added initial support for DST. Rules are defined in constants.php and are extensible.
Dan
parents:
692
diff
changeset
|
98 |
define('THIRD_SUNDAY', 3); |
f70d764aab33
Added initial support for DST. Rules are defined in constants.php and are extensible.
Dan
parents:
692
diff
changeset
|
99 |
define('LAST_SUNDAY', 4); |
f70d764aab33
Added initial support for DST. Rules are defined in constants.php and are extensible.
Dan
parents:
692
diff
changeset
|
100 |
|
1 | 101 |
// |
102 |
// User types - don't touch these |
|
103 |
// |
|
104 |
||
105 |
// User can do absolutely everything |
|
106 |
define('USER_LEVEL_ADMIN', 9); |
|
107 |
||
108 |
// User can edit/[un]approve comments and do some basic administration |
|
109 |
define('USER_LEVEL_MOD', 5); |
|
110 |
||
111 |
// Default for members. When authed at this level, the user can change his/her password. |
|
112 |
define('USER_LEVEL_CHPREF', 3); |
|
113 |
||
114 |
// The level that you will be running at most of the time |
|
115 |
define('USER_LEVEL_MEMBER', 2); |
|
116 |
||
117 |
// Special level for guests |
|
118 |
define('USER_LEVEL_GUEST', 1); |
|
119 |
||
120 |
// Group status |
|
121 |
define('GROUP_CLOSED', 1); |
|
122 |
define('GROUP_REQUEST', 2); |
|
123 |
define('GROUP_HIDDEN', 3); |
|
124 |
define('GROUP_OPEN', 4); |
|
125 |
||
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
|
126 |
// 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
|
127 |
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
|
128 |
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
|
129 |
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
|
130 |
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
|
131 |
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
|
132 |
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
|
133 |
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
|
134 |
|
526
b2fb50d572c7
New plugin manager half-implemented. Most of the UI/frontend code is done. Moved sql_parse.php to /includes/ to allow use after installation - TODO: check installer, etc. for breakage
Dan
parents:
513
diff
changeset
|
135 |
// Plugin status |
b2fb50d572c7
New plugin manager half-implemented. Most of the UI/frontend code is done. Moved sql_parse.php to /includes/ to allow use after installation - TODO: check installer, etc. for breakage
Dan
parents:
513
diff
changeset
|
136 |
define('PLUGIN_INSTALLED', 1); |
b2fb50d572c7
New plugin manager half-implemented. Most of the UI/frontend code is done. Moved sql_parse.php to /includes/ to allow use after installation - TODO: check installer, etc. for breakage
Dan
parents:
513
diff
changeset
|
137 |
define('PLUGIN_DISABLED', 2); |
b2fb50d572c7
New plugin manager half-implemented. Most of the UI/frontend code is done. Moved sql_parse.php to /includes/ to allow use after installation - TODO: check installer, etc. for breakage
Dan
parents:
513
diff
changeset
|
138 |
define('PLUGIN_OUTOFDATE', 4); |
b2fb50d572c7
New plugin manager half-implemented. Most of the UI/frontend code is done. Moved sql_parse.php to /includes/ to allow use after installation - TODO: check installer, etc. for breakage
Dan
parents:
513
diff
changeset
|
139 |
|
1 | 140 |
// Other stuff |
141 |
||
142 |
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 |
|
143 |
define('SEARCH_RESULTS_PER_PAGE', 10); |
|
144 |
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
|
145 |
define('ENANO_SUPPORT_AVATARS', 1); |
771
5e85d7db8ee5
Merged WINDOWS_MOD_REWRITE_WORKAROUNDS changes from stable.
Dan
parents:
719
diff
changeset
|
146 |
// don't change this next line in upstream (it has to be auto-patched by the dynamic download script) |
5e85d7db8ee5
Merged WINDOWS_MOD_REWRITE_WORKAROUNDS changes from stable.
Dan
parents:
719
diff
changeset
|
147 |
// define('WINDOWS_MOD_REWRITE_WORKAROUNDS', ''); |
1 | 148 |
|
149 |
// Sidebar |
|
150 |
||
151 |
define('BLOCK_WIKIFORMAT', 0); |
|
152 |
define('BLOCK_TEMPLATEFORMAT', 1); |
|
153 |
define('BLOCK_HTML', 2); |
|
154 |
define('BLOCK_PHP', 3); |
|
155 |
define('BLOCK_PLUGIN', 4); |
|
156 |
define('SIDEBAR_LEFT', 1); |
|
157 |
define('SIDEBAR_RIGHT', 2); |
|
158 |
||
159 |
define('GENERAL_ERROR', 'General error'); |
|
160 |
define('GENERAL_NOTICE', 'Information'); |
|
161 |
define('CRITICAL_ERROR', 'Critical error'); |
|
162 |
||
468
194a19711346
Fixed the fact that cron just didn't work at all (brain fart that day or something)
Dan
parents:
411
diff
changeset
|
163 |
// Protection levels |
194a19711346
Fixed the fact that cron just didn't work at all (brain fart that day or something)
Dan
parents:
411
diff
changeset
|
164 |
// These are still hardcoded in some places, so don't change them |
194a19711346
Fixed the fact that cron just didn't work at all (brain fart that day or something)
Dan
parents:
411
diff
changeset
|
165 |
define('PROTECT_NONE', 0); |
194a19711346
Fixed the fact that cron just didn't work at all (brain fart that day or something)
Dan
parents:
411
diff
changeset
|
166 |
define('PROTECT_FULL', 1); |
194a19711346
Fixed the fact that cron just didn't work at all (brain fart that day or something)
Dan
parents:
411
diff
changeset
|
167 |
define('PROTECT_SEMI', 2); |
194a19711346
Fixed the fact that cron just didn't work at all (brain fart that day or something)
Dan
parents:
411
diff
changeset
|
168 |
|
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
|
169 |
// |
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
|
170 |
// 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
|
171 |
// |
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
|
172 |
|
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
|
173 |
// 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
|
174 |
// 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
|
175 |
// 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
|
176 |
// 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
|
177 |
|
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
|
178 |
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
|
179 |
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
|
180 |
|
1 | 181 |
// You can un-comment the next line to require database backups to be encrypted using the site's unique key. |
182 |
// This keeps the file safe in transit, but also prevents any type of editing to the file. This is NOT |
|
183 |
// recommended except for tiny sites because encrypting an average of 2MB of data will take a while. |
|
184 |
// define('SQL_BACKUP_CRYPT', ''); |
|
185 |
||
186 |
// Security |
|
187 |
||
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
|
188 |
// 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
|
189 |
// 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
|
190 |
define('AES_BITS', 192); |
1 | 191 |
|
192 |
// Define this to enable Mcrypt support which makes encryption work faster. This is only triggered if Mcrypt support is detected. |
|
193 |
// THIS IS DISABLED BECAUSE MCRYPT DOES NOT SEEM TO SUPPORT THE AES BLOCK SIZES THAT ENANO USES. |
|
194 |
//define('MCRYPT_ACCEL', ''); |
|
195 |
||
196 |
//if(defined('MCRYPT_RIJNDAEL_' . AES_BITS)) |
|
197 |
//{ |
|
198 |
// eval('$bs = MCRYPT_RIJNDAEL_' . AES_BITS . ';'); |
|
199 |
// $bs = mcrypt_module_get_algo_block_size($bs); |
|
200 |
// $bs = $bs * 8; |
|
201 |
// define('AES_BLOCKSIZE', $bs); |
|
202 |
//} |
|
203 |
// else |
|
204 |
// { |
|
205 |
// define('AES_BLOCKSIZE', AES_BITS); |
|
206 |
// } |
|
207 |
||
348
87e08a6e4fec
Welcome to the new Enano installer. Much distance still to be covered but the basics are there.
Dan
parents:
345
diff
changeset
|
208 |
// 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
|
209 |
// significantly increase encryption strength either. |
1 | 210 |
define('AES_BLOCKSIZE', 128); |
211 |
||
352
9d7225c0db6d
Enano's new installable installer, alpha 1. No upgrade and (in some parts) very little localization.
Dan
parents:
348
diff
changeset
|
212 |
// Our list of tables included in Enano |
9d7225c0db6d
Enano's new installable installer, alpha 1. No upgrade and (in some parts) very little localization.
Dan
parents:
348
diff
changeset
|
213 |
$system_table_list = Array( |
9d7225c0db6d
Enano's new installable installer, alpha 1. No upgrade and (in some parts) very little localization.
Dan
parents:
348
diff
changeset
|
214 |
'categories', |
9d7225c0db6d
Enano's new installable installer, alpha 1. No upgrade and (in some parts) very little localization.
Dan
parents:
348
diff
changeset
|
215 |
'comments', |
9d7225c0db6d
Enano's new installable installer, alpha 1. No upgrade and (in some parts) very little localization.
Dan
parents:
348
diff
changeset
|
216 |
'config', |
9d7225c0db6d
Enano's new installable installer, alpha 1. No upgrade and (in some parts) very little localization.
Dan
parents:
348
diff
changeset
|
217 |
'logs', |
9d7225c0db6d
Enano's new installable installer, alpha 1. No upgrade and (in some parts) very little localization.
Dan
parents:
348
diff
changeset
|
218 |
'page_text', |
9d7225c0db6d
Enano's new installable installer, alpha 1. No upgrade and (in some parts) very little localization.
Dan
parents:
348
diff
changeset
|
219 |
'session_keys', |
9d7225c0db6d
Enano's new installable installer, alpha 1. No upgrade and (in some parts) very little localization.
Dan
parents:
348
diff
changeset
|
220 |
'pages', |
9d7225c0db6d
Enano's new installable installer, alpha 1. No upgrade and (in some parts) very little localization.
Dan
parents:
348
diff
changeset
|
221 |
'users', |
9d7225c0db6d
Enano's new installable installer, alpha 1. No upgrade and (in some parts) very little localization.
Dan
parents:
348
diff
changeset
|
222 |
'users_extra', |
9d7225c0db6d
Enano's new installable installer, alpha 1. No upgrade and (in some parts) very little localization.
Dan
parents:
348
diff
changeset
|
223 |
'themes', |
9d7225c0db6d
Enano's new installable installer, alpha 1. No upgrade and (in some parts) very little localization.
Dan
parents:
348
diff
changeset
|
224 |
'buddies', |
9d7225c0db6d
Enano's new installable installer, alpha 1. No upgrade and (in some parts) very little localization.
Dan
parents:
348
diff
changeset
|
225 |
'banlist', |
9d7225c0db6d
Enano's new installable installer, alpha 1. No upgrade and (in some parts) very little localization.
Dan
parents:
348
diff
changeset
|
226 |
'files', |
9d7225c0db6d
Enano's new installable installer, alpha 1. No upgrade and (in some parts) very little localization.
Dan
parents:
348
diff
changeset
|
227 |
'privmsgs', |
9d7225c0db6d
Enano's new installable installer, alpha 1. No upgrade and (in some parts) very little localization.
Dan
parents:
348
diff
changeset
|
228 |
'sidebar', |
9d7225c0db6d
Enano's new installable installer, alpha 1. No upgrade and (in some parts) very little localization.
Dan
parents:
348
diff
changeset
|
229 |
'hits', |
9d7225c0db6d
Enano's new installable installer, alpha 1. No upgrade and (in some parts) very little localization.
Dan
parents:
348
diff
changeset
|
230 |
'groups', |
9d7225c0db6d
Enano's new installable installer, alpha 1. No upgrade and (in some parts) very little localization.
Dan
parents:
348
diff
changeset
|
231 |
'group_members', |
9d7225c0db6d
Enano's new installable installer, alpha 1. No upgrade and (in some parts) very little localization.
Dan
parents:
348
diff
changeset
|
232 |
'acl', |
9d7225c0db6d
Enano's new installable installer, alpha 1. No upgrade and (in some parts) very little localization.
Dan
parents:
348
diff
changeset
|
233 |
'page_groups', |
9d7225c0db6d
Enano's new installable installer, alpha 1. No upgrade and (in some parts) very little localization.
Dan
parents:
348
diff
changeset
|
234 |
'page_group_members', |
9d7225c0db6d
Enano's new installable installer, alpha 1. No upgrade and (in some parts) very little localization.
Dan
parents:
348
diff
changeset
|
235 |
'tags', |
9d7225c0db6d
Enano's new installable installer, alpha 1. No upgrade and (in some parts) very little localization.
Dan
parents:
348
diff
changeset
|
236 |
'language', |
9d7225c0db6d
Enano's new installable installer, alpha 1. No upgrade and (in some parts) very little localization.
Dan
parents:
348
diff
changeset
|
237 |
'language_strings', |
9d7225c0db6d
Enano's new installable installer, alpha 1. No upgrade and (in some parts) very little localization.
Dan
parents:
348
diff
changeset
|
238 |
'lockout', |
719
f82da241eaf8
Fixed system table list; added safeguard against twice prefixing the tables in $system_table_list
Dan
parents:
711
diff
changeset
|
239 |
'search_index', |
f82da241eaf8
Fixed system table list; added safeguard against twice prefixing the tables in $system_table_list
Dan
parents:
711
diff
changeset
|
240 |
'captcha', |
f82da241eaf8
Fixed system table list; added safeguard against twice prefixing the tables in $system_table_list
Dan
parents:
711
diff
changeset
|
241 |
'diffiehellman', |
f82da241eaf8
Fixed system table list; added safeguard against twice prefixing the tables in $system_table_list
Dan
parents:
711
diff
changeset
|
242 |
'plugins', |
f82da241eaf8
Fixed system table list; added safeguard against twice prefixing the tables in $system_table_list
Dan
parents:
711
diff
changeset
|
243 |
'ranks' |
352
9d7225c0db6d
Enano's new installable installer, alpha 1. No upgrade and (in some parts) very little localization.
Dan
parents:
348
diff
changeset
|
244 |
); |
9d7225c0db6d
Enano's new installable installer, alpha 1. No upgrade and (in some parts) very little localization.
Dan
parents:
348
diff
changeset
|
245 |
|
719
f82da241eaf8
Fixed system table list; added safeguard against twice prefixing the tables in $system_table_list
Dan
parents:
711
diff
changeset
|
246 |
if ( defined('table_prefix') && !defined('ENANO_TABLELIST_PREFIXED') ) |
352
9d7225c0db6d
Enano's new installable installer, alpha 1. No upgrade and (in some parts) very little localization.
Dan
parents:
348
diff
changeset
|
247 |
{ |
719
f82da241eaf8
Fixed system table list; added safeguard against twice prefixing the tables in $system_table_list
Dan
parents:
711
diff
changeset
|
248 |
define('ENANO_TABLELIST_PREFIXED', 1); |
352
9d7225c0db6d
Enano's new installable installer, alpha 1. No upgrade and (in some parts) very little localization.
Dan
parents:
348
diff
changeset
|
249 |
foreach ( $system_table_list as $i => $_ ) |
9d7225c0db6d
Enano's new installable installer, alpha 1. No upgrade and (in some parts) very little localization.
Dan
parents:
348
diff
changeset
|
250 |
{ |
9d7225c0db6d
Enano's new installable installer, alpha 1. No upgrade and (in some parts) very little localization.
Dan
parents:
348
diff
changeset
|
251 |
$system_table_list[$i] = table_prefix . $system_table_list[$i]; |
9d7225c0db6d
Enano's new installable installer, alpha 1. No upgrade and (in some parts) very little localization.
Dan
parents:
348
diff
changeset
|
252 |
} |
9d7225c0db6d
Enano's new installable installer, alpha 1. No upgrade and (in some parts) very little localization.
Dan
parents:
348
diff
changeset
|
253 |
} |
9d7225c0db6d
Enano's new installable installer, alpha 1. No upgrade and (in some parts) very little localization.
Dan
parents:
348
diff
changeset
|
254 |
|
1 | 255 |
/* |
256 |
* MIMETYPES |
|
257 |
* |
|
258 |
* This array defines the 166 known MIME types used by the Enano file-extension filter. Whether extensions are allowed or not is |
|
259 |
* determined by a bitfield in the config table. |
|
260 |
*/ |
|
261 |
||
262 |
global $mime_types, $mimetype_exps, $mimetype_extlist; |
|
263 |
||
264 |
// IMPORTANT: this array can NEVER have items removed from it or key indexes changed |
|
265 |
$mime_types = Array ( |
|
266 |
'ai' => 'application/postscript', |
|
267 |
'aif' => 'audio/x-aiff', |
|
268 |
'aifc' => 'audio/x-aiff', |
|
269 |
'aiff' => 'audio/x-aiff', |
|
270 |
'au' => 'audio/basic', |
|
271 |
'avi' => 'video/x-msvideo', |
|
272 |
'bcpio' => 'application/x-bcpio', |
|
273 |
'bin' => 'application/octet-stream', |
|
274 |
'bmp' => 'image/bmp', |
|
275 |
'bz2' => 'application/x-bzip', |
|
276 |
'cdf' => 'application/x-netcdf', |
|
277 |
'cgm' => 'image/cgm', |
|
278 |
'class' => 'application/octet-stream', |
|
279 |
'cpio' => 'application/x-cpio', |
|
280 |
'cpt' => 'application/mac-compactpro', |
|
281 |
'csh' => 'application/x-csh', |
|
282 |
'css' => 'text/css', |
|
283 |
'dcr' => 'application/x-director', |
|
284 |
'dir' => 'application/x-director', |
|
285 |
'djv' => 'image/vnd.djvu', |
|
286 |
'djvu' => 'image/vnd.djvu', |
|
287 |
'dll' => 'application/octet-stream', |
|
288 |
'dms' => 'application/octet-stream', |
|
289 |
'doc' => 'application/msword', |
|
290 |
'dtd' => 'application/xml-dtd', |
|
291 |
'dvi' => 'application/x-dvi', |
|
292 |
'dxr' => 'application/x-director', |
|
293 |
'eps' => 'application/postscript', |
|
294 |
'etx' => 'text/x-setext', |
|
295 |
'exe' => 'application/octet-stream', |
|
296 |
'ez' => 'application/andrew-inset', |
|
297 |
'gif' => 'image/gif', |
|
298 |
'gram' => 'application/srgs', |
|
299 |
'grxml' => 'application/srgs+xml', |
|
300 |
'gtar' => 'application/x-gtar', |
|
301 |
'gz' => 'application/x-gzip', |
|
302 |
'hdf' => 'application/x-hdf', |
|
303 |
'hqx' => 'application/mac-binhex40', |
|
304 |
'htm' => 'text/html', |
|
305 |
'html' => 'text/html', |
|
306 |
'ice' => 'x-conference/x-cooltalk', |
|
307 |
'ico' => 'image/x-icon', |
|
308 |
'ics' => 'text/calendar', |
|
309 |
'ief' => 'image/ief', |
|
310 |
'ifb' => 'text/calendar', |
|
311 |
'iges' => 'model/iges', |
|
312 |
'igs' => 'model/iges', |
|
313 |
'jar' => 'application/zip', |
|
314 |
'jpe' => 'image/jpeg', |
|
315 |
'jpeg' => 'image/jpeg', |
|
316 |
'jpg' => 'image/jpeg', |
|
317 |
'js' => 'application/x-javascript', |
|
318 |
'kar' => 'audio/midi', |
|
319 |
'latex' => 'application/x-latex', |
|
320 |
'lha' => 'application/octet-stream', |
|
321 |
'lzh' => 'application/octet-stream', |
|
322 |
'm3u' => 'audio/x-mpegurl', |
|
323 |
'man' => 'application/x-troff-man', |
|
324 |
'mathml' => 'application/mathml+xml', |
|
325 |
'me' => 'application/x-troff-me', |
|
326 |
'mesh' => 'model/mesh', |
|
327 |
'mid' => 'audio/midi', |
|
328 |
'midi' => 'audio/midi', |
|
329 |
'mif' => 'application/vnd.mif', |
|
330 |
'mov' => 'video/quicktime', |
|
331 |
'movie' => 'video/x-sgi-movie', |
|
332 |
'mp2' => 'audio/mpeg', |
|
333 |
'mp3' => 'audio/mpeg', |
|
334 |
'mpe' => 'video/mpeg', |
|
335 |
'mpeg' => 'video/mpeg', |
|
336 |
'mpg' => 'video/mpeg', |
|
337 |
'mpga' => 'audio/mpeg', |
|
338 |
'ms' => 'application/x-troff-ms', |
|
339 |
'msh' => 'model/mesh', |
|
340 |
'mxu' => 'video/vnd.mpegurl', |
|
341 |
'nc' => 'application/x-netcdf', |
|
342 |
'oda' => 'application/oda', |
|
343 |
'ogg' => 'application/ogg', |
|
344 |
'ogm' => 'application/ogg', |
|
345 |
'pbm' => 'image/x-portable-bitmap', |
|
346 |
'pdb' => 'chemical/x-pdb', |
|
347 |
'pdf' => 'application/pdf', |
|
348 |
'pgm' => 'image/x-portable-graymap', |
|
349 |
'pgn' => 'application/x-chess-pgn', |
|
350 |
'png' => 'image/png', |
|
351 |
'pnm' => 'image/x-portable-anymap', |
|
352 |
'ppm' => 'image/x-portable-pixmap', |
|
353 |
'ppt' => 'application/vnd.ms-powerpoint', |
|
354 |
'ps' => 'application/postscript', |
|
355 |
'psd' => 'image/x-photoshop', |
|
356 |
'qt' => 'video/quicktime', |
|
357 |
'ra' => 'audio/x-realaudio', |
|
358 |
'ram' => 'audio/x-pn-realaudio', |
|
359 |
'ras' => 'image/x-cmu-raster', |
|
360 |
'rdf' => 'text/xml', |
|
361 |
'rgb' => 'image/x-rgb', |
|
362 |
'rm' => 'audio/x-pn-realaudio', |
|
363 |
'roff' => 'application/x-troff', |
|
364 |
'rpm' => 'audio/x-pn-realaudio-plugin', |
|
365 |
'rss' => 'text/xml', |
|
366 |
'rtf' => 'text/rtf', |
|
367 |
'rtx' => 'text/richtext', |
|
368 |
'sgm' => 'text/sgml', |
|
369 |
'sgml' => 'text/sgml', |
|
370 |
'sh' => 'application/x-sh', |
|
371 |
'shar' => 'application/x-shar', |
|
372 |
'silo' => 'model/mesh', |
|
373 |
'sit' => 'application/x-stuffit', |
|
374 |
'skd' => 'application/x-koan', |
|
375 |
'skm' => 'application/x-koan', |
|
376 |
'skp' => 'application/x-koan', |
|
377 |
'skt' => 'application/x-koan', |
|
378 |
'smi' => 'application/smil', |
|
379 |
'smil' => 'application/smil', |
|
380 |
'snd' => 'audio/basic', |
|
381 |
'so' => 'application/octet-stream', |
|
382 |
'spl' => 'application/x-futuresplash', |
|
383 |
'src' => 'application/x-wais-source', |
|
384 |
'stc' => 'application/zip', |
|
385 |
'std' => 'application/zip', |
|
386 |
'sti' => 'application/zip', |
|
387 |
'stm' => 'application/zip', |
|
388 |
'stw' => 'application/zip', |
|
389 |
'sv4cpio' => 'application/x-sv4cpio', |
|
390 |
'sv4crc' => 'application/x-sv4crc', |
|
391 |
'svg' => 'image/svg+xml', |
|
392 |
'swf' => 'application/x-shockwave-flash', |
|
393 |
'sxc' => 'application/zip', |
|
394 |
'sxd' => 'application/zip', |
|
395 |
'sxi' => 'application/zip', |
|
396 |
'sxm' => 'application/zip', |
|
397 |
'sxw' => 'application/zip', |
|
398 |
't' => 'application/x-troff', |
|
399 |
'tar' => 'application/x-tar', |
|
400 |
'tcl' => 'application/x-tcl', |
|
401 |
'tex' => 'application/x-tex', |
|
402 |
'texi' => 'application/x-texinfo', |
|
403 |
'texinfo' => 'application/x-texinfo', |
|
404 |
'tif' => 'image/tiff', |
|
405 |
'tiff' => 'image/tiff', |
|
406 |
'tr' => 'application/x-troff', |
|
407 |
'tsv' => 'text/tab-separated-values', |
|
408 |
'txt' => 'text/plain', |
|
409 |
'ustar' => 'application/x-ustar', |
|
410 |
'vcd' => 'application/x-cdlink', |
|
411 |
'vrml' => 'model/vrml', |
|
412 |
'vxml' => 'application/voicexml+xml', |
|
413 |
'wav' => 'audio/x-wav', |
|
414 |
'wbmp' => 'image/vnd.wap.wbmp', |
|
415 |
'wbxml' => 'application/vnd.wap.wbxml', |
|
416 |
'wml' => 'text/vnd.wap.wml', |
|
417 |
'wmlc' => 'application/vnd.wap.wmlc', |
|
418 |
'wmls' => 'text/vnd.wap.wmlscript', |
|
419 |
'wmlsc' => 'application/vnd.wap.wmlscriptc', |
|
420 |
'wrl' => 'model/vrml', |
|
421 |
'xbm' => 'image/x-xbitmap', |
|
422 |
'xcf' => 'image/xcf', |
|
423 |
'xht' => 'application/xhtml+xml', |
|
424 |
'xhtml' => 'application/xhtml+xml', |
|
425 |
'xls' => 'application/vnd.ms-excel', |
|
426 |
'xml' => 'text/xml', |
|
427 |
'xpi' => 'application/zip', |
|
428 |
'xpm' => 'image/x-xpixmap', |
|
429 |
'xsl' => 'text/xml', |
|
430 |
'xslt' => 'text/xml', |
|
431 |
'xwd' => 'image/x-xwindowdump', |
|
432 |
'xyz' => 'chemical/x-xyz', |
|
433 |
'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
|
434 |
'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
|
435 |
'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
|
436 |
'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
|
437 |
'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
|
438 |
'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
|
439 |
'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
|
440 |
'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
|
441 |
'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
|
442 |
'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
|
443 |
'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
|
444 |
'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
|
445 |
'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
|
446 |
'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
|
447 |
'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
|
448 |
'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
|
449 |
'oth' => 'application/vnd.oasis.opendocument.text-web' |
1 | 450 |
); |
451 |
||
452 |
$mimetype_extlist = Array( |
|
453 |
'application/andrew-inset'=>'ez', |
|
454 |
'application/mac-binhex40'=>'hqx', |
|
455 |
'application/mac-compactpro'=>'cpt', |
|
456 |
'application/mathml+xml'=>'mathml', |
|
457 |
'application/msword'=>'doc', |
|
458 |
'application/octet-stream'=>'bin dms lha lzh exe class so dll', |
|
459 |
'application/oda'=>'oda', |
|
460 |
'application/ogg'=>'ogg ogm', |
|
461 |
'application/pdf'=>'pdf', |
|
462 |
'application/postscript'=>'ai eps ps', |
|
463 |
'application/rdf+xml'=>'rdf', |
|
464 |
'application/smil'=>'smi smil', |
|
465 |
'application/srgs'=>'gram', |
|
466 |
'application/srgs+xml'=>'grxml', |
|
467 |
'application/vnd.mif'=>'mif', |
|
468 |
'application/vnd.ms-excel'=>'xls', |
|
469 |
'application/vnd.ms-powerpoint'=>'ppt', |
|
470 |
'application/vnd.wap.wbxml'=>'wbxml', |
|
471 |
'application/vnd.wap.wmlc'=>'wmlc', |
|
472 |
'application/vnd.wap.wmlscriptc'=>'wmlsc', |
|
473 |
'application/voicexml+xml'=>'vxml', |
|
474 |
'application/x-bcpio'=>'bcpio', |
|
475 |
'application/x-bzip'=>'gz bz2', |
|
476 |
'application/x-cdlink'=>'vcd', |
|
477 |
'application/x-chess-pgn'=>'pgn', |
|
478 |
'application/x-cpio'=>'cpio', |
|
479 |
'application/x-csh'=>'csh', |
|
480 |
'application/x-director'=>'dcr dir dxr', |
|
481 |
'application/x-dvi'=>'dvi', |
|
482 |
'application/x-futuresplash'=>'spl', |
|
483 |
'application/x-gtar'=>'gtar tar', |
|
484 |
'application/x-gzip'=>'gz', |
|
485 |
'application/x-hdf'=>'hdf', |
|
486 |
'application/x-jar'=>'jar', |
|
487 |
'application/x-javascript'=>'js', |
|
488 |
'application/x-koan'=>'skp skd skt skm', |
|
489 |
'application/x-latex'=>'latex', |
|
490 |
'application/x-netcdf'=>'nc cdf', |
|
491 |
'application/x-sh'=>'sh', |
|
492 |
'application/x-shar'=>'shar', |
|
493 |
'application/x-shockwave-flash'=>'swf', |
|
494 |
'application/x-stuffit'=>'sit', |
|
495 |
'application/x-sv4cpio'=>'sv4cpio', |
|
496 |
'application/x-sv4crc'=>'sv4crc', |
|
497 |
'application/x-tar'=>'tar', |
|
498 |
'application/x-tcl'=>'tcl', |
|
499 |
'application/x-tex'=>'tex', |
|
500 |
'application/x-texinfo'=>'texinfo texi', |
|
501 |
'application/x-troff'=>'t tr roff', |
|
502 |
'application/x-troff-man'=>'man', |
|
503 |
'application/x-troff-me'=>'me', |
|
504 |
'application/x-troff-ms'=>'ms', |
|
505 |
'application/x-ustar'=>'ustar', |
|
506 |
'application/x-wais-source'=>'src', |
|
507 |
'application/x-xpinstall'=>'xpi', |
|
508 |
'application/xhtml+xml'=>'xhtml xht', |
|
509 |
'application/xslt+xml'=>'xslt', |
|
510 |
'application/xml'=>'xml xsl', |
|
511 |
'application/xml-dtd'=>'dtd', |
|
512 |
'application/zip'=>'zip jar xpi sxc stc sxd std sxi sti sxm stm sxw stw ', |
|
513 |
'audio/basic'=>'au snd', |
|
514 |
'audio/midi'=>'mid midi kar', |
|
515 |
'audio/mpeg'=>'mpga mp2 mp3', |
|
516 |
'audio/ogg'=>'ogg ', |
|
517 |
'audio/x-aiff'=>'aif aiff aifc', |
|
518 |
'audio/x-mpegurl'=>'m3u', |
|
519 |
'audio/x-ogg'=>'ogg ', |
|
520 |
'audio/x-pn-realaudio'=>'ram rm', |
|
521 |
'audio/x-pn-realaudio-plugin'=>'rpm', |
|
522 |
'audio/x-realaudio'=>'ra', |
|
523 |
'audio/x-wav'=>'wav', |
|
524 |
'chemical/x-pdb'=>'pdb', |
|
525 |
'chemical/x-xyz'=>'xyz', |
|
526 |
'image/bmp'=>'bmp', |
|
527 |
'image/cgm'=>'cgm', |
|
528 |
'image/gif'=>'gif', |
|
529 |
'image/ief'=>'ief', |
|
530 |
'image/jpeg'=>'jpeg jpg jpe', |
|
531 |
'image/png'=>'png', |
|
532 |
'image/svg+xml'=>'svg', |
|
533 |
'image/tiff'=>'tiff tif', |
|
534 |
'image/vnd.djvu'=>'djvu djv', |
|
535 |
'image/vnd.wap.wbmp'=>'wbmp', |
|
536 |
'image/x-cmu-raster'=>'ras', |
|
537 |
'image/x-icon'=>'ico', |
|
538 |
'image/x-portable-anymap'=>'pnm', |
|
539 |
'image/x-portable-bitmap'=>'pbm', |
|
540 |
'image/x-portable-graymap'=>'pgm', |
|
541 |
'image/x-portable-pixmap'=>'ppm', |
|
542 |
'image/x-rgb'=>'rgb', |
|
543 |
'image/x-photoshop'=>'psd', |
|
544 |
'image/x-xbitmap'=>'xbm', |
|
545 |
'image/x-xpixmap'=>'xpm', |
|
546 |
'image/x-xwindowdump'=>'xwd', |
|
547 |
'model/iges'=>'igs iges', |
|
548 |
'model/mesh'=>'msh mesh silo', |
|
549 |
'model/vrml'=>'wrl vrml', |
|
550 |
'text/calendar'=>'ics ifb', |
|
551 |
'text/css'=>'css', |
|
552 |
'text/html'=>'html htm', |
|
553 |
'text/plain'=>'txt', |
|
554 |
'text/richtext'=>'rtx', |
|
555 |
'text/rtf'=>'rtf', |
|
556 |
'text/sgml'=>'sgml sgm', |
|
557 |
'text/tab-separated-values'=>'tsv', |
|
558 |
'text/vnd.wap.wml'=>'wml', |
|
559 |
'text/vnd.wap.wmlscript'=>'wmls', |
|
560 |
'text/xml'=>'xml xsl xslt rss rdf', |
|
561 |
'text/x-setext'=>'etx', |
|
562 |
'video/mpeg'=>'mpeg mpg mpe', |
|
563 |
'video/ogg'=>'ogm ogg', |
|
564 |
'video/quicktime'=>'qt mov', |
|
565 |
'video/vnd.mpegurl'=>'mxu', |
|
566 |
'video/x-msvideo'=>'avi', |
|
567 |
'video/x-ogg'=>'ogm ogg', |
|
568 |
'video/x-sgi-movie'=>'movie', |
|
569 |
'x-conference/x-cooltalk'=>'ice', |
|
570 |
// Added for Enano |
|
571 |
'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
|
572 |
'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
|
573 |
'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
|
574 |
'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
|
575 |
'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
|
576 |
'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
|
577 |
'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
|
578 |
'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
|
579 |
'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
|
580 |
'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
|
581 |
'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
|
582 |
'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
|
583 |
'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
|
584 |
'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
|
585 |
'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
|
586 |
'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
|
587 |
'application/vnd.oasis.opendocument.text-web' => 'oth' |
1 | 588 |
); |
589 |
||
590 |
$k = array_keys($mime_types); |
|
591 |
$mimetype_exps = Array(); |
|
592 |
foreach($k as $s => $x) |
|
593 |
{ |
|
594 |
$mimetype_exps[$x] = pow(2, $s); |
|
595 |
} |
|
596 |
||
597 |
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
|
598 |
|
dc838fd61a06
Added initial avatar support. Currently rather feature complete except for admin controls for avatar.
Dan
parents:
326
diff
changeset
|
599 |
/****************************************************************************** |
dc838fd61a06
Added initial avatar support. Currently rather feature complete except for admin controls for avatar.
Dan
parents:
326
diff
changeset
|
600 |
* 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
|
601 |
* |
dc838fd61a06
Added initial avatar support. Currently rather feature complete except for admin controls for avatar.
Dan
parents:
326
diff
changeset
|
602 |
* 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
|
603 |
* |
dc838fd61a06
Added initial avatar support. Currently rather feature complete except for admin controls for avatar.
Dan
parents:
326
diff
changeset
|
604 |
******************************************************************************/ |
dc838fd61a06
Added initial avatar support. Currently rather feature complete except for admin controls for avatar.
Dan
parents:
326
diff
changeset
|
605 |
|
dc838fd61a06
Added initial avatar support. Currently rather feature complete except for admin controls for avatar.
Dan
parents:
326
diff
changeset
|
606 |
$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
|
607 |
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
|
608 |
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
|
609 |
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
|
610 |
0xCE => "SOF14", 0xCF => "SOF15", |
dc838fd61a06
Added initial avatar support. Currently rather feature complete except for admin controls for avatar.
Dan
parents:
326
diff
changeset
|
611 |
0xC4 => "DHT", 0xCC => "DAC", |
dc838fd61a06
Added initial avatar support. Currently rather feature complete except for admin controls for avatar.
Dan
parents:
326
diff
changeset
|
612 |
|
dc838fd61a06
Added initial avatar support. Currently rather feature complete except for admin controls for avatar.
Dan
parents:
326
diff
changeset
|
613 |
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
|
614 |
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
|
615 |
|
dc838fd61a06
Added initial avatar support. Currently rather feature complete except for admin controls for avatar.
Dan
parents:
326
diff
changeset
|
616 |
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
|
617 |
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
|
618 |
|
dc838fd61a06
Added initial avatar support. Currently rather feature complete except for admin controls for avatar.
Dan
parents:
326
diff
changeset
|
619 |
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
|
620 |
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
|
621 |
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
|
622 |
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
|
623 |
|
dc838fd61a06
Added initial avatar support. Currently rather feature complete except for admin controls for avatar.
Dan
parents:
326
diff
changeset
|
624 |
|
dc838fd61a06
Added initial avatar support. Currently rather feature complete except for admin controls for avatar.
Dan
parents:
326
diff
changeset
|
625 |
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
|
626 |
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
|
627 |
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
|
628 |
0xFC => "JPG12", 0xFD => "JPG13", |
dc838fd61a06
Added initial avatar support. Currently rather feature complete except for admin controls for avatar.
Dan
parents:
326
diff
changeset
|
629 |
|
dc838fd61a06
Added initial avatar support. Currently rather feature complete except for admin controls for avatar.
Dan
parents:
326
diff
changeset
|
630 |
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
|
631 |
); |
dc838fd61a06
Added initial avatar support. Currently rather feature complete except for admin controls for avatar.
Dan
parents:
326
diff
changeset
|
632 |
|
711
f70d764aab33
Added initial support for DST. Rules are defined in constants.php and are extensible.
Dan
parents:
692
diff
changeset
|
633 |
// DST profiles |
f70d764aab33
Added initial support for DST. Rules are defined in constants.php and are extensible.
Dan
parents:
692
diff
changeset
|
634 |
global $dst_profiles; |
f70d764aab33
Added initial support for DST. Rules are defined in constants.php and are extensible.
Dan
parents:
692
diff
changeset
|
635 |
$dst_profiles = array( |
f70d764aab33
Added initial support for DST. Rules are defined in constants.php and are extensible.
Dan
parents:
692
diff
changeset
|
636 |
'off' => '0;0;0;0;60', |
f70d764aab33
Added initial support for DST. Rules are defined in constants.php and are extensible.
Dan
parents:
692
diff
changeset
|
637 |
'usa' => '3;' . SECOND_SUNDAY . ';11;' . FIRST_SUNDAY . ';60', |
f70d764aab33
Added initial support for DST. Rules are defined in constants.php and are extensible.
Dan
parents:
692
diff
changeset
|
638 |
'europe' => '3;' . LAST_SUNDAY . ';10;' . LAST_SUNDAY . ';60', |
f70d764aab33
Added initial support for DST. Rules are defined in constants.php and are extensible.
Dan
parents:
692
diff
changeset
|
639 |
'australia' => '10;' . LAST_SUNDAY . ';3;' . LAST_SUNDAY . ';60', |
f70d764aab33
Added initial support for DST. Rules are defined in constants.php and are extensible.
Dan
parents:
692
diff
changeset
|
640 |
'tasmania' => '10;' . FIRST_SUNDAY . ';3;' . LAST_SUNDAY . ';60' |
f70d764aab33
Added initial support for DST. Rules are defined in constants.php and are extensible.
Dan
parents:
692
diff
changeset
|
641 |
); |