/**
 * Ensures the given config is valid
 * @param string $p_config Configuration name
 * @return string|integer Config name if valid, or META_FILTER_NONE of not
 */
function check_config_value($p_config)
{
    if ($p_config != META_FILTER_NONE && !is_blank($p_config) && is_null(@config_get($p_config))) {
        return META_FILTER_NONE;
    }
    return $p_config;
}
# Get filter values
$t_filter_save = gpc_get_bool('save');
$t_filter_default = gpc_get_bool('default_filter_button', false);
$t_filter_reset = gpc_get_bool('reset_filter_button', false);
if ($t_filter_default) {
    $t_filter_user_value = ALL_USERS;
    $t_filter_project_value = ALL_PROJECTS;
    $t_filter_config_value = META_FILTER_NONE;
} else {
    if ($t_filter_reset) {
        $t_filter_user_value = META_FILTER_NONE;
        $t_filter_project_value = META_FILTER_NONE;
        $t_filter_config_value = META_FILTER_NONE;
    } else {
        $t_filter_user_value = gpc_get_int('filter_user_id', ALL_USERS);
        $t_filter_project_value = gpc_get_int('filter_project_id', ALL_PROJECTS);
        $t_filter_config_value = check_config_value(gpc_get_string('filter_config_id', META_FILTER_NONE));
    }
}
    $f_severity = gpc_get_int('severity', (int) config_get('default_bug_severity'));
    $f_priority = gpc_get_int('priority', (int) config_get('default_bug_priority'));
    $f_summary = gpc_get_string('summary', '');
    $f_description = gpc_get_string('description', '');
    $f_steps_to_reproduce = gpc_get_string('steps_to_reproduce', config_get('default_bug_steps_to_reproduce'));
    $f_additional_info = gpc_get_string('additional_info', config_get('default_bug_additional_info'));
    $f_view_state = gpc_get_int('view_state', (int) config_get('default_bug_view_status'));
    $f_due_date = gpc_get_string('due_date', '');
    if ($f_due_date == '') {
        $f_due_date = date_get_null();
    }
    $t_changed_project = false;
}
$f_report_stay = gpc_get_bool('report_stay', false);
$f_copy_notes_from_parent = gpc_get_bool('copy_notes_from_parent', false);
$f_copy_attachments_from_parent = gpc_get_bool('copy_attachments_from_parent', false);
$t_fields = config_get('bug_report_page_fields');
$t_fields = columns_filter_disabled($t_fields);
$t_show_category = in_array('category_id', $t_fields);
$t_show_reproducibility = in_array('reproducibility', $t_fields);
$t_show_eta = in_array('eta', $t_fields);
$t_show_severity = in_array('severity', $t_fields);
$t_show_priority = in_array('priority', $t_fields);
$t_show_steps_to_reproduce = in_array('steps_to_reproduce', $t_fields);
$t_show_handler = in_array('handler', $t_fields) && access_has_project_level(config_get('update_bug_assign_threshold'));
$t_show_profiles = config_get('enable_profiles');
$t_show_platform = $t_show_profiles && in_array('platform', $t_fields);
$t_show_os = $t_show_profiles && in_array('os', $t_fields);
$t_show_os_version = $t_show_profiles && in_array('os_version', $t_fields);
$t_show_resolution = in_array('resolution', $t_fields);
$t_show_status = in_array('status', $t_fields);
Example #3
0
require_api('access_api.php');
require_api('authentication_api.php');
require_api('columns_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('gpc_api.php');
require_api('print_api.php');
form_security_validate('manage_columns_copy');
auth_reauthenticate();
$f_project_id = gpc_get_int('project_id');
$f_other_project_id = gpc_get_int('other_project_id');
$f_copy_from = gpc_get_bool('copy_from');
$f_copy_to = gpc_get_bool('copy_to');
$f_manage_page = gpc_get_bool('manage_page');
if ($f_copy_from) {
    $t_src_project_id = $f_other_project_id;
    $t_dst_project_id = $f_project_id;
} else {
    if ($f_copy_to) {
        $t_src_project_id = $f_project_id;
        $t_dst_project_id = $f_other_project_id;
    } else {
        trigger_error(ERROR_GENERIC, ERROR);
    }
}
# only admins can set global defaults.for ALL_PROJECT
if ($f_manage_page && $t_dst_project_id == ALL_PROJECTS && !current_user_is_administrator()) {
    access_denied();
}
Example #4
0
 * @copyright Copyright (C) 2000 - 2002  Kenzaburo Ito - kenito@300baud.org
 * @copyright Copyright (C) 2002 - 2013  MantisBT Team - mantisbt-dev@lists.sourceforge.net
 * @link http://www.mantisbt.org
 */
/**
 * MantisBT Core API's
 */
require_once 'core.php';
require_once 'news_api.php';
require_once 'print_api.php';
news_ensure_enabled();
form_security_validate('news_add');
access_ensure_project_level(config_get('manage_news_threshold'));
$f_view_state = gpc_get_int('view_state');
$f_headline = gpc_get_string('headline');
$f_announcement = gpc_get_bool('announcement');
$f_body = gpc_get_string('body');
$t_news_id = news_create(helper_get_current_project(), auth_get_current_user_id(), $f_view_state, $f_announcement, $f_headline, $f_body);
form_security_purge('news_add');
$t_news_row = news_get_row($t_news_id);
html_page_top();
?>

<br />
<div align="center">
<?php 
echo lang_get('operation_successful') . '<br />';
print_bracket_link('news_menu_page.php', lang_get('proceed'));
echo '<br /><br />';
print_news_entry_from_row($t_news_row);
?>
require_api('html_api.php');
require_api('lang_api.php');
require_api('print_api.php');
form_security_validate('manage_custom_field_update');
auth_reauthenticate();
access_ensure_global_level(config_get('manage_custom_fields_threshold'));
$f_field_id = gpc_get_int('field_id');
$f_return = strip_tags(gpc_get_string('return', 'manage_custom_field_page.php'));
$t_values['name'] = gpc_get_string('name');
$t_values['type'] = gpc_get_int('type');
$t_values['possible_values'] = gpc_get_string('possible_values');
$t_values['default_value'] = gpc_get_string('default_value');
$t_values['valid_regexp'] = gpc_get_string('valid_regexp');
$t_values['access_level_r'] = gpc_get_int('access_level_r');
$t_values['access_level_rw'] = gpc_get_int('access_level_rw');
$t_values['length_min'] = gpc_get_int('length_min');
$t_values['length_max'] = gpc_get_int('length_max');
$t_values['display_report'] = gpc_get_bool('display_report');
$t_values['display_update'] = gpc_get_bool('display_update');
$t_values['display_resolved'] = gpc_get_bool('display_resolved');
$t_values['display_closed'] = gpc_get_bool('display_closed');
$t_values['require_report'] = gpc_get_bool('require_report');
$t_values['require_update'] = gpc_get_bool('require_update');
$t_values['require_resolved'] = gpc_get_bool('require_resolved');
$t_values['require_closed'] = gpc_get_bool('require_closed');
$t_values['filter_by'] = gpc_get_bool('filter_by');
custom_field_update($f_field_id, $t_values);
form_security_purge('manage_custom_field_update');
html_page_top(null, $f_return);
html_operation_successful($f_return);
html_page_bottom();
    $t_project_id = $t_bug->project_id;
} else {
    access_ensure_project_level(config_get('report_bug_threshold'));
    $f_product_version = gpc_get_string('product_version', '');
    $f_category = gpc_get_string('category', config_get('default_bug_category'));
    $f_reproducibility = gpc_get_int('reproducibility', config_get('default_bug_reproducibility'));
    $f_severity = gpc_get_int('severity', config_get('default_bug_severity'));
    $f_priority = gpc_get_int('priority', config_get('default_bug_priority'));
    $f_summary = gpc_get_string('summary', '');
    $f_description = gpc_get_string('description', '');
    $f_additional_info = gpc_get_string('additional_info', config_get('default_bug_additional_info'));
    $f_view_state = gpc_get_int('view_state', config_get('default_bug_view_status'));
    $t_project_id = helper_get_current_project();
    $t_changed_project = false;
}
$f_report_stay = gpc_get_bool('report_stay', false);
html_page_top1(lang_get('report_bug_link'));
html_page_top2();
print_recently_visited();
?>

<br />
<div align="center">
<form name="report_bug_form" method="post" <?php 
if (file_allow_bug_upload()) {
    echo 'enctype="multipart/form-data"';
}
?>
 action="bug_report.php">
<table class="width75" cellspacing="1">
Example #7
0
function helper_ensure_confirmed($p_message, $p_button_label)
{
    if (true == gpc_get_bool('_confirmed')) {
        return true;
    }
    html_page_top1();
    html_page_top2();
    # @@@ we need to improve this formatting.  I'd like the text to only
    #  be about 50% the width of the screen so that it doesn't become to hard
    #  to read.
    print "<br />\n<div align=\"center\">\n";
    print_hr();
    print "\n{$p_message}\n";
    print '<form method="post" action="' . $_SERVER['PHP_SELF'] . "\">\n";
    print_hidden_inputs(gpc_strip_slashes($_POST));
    print_hidden_inputs(gpc_strip_slashes($_GET));
    print "<input type=\"hidden\" name=\"_confirmed\" value=\"1\" />\n";
    print '<br /><br /><input type="submit" class="button" value="' . $p_button_label . '" />';
    print "\n</form>\n";
    print_hr();
    print "</div>\n";
    html_page_bottom1();
    exit;
}
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'));
$t_show = array(0 => plugin_lang_get('show_as_graph'), 1 => plugin_lang_get('show_as_table'));
?>
		<form name="graph_form" method="post" action="<?php 
echo plugin_page('bug_graph_page.php');
?>
">
			<table class="width100" cellspacing="1">

				<tr>
if (false == $result) {
    echo "Opening connection to database " . config_get_global('database_name') . " on host " . config_get_global('hostname') . " with username " . config_get_global('db_username') . " failed: " . db_error_msg() . "\n";
    exit(1);
}
# check to see if the new installer was used
if (-1 == config_get('database_version', -1)) {
    echo "Upgrade from the current installed MantisBT version is no longer supported.  If you are using MantisBT version older than 1.0.0, then upgrade to v1.0.0 first.";
    exit(1);
}
# read control variables with defaults
$f_hostname = gpc_get('hostname', config_get('hostname', 'localhost'));
$f_db_type = gpc_get('db_type', config_get('db_type', ''));
$f_database_name = gpc_get('database_name', config_get('database_name', 'bugtrack'));
$f_db_username = gpc_get('db_username', config_get('db_username', ''));
$f_db_password = gpc_get('db_password', config_get('db_password', ''));
$f_db_exists = gpc_get_bool('db_exists', false);
# install the tables
if (!preg_match('/^[a-zA-Z0-9_]+$/', $f_db_type) || !file_exists(dirname(dirname(__FILE__)) . DIRECTORY_SEPARATOR . 'library' . DIRECTORY_SEPARATOR . 'adodb' . DIRECTORY_SEPARATOR . 'drivers' . DIRECTORY_SEPARATOR . 'adodb-' . $f_db_type . '.inc.php')) {
    echo 'Invalid db type ' . htmlspecialchars($f_db_type) . '.';
    exit;
}
$GLOBALS['g_db_type'] = $f_db_type;
# database_api references this
require_once dirname(__FILE__) . DIRECTORY_SEPARATOR . 'schema.php';
$g_db = ADONewConnection($f_db_type);
echo "\nPost 1.0 schema changes\n";
echo "Connecting to database... ";
$t_result = @$g_db->Connect($f_hostname, $f_db_username, $f_db_password, $f_database_name);
if (false == $t_result) {
    echo "failed\n";
    exit(1);
Example #10
0
$my_filter[FILTER_PROPERTY_VIEW_STATE_ID] = gpc_get_string_array(FILTER_SEARCH_VIEW_STATE_ID, META_FILTER_ANY);
$my_filter[FILTER_PROPERTY_PRODUCT_VERSION] = gpc_get_string_array(FILTER_SEARCH_PRODUCT_VERSION, META_FILTER_ANY);
$my_filter[FILTER_PROPERTY_MATCH_TYPE] = gpc_get_int(FILTER_SEARCH_MATCH_TYPE, FILTER_MATCH_ALL);
// Filtering by Date
$my_filter[FILTER_PROPERTY_FILTER_BY_DATE] = gpc_get_bool(FILTER_SEARCH_FILTER_BY_DATE);
$my_filter[FILTER_PROPERTY_START_MONTH] = gpc_get_int(FILTER_SEARCH_START_MONTH, META_FILTER_ANY);
$my_filter[FILTER_PROPERTY_START_DAY] = gpc_get_int(FILTER_SEARCH_START_DAY, META_FILTER_ANY);
$my_filter[FILTER_PROPERTY_START_YEAR] = gpc_get_int(FILTER_SEARCH_START_YEAR, META_FILTER_ANY);
$my_filter[FILTER_PROPERTY_END_MONTH] = gpc_get_int(FILTER_SEARCH_END_MONTH, META_FILTER_ANY);
$my_filter[FILTER_PROPERTY_END_DAY] = gpc_get_int(FILTER_SEARCH_END_DAY, META_FILTER_ANY);
$my_filter[FILTER_PROPERTY_END_YEAR] = gpc_get_int(FILTER_SEARCH_END_YEAR, META_FILTER_ANY);
$my_filter[FILTER_PROPERTY_NOT_ASSIGNED] = gpc_get_bool(FILTER_SEARCH_NOT_ASSIGNED);
$my_filter[FILTER_PROPERTY_RELATIONSHIP_TYPE] = gpc_get_int(FILTER_SEARCH_RELATIONSHIP_TYPE, -1);
$my_filter[FILTER_PROPERTY_RELATIONSHIP_BUG] = gpc_get_int(FILTER_SEARCH_RELATIONSHIP_BUG, 0);
$my_filter[FILTER_PROPERTY_HIDE_STATUS_ID] = gpc_get_int(FILTER_SEARCH_HIDE_STATUS_ID, config_get('hide_status_default'));
$my_filter[FILTER_PROPERTY_SHOW_STICKY_ISSUES] = gpc_get_bool(FILTER_SEARCH_SHOW_STICKY_ISSUES, config_get('show_sticky_issues'));
$my_filter[FILTER_PROPERTY_SORT_FIELD_NAME] = gpc_get_string(FILTER_SEARCH_SORT_FIELD_NAME, '');
$my_filter[FILTER_PROPERTY_SORT_DIRECTION] = gpc_get_string(FILTER_SEARCH_SORT_DIRECTION, '');
$my_filter[FILTER_PROPERTY_ISSUES_PER_PAGE] = gpc_get_int(FILTER_SEARCH_ISSUES_PER_PAGE, config_get('default_limit_view'));
$t_highlight_changed = gpc_get_int(FILTER_SEARCH_HIGHLIGHT_CHANGED, -1);
if ($t_highlight_changed != -1) {
    $my_filter[FILTER_PROPERTY_HIGHLIGHT_CHANGED] = $t_highlight_changed;
}
# Handle custom fields.
$t_custom_fields = array();
foreach ($_GET as $t_var_name => $t_var_value) {
    if (strpos($t_var_name, 'custom_field_') === 0) {
        $t_custom_field_id = utf8_substr($t_var_name, 13);
        $t_custom_fields[$t_custom_field_id] = $t_var_value;
    }
}
# along with Mantis.  If not, see <http://www.gnu.org/licenses/>.
# --------------------------------------------------------
# $Id: bug_view_advanced_page.php,v 1.87.2.1 2007-10-13 22:32:59 giallu Exp $
# --------------------------------------------------------
require_once 'core.php';
$t_core_path = config_get('core_path');
require_once $t_core_path . 'bug_api.php';
require_once $t_core_path . 'custom_field_api.php';
require_once $t_core_path . 'file_api.php';
require_once $t_core_path . 'compress_api.php';
require_once $t_core_path . 'date_api.php';
require_once $t_core_path . 'relationship_api.php';
require_once $t_core_path . 'last_visited_api.php';
require_once $t_core_path . 'tag_api.php';
$f_bug_id = gpc_get_int('bug_id');
$f_history = gpc_get_bool('history', config_get('history_default_visible'));
bug_ensure_exists($f_bug_id);
access_ensure_bug_level(VIEWER, $f_bug_id);
$t_bug = bug_prepare_display(bug_get($f_bug_id, true));
if ($t_bug->project_id != helper_get_current_project()) {
    # in case the current project is not the same project of the bug we are viewing...
    # ... override the current project. This to avoid problems with categories and handlers lists etc.
    $g_project_override = $t_bug->project_id;
}
if (SIMPLE_ONLY == config_get('show_view')) {
    print_header_redirect('bug_view_page.php?bug_id=' . $f_bug_id);
}
compress_enable();
html_page_top1(bug_format_summary($f_bug_id, SUMMARY_CAPTION));
html_page_top2();
print_recently_visited();
Example #12
0
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);
if ($f_view_state == VS_PRIVATE && false === current_user_is_administrator()) {
    $t_access_level = access_get_global_level();
    $t_current_user_id = auth_get_current_user_id();
    project_add_user($t_project_id, $t_current_user_id, $t_access_level);
}
if (0 != $f_parent_id) {
    project_hierarchy_add($t_project_id, $f_parent_id, $f_inherit_parent);
}
event_signal('EVENT_MANAGE_PROJECT_CREATE', array($t_project_id));
form_security_purge('manage_proj_create');
Example #13
0
# 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/>.
$t_plugin_path = config_get('plugin_path');
require_once $t_plugin_path . 'XmlImportExport' . DIRECTORY_SEPARATOR . 'ImportXml.php';
form_security_validate('plugin_xml_import_action');
auth_reauthenticate();
//var_dump( $_POST );
$f_file = gpc_get_file('file', -1);
$f_strategy = gpc_get_string('strategy');
$f_fallback = gpc_get_string('fallback');
$f_project = gpc_get_int('project_id');
// not used, but ensures a project is selected
$f_keepcategory = gpc_get_bool('keepcategory');
$f_defaultcategory = gpc_get_int('defaultcategory');
file_ensure_uploaded($f_file);
$importer = new ImportXML($f_file, $f_strategy, $f_fallback, $f_keepcategory, $f_defaultcategory);
form_security_purge('plugin_xml_import_action');
html_page_top(plugin_lang_get('import'));
print_manage_menu('manage_import_issues_page.php');
echo "<pre>\n";
$importer->import();
echo "</pre>\n";
html_page_bottom();
<?php

# Mantis - a php based bugtracking system
# Copyright (C) 2000 - 2002  Kenzaburo Ito - kenito@300baud.org
# Copyright (C) 2002 - 2004  Mantis Team   - mantisbt-dev@lists.sourceforge.net
# This program is distributed under the terms and conditions of the GPL
# See the README and LICENSE files for details
# --------------------------------------------------------
# $Id: manage_user_update.php,v 1.37.12.1 2007/03/06 07:00:33 vboctor Exp $
# --------------------------------------------------------
require_once 'core.php';
$t_core_path = config_get('core_path');
require_once $t_core_path . 'email_api.php';
access_ensure_global_level(config_get('manage_user_threshold'));
$f_protected = gpc_get_bool('protected');
$f_enabled = gpc_get_bool('enabled');
$f_email = gpc_get_string('email', '');
$f_username = gpc_get_string('username', '');
$f_realname = gpc_get_string('realname', '');
$f_access_level = gpc_get_int('access_level');
$f_user_id = gpc_get_int('user_id');
$f_email = trim($f_email);
$f_username = trim($f_username);
$t_old_username = user_get_field($f_user_id, 'username');
# check that the username is unique
if (0 != strcasecmp($t_old_username, $f_username) && false == user_is_name_unique($f_username)) {
    trigger_error(ERROR_USER_NAME_NOT_UNIQUE, ERROR);
}
user_ensure_name_valid($f_username);
user_ensure_realname_valid($f_realname);
user_ensure_realname_unique($f_username, $f_realname);
# 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 Mantis.  If not, see <http://www.gnu.org/licenses/>.
# --------------------------------------------------------
# $Id: manage_proj_ver_add.php,v 1.31.2.1 2007-10-13 22:33:45 giallu Exp $
# --------------------------------------------------------
require_once 'core.php';
$t_core_path = config_get('core_path');
require_once $t_core_path . 'version_api.php';
form_security_validate('manage_proj_ver_add');
auth_reauthenticate();
$f_project_id = gpc_get_int('project_id');
$f_version = gpc_get_string('version');
$f_add_and_edit = gpc_get_bool('add_and_edit_version');
access_ensure_project_level(config_get('manage_project_threshold'), $f_project_id);
if (is_blank($f_version)) {
    trigger_error(ERROR_EMPTY_FIELD, ERROR);
}
# We reverse the array so that if the user enters multiple versions
#  they will likely appear with the last item entered at the top of the list
#  (i.e. in reverse chronological order).  Unless we find a way to make the
#  date_order fields different for each one, however, this is fragile, since
#  the DB may actually pull the rows out in any order
$t_versions = array_reverse(explode('|', $f_version));
$t_version_count = count($t_versions);
foreach ($t_versions as $t_version) {
    if (is_blank($t_version)) {
        continue;
    }
require_api( 'authentication_api.php' );
require_api( 'config_api.php' );
require_api( 'constant_inc.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_user_copy' );

auth_reauthenticate();

$f_project_id		= gpc_get_int( 'project_id' );
$f_other_project_id	= gpc_get_int( 'other_project_id' );
$f_copy_from		= gpc_get_bool( 'copy_from' );
$f_copy_to			= gpc_get_bool( 'copy_to' );

if ( $f_copy_from ) {
	$t_src_project_id = $f_other_project_id;
	$t_dst_project_id = $f_project_id;
} else if ( $f_copy_to ) {
	$t_src_project_id = $f_project_id;
	$t_dst_project_id = $f_other_project_id;
} else {
	/** @todo Should this become a separate error? */
	trigger_error( ERROR_CATEGORY_NO_ACTION, ERROR );
}

# We should check both since we are in the project section and an
#  admin might raise the first threshold and not realize they need
#  to raise the second
Example #17
0
require_api('current_user_api.php');
require_api('database_api.php');
require_api('gpc_api.php');
require_api('html_api.php');
require_api('lang_api.php');
require_api('print_api.php');
require_api('string_api.php');
require_api('user_api.php');
require_api('utility_api.php');
require_css('login.css');
$f_error = gpc_get_bool('error');
$f_cookie_error = gpc_get_bool('cookie_error');
$f_return = string_sanitize_url(gpc_get_string('return', ''));
$f_username = gpc_get_string('username', '');
$f_perm_login = gpc_get_bool('perm_login', false);
$f_secure_session = gpc_get_bool('secure_session', false);
$f_secure_session_cookie = gpc_get_cookie(config_get_global('cookie_prefix') . '_secure_session', null);
# Set username to blank if invalid to prevent possible XSS exploits
if (!user_is_name_valid($f_username)) {
    $f_username = '';
}
$t_session_validation = ON == config_get_global('session_validation');
# If user is already authenticated and not anonymous
if (auth_is_user_authenticated() && !current_user_is_anonymous()) {
    # If return URL is specified redirect to it; otherwise use default page
    if (!is_blank($f_return)) {
        print_header_redirect($f_return, false, false, true);
    } else {
        print_header_redirect(config_get('default_home_page'));
    }
}
 * Insert the bugnote into the database then redirect to the bug page
 *
 * @package MantisBT
 * @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
 */
/**
 * MantisBT Core API's
 */
require_once 'core.php';
require_once 'bug_api.php';
require_once 'bugnote_api.php';
form_security_validate('bugnote_add');
$f_bug_id = gpc_get_int('bug_id');
$f_private = gpc_get_bool('private');
$f_time_tracking = gpc_get_string('time_tracking', '0:00');
$f_bugnote_text = trim(gpc_get_string('bugnote_text', ''));
$t_bug = bug_get($f_bug_id, true);
if ($t_bug->project_id != helper_get_current_project()) {
    # in case the current project is not the same project of the bug we are viewing...
    # ... override the current project. This to avoid problems with categories and handlers lists etc.
    $g_project_override = $t_bug->project_id;
}
if (bug_is_readonly($f_bug_id)) {
    error_parameters($f_bug_id);
    trigger_error(ERROR_BUG_READ_ONLY_ACTION_DENIED, ERROR);
}
access_ensure_bug_level(config_get('add_bugnote_threshold'), $f_bug_id);
// We always set the note time to BUGNOTE, and the API will overwrite it with TIME_TRACKING
// if $f_time_tracking is not 0 and the time tracking feature is enabled.
    $t_custom_fields = custom_field_get_linked_ids($t_project_id);
    foreach ($t_custom_fields as $t_cfid) {
        $t_field_info = custom_field_cache_row($t_cfid, true);
        if ($t_field_info['access_level_r'] <= $t_current_user_access_level) {
            $t_accessible_custom_fields_ids[] = $t_cfid;
            $t_accessible_custom_fields_names[] = $t_field_info['name'];
            $t_accessible_custom_fields_types[] = $t_field_info['type'];
            $t_accessible_custom_fields_values[] = custom_field_distinct_values($t_field_info, $t_project_id);
        }
    }
    if (count($t_accessible_custom_fields_ids) > 0) {
        $t_per_row = config_get('filter_custom_fields_per_row');
        $t_custom_rows = ceil(count($t_accessible_custom_fields_ids) / $t_per_row);
    }
}
$f_for_screen = gpc_get_bool('for_screen', true);
$t_sort = $t_filter[FILTER_PROPERTY_SORT_FIELD_NAME];
$t_dir = $t_filter[FILTER_PROPERTY_SORT_DIRECTION];
$t_action = "view_all_set.php?f=3";
if ($f_for_screen == false) {
    $t_action = "view_all_set.php";
}
$f_default_view_type = 'simple';
if (ADVANCED_DEFAULT == config_get('view_filters')) {
    $f_default_view_type = 'advanced';
}
$f_view_type = gpc_get_string('view_type', $f_default_view_type);
if (ADVANCED_ONLY == config_get('view_filters')) {
    $f_view_type = 'advanced';
}
if (SIMPLE_ONLY == config_get('view_filters')) {
Example #20
0
require_api('file_api.php');
require_api('form_api.php');
require_api('gpc_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('project_hierarchy_api.php');
require_api('string_api.php');
require_api('user_api.php');
require_api('utility_api.php');
require_api('version_api.php');
auth_reauthenticate();
$f_project_id = gpc_get_int('project_id');
$f_show_global_users = gpc_get_bool('show_global_users');
project_ensure_exists($f_project_id);
access_ensure_project_level(config_get('manage_project_threshold'), $f_project_id);
$row = project_get_row($f_project_id);
$t_can_manage_users = access_has_project_level(config_get('project_user_threshold'), $f_project_id);
html_page_top(project_get_field($f_project_id, 'name'));
print_manage_menu('manage_proj_edit_page.php');
?>
<br />
<!-- PROJECT PROPERTIES -->
<div align="center">
<form method="post" action="manage_proj_update.php">
<?php 
echo form_security_field('manage_proj_update');
?>
<table class="width75" cellspacing="1">
Example #21
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');
Example #22
0
#
# You should have received a copy of the GNU General Public License
# along with MantisBT.  If not, see <http://www.gnu.org/licenses/>.
/**
 * Display warning to users before upgrading MantisBT
 * @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
 */
require_once dirname(dirname(__FILE__)) . '/core.php';
access_ensure_global_level(config_get_global('admin_site_threshold'));
$g_error_send_page_header = false;
# suppress page headers in the error handler
# @@@ upgrade list moved to the bottom of upgrade_inc.php
$f_advanced = gpc_get_bool('advanced', false);
html_begin();
?>
<head>
<title>MantisBT Administration - Check Installation </title>
<link rel="stylesheet" type="text/css" href="admin.css" />
</head>
<body>

<table width="100%" cellspacing="0" cellpadding="0" bgcolor="#ffffff">
	<tr class="top-bar">
		<td class="links">
			[ <a href="index.php">Back to Administration</a> ]
		</td>
		<td class="title">
			Upgrade Installation
Example #23
0
/**
 * Make sure that our filters are entirely correct and complete (it is possible that they are not).
 * We need to do this to cover cases where we don't have complete control over the filters given.
 * @param array $p_filter_arr A Filter definition.
 * @return array
 * @todo function needs to be abstracted
 */
function filter_ensure_valid_filter(array $p_filter_arr)
{
    # extend current filter to add information passed via POST
    if (!isset($p_filter_arr['_version'])) {
        $p_filter_arr['_version'] = FILTER_VERSION;
    }
    $t_cookie_vers = (int) substr($p_filter_arr['_version'], 1);
    if (substr(FILTER_VERSION, 1) > $t_cookie_vers) {
        # if the version is old, update it
        $p_filter_arr['_version'] = FILTER_VERSION;
    }
    if (!isset($p_filter_arr['_view_type'])) {
        $p_filter_arr['_view_type'] = gpc_get_string('view_type', 'simple');
    }
    if (!isset($p_filter_arr[FILTER_PROPERTY_ISSUES_PER_PAGE])) {
        $p_filter_arr[FILTER_PROPERTY_ISSUES_PER_PAGE] = gpc_get_int(FILTER_PROPERTY_ISSUES_PER_PAGE, config_get('default_limit_view'));
    }
    if (!isset($p_filter_arr[FILTER_PROPERTY_HIGHLIGHT_CHANGED])) {
        $p_filter_arr[FILTER_PROPERTY_HIGHLIGHT_CHANGED] = config_get('default_show_changed');
    }
    if (!isset($p_filter_arr[FILTER_PROPERTY_STICKY])) {
        $p_filter_arr[FILTER_PROPERTY_STICKY] = gpc_string_to_bool(config_get('show_sticky_issues'));
    }
    if (!isset($p_filter_arr[FILTER_PROPERTY_SORT_FIELD_NAME])) {
        $p_filter_arr[FILTER_PROPERTY_SORT_FIELD_NAME] = 'last_updated';
    }
    if (!isset($p_filter_arr[FILTER_PROPERTY_SORT_DIRECTION])) {
        $p_filter_arr[FILTER_PROPERTY_SORT_DIRECTION] = 'DESC';
    }
    if (!isset($p_filter_arr[FILTER_PROPERTY_PLATFORM])) {
        $p_filter_arr[FILTER_PROPERTY_PLATFORM] = array(0 => (string) META_FILTER_ANY);
    }
    if (!isset($p_filter_arr[FILTER_PROPERTY_OS])) {
        $p_filter_arr[FILTER_PROPERTY_OS] = array(0 => (string) META_FILTER_ANY);
    }
    if (!isset($p_filter_arr[FILTER_PROPERTY_OS_BUILD])) {
        $p_filter_arr[FILTER_PROPERTY_OS_BUILD] = array(0 => (string) META_FILTER_ANY);
    }
    if (!isset($p_filter_arr[FILTER_PROPERTY_PROJECT_ID])) {
        $p_filter_arr[FILTER_PROPERTY_PROJECT_ID] = array(0 => META_FILTER_CURRENT);
    }
    if (!isset($p_filter_arr[FILTER_PROPERTY_START_MONTH])) {
        $p_filter_arr[FILTER_PROPERTY_START_MONTH] = gpc_get_string(FILTER_PROPERTY_START_MONTH, date('m'));
    }
    if (!isset($p_filter_arr[FILTER_PROPERTY_START_DAY])) {
        $p_filter_arr[FILTER_PROPERTY_START_DAY] = gpc_get_string(FILTER_PROPERTY_START_DAY, 1);
    }
    if (!isset($p_filter_arr[FILTER_PROPERTY_START_YEAR])) {
        $p_filter_arr[FILTER_PROPERTY_START_YEAR] = gpc_get_string(FILTER_PROPERTY_START_YEAR, date('Y'));
    }
    if (!isset($p_filter_arr[FILTER_PROPERTY_END_MONTH])) {
        $p_filter_arr[FILTER_PROPERTY_END_MONTH] = gpc_get_string(FILTER_PROPERTY_END_MONTH, date('m'));
    }
    if (!isset($p_filter_arr[FILTER_PROPERTY_END_DAY])) {
        $p_filter_arr[FILTER_PROPERTY_END_DAY] = gpc_get_string(FILTER_PROPERTY_END_DAY, date('d'));
    }
    if (!isset($p_filter_arr[FILTER_PROPERTY_END_YEAR])) {
        $p_filter_arr[FILTER_PROPERTY_END_YEAR] = gpc_get_string(FILTER_PROPERTY_END_YEAR, date('Y'));
    }
    if (!isset($p_filter_arr[FILTER_PROPERTY_SEARCH])) {
        $p_filter_arr[FILTER_PROPERTY_SEARCH] = '';
    }
    if (!isset($p_filter_arr[FILTER_PROPERTY_FILTER_BY_DATE])) {
        $p_filter_arr[FILTER_PROPERTY_FILTER_BY_DATE] = gpc_get_bool(FILTER_PROPERTY_FILTER_BY_DATE, false);
    }
    if (!isset($p_filter_arr[FILTER_PROPERTY_VIEW_STATE])) {
        $p_filter_arr[FILTER_PROPERTY_VIEW_STATE] = gpc_get(FILTER_PROPERTY_VIEW_STATE, META_FILTER_ANY);
    } else {
        if (filter_field_is_any($p_filter_arr[FILTER_PROPERTY_VIEW_STATE])) {
            $p_filter_arr[FILTER_PROPERTY_VIEW_STATE] = META_FILTER_ANY;
        }
    }
    if (!isset($p_filter_arr[FILTER_PROPERTY_RELATIONSHIP_TYPE])) {
        $p_filter_arr[FILTER_PROPERTY_RELATIONSHIP_TYPE] = gpc_get_int(FILTER_PROPERTY_RELATIONSHIP_TYPE, -1);
    }
    if (!isset($p_filter_arr[FILTER_PROPERTY_RELATIONSHIP_BUG])) {
        $p_filter_arr[FILTER_PROPERTY_RELATIONSHIP_BUG] = gpc_get_int(FILTER_PROPERTY_RELATIONSHIP_BUG, 0);
    }
    if (!isset($p_filter_arr[FILTER_PROPERTY_TARGET_VERSION])) {
        $p_filter_arr[FILTER_PROPERTY_TARGET_VERSION] = (string) META_FILTER_ANY;
    }
    if (!isset($p_filter_arr[FILTER_PROPERTY_TAG_STRING])) {
        $p_filter_arr[FILTER_PROPERTY_TAG_STRING] = gpc_get_string(FILTER_PROPERTY_TAG_STRING, '');
    }
    if (!isset($p_filter_arr[FILTER_PROPERTY_TAG_SELECT])) {
        $p_filter_arr[FILTER_PROPERTY_TAG_SELECT] = gpc_get_string(FILTER_PROPERTY_TAG_SELECT, '');
    }
    if (!isset($p_filter_arr[FILTER_PROPERTY_MATCH_TYPE])) {
        $p_filter_arr[FILTER_PROPERTY_MATCH_TYPE] = gpc_get_int(FILTER_PROPERTY_MATCH_TYPE, FILTER_MATCH_ALL);
    }
    # initialize plugin filters
    $t_plugin_filters = filter_get_plugin_filters();
    foreach ($t_plugin_filters as $t_field_name => $t_filter_object) {
        if (!isset($p_filter_arr[$t_field_name])) {
            switch ($t_filter_object->type) {
                case FILTER_TYPE_STRING:
                    $p_filter_arr[$t_field_name] = gpc_get_string($t_field_name, $t_filter_object->default);
                    break;
                case FILTER_TYPE_INT:
                    $p_filter_arr[$t_field_name] = gpc_get_int($t_field_name, (int) $t_filter_object->default);
                    break;
                case FILTER_TYPE_BOOLEAN:
                    $p_filter_arr[$t_field_name] = gpc_get_bool($t_field_name, (bool) $t_filter_object->default);
                    break;
                case FILTER_TYPE_MULTI_STRING:
                    $p_filter_arr[$t_field_name] = gpc_get_string_array($t_field_name, array(0 => (string) META_FILTER_ANY));
                    break;
                case FILTER_TYPE_MULTI_INT:
                    $p_filter_arr[$t_field_name] = gpc_get_int_array($t_field_name, array(0 => META_FILTER_ANY));
                    break;
                default:
                    $p_filter_arr[$t_field_name] = (string) META_FILTER_ANY;
            }
        }
        if (!$t_filter_object->validate($p_filter_arr[$t_field_name])) {
            $p_filter_arr[$t_field_name] = $t_filter_object->default;
        }
    }
    $t_custom_fields = custom_field_get_ids();
    # @@@ (thraxisp) This should really be the linked ids, but we don't know the project
    $f_custom_fields_data = array();
    if (is_array($t_custom_fields) && count($t_custom_fields) > 0) {
        foreach ($t_custom_fields as $t_cfid) {
            if (is_array(gpc_get('custom_field_' . $t_cfid, null))) {
                $f_custom_fields_data[$t_cfid] = gpc_get_string_array('custom_field_' . $t_cfid, array(META_FILTER_ANY));
            } else {
                $f_custom_fields_data[$t_cfid] = gpc_get_string('custom_field_' . $t_cfid, (string) META_FILTER_ANY);
                $f_custom_fields_data[$t_cfid] = array($f_custom_fields_data[$t_cfid]);
            }
        }
    }
    # validate sorting
    $t_fields = helper_get_columns_to_view();
    $t_n_fields = count($t_fields);
    for ($i = 0; $i < $t_n_fields; $i++) {
        if (isset($t_fields[$i]) && in_array($t_fields[$i], array('selection', 'edit', 'bugnotes_count', 'attachment_count'))) {
            unset($t_fields[$i]);
        }
    }
    # Make sure array is no longer than 2 elements
    $t_sort_fields = explode(',', $p_filter_arr['sort']);
    if (count($t_sort_fields) > 2) {
        $t_sort_fields = array_slice($t_sort_fields, 0, 2);
    }
    # Make sure array is no longer than 2 elements
    $t_dir_fields = explode(',', $p_filter_arr['dir']);
    if (count($t_dir_fields) > 2) {
        $t_dir_fields = array_slice($t_dir_fields, 0, 2);
    }
    # Validate the max of two segments for $t_sort_fields and $t_dir_fields
    for ($i = 0; $i < 2; $i++) {
        if (isset($t_sort_fields[$i])) {
            $t_drop = false;
            $t_sort = $t_sort_fields[$i];
            if (strpos($t_sort, 'custom_') === 0) {
                if (false === custom_field_get_id_from_name(utf8_substr($t_sort, utf8_strlen('custom_')))) {
                    $t_drop = true;
                }
            } else {
                if (!in_array($t_sort, $t_fields)) {
                    $t_drop = true;
                }
            }
            if (!in_array($t_dir_fields[$i], array('ASC', 'DESC'))) {
                $t_drop = true;
            }
            if ($t_drop) {
                unset($t_sort_fields[$i]);
                unset($t_dir_fields[$i]);
            }
        }
    }
    if (count($t_sort_fields) > 0) {
        $p_filter_arr['sort'] = implode(',', $t_sort_fields);
        $p_filter_arr['dir'] = implode(',', $t_dir_fields);
    } else {
        $p_filter_arr['sort'] = 'last_updated';
        $p_filter_arr['dir'] = 'DESC';
    }
    # validate or filter junk from other fields
    $t_multi_select_list = array(FILTER_PROPERTY_CATEGORY_ID => 'string', FILTER_PROPERTY_SEVERITY => 'int', FILTER_PROPERTY_STATUS => 'int', FILTER_PROPERTY_REPORTER_ID => 'int', FILTER_PROPERTY_HANDLER_ID => 'int', FILTER_PROPERTY_NOTE_USER_ID => 'int', FILTER_PROPERTY_RESOLUTION => 'int', FILTER_PROPERTY_PRIORITY => 'int', FILTER_PROPERTY_BUILD => 'string', FILTER_PROPERTY_VERSION => 'string', FILTER_PROPERTY_HIDE_STATUS => 'int', FILTER_PROPERTY_FIXED_IN_VERSION => 'string', FILTER_PROPERTY_TARGET_VERSION => 'string', FILTER_PROPERTY_MONITOR_USER_ID => 'int', FILTER_PROPERTY_PROFILE_ID => 'int');
    foreach ($t_multi_select_list as $t_multi_field_name => $t_multi_field_type) {
        if (!isset($p_filter_arr[$t_multi_field_name])) {
            if (FILTER_PROPERTY_HIDE_STATUS == $t_multi_field_name) {
                $p_filter_arr[$t_multi_field_name] = array(config_get('hide_status_default'));
            } else {
                if ('custom_fields' == $t_multi_field_name) {
                    $p_filter_arr[$t_multi_field_name] = array($f_custom_fields_data);
                } else {
                    $p_filter_arr[$t_multi_field_name] = array(META_FILTER_ANY);
                }
            }
        } else {
            if (!is_array($p_filter_arr[$t_multi_field_name])) {
                $p_filter_arr[$t_multi_field_name] = array($p_filter_arr[$t_multi_field_name]);
            }
            $t_checked_array = array();
            foreach ($p_filter_arr[$t_multi_field_name] as $t_filter_value) {
                $t_filter_value = stripslashes($t_filter_value);
                if ($t_filter_value === 'any' || $t_filter_value === '[any]') {
                    $t_filter_value = META_FILTER_ANY;
                }
                if ($t_filter_value === 'none' || $t_filter_value === '[none]') {
                    $t_filter_value = META_FILTER_NONE;
                }
                if ('string' == $t_multi_field_type) {
                    $t_checked_array[] = $t_filter_value;
                } else {
                    if ('int' == $t_multi_field_type) {
                        $t_checked_array[] = (int) $t_filter_value;
                    } else {
                        if ('array' == $t_multi_field_type) {
                            $t_checked_array[] = $t_filter_value;
                        }
                    }
                }
            }
            $p_filter_arr[$t_multi_field_name] = $t_checked_array;
        }
    }
    if (is_array($t_custom_fields) && count($t_custom_fields) > 0) {
        foreach ($t_custom_fields as $t_cfid) {
            if (!isset($p_filter_arr['custom_fields'][$t_cfid])) {
                $p_filter_arr['custom_fields'][$t_cfid] = array(META_FILTER_ANY);
            } else {
                if (!is_array($p_filter_arr['custom_fields'][$t_cfid])) {
                    $p_filter_arr['custom_fields'][$t_cfid] = array($p_filter_arr['custom_fields'][$t_cfid]);
                }
                $t_checked_array = array();
                foreach ($p_filter_arr['custom_fields'][$t_cfid] as $t_filter_value) {
                    $t_filter_value = stripslashes($t_filter_value);
                    if ($t_filter_value === 'any' || $t_filter_value === '[any]') {
                        $t_filter_value = META_FILTER_ANY;
                    }
                    $t_checked_array[] = $t_filter_value;
                }
                $p_filter_arr['custom_fields'][$t_cfid] = $t_checked_array;
            }
        }
    }
    # all of our filter values are now guaranteed to be there, and correct.
    return $p_filter_arr;
}
Example #24
0
require_api('form_api.php');
require_api('gpc_api.php');
require_api('helper_api.php');
require_api('html_api.php');
require_api('lang_api.php');
require_api('print_api.php');
require_api('string_api.php');
require_api('utility_api.php');
require_api('version_api.php');
auth_ensure_user_authenticated();
helper_begin_long_process();
$f_action = gpc_get_string('action');
$f_custom_field_id = gpc_get_int('custom_field_id', 0);
$f_bug_arr = gpc_get_int_array('bug_arr', array());
$f_bug_notetext = gpc_get_string('bugnote_text', '');
$f_bug_noteprivate = gpc_get_bool('private');
$t_form_name = 'bug_actiongroup_' . $f_action;
form_security_validate($t_form_name);
$t_custom_group_actions = config_get('custom_group_actions');
foreach ($t_custom_group_actions as $t_custom_group_action) {
    if ($f_action == $t_custom_group_action['action']) {
        require_once $t_custom_group_action['action_page'];
        exit;
    }
}
$t_failed_ids = array();
if (0 != $f_custom_field_id) {
    $t_custom_field_def = custom_field_get_definition($f_custom_field_id);
}
foreach ($f_bug_arr as $t_bug_id) {
    bug_ensure_exists($t_bug_id);
Example #25
0
require_api('html_api.php');
require_api('lang_api.php');
require_api('print_api.php');
require_api('project_api.php');
require_api('sponsorship_api.php');
require_api('string_api.php');
require_api('version_api.php');
require_css('status_config.php');
if (!config_get('enable_sponsorship')) {
    trigger_error(ERROR_SPONSORSHIP_NOT_ENABLED, ERROR);
}
# anonymous users are not allowed to sponsor issues
if (current_user_is_anonymous()) {
    access_denied();
}
$t_show_all = gpc_get_bool('show_all', false);
# start the page
html_page_top(lang_get('my_sponsorship'));
$t_project = helper_get_current_project();
?>
<br />
<table class="width100" cellspacing="1">
<tr>
	<td class="form-title">
		<?php 
echo lang_get('my_sponsorship');
?>
	</td>
	<td class="right">
		<?php 
print_account_menu('account_sponsor_page.php');
Example #26
0
    $t_project_id = $t_bug->project_id;
} else {
    access_ensure_project_level(config_get('report_bug_threshold'));
    $f_product_version = gpc_get_string('product_version', '');
    $f_category = gpc_get_string('category', '');
    $f_reproducibility = gpc_get_int('reproducibility', 0);
    $f_severity = gpc_get_int('severity', config_get('default_bug_severity'));
    $f_priority = gpc_get_int('priority', config_get('default_bug_priority'));
    $f_summary = gpc_get_string('summary', '');
    $f_description = gpc_get_string('description', '');
    $f_additional_info = gpc_get_string('additional_info', config_get('default_bug_additional_info'));
    $f_view_state = gpc_get_int('view_state', config_get('default_bug_view_status'));
    $t_project_id = helper_get_current_project();
    $t_changed_project = false;
}
$f_report_stay = gpc_get_bool('report_stay');
html_page_top1(lang_get('report_bug_link'));
html_page_top2();
?>

<br />
<div align="center">
<form name="report_bug_form" method="post" <?php 
if (file_allow_bug_upload()) {
    echo 'enctype="multipart/form-data"';
}
?>
 action="bug_report.php">
<table class="width75" cellspacing="1">

Example #27
0
 * @copyright Copyright (C) 2002 - 2013  MantisBT Team - mantisbt-dev@lists.sourceforge.net
 * @link http://www.mantisbt.org
 */
/**
 * MantisBT Core API's
 */
require_once 'core.php';
require_once 'Period.php';
require_once 'graph_api.php';
access_ensure_project_level(config_get('view_summary_threshold'));
$f_width = gpc_get_int('width', 600);
$t_ar = plugin_config_get('bar_aspect');
$t_interval = new Period();
$t_interval->set_period_from_selector('interval');
$f_show_as_table = gpc_get_bool('show_table', FALSE);
$f_summary = gpc_get_bool('summary', FALSE);
$t_interval_days = $t_interval->get_elapsed_days();
if ($t_interval_days <= 14) {
    $t_incr = 60 * 60;
    // less than 14 days, use hourly
} else {
    if ($t_interval_days <= 92) {
        $t_incr = 24 * 60 * 60;
        // less than three months, use daily
    } else {
        $t_incr = 7 * 24 * 60 * 60;
        // otherwise weekly
    }
}
$f_page_number = 1;
$t_per_page = -1;
Example #28
0
 * 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 Slack Integration; if not, write to the Free Software
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA
 * or see http://www.gnu.org/licenses/.
 */
form_security_validate('plugin_Slack_config_edit');
auth_reauthenticate();
access_ensure_global_level(config_get('manage_plugin_threshold'));
$f_url_webhook = gpc_get_string('url_webhook');
$f_bot_name = gpc_get_string('bot_name');
$f_bot_icon = gpc_get_string('bot_icon');
$f_skip_bulk = gpc_get_bool('skip_bulk');
$f_default_channel = gpc_get_string('default_channel');
if (plugin_config_get('url_webhook') != $f_url_webhook) {
    plugin_config_set('url_webhook', $f_url_webhook);
}
if (plugin_config_get('bot_name') != $f_bot_name) {
    plugin_config_set('bot_name', $f_bot_name);
}
if (plugin_config_get('bot_icon') != $f_bot_icon) {
    plugin_config_set('bot_icon', $f_bot_icon);
}
if (plugin_config_get('skip_bulk') != $f_skip_bulk) {
    plugin_config_set('skip_bulk', $f_skip_bulk);
}
if (plugin_config_get('default_channel') != $f_default_channel) {
    plugin_config_set('default_channel', $f_default_channel);
Example #29
0
 * @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();
    db_query_bound($t_query, array($f_priority, $f_protected, $t_basename));
}
form_security_purge('manage_plugin_update');
print_successful_redirect('manage_plugin_page.php');
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with Mantis.  If not, see <http://www.gnu.org/licenses/>.
# --------------------------------------------------------
# $Id: manage_user_page.php,v 1.64.2.1 2007-10-13 22:33:55 giallu Exp $
# --------------------------------------------------------
require_once 'core.php';
$t_core_path = config_get('core_path');
require_once $t_core_path . 'icon_api.php';
auth_reauthenticate();
access_ensure_global_level(config_get('manage_user_threshold'));
$f_sort = gpc_get_string('sort', 'username');
$f_dir = gpc_get_string('dir', 'ASC');
$f_hide = gpc_get_bool('hide');
$f_save = gpc_get_bool('save');
$f_prefix = strtoupper(gpc_get_string('prefix', config_get('default_manage_user_prefix')));
$t_user_table = config_get('mantis_user_table');
$t_cookie_name = config_get('manage_cookie');
$t_lock_image = '<img src="' . config_get('icon_path') . 'protected.gif" width="8" height="15" border="0" alt="' . lang_get('protected') . '" />';
# Clean up the form variables
if (!in_array($f_sort, db_field_names($t_user_table))) {
    $c_sort = 'username';
} else {
    $c_sort = addslashes($f_sort);
}
if ($f_dir == 'ASC') {
    $c_dir = 'ASC';
} else {
    $c_dir = 'DESC';
}