Beispiel #1
0
 * Miscellaneous functions that provide functionality on top of other APIS
 * are found in the helper_api.
 *
 * @package CoreAPI
 * @subpackage UtilityAPI
 * @copyright Copyright 2000 - 2002  Kenzaburo Ito - kenito@300baud.org
 * @copyright Copyright 2002  MantisBT Team - mantisbt-dev@lists.sourceforge.net
 * @link http://www.mantisbt.org
 *
 * @uses config_api.php
 * @uses constant_inc.php
 * @uses error_api.php
 */
require_api('config_api.php');
require_api('constant_inc.php');
require_api('error_api.php');
/**
 * converts a 1 value to X
 * converts a 0 value to a space
 * @param integer $p_num A numeric to translate as a boolean for display.
 * @return string X or space
 * @access public
 */
function trans_bool($p_num)
{
    if (0 == $p_num) {
        return ' ';
    } else {
        return 'X';
    }
}
 * ii) "Print Issues Columns" - These are the fields that are included when printing out bug
 * details.
 * iii) "Export Issues Columns" - These are the list of fields included when exporting an issue from
 * the bug tracker.
 * Note: These are now shared between different types of exports - for example, the core MantisBT
 * distribution can export to Excel and Word Documents.
 *
 * The settings defined here can be allocated to the current project, or All Projects. In addition,
 * it is possible to copy the column configuration between different projects.
 *
 * @package MantisBT
 * @copyright Copyright 2000 - 2002  Kenzaburo Ito - kenito@300baud.org
 * @copyright Copyright 2002  MantisBT Team - mantisbt-dev@lists.sourceforge.net
 * @link http://www.mantisbt.org
 *
 * @uses core.php
 * @uses current_user_api.php
 * @uses html_api.php
 * @uses lang_api.php
 */
require_once 'core.php';
require_api('current_user_api.php');
require_api('html_api.php');
require_api('lang_api.php');
html_page_top(lang_get('manage_columns_config'));
current_user_ensure_unprotected();
# Define constant that will be checked by the include page.
define('ACCOUNT_COLUMNS', true);
define('MANAGE_COLUMNS_INC_ALLOW', true);
include dirname(__FILE__) . '/manage_columns_inc.php';
html_page_bottom();
Beispiel #3
0
 * @copyright Copyright (C) 2002 - 2010  MantisBT Team - mantisbt-dev@lists.sourceforge.net
 * @link http://www.mantisbt.org
 *
 * @uses authentication_api.php
 * @uses config_api.php
 * @uses constant_inc.php
 * @uses error_api.php
 * @uses plugin_api.php
 * @uses user_pref_api.php
 */
require_api('authentication_api.php');
require_api('config_api.php');
require_api('constant_inc.php');
require_api('error_api.php');
require_api('plugin_api.php');
require_api('user_pref_api.php');
# Cache of localization strings in the language specified by the last
# lang_load call
$g_lang_strings = array();
# stack for language overrides
$g_lang_overrides = array();
# To be used in custom_strings_inc.php :
$g_active_language = '';
/**
 * Loads the specified language and stores it in $g_lang_strings, to be used by lang_get
 * @param string $p_lang
 * @param string $p_dir
 * @return null
 */
function lang_load($p_lang, $p_dir = null)
{
Beispiel #4
0
 *
 * @package CoreAPI
 * @subpackage IconAPI
 * @copyright Copyright 2000 - 2002  Kenzaburo Ito - kenito@300baud.org
 * @copyright Copyright 2002  MantisBT Team - mantisbt-dev@lists.sourceforge.net
 * @link http://www.mantisbt.org
 *
 * @uses config_api.php
 * @uses constant_inc.php
 * @uses helper_api.php
 * @uses utility_api.php
 */
require_api('config_api.php');
require_api('constant_inc.php');
require_api('helper_api.php');
require_api('utility_api.php');
/**
 * gets the status icon
 * @param string $p_icon Icon file name.
 * @return string html img tag containing status icon
 * @access public
 */
function icon_get_status_icon($p_icon)
{
    $t_icon_path = config_get('icon_path');
    $t_status_icon_arr = config_get('status_icon_arr');
    $t_priotext = get_enum_element('priority', $p_icon);
    if (isset($t_status_icon_arr[$p_icon]) && !is_blank($t_status_icon_arr[$p_icon])) {
        return '<img src="' . $t_icon_path . $t_status_icon_arr[$p_icon] . '" alt="" title="' . $t_priotext . '" />';
    } else {
        return '&#160;';
Beispiel #5
0
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with MantisBT.  If not, see <http://www.gnu.org/licenses/>.
/**
 * JSON API
 *
 * @package CoreAPI
 * @subpackage JSONAPI
 * @copyright Copyright (C) 2000 - 2002  Kenzaburo Ito - kenito@300baud.org
 * @copyright Copyright (C) 2002 - 2012  MantisBT Team - mantisbt-dev@lists.sourceforge.net
 * @link http://www.mantisbt.org
 *
 * @uses url_api.php
 */
require_api('url_api.php');
/**
 * Get a chunk of JSON from a given URL.
 * @param string URL
 * @param string Top-level member to retrieve
 * @return multi JSON class structure
 */
function json_url($p_url, $p_member = null)
{
    $t_data = url_get($p_url);
    $t_json = json_decode(utf8_encode($t_data));
    if (is_null($p_member)) {
        return $t_json;
    } else {
        return $t_json->{$p_member};
    }
Beispiel #6
0
 * @uses config_api.php
 * @uses event_api.php
 * @uses form_api.php
 * @uses gpc_api.php
 * @uses print_api.php
 * @uses project_api.php
 */
require_once 'core.php';
require_api('access_api.php');
require_api('authentication_api.php');
require_api('config_api.php');
require_api('event_api.php');
require_api('form_api.php');
require_api('gpc_api.php');
require_api('print_api.php');
require_api('project_api.php');
form_security_validate('manage_proj_update');
auth_reauthenticate();
$f_project_id = gpc_get_int('project_id');
$f_name = gpc_get_string('name');
$f_description = gpc_get_string('description');
$f_status = gpc_get_int('status');
$f_view_state = gpc_get_int('view_state');
$f_file_path = gpc_get_string('file_path', '');
$f_enabled = gpc_get_bool('enabled');
$f_inherit_global = gpc_get_bool('inherit_global', 0);
access_ensure_project_level(config_get('manage_project_threshold'), $f_project_id);
project_update($f_project_id, $f_name, $f_description, $f_status, $f_view_state, $f_file_path, $f_enabled, $f_inherit_global);
event_signal('EVENT_MANAGE_PROJECT_UPDATE', array($f_project_id));
form_security_purge('manage_proj_update');
print_header_redirect('manage_proj_page.php');
Beispiel #7
0
# along with Mantis.  If not, see <http://www.gnu.org/licenses/>.

/**
 * Bug Revision API
 *
 * @package CoreAPI
 * @subpackage BugRevisionAPI
 * @copyright Copyright (C) 2002 - 2011  MantisBT Team - mantisbt-dev@lists.sourceforge.net
 * @link http://www.mantisbt.org
 *
 * @uses constant_inc.php
 * @uses database_api.php
 */

require_api( 'constant_inc.php' );
require_api( 'database_api.php' );

/**
 * Add a new revision to a bug history.
 * @param int $p_bug_id Bug ID
 * @param int $p_user_id User ID
 * @param int $p_type Revision Type
 * @param string $p_value Value
 * @param int $p_bugnote_id Bugnote ID
 * @param int $p_timestamp Timestamp(int)
 * @return int Revision ID
 */
function bug_revision_add( $p_bug_id, $p_user_id, $p_type, $p_value, $p_bugnote_id=0, $p_timestamp = null ) {
	if ( $p_type <= REV_ANY ) {
		return null;
	}
 * @uses project_hierarchy_api.php
 */
require_once 'core.php';
require_api('access_api.php');
require_api('authentication_api.php');
require_api('config_api.php');
require_api('constant_inc.php');
require_api('current_user_api.php');
require_api('event_api.php');
require_api('form_api.php');
require_api('gpc_api.php');
require_api('html_api.php');
require_api('lang_api.php');
require_api('print_api.php');
require_api('project_api.php');
require_api('project_hierarchy_api.php');
form_security_validate('manage_proj_create');
auth_reauthenticate();
access_ensure_global_level(config_get('create_project_threshold'));
$f_name = gpc_get_string('name');
$f_description = gpc_get_string('description');
$f_view_state = gpc_get_int('view_state');
$f_status = gpc_get_int('status');
$f_file_path = gpc_get_string('file_path', '');
$f_inherit_global = gpc_get_bool('inherit_global', 0);
$f_inherit_parent = gpc_get_bool('inherit_parent', 0);
$f_parent_id = gpc_get_int('parent_id', 0);
if (0 != $f_parent_id) {
    project_ensure_exists($f_parent_id);
}
$t_project_id = project_create(strip_tags($f_name), $f_description, $f_status, $f_view_state, $f_file_path, true, $f_inherit_global);
/**
 * This page allows the user to set the fields of the bugs he wants to print
 * Update is POSTed to acount_prefs_update.php
 * Reset is POSTed to acount_prefs_reset.php
 *
 * @package MantisBT
 * @copyright Copyright (C) 2000 - 2002  Kenzaburo Ito - kenito@300baud.org
 * @copyright Copyright (C) 2002 - 2011  MantisBT Team - mantisbt-dev@lists.sourceforge.net
 * @link http://www.mantisbt.org
 *
 * @uses core.php
 * @uses authentication_api.php
 * @uses html_api.php
 */

/**
 * MantisBT Core API's
 */
require_once( 'core.php' );
require_api( 'authentication_api.php' );
require_api( 'html_api.php' );

define( 'PRINT_ALL_BUG_OPTIONS_INC_ALLOW', true );
include( dirname( __FILE__ ) . DIRECTORY_SEPARATOR . 'print_all_bug_options_inc.php' );

auth_ensure_user_authenticated();

html_page_top();
edit_printing_prefs();
html_page_bottom();
 * @uses bug_api.php
 * @uses compress_api.php
 * @uses config_api.php
 * @uses constant_inc.php
 * @uses gpc_api.php
 * @uses relationship_graph_api.php
 */
require_once 'core.php';
require_api('access_api.php');
require_api('authentication_api.php');
require_api('bug_api.php');
require_api('compress_api.php');
require_api('config_api.php');
require_api('constant_inc.php');
require_api('gpc_api.php');
require_api('relationship_graph_api.php');
# If relationship graphs were made disabled, we disallow any access to
# this script.
auth_ensure_user_authenticated();
if (ON != config_get('relationship_graph_enable')) {
    access_denied();
}
$f_bug_id = gpc_get_int('bug_id');
$f_type = gpc_get_string('graph', 'relation');
$f_orientation = gpc_get_string('orientation', config_get('relationship_graph_orientation'));
access_ensure_bug_level(VIEWER, $f_bug_id);
$t_bug = bug_get($f_bug_id, true);
compress_enable();
$t_graph_relation = 'relation' == $f_type;
$t_graph_horizontal = 'horizontal' == $f_orientation;
if ($t_graph_relation) {
 * @uses string_api.php
 * @uses workflow_api.php
 */
require_once 'core.php';
require_api('authentication_api.php');
require_api('config_api.php');
require_api('constant_inc.php');
require_api('current_user_api.php');
require_api('form_api.php');
require_api('helper_api.php');
require_api('html_api.php');
require_api('lang_api.php');
require_api('print_api.php');
require_api('project_api.php');
require_api('string_api.php');
require_api('workflow_api.php');
auth_reauthenticate();
html_page_top(lang_get('manage_workflow_config'));
print_manage_menu('adm_permissions_report.php');
print_manage_config_menu('manage_config_workflow_page.php');
# CSS class names for overrides color coding
define('COLOR_GLOBAL', 'color-global');
define('COLOR_PROJECT', 'color-project');
$g_access = current_user_get_access_level();
$t_project = helper_get_current_project();
$g_can_change_workflow = $g_access >= config_get_access('status_enum_workflow');
$g_can_change_flags = $g_can_change_workflow;
$g_overrides = array();
/**
 * Set overrides
 * @param string $p_config     Configuration value.
Beispiel #12
0
 * MantisBT Core API's
 */
require_once 'core.php';
require_api('access_api.php');
require_api('bug_api.php');
require_api('config_api.php');
require_api('constant_inc.php');
require_api('email_api.php');
require_api('error_api.php');
require_api('form_api.php');
require_api('gpc_api.php');
require_api('helper_api.php');
require_api('history_api.php');
require_api('lang_api.php');
require_api('print_api.php');
require_api('relationship_api.php');
form_security_validate('bug_relationship_add');
$f_rel_type = gpc_get_int('rel_type');
$f_src_bug_id = gpc_get_int('src_bug_id');
$f_dest_bug_id_string = gpc_get_string('dest_bug_id');
# user has access to update the bug...
access_ensure_bug_level(config_get('update_bug_threshold'), $f_src_bug_id);
$f_dest_bug_id_string = str_replace(',', '|', $f_dest_bug_id_string);
$f_dest_bug_id_array = explode('|', $f_dest_bug_id_string);
foreach ($f_dest_bug_id_array as $f_dest_bug_id) {
    $f_dest_bug_id = (int) $f_dest_bug_id;
    # source and destination bugs are the same bug...
    if ($f_src_bug_id == $f_dest_bug_id) {
        trigger_error(ERROR_RELATIONSHIP_SAME_BUG, ERROR);
    }
    # the related bug exists...
 * Export billing information to csv
 *
 * @package MantisBT
 * @copyright Copyright 2000 - 2002  Kenzaburo Ito - kenito@300baud.org
 * @copyright Copyright 2002  MantisBT Team - mantisbt-dev@lists.sourceforge.net
 * @link http://www.mantisbt.org
 *
 * @uses core.php
 * @uses billing_api.php
 * @uses bug_api.php
 * @uses csv_api.php
 */
require_once 'core.php';
require_api('billing_api.php');
require_api('bug_api.php');
require_api('csv_api.php');
helper_begin_long_process();
$t_filename = csv_get_default_filename();
$t_date_format = config_get('normal_date_format');
$f_project_id = gpc_get_int('project_id');
$f_cost = gpc_get_int('cost');
$f_from = gpc_get_string('from');
$f_to = gpc_get_string('to');
$t_separator = ',';
billing_ensure_reporting_access($f_project_id);
$t_show_cost = ON == config_get('time_tracking_with_billing') && $f_cost != 0;
$t_billing_rows = billing_get_for_project($f_project_id, $f_from, $f_to, $f_cost);
$t_show_realname = config_get('show_realname') == ON;
header('Pragma: public');
header('Content-Type: text/csv; name=' . urlencode(file_clean_name($t_filename)));
header('Content-Transfer-Encoding: BASE64;');
Beispiel #14
0
 * Mantis Database installation process
 *
 * @package MantisBT
 * @copyright Copyright 2000 - 2002  Kenzaburo Ito - kenito@300baud.org
 * @copyright Copyright 2002  MantisBT Team - mantisbt-dev@lists.sourceforge.net
 * @link http://www.mantisbt.org
 */
error_reporting(E_ALL);
@set_time_limit(0);
# Load the MantisDB core in maintenance mode. This mode will assume that
# config/config_inc.php hasn't been specified. Thus the database will not be opened
# and plugins will not be loaded.
define('MANTIS_MAINTENANCE_MODE', true);
require_once dirname(dirname(__FILE__)) . '/core.php';
require_api('install_helper_functions_api.php');
require_api('crypto_api.php');
$g_error_send_page_header = false;
# bypass page headers in error handler
$g_failed = false;
$g_database_upgrade = false;
/**
 * Print Test result
 *
 * @param integer $p_result    Result - BAD|GOOD.
 * @param boolean $p_hard_fail Fail installation or soft warning.
 * @param string  $p_message   Message to display to user.
 * @return void
 */
function print_test_result($p_result, $p_hard_fail = true, $p_message = '')
{
    global $g_failed;
 */
/**
 * MantisBT Core API's
 */
require_once 'core.php';
require_api('authentication_api.php');
require_api('compress_api.php');
require_api('config_api.php');
require_api('constant_inc.php');
require_api('current_user_api.php');
require_api('custom_field_api.php');
require_api('error_api.php');
require_api('filter_api.php');
require_api('filter_constants_inc.php');
require_api('gpc_api.php');
require_api('helper_api.php');
auth_ensure_user_authenticated();
compress_enable();
global $t_filter;
global $t_select_modifier;
$t_filter = current_user_get_bug_filter();
if ($t_filter === false) {
    $t_filter = filter_get_default();
}
$t_project_id = helper_get_current_project();
$t_current_user_access_level = current_user_get_access_level();
$t_accessible_custom_fields_ids = array();
$t_accessible_custom_fields_names = array();
$t_accessible_custom_fields_types = array();
$t_accessible_custom_fields_values = array();
$t_filter_cols = 7;
Beispiel #16
0
    require_api('authentication_api.php');
    if (auth_is_user_authenticated()) {
        require_api('user_pref_api.php');
        $t_user_timezone = user_pref_get_pref(auth_get_current_user_id(), 'timezone');
        if (!is_blank($t_user_timezone)) {
            date_default_timezone_set($t_user_timezone);
        }
    }
}
if (!defined('MANTIS_MAINTENANCE_MODE')) {
    require_api('collapse_api.php');
    collapse_cache_token();
}
# Load custom functions
require_api('custom_function_api.php');
if (file_exists(dirname(__FILE__) . DIRECTORY_SEPARATOR . 'custom_functions_inc.php')) {
    require_once dirname(__FILE__) . DIRECTORY_SEPARATOR . 'custom_functions_inc.php';
}
# Set HTTP response headers
require_api('http_api.php');
http_all_headers();
# Push default language to speed calls to lang_get
if (!defined('LANG_LOAD_DISABLED')) {
    require_api('lang_api.php');
    lang_push(lang_get_default());
}
# Signal plugins that the core system is loaded
if (!defined('PLUGINS_DISABLED') && !defined('MANTIS_MAINTENANCE_MODE')) {
    require_api('event_api.php');
    event_signal('EVENT_CORE_READY');
}
Beispiel #17
0
 * @uses core.php
 * @uses event_api.php
 * @uses form_api.php
 * @uses gpc_api.php
 * @uses print_api.php
 * @uses tag_api.php
 */

/**
 * MantisBT Core API's
 */
require_once( 'core.php' );
require_api( 'event_api.php' );
require_api( 'form_api.php' );
require_api( 'gpc_api.php' );
require_api( 'print_api.php' );
require_api( 'tag_api.php' );

form_security_validate( 'tag_detach' );

$f_tag_id = gpc_get_int( 'tag_id' );
$f_bug_id = gpc_get_int( 'bug_id' );

tag_bug_detach( $f_tag_id, $f_bug_id );

event_signal( 'EVENT_TAG_DETACHED', array( $f_bug_id, array( $f_tag_id ) ) );

form_security_purge( 'tag_detach' );

print_successful_redirect_to_bug( $f_bug_id );
 * @link http://www.mantisbt.org
 * @uses core.php
 * @uses Period.php
 * @uses access_api.php
 * @uses config_api.php
 * @uses gpc_api.php
 * @uses html_api.php
 * @uses plugin_api.php
 */
require_once 'core.php';
plugin_require_api('core/Period.php');
require_api('access_api.php');
require_api('config_api.php');
require_api('gpc_api.php');
require_api('html_api.php');
require_api('plugin_api.php');
require_js('jscalendar/calendar.js');
require_js('jscalendar/lang/calendar-en.js');
require_js('jscalendar/calendar-setup.js');
require_css('calendar-blue.css');
access_ensure_project_level(config_get('view_summary_threshold'));
$f_interval = gpc_get_int('interval', 0);
$t_today = date('Y-m-d');
$f_type = gpc_get_int('graph_type', 0);
$f_show_as_table = gpc_get_bool('show_table', false);
html_page_top1(plugin_lang_get('graph_page'));
$t_path = config_get('path');
html_page_top2();
$t_period = new Period();
$t_period->set_period_from_selector('interval');
$t_types = array(0 => plugin_lang_get('select'), 2 => plugin_lang_get('select_bystatus'), 3 => plugin_lang_get('select_summbystatus'), 4 => plugin_lang_get('select_bycat'), 6 => plugin_lang_get('select_both'));
Beispiel #19
0
# MantisBT - A PHP based bugtracking system
# MantisBT is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 2 of the License, or
# (at your option) any later version.
#
# MantisBT is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with MantisBT.  If not, see <http://www.gnu.org/licenses/>.
require_api('access_api.php');
require_api('history_api.php');
/**
 * Antispam API
 *
 * @package CoreAPI
 * @subpackage AntispamAPI
 * @copyright Copyright 2015 MantisBT Team - mantisbt-dev@lists.sourceforge.net
 * @link http://www.mantisbt.org
 *
 * @uses access_api.php
 * @uses history_api.php
 */
/**
 * Triggers an error if the current user is suspected to be a spammer.
 * This should be run before actions like adding issues or issue notes. If the
 * user is determined to demonstrate spammy behavior, this method will trigger an
Beispiel #20
0
 * This file contains configuration checks for display/html issues
 *
 * @package MantisBT
 * @copyright Copyright 2000 - 2002  Kenzaburo Ito - kenito@300baud.org
 * @copyright Copyright 2002  MantisBT Team - mantisbt-dev@lists.sourceforge.net
 * @link http://www.mantisbt.org
 *
 * @uses check_api.php
 * @uses config_api.php
 */
if (!defined('CHECK_DISPLAY_INC_ALLOW')) {
    return;
}
# MantisBT Check API
require_once 'check_api.php';
require_api('config_api.php');
check_print_section_header_row('Display');
check_print_test_row('bug_link_tag is not blank/null', config_get_global('bug_link_tag'), array(false => 'The value of the bug_link_tag option cannot be blank/null.'));
check_print_test_row('bugnote_link_tag is not blank/null', config_get_global('bugnote_link_tag'), array(false => 'The value of the bugnote_link_tag option cannot be blank/null.'));
if (plugin_is_installed('MantisGraph')) {
    plugin_push_current('MantisGraph');
    check_print_test_row('Checking GD library is enabled, and version 2...', get_gd_version() == 2);
    if (plugin_config_get('eczlibrary', ON) == OFF) {
        $t_jpgraph_path = plugin_config_get('jpgraph_path');
        if ($t_jpgraph_path == '') {
            $t_jpgraph_path = config_get('absolute_path') . 'library/jpgraph';
        }
        $t_jpgraph_path .= '/jpgraph.php';
        $t_jpgraph_found = check_print_test_row('Checking we can find jpgraph library class files', file_exists($t_jpgraph_path), dirname($t_jpgraph_path));
        if ($t_jpgraph_found) {
            require_once $t_jpgraph_path;
Beispiel #21
0
require_api('file_api.php');
require_api('form_api.php');
require_api('helper_api.php');
require_api('html_api.php');
require_api('lang_api.php');
require_api('last_visited_api.php');
require_api('news_api.php');
require_api('prepare_api.php');
require_api('profile_api.php');
require_api('project_api.php');
require_api('project_hierarchy_api.php');
require_api('string_api.php');
require_api('tag_api.php');
require_api('user_api.php');
require_api('utility_api.php');
require_api('version_api.php');
# --------------------
# Print the headers to cause the page to redirect to $p_url
# If $p_die is true (default), terminate the execution of the script
#  immediately
# If we have handled any errors on this page and the 'stop_on_errors' config
#  option is turned on, return false and don't redirect.
# $p_sanitize - true/false - true in the case where the URL is extracted from GET/POST or untrusted source.
# This would be false if the URL is trusted (e.g. read from config_inc.php).
#
# @param string The page to redirect: has to be a relative path
# @param boolean if true, stop the script after redirecting
# @param boolean apply string_sanitize_url to passed url
# @return boolean
function print_header_redirect($p_url, $p_die = true, $p_sanitize = false, $p_absolute = false)
{
/**
 *	The filters have been changed so the field names are the same as the database
 *	field names.  This updates any filters stored in the database to use the correct
 *	keys. The 'and_not_assigned' field is no longer used as it is replaced by the meta
 *	filter None.  This removes it from all filters.
 */
function install_stored_filter_migrate()
{
    # Disable query logging even if enabled in config, due to possibility of mass spam
    $t_log_queries = install_set_log_queries();
    require_api('filter_api.php');
    $t_cookie_version = config_get('cookie_version');
    # convert filters to use the same value for the filter key and the form field
    $t_filter_fields['show_category'] = 'category_id';
    $t_filter_fields['show_severity'] = 'severity';
    $t_filter_fields['show_status'] = 'status';
    $t_filter_fields['show_priority'] = 'priority';
    $t_filter_fields['show_resolution'] = 'resolution';
    $t_filter_fields['show_build'] = 'build';
    $t_filter_fields['show_version'] = 'version';
    $t_filter_fields['user_monitor'] = 'monitor_user_id';
    $t_filter_fields['show_profile'] = 'profile_id';
    $t_filter_fields['do_filter_by_date'] = 'filter_by_date';
    $t_filter_fields['and_not_assigned'] = null;
    $t_filter_fields['sticky_issues'] = 'sticky';
    $t_filters_table = db_get_table('filters');
    $t_query = "SELECT * FROM {$t_filters_table}";
    $t_result = db_query_bound($t_query);
    while ($t_row = db_fetch_array($t_result)) {
        $t_filter_arr = filter_deserialize($t_row['filter_string']);
        foreach ($t_filter_fields as $t_old => $t_new) {
            if (isset($t_filter_arr[$t_old])) {
                $t_value = $t_filter_arr[$t_old];
                unset($t_filter_arr[$t_old]);
                if (!is_null($t_new)) {
                    $t_filter_arr[$t_new] = $t_value;
                }
            }
        }
        $t_filter_serialized = serialize($t_filter_arr);
        $t_filter_string = $t_cookie_version . '#' . $t_filter_serialized;
        $t_update_query = "UPDATE {$t_filters_table} SET filter_string=" . db_param() . ' WHERE id=' . db_param();
        $t_update_result = db_query_bound($t_update_query, array($t_filter_string, $t_row['id']));
    }
    # Re-enable query logging if we disabled it
    install_set_log_queries($t_log_queries);
    # Return 2 because that's what ADOdb/DataDict does when things happen properly
    return 2;
}
Beispiel #23
0
 */

/**
 * MantisBT Core API's
 */
require_once( 'core.php' );
require_api( 'access_api.php' );
require_api( 'authentication_api.php' );
require_api( 'config_api.php' );
require_api( 'constant_inc.php' );
require_api( 'database_api.php' );
require_api( 'form_api.php' );
require_api( 'helper_api.php' );
require_api( 'lang_api.php' );
require_api( 'print_api.php' );
require_api( 'user_api.php' );

form_security_validate( 'manage_user_prune' );

auth_reauthenticate();

access_ensure_global_level( config_get( 'manage_user_threshold' ) );

$t_user_table = db_get_table( 'user' );

# Delete the users who have never logged in and are older than 1 week
$days_old = (int)7 * SECONDS_PER_DAY;

$query = "SELECT id, access_level
		FROM $t_user_table
		WHERE ( login_count = 0 ) AND ( date_created = last_visit ) AND " . db_helper_compare_days( 0, "date_created", "> $days_old" );
 * @copyright Copyright 2002  MantisBT Team - mantisbt-dev@lists.sourceforge.net
 * @link http://www.mantisbt.org
 *
 * @uses bug_api.php
 * @uses config_api.php
 * @uses constant_inc.php
 * @uses current_user_api.php
 * @uses database_api.php
 * @uses tokens_api.php
 */
require_api('bug_api.php');
require_api('config_api.php');
require_api('constant_inc.php');
require_api('current_user_api.php');
require_api('database_api.php');
require_api('tokens_api.php');
/**
 * Determine if last visited feature is enabled
 *
 * @return boolean true: enabled; false: otherwise.
 * @access public
 */
function last_visited_enabled()
{
    return !(OFF == config_get('recently_visited') || current_user_is_anonymous());
}
/**
 * This method should be called from view, update, print pages for issues,
 * mantisconnect.
 *
 * @param integer $p_issue_id The issue id that was just visited.
 * @uses config_api.php
 * @uses database_api.php
 * @uses form_api.php
 * @uses gpc_api.php
 * @uses print_api.php
 */
/** @ignore */
define('PLUGINS_DISABLED', true);
require_once 'core.php';
require_api('access_api.php');
require_api('authentication_api.php');
require_api('config_api.php');
require_api('database_api.php');
require_api('form_api.php');
require_api('gpc_api.php');
require_api('print_api.php');
form_security_validate('manage_plugin_update');
auth_reauthenticate();
access_ensure_global_level(config_get('manage_plugin_threshold'));
$t_plugin_table = db_get_table('plugin');
$t_query = "SELECT basename FROM {$t_plugin_table}";
$t_result = db_query_bound($t_query);
while ($t_row = db_fetch_array($t_result)) {
    $t_basename = $t_row['basename'];
    $f_change = gpc_get_bool('change_' . $t_basename, 0);
    if (!$f_change) {
        continue;
    }
    $f_priority = gpc_get_int('priority_' . $t_basename, 3);
    $f_protected = gpc_get_bool('protected_' . $t_basename, 0);
    $t_query = "UPDATE {$t_plugin_table} SET priority=" . db_param() . ', protected=' . db_param() . ' WHERE basename=' . db_param();
Beispiel #26
0
 * @copyright Copyright (C) 2000 - 2002  Kenzaburo Ito - kenito@300baud.org
 * @copyright Copyright (C) 2002 - 2011  MantisBT Team - mantisbt-dev@lists.sourceforge.net
 * @link http://www.mantisbt.org
 *
 * @uses config_api.php
 * @uses constant_inc.php
 * @uses error_api.php
 * @uses gpc_api.php
 * @uses php_api.php
 */

require_api( 'config_api.php' );
require_api( 'constant_inc.php' );
require_api( 'error_api.php' );
require_api( 'gpc_api.php' );
require_api( 'php_api.php' );

/**
 *
 * @global MantisPHPSession $g_session
 */
$g_session = null;

/**
 * Abstract interface for a MantisBT session handler.
 * @package MantisBT
 * @subpackage classes
 */
abstract class MantisSession {
	var $id;
Beispiel #27
0
 * @uses history_api.php
 * @uses lang_api.php
 * @uses print_api.php
 * @uses string_api.php
 */
if (!defined('HISTORY_INC_ALLOW')) {
    return;
}
require_api('access_api.php');
require_api('collapse_api.php');
require_api('config_api.php');
require_api('helper_api.php');
require_api('history_api.php');
require_api('lang_api.php');
require_api('print_api.php');
require_api('string_api.php');
$t_access_level_needed = config_get('view_history_threshold');
if (!access_has_bug_level($t_access_level_needed, $f_bug_id)) {
    return;
}
?>

<a id="history"></a><br />

<?php 
collapse_open('history', '', 'table-container');
$t_history = history_get_events_array($f_bug_id);
?>
<table>
	<thead>
		<tr>
Beispiel #28
0
        $t_warnings[] = debug_setting_message('security', $t_config, 'OFF');
    }
    $t_config = 'display_errors';
    $t_errors = config_get_global($t_config);
    if ($t_errors[E_USER_ERROR] != DISPLAY_ERROR_HALT) {
        $t_warnings[] = debug_setting_message('integrity', $t_config . '[E_USER_ERROR]', DISPLAY_ERROR_HALT);
    }
    # since admin directory and db_upgrade lists are available check for missing db upgrades
    # if db version is 0, we do not have a valid database.
    $t_db_version = config_get('database_version', 0);
    if ($t_db_version == 0) {
        $t_warnings[] = lang_get('error_database_no_schema_version');
    }
    # Check for db upgrade for versions > 1.0.0 using new installer and schema
    # Note: install_helper_functions_api.php required for db_null_date() function definition
    require_api('install_helper_functions_api.php');
    require_once 'admin' . DIRECTORY_SEPARATOR . 'schema.php';
    $t_upgrades_reqd = count($g_upgrade) - 1;
    if (0 < $t_db_version && $t_db_version != $t_upgrades_reqd) {
        if ($t_db_version < $t_upgrades_reqd) {
            $t_warnings[] = lang_get('error_database_version_out_of_date_2');
            $t_upgrade_required = true;
        } else {
            $t_warnings[] = lang_get('error_code_version_out_of_date');
        }
    }
}
?>

<!-- Login Form BEGIN -->
<div id="login-div" class="form-container">
Beispiel #29
0
/**
 * @package MantisBT
 * @copyright Copyright (C) 2000 - 2002  Kenzaburo Ito - kenito@300baud.org
 * @copyright Copyright (C) 2002 - 2010  MantisBT Team - mantisbt-dev@lists.sourceforge.net
 * @link http://www.mantisbt.org
 *
 * @uses core.php
 * @uses config_api.php
 * @uses gpc_api.php
 */
/**
 * MantisBT Core API's
 */
require_once 'core.php';
require_api('config_api.php');
require_api('gpc_api.php');
$f_type = gpc_get_string('type', 'text');
header('Content-Type: application/opensearchdescription+xml');
?>
<OpenSearchDescription xmlns="http://a9.com/-/spec/opensearch/1.1/"
                       xmlns:moz="http://www.mozilla.org/2006/browser/search/">
<?php 
$t_path = config_get_global('path');
if (utf8_strtolower($f_type) == 'id') {
    echo '<ShortName>MantisBT IssueId</ShortName>';
    echo '<Description>MantisBT Issue Id</Description>';
    echo '<InputEncoding>UTF-8</InputEncoding>';
} else {
    echo '<ShortName>MantisBT Search</ShortName>';
    echo '<Description>MantisBT Text Search</Description>';
    echo '<InputEncoding>UTF-8</InputEncoding>';
Beispiel #30
0
# config_inc.php hasn't been specified. Thus the database will not be opened
# and plugins will not be loaded.
define( 'MANTIS_MAINTENANCE_MODE', true );

# Disable output buffering and compression so that test results are returned to
# the user in near real time. This ensures that the user can see the progress
# of the tests, ensuring that the testing process hasn't frozen.
define( 'COMPRESSION_DISABLED', true );

require_once( dirname( dirname( dirname( __FILE__ ) ) ) . DIRECTORY_SEPARATOR . 'core.php' );

require_once( 'check_api.php' );

require_api( 'gpc_api.php' );
require_api( 'html_api.php' );
require_api( 'http_api.php' );

# Initialise a special error handler for use with check.php so that errors are
# not treated as being fatal. Instead, integrate error handling inline with the
# test results.
check_init_error_handler();

# Increase the time limit for this script to 5 minutes execution time as some
# of the tests may take a long time to complete.
set_time_limit( 60 * 5 );

$g_show_all = gpc_get_bool( 'show_all', false );
$g_show_errors = gpc_get_bool( 'show_errors', false );

$t_show_all_mode_link = '<a href="index.php?show_all=' . ($g_show_all ? '0' : '1') . '&amp;show_errors=' . ($g_show_errors ? '1' : '0') . '">' . ($g_show_all ? 'Hide passed tests' : 'Show passed tests') . '</a>';
$t_show_errors_mode_link = '<a href="index.php?show_all=' . ($g_show_all ? '1' : '0') . '&amp;show_errors=' . ($g_show_errors ? '0' : '1') . '">' . ($g_show_errors ? 'Hide verbose error messages' : 'Show verbose error messages') . '</a>';