]> git.pld-linux.org Git - packages/eventum.git/blob - eventum-paths.patch
- fix paths for setup/index.php
[packages/eventum.git] / eventum-paths.patch
1 --- ./misc/cli/eventum~ 2005-01-19 02:47:20.000000000 +0200
2 +++ ./misc/cli/eventum  2005-01-19 03:02:40.119100405 +0200
3 @@ -11,7 +11,7 @@
4  //
5  // @(#) $Id$
6  //
7 -include_once("config.inc.php");
8 +include_once("/etc/eventum/cli.php");
9  include_once(APP_INC_PATH . "class.command_line.php");
10  include_once(APP_PEAR_PATH . "XML_RPC/RPC.php");
11  
12 --- eventum-1.4.orig/misc/cli/config.inc.php    2005-01-26 00:00:58.000000000 +0200
13 +++ eventum-1.4/misc/cli/config.inc.php 2005-01-25 23:57:39.000000000 +0200
14 @@ -45,16 +45,10 @@
15  }
16  
17  // definitions of path related variables
18 -@define("APP_PATH", dirname(__FILE__) . '/');
19 +@define("APP_PATH", '/usr/share/eventum/cli/');
20  @define("APP_INC_PATH", APP_PATH . "include/");
21  @define("APP_PEAR_PATH", APP_INC_PATH . "pear/");
22 -if (stristr(PHP_OS, 'darwin')) {
23 -    ini_set("include_path", ".:" . APP_PEAR_PATH);
24 -} elseif (stristr(PHP_OS, 'win')) {
25 -    ini_set("include_path", ".;" . APP_PEAR_PATH);
26 -} else {
27 -    ini_set("include_path", ".:" . APP_PEAR_PATH);
28 -}
29 +ini_set("include_path", ".:" . APP_PEAR_PATH);
30  
31  @define("APP_BENCHMARK", false);
32  ?>
33 --- eventum-1.4/misc/cli/config.inc.php~        2005-02-22 21:35:52.000000000 +0200
34 +++ eventum-1.4/misc/cli/config.inc.php 2005-02-22 21:44:10.000000000 +0200
35 @@ -46,9 +46,9 @@
36  
37  // definitions of path related variables
38  @define("APP_PATH", '/usr/share/eventum/cli/');
39 -@define("APP_INC_PATH", APP_PATH . "include/");
40 +@define("APP_INC_PATH", APP_PATH);
41  @define("APP_PEAR_PATH", APP_INC_PATH . "pear/");
42  ini_set("include_path", ".:" . APP_PEAR_PATH);
43  
44  @define("APP_BENCHMARK", false);
45 -?>
46 \ No newline at end of file
47 +?>
48 --- ./misc/cli/config.inc.php~  2005-02-22 21:49:37.000000000 +0200
49 +++ ./misc/cli/config.inc.php   2005-02-22 21:50:01.000000000 +0200
50 @@ -47,7 +47,7 @@
51  // definitions of path related variables
52  @define("APP_PATH", '/usr/share/eventum/cli/');
53  @define("APP_INC_PATH", APP_PATH);
54 -@define("APP_PEAR_PATH", APP_INC_PATH . "pear/");
55 +@define("APP_PEAR_PATH", "/usr/share/pear/");
56  ini_set("include_path", ".:" . APP_PEAR_PATH);
57  
58  @define("APP_BENCHMARK", false);
59 --- ./misc/cli/eventum~ 2005-01-24 17:49:25.000000000 +0200
60 +++ ./misc/cli/eventum  2005-01-25 15:48:56.000000000 +0200
61 @@ -13,7 +13,7 @@
62  //
63  include_once("/etc/eventum/cli.php");
64  include_once(APP_INC_PATH . "class.command_line.php");
65 -include_once(APP_PEAR_PATH . "XML_RPC/RPC.php");
66 +include_once(APP_PEAR_PATH . "XML/RPC.php");
67  
68  list($user_email, $user_password, $url, $port, $relative_url) = Command_Line::getEnvironmentSettings();
69  if (empty($port)) {
70 --- ./misc/cli/include/class.command_line.php   2005-01-05 01:06:03.000000000 +0200
71 +++ ./misc/cli/include/class.command_line.php   2005-01-25 15:48:56.000000000 +0200
72 @@ -29,7 +29,7 @@
73  //
74  
75  include_once(APP_INC_PATH . "class.misc.php");
76 -include_once(APP_PEAR_PATH . "XML_RPC/RPC.php");
77 +include_once(APP_PEAR_PATH . "XML/RPC.php");
78  
79  $_displayed_confirmation = false;
80  
81 --- ./include/class.template.php~       2005-02-27 17:49:54.000000000 +0200
82 +++ ./include/class.template.php        2005-02-27 17:51:00.000000000 +0200
83 @@ -60,7 +60,7 @@
84      {
85          $this->smarty = new Smarty;
86          $this->smarty->template_dir = APP_TPL_PATH . APP_CURRENT_LANG;
87 -        $this->smarty->compile_dir = APP_PATH . "templates_c";
88 +        $this->smarty->compile_dir = "/var/cache/eventum";
89          $this->smarty->config_dir = '';
90          $this->smarty->register_modifier("activateLinks", array('Link_Filter', 'activateLinks'));
91      }
92 --- eventum-1.4.orig/setup/index.php    2005-01-25 23:42:55.000000000 +0200
93 +++ eventum-1.4/setup/index.php 2005-01-25 23:46:14.000000000 +0200
94 @@ -114,15 +114,15 @@
95      if (ini_get('allow_call_time_pass_reference') != "1") {
96          $errors[] = "The 'allow_call_time_pass_reference' directive needs to be enabled in your PHP.INI file in order for Eventum to work properly.";
97      }
98 -    $error = checkPermissions('../locks', "Directory 'locks'", TRUE);
99 +    $error = checkPermissions('/var/run/eventum', "Directory '/var/run/eventum'", TRUE);
100      if (!empty($error)) {
101          $errors[] = $error;
102      }
103 -    $error = checkPermissions('../logs', "Directory 'logs'", TRUE);
104 +    $error = checkPermissions('/var/log/eventum', "Directory '/var/log/eventum'", TRUE);
105      if (!empty($error)) {
106          $errors[] = $error;
107      }
108 -    $error = checkPermissions('../templates_c', "Directory 'templates_c'", TRUE);
109 +    $error = checkPermissions('/var/cache/eventum', "Directory '/var/cache/eventum'", TRUE);
110      if (!empty($error)) {
111          $errors[] = $error;
112      }
113 @@ -130,7 +130,7 @@
114      if (!empty($error)) {
115          $errors[] = $error;
116      }
117 -    $error = checkPermissions('../logs/errors.log', "File 'logs/errors.log'");
118 +    $error = checkPermissions('/var/log/eventum/errors.log', "File '/var/log/eventum/errors.log'");
119      if (!empty($error)) {
120          $errors[] = $error;
121      }
122 @@ -203,7 +203,7 @@
123  
124  $tpl = new Smarty();
125  $tpl->template_dir = '../templates/en';
126 -$tpl->compile_dir = "../templates_c";
127 +$tpl->compile_dir = "/var/cache/eventum";
128  $tpl->config_dir = '';
129  
130  function replace_table_prefix($str)
131 @@ -417,23 +417,8 @@
132      $tpl->assign('is_imap_enabled', function_exists('imap_open'));
133  }
134  
135 -
136 -$full_url = dirname($HTTP_SERVER_VARS['PHP_SELF']);
137 -$pieces = explode("/", $full_url);
138 -$relative_url = array();
139 -$relative_url[] = '';
140 -foreach ($pieces as $piece) {
141 -    if ((!empty($piece)) && ($piece != 'setup')) {
142 -        $relative_url[] = $piece;
143 -    }
144 -}
145 -$relative_url[] = '';
146 -$relative_url = implode("/", $relative_url);
147 -
148 -if (substr($HTTP_SERVER_VARS['DOCUMENT_ROOT'], -1) == '/') {
149 -    $HTTP_SERVER_VARS['DOCUMENT_ROOT'] = substr($HTTP_SERVER_VARS['DOCUMENT_ROOT'], 0, -1);
150 -}
151 -$installation_path = $HTTP_SERVER_VARS['DOCUMENT_ROOT'] . $relative_url;
152 +$installation_path = "/usr/share/eventum";
153 +$relative_url = "/eventum/";
154  
155  $tpl->assign("phpversion", phpversion());
156  $tpl->assign("rel_url", $relative_url);
157 --- eventum-1.4/setup/index.php~        2005-01-25 23:52:31.000000000 +0200
158 +++ eventum-1.4/setup/index.php 2005-01-25 23:52:33.000000000 +0200
159 @@ -199,7 +199,7 @@
160  }
161  
162  ini_set("include_path", '.');
163 -include_once("../include/Smarty/Smarty.class.php");
164 +include_once("/usr/share/pear/Smarty/Smarty.class.php");
165  
166  $tpl = new Smarty();
167  $tpl->template_dir = '../templates/en';
168 --- ./setup/index.php~  2005-02-22 21:50:50.000000000 +0200
169 +++ ./setup/index.php   2005-03-28 23:01:03.000000000 +0300
170 @@ -126,7 +126,7 @@
171      if (!empty($error)) {
172          $errors[] = $error;
173      }
174 -    $error = checkPermissions('../config.inc.php', "File 'config.inc.php'");
175 +    $error = checkPermissions('/etc/eventum/config.php', "File '/etc/eventum/config.php'");
176      if (!empty($error)) {
177          $errors[] = $error;
178      }
179 @@ -134,11 +134,11 @@
180      if (!empty($error)) {
181          $errors[] = $error;
182      }
183 -    $error = checkPermissions('../setup.conf.php', "File 'setup.conf.php'");
184 +    $error = checkPermissions('/etc/eventum/setup.php', "File '/etc/eventum/setup.php'");
185      if (!empty($error)) {
186          $errors[] = $error;
187      }
188 -    $error = checkPermissions('../include/private_key.php', "File 'include/private_key.php'");
189 +    $error = checkPermissions('/etc/eventum/private_key.php', "File '/etc/eventum/private_key.php'");
190      if (!empty($error)) {
191          $errors[] = $error;
192      }
193 @@ -202,7 +202,7 @@
194  include_once("/usr/share/pear/Smarty/Smarty.class.php");
195  
196  $tpl = new Smarty();
197 -$tpl->template_dir = '../templates/en';
198 +$tpl->template_dir = '/usr/share/eventum/templates/en';
199  $tpl->compile_dir = "/var/cache/eventum";
200  $tpl->config_dir = '';
201  
202 @@ -272,8 +272,8 @@
203  
204      clearstatcache();
205      // check if config.inc.php in the root directory is writable
206 -    if (!is_writable('../config.inc.php')) {
207 -        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.";
208 +    if (!is_writable('/etc/eventum/config.php')) {
209 +        return "The file '/etc/eventum/config.php' needs to be writable by the web server user. Please correct this problem and try again.";
210      }
211      // gotta check and see if the provided installation path really exists...
212      if (!file_exists($HTTP_POST_VARS['path'])) {
213 @@ -283,16 +283,16 @@
214      $private_key = '<?php
215  $private_key = "' . md5(microtime()) . '";
216  ?>';
217 -    if (!is_writable('../include/private_key.php')) {
218 -        return "The file 'include/private_key.php' needs to be writable by the web server user. Please correct this problem and try again.";
219 +    if (!is_writable('/etc/eventum/private_key.php')) {
220 +        return "The file '/etc/eventum/private_key.php' needs to be writable by the web server user. Please correct this problem and try again.";
221      }
222 -    $fp = @fopen('../include/private_key.php', 'w');
223 +    $fp = @fopen('/etc/eventum/private_key.php', 'w');
224      if ($fp === FALSE) {
225 -        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.";
226 +        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.";
227      }
228      $res = fwrite($fp, $private_key);
229      if ($fp === FALSE) {
230 -        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.";
231 +        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.";
232      }
233      fclose($fp);
234      // check if we can connect
235 @@ -385,20 +385,20 @@
236      $config_contents = str_replace("%{APP_TABLE_PREFIX}%", $HTTP_POST_VARS['db_table_prefix'], $config_contents);
237      $config_contents = str_replace("%{APP_HOSTNAME}%", $HTTP_POST_VARS['hostname'], $config_contents);
238      $config_contents = str_replace("%{APP_RELATIVE_URL}%", $HTTP_POST_VARS['relative_url'], $config_contents);
239 -    $config_contents = str_replace("%{APP_VERSION}%", "1.5.1", $config_contents);
240 +    $config_contents = str_replace("%{APP_VERSION}%", "1.5.1", $config_contents);
241      if (@$HTTP_POST_VARS['is_ssl'] == 'yes') {
242          $protocol_type = 'https://';
243      } else {
244          $protocol_type = 'http://';
245      }
246      $config_contents = str_replace("%{PROTOCOL_TYPE}%", $protocol_type, $config_contents);
247 -    $fp = @fopen('../config.inc.php', 'w');
248 +    $fp = @fopen('/etc/eventum/config.php', 'w');
249      if ($fp === FALSE) {
250 -        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.";
251 +        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.";
252      }
253      $res = fwrite($fp, $config_contents);
254      if ($fp === FALSE) {
255 -        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.";
256 +        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.";
257      }
258      fclose($fp);
259      
260 --- eventum-1.5.1/setup/config.inc.php~ 2005-03-14 15:21:18.000000000 +0200
261 +++ eventum-1.5.1/setup/config.inc.php  2005-03-14 15:20:22.000000000 +0200
262 @@ -27,49 +27,6 @@
263  //
264  // @(#) $Id$
265  //
266 -ini_set('allow_url_fopen', 0);
267 -ini_set("display_errors", 0);
268 -error_reporting(0);
269 -@set_time_limit(0);
270 -// prevent session from messing up the browser cache
271 -ini_set('session.cache_limiter', 'nocache');
272 -
273 -// only needed for older PHP versions
274 -if (!function_exists('is_a')) {
275 -    function is_a($object, $class_name)
276 -    {
277 -        $class_name = strtolower($class_name);
278 -        if (get_class($object) == $class_name) {
279 -            return TRUE;
280 -        } else {
281 -            return is_subclass_of($object, $class_name);
282 -        }
283 -    }
284 -}
285 -
286 -// definitions of path related variables
287 -$app_path = '%{APP_PATH}%';
288 -if ((substr($app_path, -1) != '/') && (substr($app_path, -2) != '\\')) {
289 -    $app_path .= '/';
290 -}
291 -@define("APP_PATH", $app_path);
292 -@define("APP_INC_PATH", APP_PATH . "include/");
293 -@define("APP_PEAR_PATH", APP_INC_PATH . "pear/");
294 -@define("APP_TPL_PATH", APP_PATH . "templates/");
295 -@define("APP_SMARTY_PATH", APP_INC_PATH . "Smarty/");
296 -@define("APP_JPGRAPH_PATH", APP_INC_PATH . "jpgraph/");
297 -@define("APP_LOG_PATH", APP_PATH . "logs/");
298 -@define("APP_LOCKS_PATH", APP_PATH . "locks/");
299 -if (stristr(PHP_OS, 'darwin')) {
300 -    ini_set("include_path", ".:" . APP_PEAR_PATH);
301 -} elseif (stristr(PHP_OS, 'win')) {
302 -    ini_set("include_path", ".;" . APP_PEAR_PATH);
303 -} else {
304 -    ini_set("include_path", ".:" . APP_PEAR_PATH);
305 -}
306 -
307 -@define("APP_SETUP_PATH", APP_PATH);
308 -@define("APP_SETUP_FILE", APP_SETUP_PATH . "setup.conf.php");
309  
310  // definitions of SQL variables
311  @define("APP_SQL_DBTYPE", "mysql");
312 @@ -82,11 +39,6 @@
313  @define("APP_DEFAULT_DB", APP_SQL_DBNAME);
314  @define("APP_TABLE_PREFIX", "%{APP_TABLE_PREFIX}%");
315  
316 -@define("APP_ERROR_LOG", APP_LOG_PATH . "errors.log");
317 -@define("APP_CLI_LOG", APP_LOG_PATH . "cli.log");
318 -@define("APP_IRC_LOG", APP_LOG_PATH . "irc_bot.log");
319 -@define("APP_LOGIN_LOG", APP_LOG_PATH . "login_attempts.log");
320 -
321  @define("APP_NAME", "Eventum");
322  @define("APP_SHORT_NAME", APP_NAME); // used in the subject of notification emails
323  @define("APP_URL", "http://www.mysql.com/products/eventum/");
324 @@ -99,8 +51,6 @@
325  @define("APP_PROJECT_COOKIE", "eventum_project");
326  @define("APP_PROJECT_COOKIE_EXPIRE", time() + (60 * 60 * 24));
327  
328 -@define("APP_VERSION", "%{APP_VERSION}%");
329 -
330  @define("APP_DEFAULT_PAGER_SIZE", 5);
331  @define("APP_DEFAULT_REFRESH_RATE", 5); // in minutes
332  
333 @@ -114,39 +64,6 @@
334  @define("APP_CYCLE_COLORS", "#DDDDDD,#CACACA");
335  @define("APP_INTERNAL_COLOR", "#9C494B");
336  
337 -// define the user_id of system user
338 -@define("APP_SYSTEM_USER_ID", 1);
339 -
340  @define("APP_BENCHMARK", false);
341 -if (APP_BENCHMARK) {
342 -    // always benchmark the scripts
343 -    include_once("Benchmark/Timer.php");
344 -    $bench = new Benchmark_Timer;
345 -    $bench->start();
346 -}
347 -
348 -include_once(APP_INC_PATH . "class.misc.php");
349 -
350 -if (isset($_GET)) {
351 -    $HTTP_POST_VARS = $_POST;
352 -    $HTTP_GET_VARS = $_GET;
353 -    $HTTP_SERVER_VARS = $_SERVER;
354 -    $HTTP_ENV_VARS = $_ENV;
355 -    $HTTP_POST_FILES = $_FILES;
356 -    // seems like PHP 4.1.0 didn't implement the $_SESSION auto-global...
357 -    if (isset($_SESSION)) {
358 -        $HTTP_SESSION_VARS = $_SESSION;
359 -    }
360 -    $HTTP_COOKIE_VARS = $_COOKIE;
361 -}
362 -// fix magic_quote_gpc'ed values (i wish i knew who is the person behind this)
363 -$HTTP_GET_VARS =& Misc::dispelMagicQuotes($HTTP_GET_VARS);
364 -$HTTP_POST_VARS =& Misc::dispelMagicQuotes($HTTP_POST_VARS);
365 -
366 -// handle the language preferences now
367 -@include_once(APP_INC_PATH . "class.language.php");
368 -Language::setPreference();
369  
370 -// set charset
371 -header("content-type: text/html;charset=" . APP_CHARSET);
372  ?>
373 \ No newline at end of file
374 --- ./include/class.monitor.php~        2005-02-22 21:50:49.000000000 +0200
375 +++ ./include/class.monitor.php 2005-02-22 23:04:50.000000000 +0200
376 @@ -100,21 +100,29 @@
377      function checkConfiguration()
378      {
379          $required_files = array(
380 -            APP_PATH . 'config.inc.php' => array(
381 +            '/etc/eventum/config.php' => array(
382                  'check_owner'      => true,
383 -                'owner'            => 'apache',
384 +                'owner'            => 'root',
385                  'check_group'      => true,
386 -                'group'            => 'apache',
387 +                'group'            => 'eventum',
388                  'check_permission' => true,
389 -                'permission'       => 755,
390 +                'permission'       => 640,
391              ),
392 -            APP_PATH . 'setup.conf.php' => array(
393 +            '/etc/eventum/core.php' => array(
394                  'check_owner'      => true,
395 -                'owner'            => 'apache',
396 +                'owner'            => 'root',
397                  'check_group'      => true,
398 -                'group'            => 'apache',
399 +                'group'            => 'eventum',
400                  'check_permission' => true,
401 -                'permission'       => 750,
402 +                'permission'       => 640,
403 +            ),
404 +            '/etc/eventum/setup.php' => array(
405 +                'check_owner'      => true,
406 +                'owner'            => 'root',
407 +                'check_group'      => true,
408 +                'group'            => 'eventum',
409 +                'check_permission' => true,
410 +                'permission'       => 660,
411                  'check_filesize'   => true,
412                  'filesize'         => 1024
413              ),
414 @@ -157,6 +165,7 @@
415                  'permission'       => 100,
416              ),
417          );
418 +        $required_directories = array();
419          foreach ($required_directories as $dir_path => $options) {
420              // check if directory exists
421              if (!file_exists($dir_path)) {
This page took 0.068879 seconds and 4 git commands to generate.