View Issue Details
| ID | Project | Category | View Status | Date Submitted | Last Update |
|---|---|---|---|---|---|
| 0007879 | mantisbt | administration | public | 2007-04-03 17:27 | 2007-04-05 17:52 |
| Reporter | giallu | Assigned To | |||
| Priority | normal | Severity | minor | Reproducibility | have not tried |
| Status | new | Resolution | open | ||
| Summary | 0007879: alternate position for mantis_offline.php | ||||
| Description | The FHS on Linux systems impose putting configuration files under /etc; in particular, the Fedora package (but I think at least Debian is doing the same) uses /etc/mantis. A patch allowing mantis to find mantis_offline.php when it is put into /etc/mantis would be a nice aid to linux packagers. | ||||
| Tags | No tags attached. | ||||
| Attached Files | mantis-alternate_path_for_config-files.patch (803 bytes)
Index: mantisbt/core.php
===================================================================
--- mantisbt.orig/core.php
+++ mantisbt/core.php
@@ -28,7 +28,10 @@
# If you have to test Mantis while it's offline, add the
# parameter 'mbadmin=1' to the URL.
#
- $t_mantis_offline = 'mantis_offline.php';
+ $t_mantis_offline = getenv( 'MANTIS_OFFLINE' );
+ if ( is_null( $t_mantis_offline ) ) {
+ $t_mantis_offline = 'mantis_offline.php';
+ }
if ( file_exists( $t_mantis_offline ) && !isset( $_GET['mbadmin'] ) ) {
include( $t_mantis_offline );
exit;
@@ -152,4 +155,6 @@
if ( !isset( $g_bypass_headers ) && !headers_sent() ) {
header( 'Content-type: text/html;charset=' . lang_get( 'charset' ) );
}
-?>
\ No newline at end of file
+
+# vim: noexpandtab tabstop=4 softtabstop=0:
+?>
| ||||
|
With the patch attached, mantis will scan the given array of alternate mantis_offline.php position, until the array ends or the file is found. Of course the list could be expanded as needed |
|
|
Don't think that really makes sense for the offline file... |
|
|
Some questions relating to your change:
|
|
|
In reply to chillax: AFAICT, when the file is present in the mantis root directory:
Now, while 2 could be argued not being a configuration, but a customization, I think 1 definitely is a configuration thing, to the point we could decouple those semantics and have:
|
|
|
In reply to vboctor:
the difference here is that mantis gives you a method to add easily some customizations w/o touching the source code. I think we could support looking for the custom* fields in an alternate path. However this is probably a topic for another bug/thread.
|
|
|
I just noticed the offline check is performed before searching and including the configuration parameters. Possible solutions:
thoughts? |
|
|
OK. the attached revised patch lets the administrator choose the full path, including filename, to the mantis offline file. If the env varbiable MANTIS_OFFLINE is not set, the behavior is unchanged |
|