EOL for HTTP request moved to config, errno and err_desc initialized (was absend)
[mailer.git] / inc / databases.php
index aa5e967948060f5c776d9a4c194204390bbe4339..ff3555e01e1c2a1b86b4dd921cea58af2731309f 100644 (file)
  * -------------------------------------------------------------------- *
  * Kurzbeschreibung  : Definitionen und Datenfelder (hart-codertiert)   *
  * -------------------------------------------------------------------- *
- *                                                                      *
+ * $Revision::                                                        $ *
+ * $Date::                                                            $ *
+ * $Tag:: 0.2.1-FINAL                                                 $ *
+ * $Author::                                                          $ *
+ * Needs to be in all Files and every File needs "svn propset           *
+ * svn:keywords Date Revision" (autoprobset!) at least!!!!!!            *
  * -------------------------------------------------------------------- *
  * Copyright (c) 2003 - 2008 by Roland Haeder                           *
  * For more information visit: http://www.mxchange.org                  *
 
 // Some security stuff...
 if (!defined('__SECURITY')) {
-       $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php";
+       $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), '/inc') + 4) . '/security.php';
        require($INC);
 } // END - if
 
 // System-wide return codes
-define('CODE_WRONG_PASS'       , 0x001);
-define('CODE_WRONG_ID'         , 0x002);
-define('CODE_ID_LOCKED'        , 0x003);
-define('CODE_ID_UNCONFIRMED'   , 0x004);
-define('CODE_UNKNOWN_STATUS'   , 0x005);
-define('CODE_NO_COOKIES'       , 0x006);
-define('CODE_CNTR_FAILED'      , 0x008);
-define('CODE_LOGOUT_DONE'      , 0x008);
-define('CODE_LOGOUT_FAILED'    , 0x009);
-define('CODE_URL_TLOCK'        , 0x00A);
-define('CODE_URL_FOUND'        , 0x00B);
-define('CODE_OVERLENGTH'       , 0x00C);
-define('CODE_SUBJ_URL'         , 0x00D);
-define('CODE_BLIST_URL'        , 0x00E);
-define('CODE_NO_RECS_LEFT'     , 0x00F);
-define('CODE_INVALID_TAGS'     , 0x010);
-define('CODE_MORE_POINTS'      , 0x011);
-define('CODE_COOKIES_DISABLED' , 0x012);
-define('CODE_DATA_INVALID'     , 0x013);
-define('CODE_POSSIBLE_INVALID' , 0x014);
-define('CODE_ACCOUNT_LOCKED'   , 0x015);
-define('CODE_USER_404'         , 0x016);
-define('CODE_STATS_404'        , 0x017);
-define('CODE_ALREADY_CONFIRMED', 0x018);
-define('CODE_ERROR_MAILID'     , 0x019);
-define('CODE_EXTENSION_PROBLEM', 0x01A);
-define('CODE_MORE_RECEIVERS1'  , 0x01B);
-define('CODE_MORE_RECEIVERS2'  , 0x01C);
-define('CODE_MORE_RECEIVERS3'  , 0x01D);
-define('CODE_INVALID_URL'      , 0x01E);
-define('CODE_MENU_NOT_VALID'   , 0x01F);
-define('CODE_LOGIN_FAILED'     , 0x020);
-define('CODE_BEG_SAME_AS_OWN'  , 0x020);
-define('CODE_UNHANDLED_STATUS' , 0x020);
+addCode('WRONG_PASS'       , 0x001);
+addCode('WRONG_ID'         , 0x002);
+addCode('ID_LOCKED'        , 0x003);
+addCode('ID_UNCONFIRMED'   , 0x004);
+addCode('UNKNOWN_STATUS'   , 0x005);
+addCode('NO_COOKIES'       , 0x006);
+addCode('CNTR_FAILED'      , 0x008);
+addCode('LOGOUT_DONE'      , 0x008);
+addCode('LOGOUT_FAILED'    , 0x009);
+addCode('URL_TLOCK'        , 0x00a);
+addCode('URL_FOUND'        , 0x00b);
+addCode('OVERLENGTH'       , 0x00c);
+addCode('SUBJ_URL'         , 0x00d);
+addCode('BLIST_URL'        , 0x00e);
+addCode('NO_RECS_LEFT'     , 0x00f);
+addCode('INVALID_TAGS'     , 0x010);
+addCode('MORE_POINTS'      , 0x011);
+addCode('COOKIES_DISABLED' , 0x012);
+addCode('DATA_INVALID'     , 0x013);
+addCode('POSSIBLE_INVALID' , 0x014);
+addCode('ACCOUNT_LOCKED'   , 0x015);
+addCode('USER_404'         , 0x016);
+addCode('STATS_404'        , 0x017);
+addCode('ALREADY_CONFIRMED', 0x018);
+addCode('ERROR_MAILID'     , 0x019);
+addCode('EXTENSION_PROBLEM', 0x01a);
+addCode('MORE_RECEIVERS1'  , 0x01b);
+addCode('MORE_RECEIVERS2'  , 0x01c);
+addCode('MORE_RECEIVERS3'  , 0x01d);
+addCode('INVALID_URL'      , 0x01e);
+addCode('MENU_NOT_VALID'   , 0x01f);
+addCode('LOGIN_FAILED'     , 0x020);
+addCode('BEG_SAME_AS_OWN'  , 0x021);
+addCode('UNHANDLED_STATUS' , 0x022);
+addCode('MODULE_MEM_ONLY'  , 0x023);
 
-// Full version string: /([0-9]){1}\.([0-9]){1}\.([0-9]){1}(-(alpha|beta|pre|rc([1-3]))([0-9]+))?/
-// If you understand regular expressions ^^^ you may know how I versionize... ;-)
-define('FULL_VERSION', "0.2.1-FINAL");
+// Server-URL (DO NOT CHANGE THIS OR YOU CANNOT CHECK FOR UPDATES/EXTENSIONS!)
+define('SERVER_URL', 'http://www.mxchange.org');
 
 // Replacement strings
-$REPLACER = array(
-       'userid'  => "%uid%",                   // User-ID
-       'surname' => "%vorname%",               // Surname
-       'family'  => "%nachname%",              // Family name
-       'gender'  => "%anrede%",                // Gender
+$GLOBALS['replacer'] = array(
+       'userid'  => '%uid%',           // User-ID
+       'surname' => '%vorname%',       // Surname
+       'family'  => '%nachname%',      // Family name
+       'gender'  => '%anrede%',        // Gender
 );
 
 // One day
-$_CONFIG['one_day'] = 60*60*24;
+setConfigEntry('one_day', (60*60*24));
 
 //
 // Timestamp for yesterday, today ... all at 00:00 am
-define('START_YDAY', MAKE_TIME(0, 0, 0, time() - getConfig('one_day')));
-define('START_TDAY', MAKE_TIME(0, 0, 0, time()));
-
-$COOKIES = substr(URL, strpos(substr(URL, 8), "/") + 8);
-if ((strpos($COOKIES, "/") == "0") && (strpos(substr(URL, 8), "/") > 0)) {
-       // Script was installed into a sub directory
-       if (substr($COOKIES, -1) != "/") $COOKIES .= "/";
-} else {
-       // No more sub directories added to URL
-       $COOKIES = "/";
-}
-
-// Cookie-Path ( for lame servers... ;-) )
-define('COOKIE_PATH', $COOKIES);
-
-// Base directory for access logfiles
-define('LOGS_BASE', "logs");
-
-// Base directory for usage statistics
-define('USAGE_BASE', "usage");
-
-// Server-URL (DO NOT CHANGE THIS OR YOU CANNOT CHECK FOR UPDATES/EXTENSIONS!)
-define('SERVER_URL', "http://www.mxchange.org");
-
-// Current SVN revision
-define('CURR_SVN_REVISION', "683");
+setConfigEntry('START_YDAY', makeTime(0, 0, 0, time() - getConfig('one_day')));
+setConfigEntry('START_TDAY', makeTime(0, 0, 0, time()));
 
 // Take a prime number which is long (if you know a longer one please try it out!)
-define('_PRIME', 591623);
+setConfigEntry('_PRIME', 591623);
 
 // Calculate "entropy" with the prime number (for code generation)
-define('_ADD', (_PRIME * _PRIME / (pi() * getConfig('code_length') + 1)));
+setConfigEntry('_ADD', (getConfig('_PRIME') * getConfig('_PRIME') / (pi() * getConfig('code_length') + 1)));
 
-// Random number for e.g. "cache-buster" used in OpenX script
+// Random number for e.g. the "cache-buster" used in OpenX script
 define('CACHE_BUSTER', mt_rand(1000000, 9999999));
 
+// HTTP-EOL
+setConfigEntry('HTTP_EOL', "\r\n");
+
+// CFG: DEBUG-SQL (if enabled and DEBUG_MODE is enabled all SQL queries will be logged to debug.log)
+setConfigEntry('DEBUG_SQL', 'N');
+
+// CFG: ENCRYPT-SEPERATOR
+setConfigEntry('ENCRYPT_SEPERATOR', ':');
+
 // Extra title is empty by default
-$EXTRA_TITLE = "";
+setExtraTitle('');
 
 //
 ?>