--- ./misc/cli/eventum~ 2005-01-19 02:47:20.000000000 +0200 +++ ./misc/cli/eventum 2005-01-19 03:02:40.119100405 +0200 @@ -11,7 +11,7 @@ // // @(#) $Id$ // -include_once("config.inc.php"); +include_once("/etc/eventum/cli.php"); include_once(APP_INC_PATH . "class.command_line.php"); include_once(APP_PEAR_PATH . "XML_RPC/RPC.php"); --- eventum-1.4.orig/misc/cli/config.inc.php 2005-01-26 00:00:58.000000000 +0200 +++ eventum-1.4/misc/cli/config.inc.php 2005-01-25 23:57:39.000000000 +0200 @@ -45,16 +45,10 @@ } // definitions of path related variables -@define("APP_PATH", dirname(__FILE__) . '/'); +@define("APP_PATH", '/usr/share/eventum/cli/'); @define("APP_INC_PATH", APP_PATH . "include/"); @define("APP_PEAR_PATH", APP_INC_PATH . "pear/"); -if (stristr(PHP_OS, 'darwin')) { - ini_set("include_path", ".:" . APP_PEAR_PATH); -} elseif (stristr(PHP_OS, 'win')) { - ini_set("include_path", ".;" . APP_PEAR_PATH); -} else { - ini_set("include_path", ".:" . APP_PEAR_PATH); -} +ini_set("include_path", ".:" . APP_PEAR_PATH); @define("APP_BENCHMARK", false); ?> --- eventum-1.4/misc/cli/config.inc.php~ 2005-02-22 21:35:52.000000000 +0200 +++ eventum-1.4/misc/cli/config.inc.php 2005-02-22 21:44:10.000000000 +0200 @@ -46,9 +46,9 @@ // definitions of path related variables @define("APP_PATH", '/usr/share/eventum/cli/'); -@define("APP_INC_PATH", APP_PATH . "include/"); +@define("APP_INC_PATH", APP_PATH); @define("APP_PEAR_PATH", APP_INC_PATH . "pear/"); ini_set("include_path", ".:" . APP_PEAR_PATH); @define("APP_BENCHMARK", false); -?> \ No newline at end of file +?> --- ./misc/cli/config.inc.php~ 2005-02-22 21:49:37.000000000 +0200 +++ ./misc/cli/config.inc.php 2005-02-22 21:50:01.000000000 +0200 @@ -47,7 +47,7 @@ // definitions of path related variables @define("APP_PATH", '/usr/share/eventum/cli/'); @define("APP_INC_PATH", APP_PATH); -@define("APP_PEAR_PATH", APP_INC_PATH . "pear/"); +@define("APP_PEAR_PATH", "/usr/share/pear/"); ini_set("include_path", ".:" . APP_PEAR_PATH); @define("APP_BENCHMARK", false); --- ./misc/cli/eventum~ 2005-01-24 17:49:25.000000000 +0200 +++ ./misc/cli/eventum 2005-01-25 15:48:56.000000000 +0200 @@ -13,7 +13,7 @@ // include_once("/etc/eventum/cli.php"); include_once(APP_INC_PATH . "class.command_line.php"); -include_once(APP_PEAR_PATH . "XML_RPC/RPC.php"); +include_once(APP_PEAR_PATH . "XML/RPC.php"); list($user_email, $user_password, $url, $port, $relative_url) = Command_Line::getEnvironmentSettings(); if (empty($port)) { --- ./misc/cli/include/class.command_line.php 2005-01-05 01:06:03.000000000 +0200 +++ ./misc/cli/include/class.command_line.php 2005-01-25 15:48:56.000000000 +0200 @@ -29,7 +29,7 @@ // include_once(APP_INC_PATH . "class.misc.php"); -include_once(APP_PEAR_PATH . "XML_RPC/RPC.php"); +include_once(APP_PEAR_PATH . "XML/RPC.php"); $_displayed_confirmation = false; --- ./include/class.template.php~ 2005-02-27 17:49:54.000000000 +0200 +++ ./include/class.template.php 2005-02-27 17:51:00.000000000 +0200 @@ -60,7 +60,7 @@ { $this->smarty = new Smarty; $this->smarty->template_dir = APP_TPL_PATH . APP_CURRENT_LANG; - $this->smarty->compile_dir = APP_PATH . "templates_c"; + $this->smarty->compile_dir = "/var/cache/eventum"; $this->smarty->config_dir = ''; $this->smarty->register_modifier("activateLinks", array('Link_Filter', 'activateLinks')); } --- eventum-1.4.orig/setup/index.php 2005-01-25 23:42:55.000000000 +0200 +++ eventum-1.4/setup/index.php 2005-01-25 23:46:14.000000000 +0200 @@ -114,15 +114,15 @@ if (ini_get('allow_call_time_pass_reference') != "1") { $errors[] = "The 'allow_call_time_pass_reference' directive needs to be enabled in your PHP.INI file in order for Eventum to work properly."; } - $error = checkPermissions('../locks', "Directory 'locks'", TRUE); + $error = checkPermissions('/var/run/eventum', "Directory '/var/run/eventum'", TRUE); if (!empty($error)) { $errors[] = $error; } - $error = checkPermissions('../logs', "Directory 'logs'", TRUE); + $error = checkPermissions('/var/log/eventum', "Directory '/var/log/eventum'", TRUE); if (!empty($error)) { $errors[] = $error; } - $error = checkPermissions('../templates_c', "Directory 'templates_c'", TRUE); + $error = checkPermissions('/var/cache/eventum', "Directory '/var/cache/eventum'", TRUE); if (!empty($error)) { $errors[] = $error; } @@ -130,7 +130,7 @@ if (!empty($error)) { $errors[] = $error; } - $error = checkPermissions('../logs/errors.log', "File 'logs/errors.log'"); + $error = checkPermissions('/var/log/eventum/errors.log', "File '/var/log/eventum/errors.log'"); if (!empty($error)) { $errors[] = $error; } @@ -203,7 +203,7 @@ $tpl = new Smarty(); $tpl->template_dir = '../templates/en'; -$tpl->compile_dir = "../templates_c"; +$tpl->compile_dir = "/var/cache/eventum"; $tpl->config_dir = ''; function replace_table_prefix($str) @@ -417,23 +417,8 @@ $tpl->assign('is_imap_enabled', function_exists('imap_open')); } - -$full_url = dirname($HTTP_SERVER_VARS['PHP_SELF']); -$pieces = explode("/", $full_url); -$relative_url = array(); -$relative_url[] = ''; -foreach ($pieces as $piece) { - if ((!empty($piece)) && ($piece != 'setup')) { - $relative_url[] = $piece; - } -} -$relative_url[] = ''; -$relative_url = implode("/", $relative_url); - -if (substr($HTTP_SERVER_VARS['DOCUMENT_ROOT'], -1) == '/') { - $HTTP_SERVER_VARS['DOCUMENT_ROOT'] = substr($HTTP_SERVER_VARS['DOCUMENT_ROOT'], 0, -1); -} -$installation_path = $HTTP_SERVER_VARS['DOCUMENT_ROOT'] . $relative_url; +$installation_path = "/usr/share/eventum"; +$relative_url = "/eventum/"; $tpl->assign("phpversion", phpversion()); $tpl->assign("rel_url", $relative_url); --- eventum-1.4/setup/index.php~ 2005-01-25 23:52:31.000000000 +0200 +++ eventum-1.4/setup/index.php 2005-01-25 23:52:33.000000000 +0200 @@ -199,7 +199,7 @@ } ini_set("include_path", '.'); -include_once("../include/Smarty/Smarty.class.php"); +include_once("/usr/share/pear/Smarty/Smarty.class.php"); $tpl = new Smarty(); $tpl->template_dir = '../templates/en'; --- ./setup/index.php~ 2005-02-22 21:50:50.000000000 +0200 +++ ./setup/index.php 2005-03-28 23:01:03.000000000 +0300 @@ -126,7 +126,7 @@ if (!empty($error)) { $errors[] = $error; } - $error = checkPermissions('../config.inc.php', "File 'config.inc.php'"); + $error = checkPermissions('/etc/eventum/config.php', "File '/etc/eventum/config.php'"); if (!empty($error)) { $errors[] = $error; } @@ -134,11 +134,11 @@ if (!empty($error)) { $errors[] = $error; } - $error = checkPermissions('../setup.conf.php', "File 'setup.conf.php'"); + $error = checkPermissions('/etc/eventum/setup.php', "File '/etc/eventum/setup.php'"); if (!empty($error)) { $errors[] = $error; } - $error = checkPermissions('../include/private_key.php', "File 'include/private_key.php'"); + $error = checkPermissions('/etc/eventum/private_key.php', "File '/etc/eventum/private_key.php'"); if (!empty($error)) { $errors[] = $error; } @@ -202,7 +202,7 @@ include_once("/usr/share/pear/Smarty/Smarty.class.php"); $tpl = new Smarty(); -$tpl->template_dir = '../templates/en'; +$tpl->template_dir = '/usr/share/eventum/templates/en'; $tpl->compile_dir = "/var/cache/eventum"; $tpl->config_dir = ''; @@ -272,8 +272,8 @@ clearstatcache(); // check if config.inc.php in the root directory is writable - if (!is_writable('../config.inc.php')) { - return "The file 'config.inc.php' in Eventum's root directory needs to be writable by the web server user. Please correct this problem and try again."; + if (!is_writable('/etc/eventum/config.php')) { + return "The file '/etc/eventum/config.php' needs to be writable by the web server user. Please correct this problem and try again."; } // gotta check and see if the provided installation path really exists... if (!file_exists($HTTP_POST_VARS['path'])) { @@ -283,16 +283,16 @@ $private_key = ''; - if (!is_writable('../include/private_key.php')) { - return "The file 'include/private_key.php' needs to be writable by the web server user. Please correct this problem and try again."; + if (!is_writable('/etc/eventum/private_key.php')) { + return "The file '/etc/eventum/private_key.php' needs to be writable by the web server user. Please correct this problem and try again."; } - $fp = @fopen('../include/private_key.php', 'w'); + $fp = @fopen('/etc/eventum/private_key.php', 'w'); if ($fp === FALSE) { - return "Could not open the file 'include/private_key.php' for writing. The permissions on the file should be set as to allow the user that the web server runs as to open it. Please correct this problem and try again."; + return "Could not open the file '/etc/eventum/private_key.php' for writing. The permissions on the file should be set as to allow the user that the web server runs as to open it. Please correct this problem and try again."; } $res = fwrite($fp, $private_key); if ($fp === FALSE) { - return "Could not write the configuration information to 'include/private_key.php'. The file should be writable by the user that the web server runs as. Please correct this problem and try again."; + return "Could not write the configuration information to '/etc/eventum/private_key.php'. The file should be writable by the user that the web server runs as. Please correct this problem and try again."; } fclose($fp); // check if we can connect @@ -385,20 +385,20 @@ $config_contents = str_replace("%{APP_TABLE_PREFIX}%", $HTTP_POST_VARS['db_table_prefix'], $config_contents); $config_contents = str_replace("%{APP_HOSTNAME}%", $HTTP_POST_VARS['hostname'], $config_contents); $config_contents = str_replace("%{APP_RELATIVE_URL}%", $HTTP_POST_VARS['relative_url'], $config_contents); - $config_contents = str_replace("%{APP_VERSION}%", "1.5.1", $config_contents); + $config_contents = str_replace("%{APP_VERSION}%", "1.5.1", $config_contents); if (@$HTTP_POST_VARS['is_ssl'] == 'yes') { $protocol_type = 'https://'; } else { $protocol_type = 'http://'; } $config_contents = str_replace("%{PROTOCOL_TYPE}%", $protocol_type, $config_contents); - $fp = @fopen('../config.inc.php', 'w'); + $fp = @fopen('/etc/eventum/config.php', 'w'); if ($fp === FALSE) { - return "Could not open the file 'config.inc.php' for writing. The permissions on the file should be set as to allow the user that the web server runs as to open it. Please correct this problem and try again."; + return "Could not open the file '/etc/eventum/config.php' for writing. The permissions on the file should be set as to allow the user that the web server runs as to open it. Please correct this problem and try again."; } $res = fwrite($fp, $config_contents); if ($fp === FALSE) { - return "Could not write the configuration information to 'config.inc.php'. The file should be writable by the user that the web server runs as. Please correct this problem and try again."; + return "Could not write the configuration information to '/etc/eventum/config.php'. The file should be writable by the user that the web server runs as. Please correct this problem and try again."; } fclose($fp); --- eventum-1.5.1/setup/config.inc.php~ 2005-03-14 15:21:18.000000000 +0200 +++ eventum-1.5.1/setup/config.inc.php 2005-03-14 15:20:22.000000000 +0200 @@ -27,49 +27,6 @@ // // @(#) $Id$ // -ini_set('allow_url_fopen', 0); -ini_set("display_errors", 0); -error_reporting(0); -@set_time_limit(0); -// prevent session from messing up the browser cache -ini_set('session.cache_limiter', 'nocache'); - -// only needed for older PHP versions -if (!function_exists('is_a')) { - function is_a($object, $class_name) - { - $class_name = strtolower($class_name); - if (get_class($object) == $class_name) { - return TRUE; - } else { - return is_subclass_of($object, $class_name); - } - } -} - -// definitions of path related variables -$app_path = '%{APP_PATH}%'; -if ((substr($app_path, -1) != '/') && (substr($app_path, -2) != '\\')) { - $app_path .= '/'; -} -@define("APP_PATH", $app_path); -@define("APP_INC_PATH", APP_PATH . "include/"); -@define("APP_PEAR_PATH", APP_INC_PATH . "pear/"); -@define("APP_TPL_PATH", APP_PATH . "templates/"); -@define("APP_SMARTY_PATH", APP_INC_PATH . "Smarty/"); -@define("APP_JPGRAPH_PATH", APP_INC_PATH . "jpgraph/"); -@define("APP_LOG_PATH", APP_PATH . "logs/"); -@define("APP_LOCKS_PATH", APP_PATH . "locks/"); -if (stristr(PHP_OS, 'darwin')) { - ini_set("include_path", ".:" . APP_PEAR_PATH); -} elseif (stristr(PHP_OS, 'win')) { - ini_set("include_path", ".;" . APP_PEAR_PATH); -} else { - ini_set("include_path", ".:" . APP_PEAR_PATH); -} - -@define("APP_SETUP_PATH", APP_PATH); -@define("APP_SETUP_FILE", APP_SETUP_PATH . "setup.conf.php"); // definitions of SQL variables @define("APP_SQL_DBTYPE", "mysql"); @@ -82,11 +39,6 @@ @define("APP_DEFAULT_DB", APP_SQL_DBNAME); @define("APP_TABLE_PREFIX", "%{APP_TABLE_PREFIX}%"); -@define("APP_ERROR_LOG", APP_LOG_PATH . "errors.log"); -@define("APP_CLI_LOG", APP_LOG_PATH . "cli.log"); -@define("APP_IRC_LOG", APP_LOG_PATH . "irc_bot.log"); -@define("APP_LOGIN_LOG", APP_LOG_PATH . "login_attempts.log"); - @define("APP_NAME", "Eventum"); @define("APP_SHORT_NAME", APP_NAME); // used in the subject of notification emails @define("APP_URL", "http://www.mysql.com/products/eventum/"); @@ -99,8 +51,6 @@ @define("APP_PROJECT_COOKIE", "eventum_project"); @define("APP_PROJECT_COOKIE_EXPIRE", time() + (60 * 60 * 24)); -@define("APP_VERSION", "%{APP_VERSION}%"); - @define("APP_DEFAULT_PAGER_SIZE", 5); @define("APP_DEFAULT_REFRESH_RATE", 5); // in minutes @@ -114,39 +64,6 @@ @define("APP_CYCLE_COLORS", "#DDDDDD,#CACACA"); @define("APP_INTERNAL_COLOR", "#9C494B"); -// define the user_id of system user -@define("APP_SYSTEM_USER_ID", 1); - @define("APP_BENCHMARK", false); -if (APP_BENCHMARK) { - // always benchmark the scripts - include_once("Benchmark/Timer.php"); - $bench = new Benchmark_Timer; - $bench->start(); -} - -include_once(APP_INC_PATH . "class.misc.php"); - -if (isset($_GET)) { - $HTTP_POST_VARS = $_POST; - $HTTP_GET_VARS = $_GET; - $HTTP_SERVER_VARS = $_SERVER; - $HTTP_ENV_VARS = $_ENV; - $HTTP_POST_FILES = $_FILES; - // seems like PHP 4.1.0 didn't implement the $_SESSION auto-global... - if (isset($_SESSION)) { - $HTTP_SESSION_VARS = $_SESSION; - } - $HTTP_COOKIE_VARS = $_COOKIE; -} -// fix magic_quote_gpc'ed values (i wish i knew who is the person behind this) -$HTTP_GET_VARS =& Misc::dispelMagicQuotes($HTTP_GET_VARS); -$HTTP_POST_VARS =& Misc::dispelMagicQuotes($HTTP_POST_VARS); - -// handle the language preferences now -@include_once(APP_INC_PATH . "class.language.php"); -Language::setPreference(); -// set charset -header("content-type: text/html;charset=" . APP_CHARSET); ?> \ No newline at end of file --- ./include/class.monitor.php~ 2005-02-22 21:50:49.000000000 +0200 +++ ./include/class.monitor.php 2005-02-22 23:04:50.000000000 +0200 @@ -100,21 +100,29 @@ function checkConfiguration() { $required_files = array( - APP_PATH . 'config.inc.php' => array( + '/etc/eventum/config.php' => array( 'check_owner' => true, - 'owner' => 'apache', + 'owner' => 'root', 'check_group' => true, - 'group' => 'apache', + 'group' => 'eventum', 'check_permission' => true, - 'permission' => 755, + 'permission' => 640, ), - APP_PATH . 'setup.conf.php' => array( + '/etc/eventum/core.php' => array( 'check_owner' => true, - 'owner' => 'apache', + 'owner' => 'root', 'check_group' => true, - 'group' => 'apache', + 'group' => 'eventum', 'check_permission' => true, - 'permission' => 750, + 'permission' => 640, + ), + '/etc/eventum/setup.php' => array( + 'check_owner' => true, + 'owner' => 'root', + 'check_group' => true, + 'group' => 'eventum', + 'check_permission' => true, + 'permission' => 660, 'check_filesize' => true, 'filesize' => 1024 ), @@ -157,6 +165,7 @@ 'permission' => 100, ), ); + $required_directories = array(); foreach ($required_directories as $dir_path => $options) { // check if directory exists if (!file_exists($dir_path)) {