Exemplo n.º 1
0
function print_successful_redirect($p_redirect_to)
{
    if (helper_show_queries()) {
        html_meta_redirect($p_redirect_to);
        html_page_top1();
        html_page_top2();
        print '<br /><div class="center">';
        print lang_get('operation_successful') . '<br />';
        print_bracket_link($p_redirect_to, lang_get('proceed'));
        print '</div>';
        html_page_bottom1();
    } else {
        print_header_redirect($p_redirect_to);
    }
}
require_once 'core.php';
$t_core_path = config_get('core_path');
require_once $t_core_path . 'custom_field_api.php';
form_security_validate('manage_custom_field_delete');
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_definition = custom_field_get_definition($f_field_id);
if (0 < count(custom_field_get_project_ids($f_field_id))) {
    helper_ensure_confirmed(lang_get('confirm_used_custom_field_deletion') . '<br/>' . lang_get('custom_field') . ': ' . string_attribute($t_definition['name']), lang_get('field_delete_button'));
} else {
    helper_ensure_confirmed(lang_get('confirm_custom_field_deletion') . '<br/>' . lang_get('custom_field') . ': ' . string_attribute($t_definition['name']), lang_get('field_delete_button'));
}
custom_field_destroy($f_field_id);
form_security_purge('manage_custom_field_delete');
html_page_top1();
html_meta_redirect($f_return);
html_page_top2();
?>

<br />
<div align="center">
<?php 
echo lang_get('operation_successful') . '<br />';
print_bracket_link($f_return, lang_get('proceed'));
?>
</div>

<?php 
html_page_bottom1(__FILE__);
Exemplo n.º 3
0
        if (1 == $t_version_count) {
            # We only error out on duplicates when a single value was
            #  given.  If multiple values were given, we just add the
            #  ones we can.  The others already exist so it isn't really
            #  an error.
            trigger_error(ERROR_VERSION_DUPLICATE, ERROR);
        }
    }
}
form_security_purge('manage_proj_ver_add');
if (true == $f_add_and_edit) {
    $t_version_id = version_get_id($t_version, $f_project_id);
    $t_redirect_url = 'manage_proj_ver_edit_page.php?version_id=' . $t_version_id;
} else {
    $t_redirect_url = 'manage_proj_edit_page.php?project_id=' . $f_project_id;
}
html_page_top1();
html_meta_redirect($t_redirect_url);
html_page_top2();
?>

<br />
<div align="center">
<?php 
echo lang_get('operation_successful') . '<br />';
print_bracket_link($t_redirect_url, lang_get('proceed'));
?>
</div>

<?php 
html_page_bottom1(__FILE__);
Exemplo n.º 4
0
}
helper_call_custom_function('issue_create_notify', array($t_bug_id));
# Allow plugins to post-process bug data with the new bug ID
event_signal('EVENT_REPORT_BUG', array($t_bug_data, $t_bug_id));
email_new_bug($t_bug_id);
// log status and resolution changes if they differ from the default
if ($t_bug_data->status != config_get('bug_submit_status')) {
    history_log_event($t_bug_id, 'status', config_get('bug_submit_status'));
}
if ($t_bug_data->resolution != config_get('default_bug_resolution')) {
    history_log_event($t_bug_id, 'resolution', config_get('default_bug_resolution'));
}
form_security_purge('bug_report');
html_page_top1();
if (!$f_report_stay) {
    html_meta_redirect('view_all_bug_page.php');
}
html_page_top2();
?>
<br />
<div align="center">
<?php 
echo lang_get('operation_successful') . '<br />';
print_bracket_link(string_get_bug_view_url($t_bug_id), sprintf(lang_get('view_submitted_bug_link'), $t_bug_id));
print_bracket_link('view_all_bug_page.php', lang_get('view_bugs_link'));
if ($f_report_stay) {
    ?>
	<p>
	<form method="post" action="<?php 
    echo string_get_bug_report_url();
    ?>
Exemplo n.º 5
0
# You should have received a copy of the GNU General Public License
# along with MantisBT.  If not, see <http://www.gnu.org/licenses/>.
require_once 'core.php';
require_once 'compress_api.php';
require_once 'filter_api.php';
require_once 'last_visited_api.php';
auth_ensure_user_authenticated();
$t_current_user_id = auth_get_current_user_id();
# Improve performance by caching category data in one pass
category_get_all_rows(helper_get_current_project());
compress_enable();
# don't index my view page
html_robots_noindex();
html_page_top1(plugin_lang_get('title'));
if (current_user_get_pref('refresh_delay') > 0) {
    html_meta_redirect(plugin_page('dashboard', true), current_user_get_pref('refresh_delay') * 60);
}
html_page_top2();
print_recently_visited();
$f_page_number = gpc_get_int('page_number', 1);
$t_per_page = config_get('my_view_bug_count');
$t_bug_count = null;
$t_page_count = null;
$t_filters = filter_db_get_available_queries();
$t_config_boxes = plugin_config_get('boxes');
$t_boxes = array();
if (is_array($t_config_boxes) && sizeof($t_config_boxes) > 0) {
    $t_result = asort($t_config_boxes);
    foreach ($t_config_boxes as $t_filter_id => $t_box_position) {
        if ($t_box_position > 0 && array_key_exists($t_filter_id, $t_filters)) {
            $t_boxes[$t_filter_id] = $t_filters[$t_filter_id];
Exemplo n.º 6
0
    $t_realname_updated = true;
}
# Update password if the two match and are not empty
if (!is_blank($f_password)) {
    if ($f_password != $f_password_confirm) {
        trigger_error(ERROR_USER_CREATE_PASSWORD_MISMATCH, ERROR);
    } else {
        if (!auth_does_password_match($t_user_id, $f_password)) {
            user_set_password($t_user_id, $f_password);
            $t_password_updated = true;
        }
    }
}
form_security_purge('account_update');
html_page_top1();
html_meta_redirect($t_redirect);
html_page_top2();
echo '<br /><div align="center">';
if ($t_email_updated) {
    echo lang_get('email_updated') . '<br />';
}
if ($t_password_updated) {
    echo lang_get('password_updated') . '<br />';
}
if ($t_realname_updated) {
    echo lang_get('realname_updated') . '<br />';
}
echo lang_get('operation_successful') . '<br />';
print_bracket_link($t_redirect, lang_get('proceed'));
echo '</div>';
html_page_bottom1(__FILE__);
Exemplo n.º 7
0
/**
 * Defines the top of a HTML page
 * @param string $p_page_title html page title
 * @param string $p_redirect_url url to redirect to if necessary
 * @return null
 */
function html_page_top($p_page_title = null, $p_redirect_url = null)
{
    html_page_top1($p_page_title);
    if ($p_redirect_url !== null) {
        html_meta_redirect($p_redirect_url);
    }
    html_page_top2();
}
Exemplo n.º 8
0
$t_page_count = null;
$rows = filter_get_bug_rows($f_page_number, $t_per_page, $t_page_count, $t_bug_count, null, null, null, true);
if ($rows === false) {
    print_header_redirect('view_all_set.php?type=0');
}
$t_bugslist = array();
$t_users_handlers = array();
$t_project_ids = array();
$t_row_count = count($rows);
for ($i = 0; $i < $t_row_count; $i++) {
    array_push($t_bugslist, $rows[$i]->id);
    $t_users_handlers[] = $rows[$i]->handler_id;
    $t_project_ids[] = $rows[$i]->project_id;
}
$t_unique_users_handlers = array_unique($t_users_handlers);
$t_unique_project_ids = array_unique($t_project_ids);
user_cache_array_rows($t_unique_users_handlers);
project_cache_array_rows($t_unique_project_ids);
gpc_set_cookie(config_get('bug_list_cookie'), implode(',', $t_bugslist));
compress_enable();
# don't index view issues pages
html_robots_noindex();
html_page_top1(lang_get('view_bugs_link'));
if (current_user_get_pref('refresh_delay') > 0) {
    html_meta_redirect('view_all_bug_page.php?page_number=' . $f_page_number, current_user_get_pref('refresh_delay') * 60);
}
html_page_top2();
print_recently_visited();
define('VIEW_ALL_INC_ALLOW', true);
include dirname(__FILE__) . DIRECTORY_SEPARATOR . 'view_all_inc.php';
html_page_bottom();
Exemplo n.º 9
0
/**
 * (11) Print the user's account information
 * Also print the select box where users can switch projects
 * @return null
 */
function html_login_info()
{
    $t_username = current_user_get_field('username');
    $t_access_level = get_enum_element('access_levels', current_user_get_access_level());
    $t_now = date(config_get('complete_date_format'));
    $t_realname = current_user_get_field('realname');
    echo '<table class="hide">';
    echo '<tr>';
    echo '<td class="login-info-left">';
    if (current_user_is_anonymous()) {
        $t_return_page = $_SERVER['SCRIPT_NAME'];
        if (isset($_SERVER['QUERY_STRING'])) {
            $t_return_page .= '?' . $_SERVER['QUERY_STRING'];
        }
        $t_return_page = string_url($t_return_page);
        echo lang_get('anonymous') . ' | <a href="' . helper_mantis_url('login_page.php?return=' . $t_return_page) . '">' . lang_get('login_link') . '</a>';
        if (config_get_global('allow_signup') == ON) {
            echo ' | <a href="' . helper_mantis_url('signup_page.php') . '">' . lang_get('signup_link') . '</a>';
        }
    } else {
        echo lang_get('logged_in_as'), ": <span class=\"italic\">", string_html_specialchars($t_username), "</span> <span class=\"small\">";
        echo is_blank($t_realname) ? "({$t_access_level})" : "(" . string_html_specialchars($t_realname) . " - {$t_access_level})";
        echo "</span>";
    }
    echo '</td>';
    echo '<td class="login-info-middle">';
    echo "<span class=\"italic\">{$t_now}</span>";
    echo '</td>';
    echo '<td class="login-info-right">';
    # Project Selector hidden if only one project visisble to user
    $t_show_project_selector = true;
    $t_project_ids = current_user_get_accessible_projects();
    if (count($t_project_ids) == 1) {
        $t_project_id = (int) $t_project_ids[0];
        if (count(current_user_get_accessible_subprojects($t_project_id)) == 0) {
            $t_show_project_selector = false;
        }
    }
    if ($t_show_project_selector) {
        echo '<form method="post" name="form_set_project" action="' . helper_mantis_url('set_project.php') . '">';
        # CSRF protection not required here - form does not result in modifications
        echo lang_get('email_project'), ': ';
        if (ON == config_get('show_extended_project_browser')) {
            print_extended_project_browser(helper_get_current_project_trace());
        } else {
            if (ON == config_get('use_javascript')) {
                echo '<select name="project_id" class="small" onchange="document.forms.form_set_project.submit();">';
            } else {
                echo '<select name="project_id" class="small">';
            }
            print_project_option_list(join(';', helper_get_current_project_trace()), true, null, true);
            echo '</select> ';
        }
        echo '<input type="submit" class="button-small" value="' . lang_get('switch') . '" />';
        echo '</form>';
    } else {
        # User has only one project, set it as both current and default
        if (ALL_PROJECTS == helper_get_current_project()) {
            helper_set_current_project($t_project_id);
            if (!current_user_is_protected()) {
                current_user_set_default_project($t_project_id);
            }
            # Force reload of current page, except if we got here after
            # creating the first project
            $t_redirect_url = str_replace(config_get('short_path'), '', $_SERVER['REQUEST_URI']);
            if ('manage_proj_create.php' != $t_redirect_url) {
                html_meta_redirect($t_redirect_url, 0, false);
            }
        }
    }
    if (OFF != config_get('rss_enabled')) {
        # Link to RSS issues feed for the selected project, including authentication details.
        echo '<a href="' . htmlspecialchars(rss_get_issues_feed_url()) . '">';
        echo '<img src="' . helper_mantis_url('images/rss.png') . '" alt="' . lang_get('rss') . '" style="border-style: none; margin: 5px; vertical-align: middle;" />';
        echo '</a>';
    }
    echo '</td>';
    echo '</tr>';
    echo '</table>';
}
Exemplo n.º 10
0
/**
 * (10) Print the user's account information
 * Also print the select box where users can switch projects
 * @return void
 */
function html_login_info()
{
    $t_username = current_user_get_field('username');
    $t_access_level = get_enum_element('access_levels', current_user_get_access_level());
    $t_now = date(config_get('complete_date_format'));
    $t_realname = current_user_get_field('realname');
    # Login information
    echo '<div id="login-info">' . "\n";
    if (current_user_is_anonymous()) {
        $t_return_page = $_SERVER['SCRIPT_NAME'];
        if (isset($_SERVER['QUERY_STRING'])) {
            $t_return_page .= '?' . $_SERVER['QUERY_STRING'];
        }
        $t_return_page = string_url($t_return_page);
        echo "\t" . '<span id="logged-anon-label">' . lang_get('anonymous') . '</span>' . "\n";
        echo "\t" . '<span id="login-link"><a href="' . helper_mantis_url('login_page.php?return=' . $t_return_page) . '">' . lang_get('login_link') . '</a></span>' . "\n";
        if (config_get_global('allow_signup') == ON) {
            echo "\t" . '<span id="signup-link"><a href="' . helper_mantis_url('signup_page.php') . '">' . lang_get('signup_link') . '</a></span>' . "\n";
        }
    } else {
        echo "\t" . '<span id="logged-in-label">' . lang_get('logged_in_as') . '</span>' . "\n";
        echo "\t" . '<span id="logged-in-user">' . string_html_specialchars($t_username) . '</span>' . "\n";
        echo "\t" . '<span id="logged-in">';
        echo !is_blank($t_realname) ? "\t" . '<span id="logged-in-realname">' . string_html_specialchars($t_realname) . '</span>' . "\n" : '';
        echo "\t" . '<span id="logged-in-accesslevel" class="' . $t_access_level . '">' . $t_access_level . '</span>' . "\n";
        echo "\t" . '</span>' . "\n";
    }
    echo '</div>' . "\n";
    # RSS feed
    if (OFF != config_get('rss_enabled')) {
        echo '<div id="rss-feed">' . "\n";
        # Link to RSS issues feed for the selected project, including authentication details.
        echo "\t" . '<a href="' . htmlspecialchars(rss_get_issues_feed_url()) . '">' . "\n";
        echo "\t" . '<img src="' . helper_mantis_url('images/rss.png') . '" alt="' . lang_get('rss') . '" title="' . lang_get('rss') . '" />' . "\n";
        echo "\t" . '</a>' . "\n";
        echo '</div>' . "\n";
    }
    # Project Selector (hidden if only one project visisble to user)
    $t_show_project_selector = true;
    $t_project_ids = current_user_get_accessible_projects();
    if (count($t_project_ids) == 1) {
        $t_project_id = (int) $t_project_ids[0];
        if (count(current_user_get_accessible_subprojects($t_project_id)) == 0) {
            $t_show_project_selector = false;
        }
    }
    if ($t_show_project_selector) {
        echo '<div id="project-selector-div">';
        echo '<form method="post" id="form-set-project" action="' . helper_mantis_url('set_project.php') . '">';
        echo '<fieldset id="project-selector">';
        # CSRF protection not required here - form does not result in modifications
        echo '<label for="form-set-project-id">' . lang_get('email_project') . '</label>';
        echo '<select id="form-set-project-id" name="project_id">';
        print_project_option_list(join(';', helper_get_current_project_trace()), true, null, true);
        echo '</select> ';
        echo '<input type="submit" class="button" value="' . lang_get('switch') . '" />';
        echo '</fieldset>';
        echo '</form>';
        echo '</div>';
    } else {
        # User has only one project, set it as both current and default
        if (ALL_PROJECTS == helper_get_current_project()) {
            helper_set_current_project($t_project_id);
            if (!current_user_is_protected()) {
                current_user_set_default_project($t_project_id);
            }
            # Force reload of current page, except if we got here after
            # creating the first project
            $t_redirect_url = str_replace(config_get('short_path'), '', $_SERVER['REQUEST_URI']);
            if ('manage_proj_create.php' != $t_redirect_url) {
                html_meta_redirect($t_redirect_url, 0, false);
            }
        }
    }
    # Current time
    echo '<div id="current-time">' . $t_now . '</div>';
}
Exemplo n.º 11
0
 * MantisBT Core API's
 */
require_once 'core.php';
require_once 'compress_api.php';
require_once 'filter_api.php';
require_once 'last_visited_api.php';
auth_ensure_user_authenticated();
$t_current_user_id = auth_get_current_user_id();
# Improve performance by caching category data in one pass
category_get_all_rows(helper_get_current_project());
compress_enable();
# don't index my view page
html_robots_noindex();
html_page_top1(lang_get('my_view_link'));
if (current_user_get_pref('refresh_delay') > 0) {
    html_meta_redirect('my_view_page.php', current_user_get_pref('refresh_delay') * 60);
}
html_page_top2();
#modifié le 09/08/2012
if (!current_user_is_anonymous()) {
    $t_current_user_id = auth_get_current_user_id();
    $t_hide_status = config_get('bug_resolved_status_threshold');
    echo '<div class="quick-summary-left">';
    echo lang_get('open_and_assigned_to_me') . ': ';
    print_link("view_all_set.php?type=1&handler_id={$t_current_user_id}&hide_status={$t_hide_status}", current_user_get_assigned_open_bug_count(), false, 'subtle');
    echo '</div>';
    echo '<div class="quick-summary-right">';
    echo lang_get('open_and_reported_to_me') . ': ';
    print_link("view_all_set.php?type=1&reporter_id={$t_current_user_id}&hide_status={$t_hide_status}", current_user_get_reported_open_bug_count(), false, 'subtle');
    echo '</div>';
    echo '<div class="quick-summary-left">';
Exemplo n.º 12
0
    if (ON == config_get('reminder_recipents_monitor_bug') && access_has_bug_level(config_get('monitor_bug_threshold'), $f_bug_id) && !bug_is_user_handler($f_bug_id, $t_recipient) && !bug_is_user_reporter($f_bug_id, $t_recipient)) {
        bug_monitor($f_bug_id, $t_recipient);
    }
}
$result = email_bug_reminder($f_to, $f_bug_id, $f_body);
# Add reminder as bugnote if store reminders option is ON.
if (ON == config_get('store_reminders')) {
    if (count($f_to) > 50) {
        # too many recipients to log, truncate the list
        $t_to = array();
        for ($i = 0; $i < 50; $i++) {
            $t_to[] = $f_to[$i];
        }
        $f_to = $t_to;
    }
    $t_attr = '|' . implode('|', $f_to) . '|';
    bugnote_add($f_bug_id, $f_body, config_get('default_reminder_view_status') == VS_PRIVATE, REMINDER, $t_attr);
}
html_page_top1();
html_meta_redirect(string_get_bug_view_url($f_bug_id));
html_page_top2();
?>
<br />
<div align="center">
<?php 
echo lang_get('operation_successful') . '<br />';
print_bracket_link(string_get_bug_view_url($f_bug_id), lang_get('proceed'));
?>
</div>
<?php 
html_page_bottom1(__FILE__);
Exemplo n.º 13
0
$t_bugslist = array();
$t_users_handlers = array();
$t_project_ids = array();
$t_row_count = count($t_rows);
for ($i = 0; $i < $t_row_count; $i++) {
    array_push($t_bugslist, $t_rows[$i]->id);
    $t_users_handlers[] = $t_rows[$i]->handler_id;
    $t_project_ids[] = $t_rows[$i]->project_id;
}
$t_unique_users_handlers = array_unique($t_users_handlers);
$t_unique_project_ids = array_unique($t_project_ids);
user_cache_array_rows($t_unique_users_handlers);
project_cache_array_rows($t_unique_project_ids);
gpc_set_cookie(config_get('bug_list_cookie'), implode(',', $t_bugslist));
compress_enable();
# don't index view issues pages
html_robots_noindex();
html_page_top1(lang_get('view_bugs_link'));
if (current_user_get_pref('refresh_delay') > 0) {
    $t_query = '?';
    if ($f_page_number > 1) {
        $t_query .= 'page_number=' . $f_page_number . '&';
    }
    $t_query .= 'refresh=true';
    html_meta_redirect('view_all_bug_page.php' . $t_query, current_user_get_pref('refresh_delay') * 60);
}
html_page_top2();
print_recently_visited();
define('VIEW_ALL_INC_ALLOW', true);
include dirname(__FILE__) . DIRECTORY_SEPARATOR . 'view_all_inc.php';
html_page_bottom();
Exemplo n.º 14
0
# You should have received a copy of the GNU General Public License
# along with MantisBT.  If not, see <http://www.gnu.org/licenses/>.
/**
 * This page stores the reported bug
 *
 * @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 api_token_api.php
 */
require_once 'core.php';
require_api('api_token_api.php');
form_security_validate('revoke_api_token_form');
auth_ensure_user_authenticated();
auth_reauthenticate();
$f_token_id = gpc_get_int('token_id');
$f_token_name = gpc_get_string('token_name');
$t_user_id = auth_get_current_user_id();
user_ensure_unprotected($t_user_id);
api_token_revoke($f_token_id, $t_user_id);
html_page_top1();
html_meta_redirect('api_tokens_page.php');
html_page_top2();
echo '<div align="center">';
echo '<br /><br />' . sprintf(lang_get('api_token_revoked'), string_display_line($f_token_name)) . '<br /><br />';
print_bracket_link('api_tokens_page.php', lang_get('api_tokens_link'));
echo '</div>';
html_page_bottom();
Exemplo n.º 15
0
<?php

/**************************************************************************
 MantisBT Seeder Plugin
 Copyright (c) MantisHub - Victor Boctor
 All rights reserved.
 MIT License
 **************************************************************************/
access_ensure_global_level(ADMINISTRATOR);
require_once dirname(dirname(__FILE__)) . '/core/Seeder.php';
html_page_top1();
html_meta_redirect(plugin_page('config_page'));
html_page_top2();
$f_create_issues = gpc_isset('create_issues');
$g_enable_email_notification = OFF;
$t_seeder = new Seeder();
if ($f_create_issues !== OFF) {
    $t_project_ids = $t_seeder->createProjects();
    $t_seeder->createIssues($t_project_ids);
}
echo '<div class="success-msg">';
echo lang_get('operation_successful');
echo '</div>';
html_page_bottom();
// log status and resolution changes if they differ from the default
if ($t_bug_data->status != config_get('bug_submit_status')) {
    history_log_event($t_bug_id, 'status', config_get('bug_submit_status'));
}
if ($t_bug_data->resolution != config_get('default_bug_resolution')) {
    history_log_event($t_bug_id, 'resolution', config_get('default_bug_resolution'));
}
if (!$f_report_stay) {
    if ($t_bug_data->status < config_get('bug_readonly_status_threshold')) {
        html_meta_redirect('view.php?id=' . $t_bug_id);
    } else {
        bug_update_date($t_bug_id, $t_bug_data->date_submitted);
        $t_category_table = db_get_table('mantis_category_table');
        $result = db_query_bound("SELECT `name` FROM " . $t_category_table . " WHERE `id` = " . db_param(), array($t_bug_data->category_id));
        $row = db_fetch_array($result);
        html_meta_redirect('browse.php?reset=true&category=' . $row['name']);
    }
}
?>
<br />
<div align="center">
<?php 
echo lang_get('operation_successful') . '<br />';
print_bracket_link(string_get_bug_view_url($t_bug_id), sprintf(lang_get('view_submitted_bug_link'), $t_bug_id));
print_bracket_link('view_all_bug_page.php', lang_get('view_bugs_link'));
if ($f_report_stay) {
    ?>
  <p>
  <form method="post" action="<?php 
    echo string_get_bug_report_url();
    ?>