2 /************************************************************************
3 * MXChange v0.2.1 Start: 08/25/2003 *
4 * =============== Last change: 05/29/2004 *
6 * -------------------------------------------------------------------- *
7 * File : databases.php *
8 * -------------------------------------------------------------------- *
9 * Short description : Definitions and arrays (hard-coded databases) *
10 * -------------------------------------------------------------------- *
11 * Kurzbeschreibung : Definitionen und Datenfelder (hart-codertiert) *
12 * -------------------------------------------------------------------- *
14 * -------------------------------------------------------------------- *
15 * Copyright (c) 2003 - 2008 by Roland Haeder *
16 * For more information visit: http://www.mxchange.org *
18 * This program is free software; you can redistribute it and/or modify *
19 * it under the terms of the GNU General Public License as published by *
20 * the Free Software Foundation; either version 2 of the License, or *
21 * (at your option) any later version. *
23 * This program is distributed in the hope that it will be useful, *
24 * but WITHOUT ANY WARRANTY; without even the implied warranty of *
25 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
26 * GNU General Public License for more details. *
28 * You should have received a copy of the GNU General Public License *
29 * along with this program; if not, write to the Free Software *
30 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, *
32 ************************************************************************/
34 // Some security stuff...
35 if (!defined('__SECURITY')) {
36 $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php";
40 // System-wide return codes
41 define('CODE_WRONG_PASS' , 1);
42 define('CODE_WRONG_ID' , 2);
43 define('CODE_ID_LOCKED' , 3);
44 define('CODE_ID_UNCONFIRMED' , 4);
45 define('CODE_UNKNOWN_STATUS' , 5);
46 define('CODE_NO_COOKIES' , 6);
47 define('CODE_CNTR_FAILED' , 8);
48 define('CODE_LOGOUT_DONE' , 8);
49 define('CODE_LOGOUT_FAILED' , 9);
50 define('CODE_URL_TLOCK' , 10);
51 define('CODE_URL_FOUND' , 11);
52 define('CODE_OVERLENGTH' , 12);
53 define('CODE_SUBJ_URL' , 13);
54 define('CODE_BLIST_URL' , 14);
55 define('CODE_NO_RECS_LEFT' , 15);
56 define('CODE_INVALID_TAGS' , 16);
57 define('CODE_MORE_POINTS' , 18);
58 define('CODE_COOKIES_DISABLED' , 18);
59 define('CODE_DATA_INVALID' , 19);
60 define('CODE_POSSIBLE_INVALID' , 20);
61 define('CODE_ACCOUNT_LOCKED' , 21);
62 define('CODE_USER_404' , 22);
63 define('CODE_STATS_404' , 23);
64 define('CODE_ALREADY_CONFIRMED', 24);
65 define('CODE_ERROR_MAILID' , 25);
66 define('CODE_EXTENSION_PROBLEM', 26);
67 define('CODE_MORE_RECEIVERS1' , 28);
68 define('CODE_MORE_RECEIVERS2' , 28);
69 define('CODE_MORE_RECEIVERS3' , 29);
70 define('CODE_INVALID_URL' , 30);
71 define('CODE_MENU_NOT_VALID' , 31);
72 define('CODE_LOGIN_FAILED' , 32);
74 // Full version string: /([0-9]){1}\.([0-9]){1}\.([0-9]){1}(-(alpha|beta|pre|rc([1-3]))([0-9]+))?/
75 // If you understand regular expressions ^^^ you may know how I versionize... ;-)
76 define('FULL_VERSION', "0.2.1-FINAL");
78 // Replacement strings
80 'userid' => "%uid%", // User-ID
81 'surname' => "%vorname%", // Surname
82 'family' => "%nachname%", // Family name
83 'gender' => "%anrede%", // Gender
87 $_CONFIG['one_day'] = 60*60*24;
90 // Timestamp for yesterday, today ... all at 00:00 am
91 define('START_YDAY', MAKE_TIME(0, 0, 0, time() - $_CONFIG['one_day']));
92 define('START_TDAY', MAKE_TIME(0, 0, 0, time()));
94 $COOKIES = substr(URL, strpos(substr(URL, 8), "/") + 8);
95 if ((strpos($COOKIES, "/") == "0") && (strpos(substr(URL, 8), "/") > 0)) {
96 // Script was installed into a sub directory
97 if (substr($COOKIES, -1) != "/") $COOKIES .= "/";
99 // No more sub directories added to URL
103 // Cookie-Path ( for lame servers... ;-) )
104 define('COOKIE_PATH', $COOKIES);
106 // Base directory for access logfiles
107 define('LOGS_BASE', "logs");
109 // Base directory for usage statistics
110 define('USAGE_BASE', "usage");
112 // Server-URL (DO NOT CHANGE THIS OR YOU CANNOT CHECK FOR UPDATES/EXTENSIONS!)
113 define('SERVER_URL', "http://www.mxchange.org");
115 // This current patch level
116 define('CURR_SVN_REVISION', "470");
118 // Take a prime number which is long (if you know a longer one please try it out!)
119 define('_PRIME', 591623);
121 // Calculate "entropy" with the prime number (for code generation)
122 define('_ADD', (_PRIME * _PRIME / (pi() * $_CONFIG['code_length'] + 1)));
124 // Random number for e.g. "cache-buster" used in OpenX script
125 define('CACHE_BUSTER', mt_rand(1000000, 9999999));
127 // Extra title is empty by default