Skip to content

Commit

Permalink
- Replaced the use of / by DIRECTORY_SEPARATOR in a couple of places.
Browse files Browse the repository at this point in the history
- Check for obsolete variables is now only done in the login_page.php as well as admin pages.
- Add config_obsolete() to config_api.php
- Added core/obsolete.php to call config_obsolete for all obsolete variables.
- Localised "cached"


git-svn-id: http://mantisbt.svn.sourceforge.net/svnroot/mantisbt/trunk@1369 f5dc347c-c33d-0410-90a0-b07cc1902cb9
  • Loading branch information
vboctor committed Aug 27, 2002
1 parent 549fbb1 commit cfd6797
Show file tree
Hide file tree
Showing 9 changed files with 42 additions and 40 deletions.
8 changes: 3 additions & 5 deletions admin/admin_check.php
@@ -1,10 +1,8 @@
<?php
$f_skip_open_db = true; // don't open the database in database_api.php
require( 'admin_inc.php' );
?>
<?php
error_reporting( E_ALL );
require_once( '..' . DIRECTORY_SEPARATOR . 'core' . DIRECTORY_SEPARATOR . 'php_api.php' );

$f_skip_open_db = true; // don't open the database in database_api.php
require_once( 'admin_inc.php' );

# mail test
if ( isset( $f_mail_test ) ) {
Expand Down
10 changes: 8 additions & 2 deletions admin/admin_inc.php
@@ -1,5 +1,9 @@
<?php
$t_mantis_path = '..' . DIRECTORY_SEPARATOR;
# Unable to use DIRECTORY_SEPARATOR because it may not be defined at
# this stage.
require_once( '../core/php_api.php' );

$t_mantis_path = dirname( dirname( __FILE__ ) ) . DIRECTORY_SEPARATOR;

require_once( $t_mantis_path . 'constant_inc.php' );

Expand All @@ -19,7 +23,9 @@
require_once( $t_custom_config );
}

require_once( $t_mantis_path . 'core' . DIRECTORY_SEPARATOR . 'database_api.php' );
require_once( $g_core_path . 'database_api.php' );
require_once( $g_core_path . 'config_api.php' );
require_once( $g_core_path . 'obsolete.php' );

# Checks whether the specified field in the specified database exists.
# If not, a message is displayed and the script exits.
Expand Down
9 changes: 5 additions & 4 deletions config_defaults_inc.php
Expand Up @@ -49,15 +49,15 @@

# path to your images directory (for icons)
# requires trailing /
$g_icon_path = $g_path.'images/';
$g_icon_path = $g_path . 'images' . DIRECTORY_SEPARATOR;

# absolute path to your installation. Requires trailing / or \
# Symbolic links are allowed since release 0.17.3
$g_absolute_path = dirname( __FILE__ ) . DIRECTORY_SEPARATOR;

# absolute patch to your core files. The default is usually OK,
# unless you moved the 'core' directory out of your webroot (recommended).
$g_core_path = $g_absolute_path . 'core/';
$g_core_path = $g_absolute_path . 'core' . DIRECTORY_SEPARATOR;

#############################
# Web Server
Expand Down Expand Up @@ -547,7 +547,8 @@
'closed' => '#e8e8e8'); # light gray
# --- custom status color codes ----------
# array for colors assoociated with custom attributes
#
# @@@@ Consider changing the values in this array to point to $s_color_<xxxx>. For example,
# lang_get('color_antique_white') should return 'Antique White' for English language.
$g_custom_colors = array( '#FAEBD7' => 'ANTIQUEWHITE',
'#F5DEB3' => 'WHEAT',
'#FFD700' => 'GOLD',
Expand Down
22 changes: 1 addition & 21 deletions core/API.php
Expand Up @@ -9,29 +9,10 @@
# INCLUDES
###########################################################################

$t_core_dir = dirname(__FILE__) . DIRECTORY_SEPARATOR;
$t_core_dir = dirname( __FILE__ ) . DIRECTORY_SEPARATOR;

# Include compatibility file before anything else
require_once( $t_core_dir . 'php_api.php' );

# Should be eventually moved to the admin scripts, but keep it here for a while
# to make sure people don't miss it.
function obsolete_config_variable($var, $replace) {
global $$var;
if (isset($$var)) {
PRINT '$' . $var . ' is now obsolete';
if ($replace != '') {
PRINT ', please use $' . $replace;
}
exit;
}
}

# Check for obsolete variables
obsolete_config_variable('g_notify_developers_on_new', 'g_notify_flags');
obsolete_config_variable('g_notify_on_new_threshold', 'g_notify_flags');
obsolete_config_variable('g_notify_admin_on_new', 'g_notify_flags');

require_once( $t_core_dir . 'timer_api.php' );

# initialize our timer
Expand All @@ -45,7 +26,6 @@ function obsolete_config_variable($var, $replace) {
# OPENED ANYWHERE ELSE.
require_once( $t_core_dir . 'database_api.php' );


require_once( $t_core_dir . 'config_api.php' );
require_once( $t_core_dir . 'gpc_api.php' );
require_once( $t_core_dir . 'error_api.php' );
Expand Down
15 changes: 14 additions & 1 deletion core/config_api.php
Expand Up @@ -6,7 +6,7 @@
# See the files README and LICENSE for details

# --------------------------------------------------------
# $Id: config_api.php,v 1.3 2002-08-27 10:08:08 jfitzell Exp $
# $Id: config_api.php,v 1.4 2002-08-27 12:44:10 vboctor Exp $
# --------------------------------------------------------

###########################################################################
Expand Down Expand Up @@ -64,4 +64,17 @@ function config_set( $p_option, $p_value ) {

return true;
}
# ------------------
# Checks if an obsolete configuration variable is still in use. If so, an error
# will be generated and the script will exit. This is called from login_page.php and
# admin_check.php.
function config_obsolete($var, $replace) {
if ( config_is_set( $var ) ) {
PRINT '$' . $var . ' is now obsolete';
if ($replace != '') {
PRINT ', please use $' . $replace;
}
exit;
}
}
?>
4 changes: 2 additions & 2 deletions core/file_api.php
Expand Up @@ -6,7 +6,7 @@
# See the README and LICENSE files for details

# --------------------------------------------------------
# $Id: file_api.php,v 1.3 2002-08-26 22:42:26 vboctor Exp $
# $Id: file_api.php,v 1.4 2002-08-27 12:44:10 vboctor Exp $
# --------------------------------------------------------

###########################################################################
Expand Down Expand Up @@ -43,7 +43,7 @@ function file_list_attachments ( $p_bug_id ) {
}

if ( ( FTP == config_get( 'file_upload_method' ) ) && file_exists ( $v_diskfile ) ) {
PRINT " (cached)";
PRINT ' (' . lang_get( 'cached' ) . ')';
}

if ( $i != ($num_files - 1) ) {
Expand Down
1 change: 1 addition & 0 deletions doc/ChangeLog
Expand Up @@ -121,6 +121,7 @@ Mantis ChangeLog
* Make db_result() and db_fetch_array() return data with slashes stripped
* Added authentication_api.php
* Removed proj_user_api.php
* Added obsolete.php that checks for obsolete variables.

2002.08.23 - 0.17.5
* Corrected bug_delete.php and bug_delete_page.php, which ignored the $g_allow_bug_delete_access_level setting.
Expand Down
9 changes: 5 additions & 4 deletions lang/strings_english.txt
Expand Up @@ -9,11 +9,11 @@
###########################################################################
# English strings for Mantis
# -------------------------------------------------
# $Revision: 1.79 $
# $Author: jfitzell $
# $Date: 2002-08-27 10:08:09 $
# $Revision: 1.80 $
# $Author: vboctor $
# $Date: 2002-08-27 12:44:10 $
#
# $Id: strings_english.txt,v 1.79 2002-08-27 10:08:09 jfitzell Exp $
# $Id: strings_english.txt,v 1.80 2002-08-27 12:44:10 vboctor Exp $
###########################################################################
?>
<?php
Expand Down Expand Up @@ -771,6 +771,7 @@
$s_reopen_bug_button = 'Reopen Bug';
$s_attached_files = 'Attached Files';
$s_publish = 'Publish';
$s_cached = 'Cached';

# view_bug_inc.php

Expand Down
4 changes: 3 additions & 1 deletion login_page.php
Expand Up @@ -9,8 +9,10 @@
# Login page POSTs results to login.php
# Check to see if the user is already logged in via login_cookie_check()
?>
<?php require_once( 'core.php' ) ?>
<?php
require_once( 'core.php' );
require_once( $g_core_path . 'obsolete.php' );

# Check to see if the user is logged in and then validate the cookie value
if ( !empty( $g_string_cookie_val ) ) {
login_cookie_check( 'main_page.php' );
Expand Down

0 comments on commit cfd6797

Please sign in to comment.