Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

- Replaced the use of / by DIRECTORY_SEPARATOR in a couple of places.

- 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...
commit cfd6797e51defcea3354f61da4943b7170b24c9c 1 parent 549fbb1
@vboctor vboctor authored
View
8 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 ) ) {
View
10 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' );
@@ -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.
View
9 config_defaults_inc.php
@@ -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
@@ -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',
View
22 core/API.php
@@ -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
@@ -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' );
View
15 core/config_api.php
@@ -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 $
# --------------------------------------------------------
###########################################################################
@@ -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;
+ }
+ }
?>
View
4 core/file_api.php
@@ -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 $
# --------------------------------------------------------
###########################################################################
@@ -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) ) {
View
1  doc/ChangeLog
@@ -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.
View
9 lang/strings_english.txt
@@ -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
@@ -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
View
4 login_page.php
@@ -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' );
Please sign in to comment.
Something went wrong with that request. Please try again.