/**
  * Reset all plugin-related data
  *
  * - config entries
  * - database entities
  */
 public function reset_plugin()
 {
     $query = "DROP TABLE mantis_plugin_SpecManagement_src_table";
     $this->mysqli->query($query);
     $query = "DROP TABLE mantis_plugin_SpecManagement_type_table";
     $this->mysqli->query($query);
     $query = "DROP TABLE mantis_plugin_SpecManagement_ptime_table";
     $this->mysqli->query($query);
     $query = "DROP TABLE mantis_plugin_SpecManagement_vers_table";
     $this->mysqli->query($query);
     $query = "DELETE FROM mantis_config_table\n          WHERE config_id LIKE 'plugin_SpecManagement%'";
     $this->mysqli->query($query);
     print_successful_redirect('manage_plugin_page.php');
 }
form_security_validate('plugin_manage_usergroups_edit');
auth_reauthenticate();
access_ensure_global_level(config_get('manage_plugin_threshold'));
$t_group_prefix = gpc_get_string('group_prefix', '');
$t_assign_group_threshold = gpc_get_int('assign_group_threshold', '');
if (isset($_POST['assign_to_groups'])) {
    $t_assign_to_groups = $_POST['assign_to_groups'];
} else {
    $t_assign_to_groups = 0;
}
if (isset($_POST['nested_groups'])) {
    $t_nested_groups = $_POST['nested_groups'];
} else {
    $t_nested_groups = 0;
}
if (plugin_config_get('group_prefix', '') != $t_group_prefix) {
    plugin_config_set('group_prefix', $t_group_prefix);
}
if (plugin_config_get('assign_group_threshold', '') != $t_assign_group_threshold) {
    plugin_config_set('assign_group_threshold', $t_assign_group_threshold);
}
if (plugin_config_get('assign_to_groups', '') != $t_assign_to_groups) {
    plugin_config_set('assign_to_groups', $t_assign_to_groups);
}
if (plugin_config_get('nested_groups', '') != $t_nested_groups) {
    plugin_config_set('nested_groups', $t_nested_groups);
}
form_security_purge('plugin_manage_usergroups_edit');
print_successful_redirect(plugin_page('manage_usergroups', true));
示例#3
0
function print_successful_redirect_to_bug($p_bug_id)
{
    $t_url = string_get_bug_view_url($p_bug_id, auth_get_current_user_id());
    print_successful_redirect($t_url);
}
示例#4
0
 * 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);
}
form_security_purge('plugin_Slack_config_edit');
print_successful_redirect(plugin_page('config', true));
示例#5
0
require_api('event_api.php');
require_api('form_api.php');
require_api('gpc_api.php');
require_api('print_api.php');
require_api('string_api.php');
form_security_validate('bugnote_update');
$f_bugnote_id = gpc_get_int('bugnote_id');
$f_bugnote_text = gpc_get_string('bugnote_text', '');
$f_time_tracking = gpc_get_string('time_tracking', '0:00');
# Check if the current user is allowed to edit the bugnote
$t_user_id = auth_get_current_user_id();
$t_reporter_id = bugnote_get_field($f_bugnote_id, 'reporter_id');
if ($t_user_id == $t_reporter_id) {
    access_ensure_bugnote_level(config_get('bugnote_user_edit_threshold'), $f_bugnote_id);
} else {
    access_ensure_bugnote_level(config_get('update_bugnote_threshold'), $f_bugnote_id);
}
# Check if the bug is readonly
$t_bug_id = bugnote_get_field($f_bugnote_id, 'bug_id');
if (bug_is_readonly($t_bug_id)) {
    error_parameters($t_bug_id);
    trigger_error(ERROR_BUG_READ_ONLY_ACTION_DENIED, ERROR);
}
$f_bugnote_text = trim($f_bugnote_text) . "\n\n";
bugnote_set_text($f_bugnote_id, $f_bugnote_text);
bugnote_set_time_tracking($f_bugnote_id, $f_time_tracking);
# Plugin integration
event_signal('EVENT_BUGNOTE_EDIT', array($t_bug_id, $f_bugnote_id));
form_security_purge('bugnote_update');
print_successful_redirect(string_get_bug_view_url($t_bug_id) . '#bugnotes');
示例#6
0
# Mantis - a php based bugtracking system
# Copyright (C) 2000 - 2002  Kenzaburo Ito - kenito@300baud.org
# Copyright (C) 2002 - 2007  Mantis Team   - mantisbt-dev@lists.sourceforge.net
# Mantis 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.
#
# Mantis 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 Mantis.  If not, see <http://www.gnu.org/licenses/>.
# --------------------------------------------------------
# $Id: tag_delete.php,v 1.1.2.1 2007-10-13 22:34:44 giallu Exp $
# --------------------------------------------------------
require_once 'core.php';
$t_core_path = config_get('core_path');
require_once $t_core_path . 'tag_api.php';
form_security_validate('tag_delete');
access_ensure_global_level(config_get('tag_edit_threshold'));
$f_tag_id = gpc_get_int('tag_id');
$t_tag_row = tag_get($f_tag_id);
helper_ensure_confirmed(lang_get('tag_delete_message'), lang_get('tag_delete_button'));
tag_delete($f_tag_id);
form_security_purge('tag_delete');
print_successful_redirect(config_get('default_home_page'));
/**
 * 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( 'current_user_api.php' );
require_api( 'form_api.php' );
require_api( 'gpc_api.php' );
require_api( 'print_api.php' );
require_api( 'project_hierarchy_api.php' );

form_security_validate( 'manage_proj_update_children' );

auth_reauthenticate();

$f_project_id = gpc_get_int( 'project_id' );

access_ensure_project_level( config_get( 'manage_project_threshold' ), $f_project_id );

$t_subproject_ids = current_user_get_accessible_subprojects( $f_project_id, true );
foreach ( $t_subproject_ids as $t_subproject_id ) {
	$f_inherit_child = gpc_get_bool( 'inherit_child_' . $t_subproject_id, false );
	project_hierarchy_update( $t_subproject_id, $f_project_id, $f_inherit_child );
}

form_security_purge( 'manage_proj_update_children' );

print_successful_redirect( 'manage_proj_edit_page.php?project_id=' . $f_project_id );
$user_id = gpc_get_string('user_id', '');
// Get user login
$user_table = db_get_table('mantis_user_table');
$query_rep_user_name = "SELECT username FROM {$user_table} WHERE id = {$user_id};";
$res_user_name = db_query($query_rep_user_name);
while ($row_user_name = db_fetch_array($res_user_name)) {
    $user_name = $row_user_name['username'];
}
// Add xmpp login
if ($xmpp_login != '') {
    $xmpp_table = plugin_table('xmpp_login', 'JabberNotifierSystem');
    $query_xmpp_login = "******";
    $res_xmpp_login = db_query($query_xmpp_login);
    if (db_num_rows($res_xmpp_login) == 0) {
        if ($xmpp_login != $user_name) {
            $add_user_query = "INSERT INTO {$xmpp_table} (user_id, xmpp_login, chng_login) VALUES ({$user_id}, \"{$xmpp_login}\", 0);";
            db_query($add_user_query);
            print_successful_redirect('account_page.php');
        } else {
            print_successful_redirect('account_page.php');
            exit;
        }
    } else {
        $add_user_query = "UPDATE {$xmpp_table} SET xmpp_login = \"{$xmpp_login}\" WHERE user_id = {$user_id};";
        db_query_bound($add_user_query);
        print_successful_redirect('account_page.php');
    }
} else {
    print_successful_redirect('account_page.php');
    exit;
}
示例#9
0
   Copyright 2012 Nikitin Artem (AcanthiS)

	E-Mail : acanthis@ya.ru
	ICQ    : 411746920

   Licensed under the Apache License, Version 2.0 (the "License");
   you may not use this file except in compliance with the License.
   You may obtain a copy of the License at

       http://www.apache.org/licenses/LICENSE-2.0

   Unless required by applicable law or agreed to in writing, software
   distributed under the License is distributed on an "AS IS" BASIS,
   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   See the License for the specific language governing permissions and
   limitations under the License.
*/
auth_reauthenticate();
access_ensure_global_level(config_get('manage_plugin_threshold'));
$f_user_id = gpc_get_int_array('user_id', array());
$f_proj_id = gpc_get_int_array('project_id', array());
$proj_table = plugin_table('user_proj', 'JabberNotifierSystem');
foreach ($f_user_id as $t_user_id) {
    if (count($f_proj_id) != 0) {
        $proj_id = implode(',', $f_proj_id);
        $add_user_query = "INSERT INTO {$proj_table} (user_id, proj_id) VALUES ({$t_user_id}, \"{$proj_id}\");";
        db_query($add_user_query);
    }
}
print_successful_redirect(plugin_page('config_custom_proj_user', true));
        html_page_top(plugin_lang_get('plugin_title'));
        ?>
<br /><div class="center">
<?php 
        echo plugin_lang_get($t_is_custom_error || PEAR::isError($t_result) ? 'test_failure' : 'test_success') . '<br /><br />';
        echo plugin_lang_get('description') . ': ' . $t_mailbox_api->_mailbox['description'] . '<br />';
        echo plugin_lang_get('mailbox_type') . ': ' . $t_mailbox_api->_mailbox['mailbox_type'] . '<br />';
        echo plugin_lang_get('hostname') . ': ', $t_mailbox_api->_mailbox['hostname'] . '<br />';
        echo plugin_lang_get('port') . ': ', $t_mailbox_api->_mailbox['port'] . '<br />';
        echo plugin_lang_get('encryption') . ': ' . $t_mailbox_api->_mailbox['encryption'] . '<br />';
        echo plugin_lang_get('ssl_cert_verify') . ': ' . $t_mailbox_api->_mailbox['ssl_cert_verify'] . '<br />';
        echo plugin_lang_get('erp_username') . ': ' . $t_mailbox_api->_mailbox['erp_username'] . '<br />';
        echo plugin_lang_get('erp_password') . ': ******' . '<br />';
        echo plugin_lang_get('auth_method') . ': ' . $t_mailbox_api->_mailbox['auth_method'] . '<br />';
        if ($t_mailbox_api->_mailbox['mailbox_type'] === 'IMAP') {
            echo plugin_lang_get('imap_basefolder') . ': ' . $t_mailbox_api->_mailbox['imap_basefolder'] . '<br />';
        }
        echo '<br />' . ($t_is_custom_error ? nl2br($t_result['ERROR_MESSAGE']) : (PEAR::isError($t_result) ? $t_result->toString() : NULL)) . '<br /><br />';
        print_bracket_link(plugin_page('manage_mailbox', TRUE), lang_get('proceed'));
        ?>
</div>
<?php 
        html_page_bottom(__FILE__);
    }
}
if (plugin_config_get('mailboxes') !== $t_mailboxes && ($f_mailbox_action === 'add' || $f_mailbox_action === 'copy' || ($f_mailbox_action === 'edit' || $f_mailbox_action === 'delete') && $f_select_mailbox >= 0)) {
    plugin_config_set('mailboxes', $t_mailboxes);
}
if (!isset($t_no_redirect)) {
    print_successful_redirect(plugin_page('manage_mailbox', TRUE));
}
示例#11
0
$f_send_mes_up_category = gpc_get_string('send_mes_up_category');
$f_send_mes_up_view = gpc_get_string('send_mes_up_view');
$f_send_mes_add_note = gpc_get_string('send_mes_add_note');
plugin_config_set('jbr_server', $f_jbr_server);
plugin_config_set('jbr_port', $f_jbr_port);
plugin_config_set('jbr_timeout', $f_jbr_timeout);
plugin_config_set('jbr_login', $f_jbr_login);
plugin_config_set('jbr_pwd', $f_jbr_pwd);
plugin_config_set('add_send_quick_msg', $f_add_send_quick_msg);
plugin_config_set('change_xmpp_login', $f_change_xmpp_login);
plugin_config_set('send_mes_new_assign', $f_send_mes_new_assing);
plugin_config_set('send_mes_move_bug', $f_send_mes_move_bug);
plugin_config_set('send_mes_new_bug', $f_send_mes_new_bug);
plugin_config_set('send_mes_new_bugnote', $f_send_mes_new_bugnote);
plugin_config_set('send_mes_edit_bugnote', $f_send_mes_edit_bugnote);
plugin_config_set('send_mes_del_bugnote', $f_send_mes_del_bugnote);
plugin_config_set('send_mes_del_bug', $f_send_mes_del_bug);
plugin_config_set('send_mes_new_state_10', $f_send_mes_new_state_10);
plugin_config_set('send_mes_new_state_20', $f_send_mes_new_state_20);
plugin_config_set('send_mes_new_state_30', $f_send_mes_new_state_30);
plugin_config_set('send_mes_new_state_40', $f_send_mes_new_state_40);
plugin_config_set('send_mes_new_state_50', $f_send_mes_new_state_50);
plugin_config_set('send_mes_new_state_80', $f_send_mes_new_state_80);
plugin_config_set('send_mes_new_state_90', $f_send_mes_new_state_90);
plugin_config_set('send_mes_up_prior', $f_send_mes_up_prior);
plugin_config_set('send_mes_up_status', $f_send_mes_up_status);
plugin_config_set('send_mes_up_category', $f_send_mes_up_category);
plugin_config_set('send_mes_up_view', $f_send_mes_up_view);
plugin_config_set('send_mes_add_note', $f_send_mes_add_note);
print_successful_redirect(plugin_page('config_main'));
    plugin_config_delete('buglink_regex_2');
}
if (!$f_bugfix_reset_1) {
    maybe_set_option('bugfix_regex_1', $f_bugfix_regex_1);
} else {
    plugin_config_delete('bugfix_regex_1');
}
if (!$f_bugfix_reset_2) {
    maybe_set_option('bugfix_regex_2', $f_bugfix_regex_2);
} else {
    plugin_config_delete('bugfix_regex_2');
}
maybe_set_option('bugfix_status', $f_bugfix_status);
maybe_set_option('bugfix_resolution', $f_bugfix_resolution);
maybe_set_option('bugfix_status_pvm', $f_bugfix_status_pvm);
maybe_set_option('bugfix_handler', $f_bugfix_handler);
maybe_set_option('bugfix_message', $f_bugfix_message);
maybe_set_option('bugfix_message_view_status', $f_bugfix_message_view_status);
maybe_set_option('remote_checkin', $f_remote_checkin);
maybe_set_option('checkin_urls', serialize($t_checkin_urls));
maybe_set_option('remote_imports', $f_remote_imports);
maybe_set_option('import_urls', serialize($t_import_urls));
maybe_set_option('api_key', $f_api_key);
foreach (SourceVCS::all() as $t_type => $t_vcs) {
    if ($t_vcs->configuration) {
        $t_vcs->update_config();
    }
}
form_security_purge('plugin_Source_manage_config');
print_successful_redirect(plugin_page('manage_config_page', true));
# This program 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/>.
form_security_validate('plugin_Dashboard_config_update');
$f_width = gpc_get_int('width', 4);
$f_reset_width = gpc_get_bool('reset-width', false);
if ($f_reset_width) {
    plugin_config_delete('width');
} else {
    plugin_config_set('width', $f_width);
}
$f_filter = gpc_get_int_array('filter', array());
$f_reset_boxes = gpc_get_bool('reset-boxes', false);
if ($f_reset_boxes) {
    plugin_config_delete('boxes');
} else {
    $f_boxes = array();
    foreach ($f_filter as $t_filter_id => $t_filter_pos) {
        if ($t_filter_pos != 0) {
            $f_boxes[$t_filter_id] = $t_filter_pos;
        }
    }
    plugin_config_set('boxes', $f_boxes);
}
form_security_purge('plugin_Dashboard_config_update');
print_successful_redirect(plugin_page('dashboard', true));
示例#14
0
<?php

/*
   Copyright 2012 Nikitin Artem (AcanthiS)

	E-Mail : acanthis@ya.ru
	ICQ    : 411746920

   Licensed under the Apache License, Version 2.0 (the "License");
   you may not use this file except in compliance with the License.
   You may obtain a copy of the License at

       http://www.apache.org/licenses/LICENSE-2.0

   Unless required by applicable law or agreed to in writing, software
   distributed under the License is distributed on an "AS IS" BASIS,
   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   See the License for the specific language governing permissions and
   limitations under the License.
*/
auth_reauthenticate();
access_ensure_global_level(config_get('manage_plugin_threshold'));
$user_id = gpc_get_string('user_id', '');
$xmpp_login = gpc_get_string('xmpp_login', '');
$table = plugin_table('xmpp_login', 'JabberNotifierSystem');
$query = "UPDATE {$table} SET xmpp_login = \"{$xmpp_login}\" WHERE user_id = {$user_id};";
db_query($query);
print_successful_redirect(plugin_page('config_xmpp_login', true));
    echo '<link rel="stylesheet" href="' . SPECMANAGEMENT_PLUGIN_URL . 'files/specmanagement.css">';
    if (!$print_flag) {
        html_page_top2();
        //      if ( plugin_is_installed( 'WhiteboardMenu' ) && file_exists ( config_get_global ( 'plugin_path' ) . 'WhiteboardMenu' ) )
        //      {
        //         require_once WHITEBOARDMENU_CORE_URI . 'whiteboard_print_api.php';
        //         $whiteboard_print_api = new whiteboard_print_api();
        //         $whiteboard_print_api->printWhiteboardMenu();
        //      }
    }
    calculate_page_content($print_flag);
    if (!$print_flag) {
        html_page_bottom1();
    }
} else {
    print_successful_redirect('plugin.php?page=SpecManagement/choose_document');
}
/**
 * @param $print_flag
 */
function calculate_page_content($print_flag)
{
    $specmanagement_database_api = new specmanagement_database_api();
    $specmanagement_print_api = new specmanagement_print_api();
    $specmanagement_editor_api = new specmanagement_editor_api();
    $version_id = $_POST['version_id'];
    $version_spec_bug_ids = $specmanagement_database_api->get_version_spec_bugs(version_get_field($version_id, 'version'));
    if (!is_null($version_spec_bug_ids)) {
        /** get bug and work package data */
        $plugin_version_obj = $specmanagement_database_api->get_plugin_version_row_by_version_id($version_id);
        $p_version_id = $plugin_version_obj[0];
# (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/>.
/**
 * @package MantisBT
 * @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';
/**
 * requires tag_api
 */
require_once 'tag_api.php';
form_security_validate('tag_delete');
access_ensure_global_level(config_get('tag_edit_threshold'));
$f_tag_id = gpc_get_int('tag_id');
$t_tag_row = tag_get($f_tag_id);
helper_ensure_confirmed(lang_get('tag_delete_message'), lang_get('tag_delete_button'));
tag_delete($f_tag_id);
form_security_purge('tag_delete');
print_successful_redirect('manage_tags_page.php');
示例#17
0
<?php

# Copyright (c) 2012 John Reese
# Licensed under the MIT license
access_ensure_project_level(plugin_config_get('update_threshold'));
$f_changeset_id = gpc_get_int('id');
$t_changeset = SourceChangeset::load($f_changeset_id);
$t_repos = SourceRepo::load_by_changesets($t_changeset);
if (count($t_repos) < 1) {
    trigger_error(ERROR_GENERIC, ERROR);
}
$t_repo = array_shift($t_repos);
$t_repo->load_branches();
if (plugin_config_get('enable_porting')) {
    $f_ported = gpc_get_string('ported', '');
    if (0 == $f_ported || in_array($f_ported, $t_repo->branches)) {
        $t_changeset->ported = $f_ported;
    }
}
$t_changeset->save();
print_successful_redirect(plugin_page('view', true) . '&id=' . $t_changeset->id);
示例#18
0
   Unless required by applicable law or agreed to in writing, software
   distributed under the License is distributed on an "AS IS" BASIS,
   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   See the License for the specific language governing permissions and
   limitations under the License.

   Notes: Based on the Time Tracking plugin by Elmar:
   2005 by Elmar Schumacher - GAMBIT Consulting GmbH
   http://www.mantisbt.org/forums/viewtopic.php?f=4&t=589	
*/
form_security_validate('plugin_TimeTracking_delete_record');
$f_bug_id = gpc_get_int('bug_id');
$f_delete_id = gpc_get_int('delete_id');
$table = plugin_table('data', 'TimeTracking');
$query_pull_timerecords = "SELECT * FROM {$table} WHERE id = {$f_delete_id} ORDER BY timestamp DESC";
$result_pull_timerecords = db_query($query_pull_timerecords);
$row = db_fetch_array($result_pull_timerecords);
$t_user_id = auth_get_current_user_id();
if ($row[user] == $t_user_id) {
    access_ensure_bug_level(plugin_config_get('admin_own_threshold'), $f_bug_id);
} else {
    access_ensure_bug_level(plugin_config_get('admin_threshold'), $f_bug_id);
}
$query_delete = "DELETE FROM {$table} WHERE id = {$f_delete_id}";
db_query($query_delete);
history_log_event_direct($f_bug_id, plugin_lang_get('history') . " " . plugin_lang_get('deleted'), date(config_get("short_date_format"), strtotime($row["expenditure_date"])) . ": " . number_format($row["hours"], 2, ',', '.') . " h.", "deleted", $user);
form_security_purge('plugin_TimeTracking_delete_record');
$t_url = string_get_bug_view_url($f_bug_id, auth_get_current_user_id());
print_successful_redirect($t_url . "#timerecord");
        if (is_null($obsolete)) {
            $version->obsolete = false;
        } else {
            if ($obsolete == 'on') {
                $version->obsolete = true;
            }
        }
        if (!is_null($date_order)) {
            $new_date_order = $date_order[$version_index];
            $version->date_order = $new_date_order;
        }
        if (!is_null($type)) {
            $new_type = $type[$version_index];
            if (strlen($new_type) > 0) {
                $new_type_id = $specmanagement_database_api->get_type_id($new_type);
                $specmanagement_database_api->update_version_associated_type($project_id, $version_ids[$version_index], $new_type_id);
            } else {
                $specmanagement_database_api->update_version_associated_type($project_id, $version_ids[$version_index], 9999);
            }
        }
        if (!is_null($description)) {
            $new_description = $description[$version_index];
            $version->description = $new_description;
        }
        version_update($version);
        event_signal('EVENT_MANAGE_VERSION_UPDATE', array($version_id));
    }
}
form_security_purge('plugin_SpecManagement_manage_versions_update');
print_successful_redirect(plugin_page('manage_versions', true));
<?php

form_security_validate('plugin_DailyScrum_config_update');
$f_foo_or_bar = gpc_get_string('foo_or_bar');
$f_reset = gpc_get_bool('reset', false);
if ($f_reset) {
    plugin_config_delete('foo_or_bar');
} else {
    if ($f_foo_or_bar == 'foo' || $f_foo_or_bar == 'bar') {
        plugin_config_set('foo_or_bar', $f_foo_or_bar);
    }
}
form_security_purge('plugin_DailyScrum_config_update');
print_successful_redirect(plugin_page('foo', true));
示例#21
0
<?php

auth_reauthenticate();
access_ensure_global_level(config_get('manage_plugin_threshold'));
$f_format_text = gpc_get_int('format_text', ON);
$f_search_text = gpc_get_int('search_text', ON);
$f_search_threshold = gpc_get_string('search_threshold', REPORTER);
$f_serials_view_threshold = gpc_get_string('serials_view_threshold', REPORTER);
$f_format_threshold = gpc_get_string('format_threshold', DEVELOPER);
$f_manage_threshold = gpc_get_string('manage_threshold', ADMINISTRATOR);
plugin_config_set('format_text', $f_format_text);
plugin_config_set('search_text', $f_search_text);
plugin_config_set('search_threshold', $f_search_threshold);
plugin_config_set('serials_view_threshold', $f_serials_view_threshold);
plugin_config_set('format_threshold', $f_format_threshold);
plugin_config_set('manage_threshold', $f_manage_threshold);
print_successful_redirect(plugin_page('config', TRUE));
示例#22
0
    }
    if (!empty($task_list)) {
        foreach ($task_list as $num => $row) {
            $agilemantis_sprint->resetPlanned($num);
        }
    }
}
form_security_purge('plugin_format_config_edit');
# redirect back to config page with errors
if ($throw_error_5) {
    print_successful_redirect(plugin_page('config.php&error=file_upload_error', true));
}
if (!$throw_error_7) {
    if ($throw_error_4) {
        print_successful_redirect(plugin_page('config.php&error=workday_error', true));
    }
}
if ($throw_error_7) {
    print_successful_redirect(plugin_page('config.php&error=sprint_length_error', true));
}
if ($throw_error_1) {
    print_successful_redirect(plugin_page('config.php&error=no_license_error', true));
}
if ($throw_error_2 && !$file_upload) {
    print_successful_redirect(plugin_page('config.php&error=could_not_find_error', true));
}
if ($throw_error_3) {
    print_successful_redirect(plugin_page('config.php&error=empty_license_error', true));
}
print_successful_redirect(plugin_page('config.php&save=success', true));
示例#23
0
<?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: bug_delete.php,v 1.40 2005/07/25 16:34:10 thraxisp Exp $
# --------------------------------------------------------
# Deletes the bug and re-directs to view_all_bug_page.php
require_once 'core.php';
$t_core_path = config_get('core_path');
require_once $t_core_path . 'bug_api.php';
$f_bug_id = gpc_get_int('bug_id');
access_ensure_bug_level(config_get('delete_bug_threshold'), $f_bug_id);
$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;
}
helper_ensure_confirmed(lang_get('delete_bug_sure_msg'), lang_get('delete_bug_button'));
$t_bug = bug_get($f_bug_id, true);
helper_call_custom_function('issue_delete_validate', array($f_bug_id));
bug_delete($f_bug_id);
helper_call_custom_function('issue_delete_notify', array($f_bug_id));
print_successful_redirect('view_all_bug_page.php');
示例#24
0
 * @uses user_api.php
 */
require_once 'core.php';
require_api('access_api.php');
require_api('authentication_api.php');
require_api('compress_api.php');
require_api('config_api.php');
require_api('form_api.php');
require_api('gpc_api.php');
require_api('print_api.php');
require_api('tag_api.php');
require_api('user_api.php');
form_security_validate('tag_update');
compress_enable();
$f_tag_id = gpc_get_int('tag_id');
$t_tag_row = tag_get($f_tag_id);
if (!(access_has_global_level(config_get('tag_edit_threshold')) || auth_get_current_user_id() == $t_tag_row['user_id'] && access_has_global_level(config_get('tag_edit_own_threshold')))) {
    access_denied();
}
if (access_has_global_level(config_get('tag_edit_threshold'))) {
    $f_new_user_id = gpc_get_int('user_id', $t_tag_row['user_id']);
} else {
    $f_new_user_id = $t_tag_row['user_id'];
}
$f_new_name = gpc_get_string('name', $t_tag_row['name']);
$f_new_description = gpc_get_string('description', $t_tag_row['description']);
tag_update($f_tag_id, $f_new_name, $f_new_user_id, $f_new_description);
form_security_purge('tag_update');
$t_url = 'tag_view_page.php?tag_id=' . $f_tag_id;
print_successful_redirect($t_url);
示例#25
0
/**
 * Get a view URL for the bug id based on the user's preference and
 * call print_successful_redirect() with that URL
 *
 * @param integer $p_bug_id A bug identifier.
 * @return void
 */
function print_successful_redirect_to_bug($p_bug_id)
{
    $t_url = string_get_bug_view_url($p_bug_id);
    print_successful_redirect($t_url);
}
    $f_mapping_pvm_version_id = gpc_get_int('_pvm_version_id', 0);
    $f_mapping_version = '';
} else {
    $f_mapping_pvm_version_id = 0;
    $f_mapping_version = gpc_get_string('_version', '');
}
$f_mapping_regex = gpc_get_string('_regex', '');
if (!is_blank($f_mapping_branch)) {
    if (isset($t_mappings[$f_mapping_branch])) {
        die('error branch');
    }
    if ($f_mapping_type < SOURCE_EXPLICIT) {
        die('error type');
    }
    if ($f_mapping_type == SOURCE_EXPLICIT) {
        if (Source_PVM()) {
            if ($f_mapping_pvm_version_id < 1) {
                die('error product version');
            }
        } else {
            if (is_blank($f_mapping_version)) {
                die('error version');
            }
        }
    }
    $t_mapping = new SourceMapping($t_repo->id, $f_mapping_branch, $f_mapping_type, $f_mapping_version, $f_mapping_regex, $f_mapping_pvm_version_id);
    $t_mapping->save();
}
form_security_purge('plugin_Source_repo_update_mappings');
print_successful_redirect(plugin_page('repo_manage_page', true) . '&id=' . $t_repo->id);
示例#27
0
                $t_split = split('=>', $value, 2);
                if (count($t_split) == 2) {
                    // associative array
                    $t_new_key = constant_replace(trim($t_split[0]));
                    $t_new_value = constant_replace(trim($t_split[1]));
                    $t_value[$t_new_key] = $t_new_value;
                } else {
                    // regular array
                    $t_value[$key] = constant_replace(trim($value));
                }
            }
        } else {
            // scalar value
            $t_value = constant_replace(trim($t_full_string));
        }
    }
}
config_set($f_config_option, $t_value, $f_user_id, $f_project_id);
print_successful_redirect('adm_config_report.php');
/** 
 * Check if the passed string is a constant and return its value
 */
function constant_replace($p_name)
{
    $t_result = $p_name;
    if (is_string($p_name) && defined($p_name)) {
        // we have a constant
        $t_result = constant($p_name);
    }
    return $t_result;
}
<?php

# Copyright (c) 2012 John Reese
# Licensed under the MIT license
form_security_validate('plugin_Source_repo_delete');
access_ensure_global_level(plugin_config_get('manage_threshold'));
$f_repo_id = gpc_get_string('id');
$t_repo = SourceRepo::load($f_repo_id);
helper_ensure_confirmed(sprintf(plugin_lang_get('ensure_delete'), $t_repo->name), plugin_lang_get('delete_repository'));
SourceRepo::delete($t_repo->id);
form_security_purge('plugin_Source_repo_delete');
print_successful_redirect(plugin_page('index', true));
示例#29
0
 */
/** @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');
        if (isset($_POST['showpt' . $type_index])) {
            $show_pt = $_POST['showpt' . $type_index];
            if ($show_pt == 'on') {
                $show_pt = 1;
            }
        }
        if (isset($_POST['showeo' . $type_index])) {
            $show_eo = $_POST['showeo' . $type_index];
            if ($show_eo == 'on') {
                $show_eo = 1;
            }
        }
        if (isset($_POST['showdy' . $type_index])) {
            $show_dy = $_POST['showdy' . $type_index];
            if ($show_dy == 'on') {
                $show_dy = 1;
            }
        }
        /* fill array with option values */
        array_push($type_options, $show_pt);
        array_push($type_options, $show_eo);
        array_push($type_options, $show_dy);
        /* generate option string */
        $type_options_set = implode(';', $type_options);
        /* fill database with option string */
        $specmanagement_database_api->update_type_options($type_id, $type_options_set);
    }
}
form_security_purge('plugin_SpecManagement_manage_types_update');
print_successful_redirect(plugin_page('manage_types', true));