Skip to content

Commit

Permalink
Merge branch 'atrol/i27884-config-cleanup'
Browse files Browse the repository at this point in the history
  • Loading branch information
dregad committed Jan 31, 2021
2 parents f81f612 + d52954e commit 43879eb
Show file tree
Hide file tree
Showing 14 changed files with 44 additions and 26 deletions.
2 changes: 1 addition & 1 deletion admin/index.php
Expand Up @@ -65,7 +65,7 @@ function print_info_row( $p_description, $p_value ) {
<div class="table-responsive">
<table class="table table-bordered table-condensed">
<?php
if( ON == config_get( 'show_version' ) ) {
if( ON == config_get_global( 'show_version' ) ) {
$t_version_suffix = config_get_global( 'version_suffix' );
} else {
$t_version_suffix = '';
Expand Down
2 changes: 1 addition & 1 deletion browser_search_plugin.php
Expand Up @@ -38,7 +38,7 @@

$t_path = config_get_global( 'path' );
$t_title = config_get( 'search_title' );
$t_icon = $t_path . config_get( 'favicon_image' );
$t_icon = $t_path . config_get_global( 'favicon_image' );
$t_searchform = $t_path . 'view_all_bug_page.php';

# Localized ShortName and Description elements
Expand Down
18 changes: 18 additions & 0 deletions config_defaults_inc.php
Expand Up @@ -4372,6 +4372,7 @@
'cookie_path',
'cookie_prefix',
'cookie_time_length',
'copyright_statement',
'core_path',
'crypto_master_salt',
'css_include_file',
Expand All @@ -4388,6 +4389,13 @@
'default_language',
'display_errors',
'dot_tool',
'email_dkim_domain',
'email_dkim_enable',
'email_dkim_identity',
'email_dkim_passphrase',
'email_dkim_private_key_file_path',
'email_dkim_private_key_string',
'email_dkim_selector',
'email_ensure_unique',
'email_login_enabled',
'email_retry_in_days',
Expand All @@ -4397,6 +4405,7 @@
'email_smime_key_file',
'email_smime_key_password',
'fallback_language',
'favicon_image',
'file_type_icons',
'fileinfo_magic_db_file',
'form_security_validation',
Expand All @@ -4420,9 +4429,11 @@
'ldap_uid_field',
'library_path',
'login_method',
'logo_image',
'logo_url',
'logout_cookie',
'logout_redirect_page',
'long_process_timeout',
'manage_config_cookie',
'manual_url',
'neato_tool',
Expand All @@ -4438,14 +4449,21 @@
'show_memory_usage',
'show_queries_count',
'show_timer',
'show_version',
'stop_on_errors',
'string_cookie',
'subprojects_enabled',
'top_include_page',
'use_ldap_email',
'use_ldap_realname',
'validate_email',
'version_suffix',
'view_all_cookie',
'webmaster_email',
'wiki_enable',
'wiki_engine',
'wiki_engine_url',
'wiki_root_namespace',
);

/**
Expand Down
2 changes: 1 addition & 1 deletion core/commands/ProjectHierarchyAddCommand.php
Expand Up @@ -58,7 +58,7 @@ function __construct( array $p_data ) {
* Validate the data.
*/
function validate() {
if ( config_get( 'subprojects_enabled' ) == OFF ) {
if ( config_get_global( 'subprojects_enabled' ) == OFF ) {
throw new ClientException(
'Project hierarchy (subprojects) is disabled',
ERROR_PROJECT_HIERARCHY_DISABLED );
Expand Down
2 changes: 1 addition & 1 deletion core/commands/ProjectHierarchyDeleteCommand.php
Expand Up @@ -53,7 +53,7 @@ function __construct( array $p_data ) {
* Validate the data.
*/
function validate() {
if ( config_get( 'subprojects_enabled' ) == OFF ) {
if ( config_get_global( 'subprojects_enabled' ) == OFF ) {
throw new ClientException(
'Project hierarchy (subprojects) is disabled',
ERROR_PROJECT_HIERARCHY_DISABLED );
Expand Down
2 changes: 1 addition & 1 deletion core/commands/ProjectHierarchyUpdateCommand.php
Expand Up @@ -61,7 +61,7 @@ function __construct( array $p_data ) {
* Validate the data.
*/
function validate() {
if ( config_get( 'subprojects_enabled' ) == OFF ) {
if ( config_get_global( 'subprojects_enabled' ) == OFF ) {
throw new ClientException(
'Project hierarchy (subprojects) is disabled',
ERROR_PROJECT_HIERARCHY_DISABLED );
Expand Down
16 changes: 8 additions & 8 deletions core/email_api.php
Expand Up @@ -116,7 +116,7 @@ function email_regex_simple() {
* @return boolean
*/
function email_is_valid( $p_email ) {
$t_validate_email = config_get( 'validate_email' );
$t_validate_email = config_get_global( 'validate_email' );

# if we don't validate then just accept
# If blank email is allowed or current user is admin, then accept blank emails which are useful for
Expand Down Expand Up @@ -1346,13 +1346,13 @@ function email_send( EmailData $p_email_data ) {
}

#apply DKIM settings
if( config_get( 'email_dkim_enable' ) ) {
$t_mail->DKIM_domain = config_get( 'email_dkim_domain' );
$t_mail->DKIM_private = config_get( 'email_dkim_private_key_file_path' );
$t_mail->DKIM_private_string = config_get( 'email_dkim_private_key_string' );
$t_mail->DKIM_selector = config_get( 'email_dkim_selector' );
$t_mail->DKIM_passphrase = config_get( 'email_dkim_passphrase' );
$t_mail->DKIM_identity = config_get( 'email_dkim_identity' );
if( config_get_global( 'email_dkim_enable' ) ) {
$t_mail->DKIM_domain = config_get_global( 'email_dkim_domain' );
$t_mail->DKIM_private = config_get_global( 'email_dkim_private_key_file_path' );
$t_mail->DKIM_private_string = config_get_global( 'email_dkim_private_key_string' );
$t_mail->DKIM_selector = config_get_global( 'email_dkim_selector' );
$t_mail->DKIM_passphrase = config_get_global( 'email_dkim_passphrase' );
$t_mail->DKIM_identity = config_get_global( 'email_dkim_identity' );
}

$t_mail->isHTML( false ); # set email format to plain text
Expand Down
2 changes: 1 addition & 1 deletion core/helper_api.php
Expand Up @@ -293,7 +293,7 @@ function check_disabled( $p_val = true ) {
* @return integer
*/
function helper_begin_long_process( $p_ignore_abort = false ) {
$t_timeout = config_get( 'long_process_timeout' );
$t_timeout = config_get_global( 'long_process_timeout' );

# silent errors or warnings reported when safe_mode is ON.
@set_time_limit( $t_timeout );
Expand Down
4 changes: 2 additions & 2 deletions core/html_api.php
Expand Up @@ -362,7 +362,7 @@ function html_head_end() {
*/
function html_print_logo( $p_logo = null ) {
if( !$p_logo ) {
$p_logo = config_get( 'logo_image' );
$p_logo = config_get_global( 'logo_image' );
}

if( !is_blank( $p_logo ) ) {
Expand All @@ -388,7 +388,7 @@ function html_print_logo( $p_logo = null ) {
*/
function html_top_banner() {
$t_page = config_get_global( 'top_include_page' );
$t_logo_image = config_get( 'logo_image' );
$t_logo_image = config_get_global( 'logo_image' );

if( !is_blank( $t_page ) && file_exists( $t_page ) && !is_dir( $t_page ) ) {
include( $t_page );
Expand Down
12 changes: 6 additions & 6 deletions core/layout_api.php
Expand Up @@ -82,7 +82,7 @@ function layout_page_header_begin( $p_page_title = null ) {
layout_head_css();
html_rss_link();

$t_favicon_image = config_get( 'favicon_image' );
$t_favicon_image = config_get_global( 'favicon_image' );
if( !is_blank( $t_favicon_image ) ) {
echo "\t", '<link rel="shortcut icon" href="', helper_mantis_url( $t_favicon_image ), '" type="image/x-icon" />', "\n";
}
Expand Down Expand Up @@ -357,7 +357,7 @@ function layout_login_page_begin() {
layout_head_css();
html_rss_link();

$t_favicon_image = config_get( 'favicon_image' );
$t_favicon_image = config_get_global( 'favicon_image' );
if( !is_blank( $t_favicon_image ) ) {
echo "\t", '<link rel="shortcut icon" href="', helper_mantis_url( $t_favicon_image ), '" type="image/x-icon" />', "\n";
}
Expand Down Expand Up @@ -1145,7 +1145,7 @@ function layout_footer() {
# Show MantisBT version and copyright statement
$t_version_suffix = '';
$t_copyright_years = ' 2000 - ' . date( 'Y' );
if( config_get( 'show_version' ) == ON ) {
if( config_get_global( 'show_version' ) == ON ) {
$t_version_suffix = ' ' . htmlentities( MANTIS_VERSION . config_get_global( 'version_suffix' ) );
}
echo '<div class="col-md-6 col-xs-12 no-padding">' . "\n";
Expand All @@ -1154,14 +1154,14 @@ function layout_footer() {
echo "<small>Copyright &copy;$t_copyright_years MantisBT Team</small>" . '<br>';

# Show optional user-specified custom copyright statement
$t_copyright_statement = config_get( 'copyright_statement' );
$t_copyright_statement = config_get_global( 'copyright_statement' );
if( $t_copyright_statement ) {
echo '<small>' . $t_copyright_statement . '</small>' . "\n";
}

# Show contact information
if( !is_page_name( 'login_page' ) ) {
$t_webmaster_contact_information = sprintf( lang_get( 'webmaster_contact_information' ), string_html_specialchars( config_get( 'webmaster_email' ) ) );
$t_webmaster_contact_information = sprintf( lang_get( 'webmaster_contact_information' ), string_html_specialchars( config_get_global( 'webmaster_email' ) ) );
echo '<small>' . $t_webmaster_contact_information . '</small>' . '<br>' . "\n";
}

Expand Down Expand Up @@ -1292,7 +1292,7 @@ function layout_scroll_up_button() {
function layout_login_page_logo() {
?>
<div class="login-logo">
<img src="<?php echo helper_mantis_url( config_get( 'logo_image' ) ); ?>">
<img src="<?php echo helper_mantis_url( config_get_global( 'logo_image' ) ); ?>">
</div>
<?php
}
Expand Down
2 changes: 1 addition & 1 deletion core/print_api.php
Expand Up @@ -643,7 +643,7 @@ function print_project_option_list( $p_project_id = null, $p_include_all_project
* @return void
*/
function print_subproject_option_list( $p_parent_id, $p_project_id = null, $p_filter_project_id = null, $p_trace = false, $p_can_report_only = false, array $p_parents = array() ) {
if ( config_get( 'subprojects_enabled' ) == OFF ) {
if ( config_get_global( 'subprojects_enabled' ) == OFF ) {
return;
}

Expand Down
2 changes: 1 addition & 1 deletion issues_rss.php
Expand Up @@ -102,7 +102,7 @@
$t_encoding = 'utf-8';
$t_about = $t_path;
$t_title = config_get( 'window_title' );
$t_image_link = $t_path . config_get( 'logo_image' );
$t_image_link = $t_path . config_get_global( 'logo_image' );

# only rss 2.0
$t_category = project_get_name( $f_project_id );
Expand Down
2 changes: 1 addition & 1 deletion manage_proj_edit_page.php
Expand Up @@ -227,7 +227,7 @@
</div>

<?php
if ( config_get( 'subprojects_enabled') == ON ) {
if ( config_get_global( 'subprojects_enabled') == ON ) {
?>
<!-- SUBPROJECTS -->
<div class="col-md-12 col-xs-12">
Expand Down
2 changes: 1 addition & 1 deletion news_rss.php
Expand Up @@ -89,7 +89,7 @@
}

$t_description = $t_title;
$t_image_link = config_get_global( 'path' ) . config_get( 'logo_image' );;
$t_image_link = config_get_global( 'path' ) . config_get_global( 'logo_image' );;

# only rss 2.0
$t_category = string_rss_links( project_get_name( $f_project_id ) );
Expand Down

0 comments on commit 43879eb

Please sign in to comment.