entfernten Angreifer theoretisch moeglich, SQL-Befehle einzuschleusen und auch
Attacken auf die Variable $PHP_SELF durchzufueheren. Seit Patch 486 und 487
(laden Sie sich am Besten immer die aktuellsten Patches herunter!) sind nun
-entsprechende Zeilen aus der inc/db/lib-mysql3.php (Funktion sqlQueryEscaped)
+entsprechende Zeilen aus der inc/db/lib-mysql.php (Funktion sqlQueryEscaped)
entfernt und sollten nicht mehr angreifbar sein. Der generierten SQL-Befehl
wurde vor der Ausfuehrung nochmals "uebersetzt", also alle
sicherheitsgefaehrdenen Zeichen wieder eingebaut. Zudem existiert im Script
entfernten Angreifer theoretisch moeglich, SQL-Befehle einzuschleusen und auch
Attacken auf die Variable $PHP_SELF durchzufueheren. Seit Patch 486 und 487
(laden Sie sich am Besten immer die aktuellsten Patches herunter!) sind nun
-entsprechende Zeilen aus der inc/db/lib-mysql3.php (Funktion sqlQueryEscaped)
+entsprechende Zeilen aus der inc/db/lib-mysql.php (Funktion sqlQueryEscaped)
entfernt sollten nicht mehr angreifbar sein. Der generierten SQL-Befehl wurde
vor der Ausfuehrung nochmals "uebersetzt", also alle sicherheitsgefaehrdenen
Zeichen wieder eingebaut. Zudem existiert im Script
* -------------------------------------------------------------------- *
* Kurzbeschreibung : AJAX-bezogene Funktionen *
* -------------------------------------------------------------------- *
- * $Revision:: $ *
- * $Date:: $ *
- * $Tag:: 0.2.1-FINAL $ *
- * $Author:: $ *
- * -------------------------------------------------------------------- *
* Copyright (c) 2003 - 2009 by Roland Haeder *
* Copyright (c) 2009 - 2013 by Mailer Developer Team *
* For more information visit: http://mxchange.org *
* -------------------------------------------------------------------- *
* Kurzbeschreibung : AJAX-Bibliothek fuer Adminmenu *
* -------------------------------------------------------------------- *
- * $Revision:: $ *
- * $Date:: $ *
- * $Tag:: 0.2.1-FINAL $ *
- * $Author:: $ *
- * -------------------------------------------------------------------- *
* Copyright (c) 2003 - 2009 by Roland Haeder *
* Copyright (c) 2009 - 2013 by Mailer Developer Team *
* For more information visit: http://mxchange.org *
* -------------------------------------------------------------------- *
* Kurzbeschreibung : AJAX-Bibliothek fuer Adminmenu *
* -------------------------------------------------------------------- *
- * $Revision:: $ *
- * $Date:: $ *
- * $Tag:: 0.2.1-FINAL $ *
- * $Author:: $ *
- * -------------------------------------------------------------------- *
* Copyright (c) 2003 - 2009 by Roland Haeder *
* Copyright (c) 2009 - 2013 by Mailer Developer Team *
* For more information visit: http://mxchange.org *
* -------------------------------------------------------------------- *
* Kurzbeschreibung : AJAX-bezogene Funktionen fuer Installer *
* -------------------------------------------------------------------- *
- * $Revision:: $ *
- * $Date:: $ *
- * $Tag:: 0.2.1-FINAL $ *
- * $Author:: $ *
- * -------------------------------------------------------------------- *
* Copyright (c) 2003 - 2009 by Roland Haeder *
* Copyright (c) 2009 - 2013 by Mailer Developer Team *
* For more information visit: http://mxchange.org *
// Establish a database link
function establishAjaxInstallerDatabaseLink () {
// This requires some session data
- if (!isSessionDataSet(array('mysql_host', 'mysql_dbase', 'mysql_prefix', 'mysql_login', 'mysql_password1', 'mysql_password2', 'mysql_engine'))) {
+ if (!isSessionDataSet(array('mysql_host', 'mysql_dbase', 'mysql_prefix', 'mysql_login', 'mysql_password1', 'mysql_password2', 'mysql_engine', 'database_extension'))) {
// Some required session data is not set
reportBug(__FUNCTION__, __LINE__, 'Required session data for this step not found.');
} // END - if
// Set type, prefix from POST data and database name for later queries
setConfigEntry('_TABLE_TYPE' , getSession('mysql_engine'));
+ setConfigEntry('_DB_TYPE' , getSession('database_extension'));
setConfigEntry('_MYSQL_PREFIX', getSession('mysql_prefix'));
setConfigEntry('__DB_NAME' , getSession('mysql_dbase'));
}
(isInstallerDataValid($saveStatus, $key, $value))
&&
// And can it be stored in session?
- (setSession($key, $value))
+ (setSessionCompiled($key, $value))
);
// Save the overall status for below final check
// Is 'base_path' not set?
if (!isSessionVariableSet('base_path')) {
// Then set it from PATH
- setSession('base_path', getPath());
+ setSessionCompiled('base_path', getPath());
} // END - if
// Is 'base_url' not set?
if (!isSessionVariableSet('base_url')) {
// Then set it from URL
- setSession('base_url', getUrl());
+ setSessionCompiled('base_url', getUrl());
} // END - if
// Is 'main_title' not set?
if (!isSessionVariableSet('main_title')) {
// Then set it from default main title
- setSession('main_title', compileRawCode(getMessage('DEFAULT_MAIN_TITLE')));
+ setSessionCompiled('main_title', compileRawCode(getMessage('DEFAULT_MAIN_TITLE')));
} // END - if
// Is 'slogan' not set?
if (!isSessionVariableSet('slogan')) {
// Then set it from default slogan
- setSession('slogan', compileRawCode(getMessage('DEFAULT_SLOGAN')));
+ setSessionCompiled('slogan', compileRawCode(getMessage('DEFAULT_SLOGAN')));
} // END - if
// Is 'webmaster' not set?
if (!isSessionVariableSet('webmaster')) {
// Then set it from default webmaster email address
- setSession('webmaster', '{--DEFAULT_WEBMASTER--}');
+ setSessionCompiled('webmaster', '{--DEFAULT_WEBMASTER--}');
} // END - if
}
// Is 'mysql_host' not set?
if (!isSessionVariableSet('mysql_host')) {
// Then set it directly
- setSession('mysql_host', 'localhost');
+ setSessionCompiled('mysql_host', 'localhost');
} // END - if
// Is 'mysql_dbase' not set?
if (!isSessionVariableSet('mysql_dbase')) {
// Then set it directly
- setSession('mysql_dbase', 'your_database');
+ setSessionCompiled('mysql_dbase', 'your_database');
} // END - if
// Is 'mysql_prefix' not set?
if (!isSessionVariableSet('mysql_prefix')) {
// Then set it directly
- setSession('mysql_prefix', 'mailer');
+ setSessionCompiled('mysql_prefix', 'mailer');
} // END - if
// Is 'mysql_login' not set?
if (!isSessionVariableSet('mysql_login')) {
// Then set it directly
- setSession('mysql_login', 'your_login');
+ setSessionCompiled('mysql_login', 'your_login');
} // END - if
// Is 'mysql_dbase' not set?
if (!isSessionVariableSet('mysql_password1')) {
// Then set it directly
- setSession('mysql_password1', '');
+ setSessionCompiled('mysql_password1', '');
} // END - if
// Is 'mysql_password2' not set?
if (!isSessionVariableSet('mysql_password2')) {
// Then set it directly
- setSession('mysql_password2', '');
+ setSessionCompiled('mysql_password2', '');
} // END - if
// Is 'mysql_engine' not set?
if (!isSessionVariableSet('mysql_engine')) {
// Then set it directly
- setSession('mysql_engine', 'MyISAM');
+ setSessionCompiled('mysql_engine', 'MyISAM');
+ } // END - if
+
+ // Is 'mysql_engine' not set?
+ if (!isSessionVariableSet('database_extension')) {
+ // Then set it directly
+ setSessionCompiled('database_extension', 'mysqli');
} // END - if
}
// Is 'output_mode' not set?
if (!isSessionVariableSet('output_mode')) {
// Then set it directly
- setSession('output_mode', 'render');
+ setSessionCompiled('output_mode', 'render');
} // END - if
// Is 'warn_no_pass' not set?
if (!isSessionVariableSet('warn_no_pass')) {
// Then set it directly
- setSession('warn_no_pass', 'Y');
+ setSessionCompiled('warn_no_pass', 'Y');
} // END - if
// Is 'write_footer' not set?
if (!isSessionVariableSet('write_footer')) {
// Then set it directly
- setSession('write_footer', 'Y');
+ setSessionCompiled('write_footer', 'Y');
} // END - if
// Is 'enable_backlink' not set?
if (!isSessionVariableSet('enable_backlink')) {
// Then set it directly
- setSession('enable_backlink', 'Y');
+ setSessionCompiled('enable_backlink', 'Y');
} // END - if
}
* At least ext-admins, ext-sql_patches and ext-task should be installed
* (ext-sql_patches is a must!)
*/
- setSession('extensions', 'admins:sql_patches:task');
+ setSessionCompiled('extensions', 'admins:sql_patches:task');
} elseif (strpos(getSession('extensions'), 'sql_patches') === FALSE) {
// Add missing ext-sql_patches
- setSession('extensions', getSession('extensions') . ':sql_patches');
+ setSessionCompiled('extensions', getSession('extensions') . ':sql_patches');
}
}
// Is 'admin_login' set?
if (!isSessionVariableSet('admin_login')) {
// Set it
- setSession('admin_login', 'admin');
+ setSessionCompiled('admin_login', 'admin');
} // END - if
// Is 'admin_email' set?
if (!isSessionVariableSet('admin_email')) {
// Set it
- setSession('admin_email', getSession('webmaster'));
+ setSessionCompiled('admin_email', getSession('webmaster'));
} // END - if
// Is 'admin_password1' set?
if (!isSessionVariableSet('admin_password1')) {
// Set it
- setSession('admin_password1', '');
+ setSessionCompiled('admin_password1', '');
} // END - if
// Is 'admin_password2' set?
if (!isSessionVariableSet('admin_password2')) {
// Set it
- setSession('admin_password2', '');
+ setSessionCompiled('admin_password2', '');
} // END - if
}
// Call-back function to write local configuration file
function doAjaxInstallerStepWriteLocalConfig () {
// Is all set?
- if (!isSessionDataSet(array('base_path', 'base_url', 'main_title', 'slogan', 'webmaster', 'mysql_host', 'mysql_dbase', 'mysql_prefix', 'mysql_login', 'mysql_password1', 'mysql_password2', 'mysql_engine', 'output_mode', 'warn_no_pass', 'write_footer', 'enable_backlink'))) {
+ if (!isSessionDataSet(array('base_path', 'base_url', 'main_title', 'slogan', 'webmaster', 'mysql_host', 'mysql_dbase', 'mysql_prefix', 'mysql_login', 'mysql_password1', 'mysql_password2', 'mysql_engine', 'database_extension', 'output_mode', 'warn_no_pass', 'write_footer', 'enable_backlink'))) {
// Some required session data is not set
reportBug(__FUNCTION__, __LINE__, 'Required session data for this step not found.');
} elseif (isInstalled()) {
getSession('mysql_password1'),
getSession('mysql_prefix'),
getSession('mysql_engine'),
+ getSession('database_extension'),
getSession('smtp_host'),
getSession('smtp_user'),
getSession('smtp_password1')
* -------------------------------------------------------------------- *
* Kurzbeschreibung : CacheSystem-Klasse *
* -------------------------------------------------------------------- *
- * $Revision:: $ *
- * $Date:: $ *
- * $Tag:: 0.2.1-FINAL $ *
- * $Author:: $ *
- * -------------------------------------------------------------------- *
* Copyright (c) 2003 - 2009 by Roland Haeder *
* Copyright (c) 2009 - 2013 by Mailer Developer Team *
* For more information visit: http://mxchange.org *
} elseif ($this->name == 'refsystem') {
// Referral system
$GLOBALS['cache_array']['refsystem'][$k][$data['id']] = $v;
- } elseif ($this->name == 'revision') {
- // Revision data
- $GLOBALS['cache_array']['revision'][$k][0] = $v;
} elseif ($this->name == 'themes') {
// Themes
if ($k == 'theme_path') {
* -------------------------------------------------------------------- *
* Kurzbeschreibung : Lokale Konfiguration *
* -------------------------------------------------------------------- *
- * $Revision:: $ *
- * $Date:: $ *
- * $Tag:: 0.2.1-FINAL $ *
- * $Author:: $ *
- * -------------------------------------------------------------------- *
* Copyright (c) 2003 - 2008 by Roland Haeder *
* Copyright (c) 2009 - 2013 by Mailer Developer Team *
* For more information visit: http://mxchange.org *
setConfigEntry('_TABLE_TYPE', 'MyISAM');
// CFG: DATABASE-TYPE
-setConfigEntry('_DB_TYPE', 'mysql3');
+setConfigEntry('_DB_TYPE', 'mysql');
// CFG: BACKLINK (Enable backlink to mxchange.org in footer? rel=external is set!)
setConfigEntry('ENABLE_BACKLINK', 'Y');
* =================== Last change: 08/29/2004 *
* *
* -------------------------------------------------------------------- *
- * File : lib-mysql3.php *
+ * File : lib-mysql.php *
* -------------------------------------------------------------------- *
- * Short description : Database layer for MySQL 3/4/5 server *
+ * Short description : Database layer for PHP 5.4 and older *
* -------------------------------------------------------------------- *
- * Kurzbeschreibung : Datenbankschicht fuer MySQL 3/4/5 Server *
- * -------------------------------------------------------------------- *
- * $Revision:: $ *
- * $Date:: $ *
- * $Tag:: 0.2.1-FINAL $ *
- * $Author:: $ *
+ * Kurzbeschreibung : Datenbankschicht fuer PHP 5.4 und aelter *
* -------------------------------------------------------------------- *
* Copyright (c) 2003 - 2009 by Roland Haeder *
* Copyright (c) 2009 - 2013 by Mailer Developer Team *
// Run SQL command
//* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'file=' . basename($file) . ',line=' . $line . ',sql=' . $GLOBALS['last_sql']);
$result = mysql_query($GLOBALS['last_sql'], getSqlLink())
- or sqlError($file, $line, 'file='. basename($file) . ',line=' . $line . ':mysql_error()=' . mysql_error() . ',last_query=' . $GLOBALS['last_sql']);
+ or logSqlError($file, $line, 'file='. basename($file) . ',line=' . $line . ':mysql_error()=' . mysql_error() . ',last_query=' . $GLOBALS['last_sql']);
//* DEBUG: */ logDebugMessage($file, $line, 'sql=' . $GLOBALS['last_sql'] . ',affected=' . sqlAffectedRows() . ',numRows='.(isValidSqlLink($result) ? sqlNumRows($result) : gettype($result)));
// Calculate query time
// SQL connect
function sqlConnectToDatabase ($host, $login, $password, $file, $line) {
// Try to connect
- $linkResource = mysql_connect($host, $login, $password) or sqlError($file, $line, mysql_error());
+ $linkResource = mysql_connect($host, $login, $password) or logSqlError($file, $line, mysql_error());
// Set the link resource
if (isValidSqlLink($linkResource)) {
// Return the result
//* DEBUG: */ logDebugMessage($file . ':' . __FUNCTION__, $line . ':' . __LINE__, 'Selecting database ' . $dbName);
- return mysql_select_db($dbName, getSqlLink()) or sqlError($file, $line, mysql_error());
+ return mysql_select_db($dbName, getSqlLink()) or logSqlError($file, $line, mysql_error());
}
// SQL close link
} // END - if
// Close database link and forget the link
- $close = mysql_close(getSqlLink()) or sqlError($file . ':' . __FUNCTION__, $line . ':' . __LINE__, mysql_error());
+ $close = mysql_close(getSqlLink()) or logSqlError($file . ':' . __FUNCTION__, $line . ':' . __LINE__, mysql_error());
// Close link in this layer
unsetSqlLinkUp(__FUNCTION__, __LINE__);
return $GLOBALS['sql_escapes']['' . $str . ''];
}
-// Log SQL errors to debug.log in installation phase or call reportBug()
-function sqlError ($file, $line, $message) {
+// Set SQL error in global array
+function setSqlError ($file, $line, $message) {
// Remember plain error in last_sql_error
$GLOBALS['last_sql_error'] = mysql_error();
-
- // Is login set?
- if (!empty($GLOBALS['mysql']['login'])) {
- // Secure login name in message
- $message = str_replace($GLOBALS['mysql']['login'], '***', $message);
- } // END - if
-
- // Is database password set?
- if (!empty($GLOBALS['mysql']['password'])) {
- // Secure password in message
- $message = str_replace($GLOBALS['mysql']['password'], '***', $message);
- } // END - if
-
- // Is database name set?
- if (!empty($GLOBALS['mysql']['dbase'])) {
- // Secure database name in message
- $message = str_replace($GLOBALS['mysql']['dbase'], '***', $message);
- } // END - if
-
- // Is there installation phase?
- if (isInstaller()) {
- /*
- * In installation phase, we don't want SQL errors abort e.g. connection
- * tests, so just log it away.
- */
- logDebugMessage($file, $line, $message);
- } else {
- // Regular mode, then call reportBug()
- reportBug($file, $line, $message);
- }
}
// Checks whether given link is a valid SQL link
* -------------------------------------------------------------------- *
* Kurzbeschreibung : Datenbankschicht fuer MySQL 3/4/5 Server (MySQLi)*
* -------------------------------------------------------------------- *
- * $Revision:: $ *
- * $Date:: $ *
- * $Tag:: 0.2.1-FINAL $ *
- * $Author:: $ *
- * -------------------------------------------------------------------- *
* Copyright (c) 2003 - 2009 by Roland Haeder *
* Copyright (c) 2009 - 2013 by Mailer Developer Team *
* For more information visit: http://mxchange.org *
// Run SQL command
//* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'file=' . basename($file) . ',line=' . $line . ',sql=' . $GLOBALS['last_sql']);
$result = mysqli_query(getSqlLink(), $GLOBALS['last_sql'])
- or sqlError($file, $line, 'file='. basename($file) . ',line=' . $line . ':mysqli_error()=' . mysqli_error(getSqlLink()) . ',last_query=' . $GLOBALS['last_sql']);
+ or logSqlError($file, $line, 'file='. basename($file) . ',line=' . $line . ':mysqli_error()=' . mysqli_error(getSqlLink()) . ',last_query=' . $GLOBALS['last_sql']);
//* DEBUG: */ logDebugMessage($file, $line, 'sql=' . $GLOBALS['last_sql'] . ',affected=' . sqlAffectedRows() . ',numRows='.(isValidSqlLink($result) ? sqlNumRows($result) : gettype($result)));
// Calculate query time
// SQL connect
function sqlConnectToDatabase ($host, $login, $password, $file, $line) {
// Try to connect
- $linkResource = mysqli_connect($host, $login, $password) or sqlError($file, $line, mysqli_error(getSqlLink()));
+ $linkResource = mysqli_connect($host, $login, $password) or logSqlError($file, $line, mysqli_error(getSqlLink()));
// Set the link resource
if ($linkResource instanceof mysqli) {
// Return the result
//* DEBUG: */ logDebugMessage($file . ':' . __FUNCTION__, $line . ':' . __LINE__, 'Selecting database ' . $dbName);
- return mysqli_select_db(getSqlLink(), $dbName) or sqlError($file, $line, mysqli_error(getSqlLink()));
+ return mysqli_select_db(getSqlLink(), $dbName) or logSqlError($file, $line, mysqli_error(getSqlLink()));
}
// SQL close link
} // END - if
// Close database link and forget the link
- $close = mysqli_close(getSqlLink()) or sqlError($file . ':' . __FUNCTION__, $line . ':' . __LINE__, mysqli_error(getSqlLink()));
+ $close = mysqli_close(getSqlLink()) or logSqlError($file . ':' . __FUNCTION__, $line . ':' . __LINE__, mysqli_error(getSqlLink()));
// Close link in this layer
unsetSqlLinkUp(__FUNCTION__, __LINE__);
return $GLOBALS['sql_escapes']['' . $str . ''];
}
-// Log SQL errors to debug.log in installation phase or call reportBug()
-function sqlError ($file, $line, $message) {
+// Set SQL error in global array
+function setSqlError ($file, $line, $message) {
// Remember plain error in last_sql_error
$GLOBALS['last_sql_error'] = mysqli_error(getSqlLink());
-
- // Is login set?
- if (!empty($GLOBALS['mysql']['login'])) {
- // Secure login name in message
- $message = str_replace($GLOBALS['mysql']['login'], '***', $message);
- } // END - if
-
- // Is database password set?
- if (!empty($GLOBALS['mysql']['password'])) {
- // Secure password in message
- $message = str_replace($GLOBALS['mysql']['password'], '***', $message);
- } // END - if
-
- // Is database name set?
- if (!empty($GLOBALS['mysql']['dbase'])) {
- // Secure database name in message
- $message = str_replace($GLOBALS['mysql']['dbase'], '***', $message);
- } // END - if
-
- // Is there installation phase?
- if (isInstaller()) {
- /*
- * In installation phase, we don't want SQL errors abort e.g. connection
- * tests, so just log it away.
- */
- logDebugMessage($file, $line, $message);
- } else {
- // Regular mode, then call reportBug()
- reportBug($file, $line, $message);
- }
}
// Checks whether given link is a valid SQL link
* -------------------------------------------------------------------- *
* Kurzbeschreibung : Expression-Callback-Funktionen *
* -------------------------------------------------------------------- *
- * $Revision:: $ *
- * $Date:: $ *
- * $Tag:: 0.2.1-FINAL $ *
- * $Author:: $ *
- * -------------------------------------------------------------------- *
* Copyright (c) 2003 - 2009 by Roland Haeder *
* Copyright (c) 2009 - 2013 by Mailer Developer Team *
* For more information visit: http://mxchange.org *
} // END - if
// Generate replacer
- $replacer = sprintf('&ext=%s&ver=%s&rev={?CURRENT_REPOSITORY_REVISION?}', $data['matches'][4][$data['key']], $replacer);
+ $replacer = sprintf('&ext=%s&ver=%s', $data['matches'][4][$data['key']], $replacer);
// Replace it and insert parameter for GET request
$code = replaceExpressionCode($data, $replacer);
* -------------------------------------------------------------------- *
* Kurzbeschreibung : Funktionen fuer Filter-System *
* -------------------------------------------------------------------- *
- * $Revision:: $ *
- * $Date:: $ *
- * $Tag:: 0.2.1-FINAL $ *
- * $Author:: $ *
- * -------------------------------------------------------------------- *
* Copyright (c) 2003 - 2009 by Roland Haeder *
* Copyright (c) 2009 - 2013 by Mailer Developer Team *
* For more information visit: http://mxchange.org *
registerFilter(__FUNCTION__, __LINE__, 'init', 'INIT_SESSION');
registerFilter(__FUNCTION__, __LINE__, 'init', 'SET_CURRENT_DATE');
registerFilter(__FUNCTION__, __LINE__, 'init', 'INIT_RANDOM_NUMBER');
- registerFilter(__FUNCTION__, __LINE__, 'init', 'CHECK_REPOSITORY_REVISION');
registerFilter(__FUNCTION__, __LINE__, 'init', 'RUN_HOURLY_RESET');
registerFilter(__FUNCTION__, __LINE__, 'init', 'RUN_DAILY_RESET');
registerFilter(__FUNCTION__, __LINE__, 'init', 'RUN_WEEKLY_RESET');
* -------------------------------------------------------------------- *
* Kurzbeschreibung : Allgemeine Filter *
* -------------------------------------------------------------------- *
- * $Revision:: $ *
- * $Date:: $ *
- * $Tag:: 0.2.1-FINAL $ *
- * $Author:: $ *
- * -------------------------------------------------------------------- *
* Copyright (c) 2003 - 2009 by Roland Haeder *
* Copyright (c) 2009 - 2013 by Mailer Developer Team *
* For more information visit: http://mxchange.org *
unset($GLOBALS['pool_cnt']);
}
-// Filter for checking and updating SVN revision
-function FILTER_CHECK_REPOSITORY_REVISION () {
- // Only execute this filter if installed and all config entries are there
- if ((!isInstalled()) || (!isConfigEntrySet('patch_level'))) {
- return;
- } // END - if
-
- // Check for patch level differences between database and current hard-coded
- if ((getCurrentRepositoryRevision() > getConfig('patch_level')) || (getConfig('patch_level') == 'CURRENT_REPOSITORY_REVISION') || (getConfig('patch_ctime') == 'UNIX_TIMES')) {
- // Update database and CONFIG array
- updateConfiguration(array('patch_level', 'patch_ctime'), array(getCurrentRepositoryRevision(), 'UNIX_TIMESTAMP()'));
- setConfigEntry('patch_level', getCurrentRepositoryRevision());
- setConfigEntry('patch_ctime', time());
- } // END - if
-}
-
// Filter for running hourly reset
function FILTER_RUN_HOURLY_RESET () {
// Only execute this filter if installed
// Filter for loading more runtime includes (not for installation)
function FILTER_LOAD_RUNTIME_INCLUDES () {
// Load more includes
- foreach (array('databases', 'session', 'versions') as $inc) {
+ foreach (array('databases', 'session') as $inc) {
// Load the include
loadIncludeOnce('inc/' . $inc . '.php');
} // END - foreach
'corr' => $CORR
);
- // Load footer
- loadIncludeOnce('inc/header.php');
+ // Load header
+ loadPageHeader();
// Load main template
loadTemplate('fatal_errors', FALSE, $content);
initFatalMessages();
// Load footer
- loadIncludeOnce('inc/footer.php');
+ loadPageFooter();
// Abort here
doShutdown();
* -------------------------------------------------------------------- *
* Kurzbeschreibung : Viele Nicht-Datenbank-Funktionen *
* -------------------------------------------------------------------- *
- * $Revision:: $ *
- * $Date:: $ *
- * $Tag:: 0.2.1-FINAL $ *
- * $Author:: $ *
- * -------------------------------------------------------------------- *
* Copyright (c) 2003 - 2009 by Roland Haeder *
* Copyright (c) 2009 - 2013 by Mailer Developer Team *
* For more information visit: http://mxchange.org *
sendRawRedirect(doFinalCompilation(str_replace('&', '&', $url), FALSE));
} else {
// Output error message
- loadInclude('inc/header.php');
+ loadPageHeader();
loadTemplate('redirect_url', FALSE, str_replace('&', '&', $url));
- loadInclude('inc/footer.php');
+ loadPageFooter();
}
// Shut the mailer down here
if (isConfigEntrySet('file_hash')) {
$keys .= getEncryptSeparator() . getFileHash();
} // END - if
- $keys .= getEncryptSeparator() . getDateFromRepository();
+
if (isConfigEntrySet('master_salt')) {
$keys .= getEncryptSeparator() . getMasterSalt();
} // END - if
$server = $_SERVER['PHP_SELF'] . getEncryptSeparator() . detectUserAgent() . getEncryptSeparator() . getenv('SERVER_SOFTWARE') . getEncryptSeparator() . detectRealIpAddress() . getEncryptSeparator() . detectRemoteAddr();
// Build key string
- $keys = getSiteKey() . getEncryptSeparator() . getDateKey() . getEncryptSeparator() . getFileHash() . getEncryptSeparator() . getDateFromRepository() . getEncryptSeparator() . getMasterSalt();
+ $keys = getSiteKey() . getEncryptSeparator() . getDateKey() . getEncryptSeparator() . getFileHash() . getEncryptSeparator() . getMasterSalt();
// Is the secret_key config entry set?
if (isConfigEntrySet('secret_key')) {
*
* @param $baseDir Relative base directory to PATH to scan from
* @param $prefix Prefix for all positive matches (which files should be found)
- * @param $fileIncludeDirs whether to include directories in the final output array
- * @param $addBaseDir whether to add $baseDir to all array entries
+ * @param $fileIncludeDirs Whether to include directories in the final output array
+ * @param $addBaseDir Whether to add $baseDir to all array entries
* @param $excludeArray Excluded files and directories, these must be full files names, e.g. 'what-' will exclude all files named 'what-' but won't exclude 'what-foo.php'
* @param $extension File extension for all positive matches
* @param $excludePattern Regular expression to exclude more files (preg_match())
- * @param $recursive whether to scan recursively
+ * @param $recursive Whether to scan recursively
* @param $suffix Suffix for positive matches ($extension will be appended, too)
* @param $withPrefixSuffix Whether to include prefix/suffix in found entries
* @return $foundMatches All found positive matches for above criteria
return ((isInStringIgnoreCase('spider', $userAgent)) || (isInStringIgnoreCase('slurp', $userAgent)) || (isInStringIgnoreCase('bot', $userAgent)) || (isInStringIgnoreCase('archiver', $userAgent)));
}
-// Function to search for the last modified file
-function searchDirsRecursive ($dir, &$last_changed, $lookFor = 'Date') {
- // Get dir as array
- //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'dir=' . $dir);
- // Does it match what we are looking for? (We skip a lot files already!)
- // RegexPattern to exclude ., .., .revision, .svn, debug.log or .cache in the filenames
- $excludePattern = '@(\.revision|\.svn|debug\.log|\.cache|config\.php)$@';
-
- $ds = getArrayFromDirectory($dir, '', FALSE, TRUE, array(), '.php', $excludePattern);
- //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'count(ds)='.count($ds));
-
- // Walk through all entries
- foreach ($ds as $d) {
- // Generate proper FQFN
- $FQFN = str_replace('//', '/', getPath() . $dir . '/' . $d);
-
- // Is it a file and readable?
- //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'dir=' . $dir . ',d=' . $d);
- if (isFileReadable($FQFN)) {
- // $FQFN is a readable file so extract the requested data from it
- $check = extractRevisionInfoFromFile($FQFN, $lookFor);
- //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'File: ' . $d . ' found. check=' . $check);
-
- // Is the file more recent?
- if ((!isset($last_changed[$lookFor])) || ($last_changed[$lookFor] < $check)) {
- // This file is newer as the file before
- //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'NEWER!');
- $last_changed['path_name'] = $FQFN;
- $last_changed[$lookFor] = $check;
- } // END - if
- } else {
- // Not readable
- /* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'File: ' . $d . ' not readable or directory.');
- }
- } // END - foreach
-}
-
// Handles the braces [] of a field (e.g. value of 'name' attribute)
function handleFieldWithBraces ($field) {
// Are there braces [] at the end?
return $GLOBALS[__FUNCTION__][$theme];
}
+// Checks whether a given PHP extension is loaded or can be loaded at runtime
+//
+// Supported OS: Windows, Linux, (Mac?)
+function isPhpExtensionLoaded ($extension) {
+ // Is the extension loaded?
+ if (extension_loaded($extension)) {
+ // All fine
+ return TRUE;
+ } // END - if
+
+ // Try to load the extension
+ return loadLibrary($extension);
+}
+
+// Loads given library (aka. PHP extension)
+// Credits: shaunspiller at spammenot-gmail dot com ( http://de.php.net/dl#88566 )
+function loadLibrary ($n, $f = NULL) {
+ return extension_loaded($n) or dl(((PHP_SHLIB_SUFFIX === 'dll') ? 'php_' : '') . ($f ? $f : $n) . '.' . PHP_SHLIB_SUFFIX);
+}
+
+// "Translates" given PHP extension name into a readable version
+function translatePhpExtension ($extension) {
+ // Return the language element
+ return '{--PHP_EXTENSION_' . strtoupper($extension) . '--}';
+}
+
// [EOF]
?>
* -------------------------------------------------------------------- *
* Kurzbeschreibung : Lader fuer Konfiguration *
* -------------------------------------------------------------------- *
- * $Revision:: $ *
- * $Date:: $ *
- * $Tag:: 0.2.1-FINAL $ *
- * $Author:: $ *
- * -------------------------------------------------------------------- *
* Copyright (c) 2003 - 2009 by Roland Haeder *
* Copyright (c) 2009 - 2013 by Mailer Developer Team *
* For more information visit: http://mxchange.org *
// Set some config entries which is required for installation phase
setConfigEntry('OUTPUT_MODE' , 'render');
setConfigEntry('WRITE_FOOTER', 'Y');
-setConfigEntry('_DB_TYPE' , 'mysql3');
+setConfigEntry('_DB_TYPE' , 'mysql');
// Mark configuration as NOT loaded which is the default
$GLOBALS['config_local_loaded'] = FALSE;
* -------------------------------------------------------------------- *
* Kurzbeschreibung : Verbindet zu Ihrer Datenbank *
* -------------------------------------------------------------------- *
- * $Revision:: $ *
- * $Date:: $ *
- * $Tag:: 0.2.1-FINAL $ *
- * $Author:: $ *
- * -------------------------------------------------------------------- *
* Copyright (c) 2003 - 2009 by Roland Haeder *
* Copyright (c) 2009 - 2013 by Mailer Developer Team *
* For more information visit: http://mxchange.org *
'sql',
'expression',
'filter',
- 'revision',
'extensions') as $lib) {
// Add it
// Init fatal messages
initFatalMessages();
-// Init repository data sub-system
-initRepositoryData();
-
// Enable HTML templates by default
enableTemplateHtml();
} // END - if
// CFG: DATABASE-TYPE
- setConfigEntry('_DB_TYPE', 'mysql3');
+ setConfigEntry('_DB_TYPE', 'mysql');
// Set link as down
unsetSqlLinkUp(__FILE__, __LINE__);
initMessages();
// Include more
- foreach (array('databases', 'session', 'versions', 'install-functions', 'load_config', 'load_cache') as $inc) {
+ foreach (array('databases', 'session', 'install-functions', 'load_config', 'load_cache') as $inc) {
// Load include file
loadIncludeOnce('inc/' . $inc . '.php');
} // END - foreach