function bfefooter()
 {
     if ("/view.php" == $_SERVER['PHP_SELF']) {
         $t_bugnote_add_text = str_replace(array("\n", "\r"), array('\\n', '\\r'), bugnote_get_text(gpc_get('bugnote_id', '')));
         if ($t_bugnote_add_text) {
             return '<!-- Beginn BFE-Footer -->' . "\n" . '<script type="text/javascript">' . "\n" . '	document.getElementsByName("bugnote_text")[0].value="' . $t_bugnote_add_text . '";' . "\n" . '</script>' . "\n" . '<!-- Ende BFE-Footer -->' . "\n";
         }
     }
 }
function set_capability_enum($p_threshold, $p_all_projects_only = false)
{
    global $t_access, $t_project;
    if ($t_access >= config_get_access($p_threshold) && (ALL_PROJECTS == $t_project || !$p_all_projects_only)) {
        $f_flag = gpc_get('flag_' . $p_threshold);
        $f_access = gpc_get_int('access_' . $p_threshold);
        # @@debug @@ echo "<br />for $p_threshold "; var_dump($f_flag, $f_access); echo '<br />';
        if ($f_flag != config_get($p_threshold)) {
            config_set($p_threshold, $f_flag, NO_USER, $t_project, $f_access);
        }
    }
}
Example #3
0
function gpc_get_bool($p_var_name, $p_default = false)
{
    $t_result = gpc_get($p_var_name, $p_default);
    if ($t_result === $p_default) {
        return $p_default;
    } else {
        if (is_array($t_result)) {
            error_parameters($p_var_name);
            trigger_error(ERROR_GPC_ARRAY_UNEXPECTED, ERROR);
        }
        return gpc_string_to_bool($t_result);
    }
}
Example #4
0
    $f_database_name = gpc_get('database_name', config_get('database_name', 'bugtracker'));
    $f_db_schema = gpc_get('db_schema', config_get('db_schema', ''));
    $f_db_username = gpc_get('db_username', config_get('db_username', ''));
    $f_db_password = gpc_get('db_password', config_get('db_password', ''));
    if (CONFIGURED_PASSWORD == $f_db_password) {
        $f_db_password = config_get('db_password');
    }
    $f_timezone = gpc_get('timezone', config_get('default_timezone'));
    # Set default prefix/suffix form variables ($f_db_table_XXX)
    $t_prefix_type = $f_db_type == 'oci8' ? $f_db_type : 'other';
    foreach ($t_prefix_defaults[$t_prefix_type] as $t_key => $t_value) {
        ${'f_' . $t_key} = gpc_get($t_key, $t_value);
    }
}
$f_admin_username = gpc_get('admin_username', '');
$f_admin_password = gpc_get('admin_password', '');
if (CONFIGURED_PASSWORD == $f_admin_password) {
    $f_admin_password = '';
}
$f_log_queries = gpc_get_bool('log_queries', false);
$f_db_exists = gpc_get_bool('db_exists', false);
if ($t_config_exists) {
    if (0 == $t_install_state) {
        print_test('Config File Exists - Upgrade', true);
        print_test('Setting Database Type', '' !== $f_db_type, true, 'database type is blank?');
        # @TODO: dsn config seems to be undefined, remove ?
        $t_db_conn_exists = $f_dsn !== '' || $f_database_name !== '' && $f_db_username !== '' && $f_hostname !== '';
        # Oracle supports binding in two ways:
        #  - hostname, username/password and database name
        #  - tns name (insert into hostname field) and username/password, database name is still empty
        if ($f_db_type == 'oci8') {
 * @copyright Copyright (C) 2002 - 2014  MantisBT Team - mantisbt-dev@lists.sourceforge.net
 * @link http://www.mantisbt.org
 */
/**
 * MantisBT Core API's
 */
require_once 'core.php';
require_once 'email_api.php';
form_security_validate('manage_config_email_set');
auth_reauthenticate();
$t_can_change_level = min(config_get_access('notify_flags'), config_get_access('default_notify_flags'));
access_ensure_project_level($t_can_change_level);
$t_redirect_url = 'manage_config_email_page.php';
$t_project = helper_get_current_project();
$f_flags = gpc_get('flag', array());
$f_thresholds = gpc_get('flag_threshold', array());
$f_actions_access = gpc_get_int('notify_actions_access');
html_page_top(lang_get('manage_email_config'), $t_redirect_url);
$t_access = current_user_get_access_level();
$t_can_change_flags = $t_access >= config_get_access('notify_flags');
$t_can_change_defaults = $t_access >= config_get_access('default_notify_flags');
# build a list of the possible actions and flags
$t_valid_actions = array('owner', 'reopened', 'deleted', 'bugnote');
if (config_get('enable_sponsorship') == ON) {
    $t_valid_actions[] = 'sponsor';
}
$t_valid_actions[] = 'relation';
$t_statuses = MantisEnum::getAssocArrayIndexedByValues(config_get('status_enum_string'));
ksort($t_statuses);
reset($t_statuses);
foreach ($t_statuses as $t_status => $t_label) {
Example #6
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 upgrade moves attachments from the database to the disk
/**
 * @package MantisBT
 * @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 dirname(dirname(__FILE__)) . DIRECTORY_SEPARATOR . 'core.php';
access_ensure_global_level(config_get_global('admin_site_threshold'));
$f_source_field_id = gpc_get_int('source_id');
$f_dest_field = gpc_get('dest_id');
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<title> MantisBT Administration - Copy Custom Fields to Built-in </title>
<link rel="stylesheet" type="text/css" href="admin.css" />
</head>
<body>

<table width="100%" border="0" cellspacing="0" cellpadding="0" bgcolor="#ffffff">
	<tr class="top-bar">
		<td class="links">
			[ <a href="system_utils.php">Back to System Utilities</a> ]
			[ <a href="copy_field.php?source_id=<?php 
echo $f_source_field_id;
function gpc_get_bool_array($p_var_name, $p_default = null)
{
    # Don't pass along a default unless one was given to us
    #  otherwise we prevent an error being triggered
    if (func_num_args() > 1) {
        $t_result = gpc_get($p_var_name, $p_default);
    } else {
        $t_result = gpc_get($p_var_name);
    }
    if (!is_array($t_result)) {
        #trigger_error( ERROR_GPC_ARRAY_EXPECTED, ERROR);
        echo "Unexpected array '{$p_var_name}'.";
    }
    for ($i = 0; $i < sizeof($t_result); $i++) {
        $t_result[$i] = gpc_string_to_bool($t_result[$i]);
    }
    return $t_result;
}
                    break;
                case CUSTOM_FIELD_DATE_AFTER:
                    $t_start = $t_start_date + $t_one_day - 1;
                    $t_end = 2147483647;
                    // Some time in 2038, max value of a signed int.
                    break;
                case CUSTOM_FIELD_DATE_ONORAFTER:
                    $t_start = $t_start_date;
                    $t_end = 2147483647;
                    // Some time in 2038, max value of a signed int.
                    break;
            }
            $f_custom_fields_data[$t_cfid][1] = $t_start;
            $f_custom_fields_data[$t_cfid][2] = $t_end;
        } else {
            if (is_array(gpc_get('custom_field_' . $t_cfid, null))) {
                $f_custom_fields_data[$t_cfid] = gpc_get_string_array('custom_field_' . $t_cfid, META_FILTER_ANY);
            } else {
                $f_custom_fields_data[$t_cfid] = gpc_get_string('custom_field_' . $t_cfid, META_FILTER_ANY);
                $f_custom_fields_data[$t_cfid] = array($f_custom_fields_data[$t_cfid]);
            }
        }
    }
}
$f_relationship_type = gpc_get_int(FILTER_PROPERTY_RELATIONSHIP_TYPE, -1);
$f_relationship_bug = gpc_get_int(FILTER_PROPERTY_RELATIONSHIP_BUG, 0);
if ($f_temp_filter) {
    $f_type = 1;
}
if ($f_and_not_assigned) {
    $f_and_not_assigned = 'on';
# phpWebNotes - a php based note addition system
# Copyright (C) 2000-2002 Webnotes Team - webnotes-devel@sourceforge.net
# This program is distributed under the terms and conditions of the GPL
# See the files README and LICENSE for details
# --------------------------------------------------------
# $Id: admin_manage_users_update.php,v 1.6 2002/10/07 02:54:39 vboctor Exp $
# --------------------------------------------------------
require_once 'core' . DIRECTORY_SEPARATOR . 'api.php';
login_cookie_check();
access_ensure_check_action(ACTION_USERS_EDIT);
$f_user_id = gpc_get('f_user_id');
$f_email = gpc_get('f_email');
$f_password = gpc_get('f_password');
$f_password_confirm = gpc_get('f_password_confirm');
$f_access_level = gpc_get('f_access_level');
if ($f_password != $f_password_confirm) {
    util_header_redirect($g_admin_manage_users_edit . '?f_user_id=' . $f_user_id);
}
if (isset($f_enabled)) {
    $f_enabled = 1;
} else {
    $f_enabled = 0;
}
if (isset($f_protected)) {
    $f_protected = 1;
} else {
    $f_protected = 0;
}
user_update($f_user_id, $f_email, $f_password, $f_access_level, $f_enabled, $f_protected);
util_header_redirect($g_admin_manage_users);
Example #10
0
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with MantisBT.  If not, see <http://www.gnu.org/licenses/>.
/**
 * This upgrade moves attachments from the database to the disk
 * @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';
form_security_validate('move_attachments_project_select');
access_ensure_global_level(config_get_global('admin_site_threshold'));
$f_file_type = gpc_get('type');
$f_project_to_move = gpc_get('to_move', null);
/**
 * Moves attachments from the specified list of projects from disk to database
 * @param string $p_type Attachment type ('bug' or 'project')
 * @param array $p_projects List of projects to process
 * @return array summary of moves per project
 */
function move_attachments_to_db($p_type, $p_projects)
{
    if (empty($p_projects)) {
        return array();
    }
    # Build the SQL query based on attachment type
    $t_file_table = '{' . $p_type . '_file}';
    switch ($p_type) {
        case 'project':
Example #11
0
						<?php 
echo get_dropdown($t_show, 'show_table', $f_show_as_table ? 1 : 0);
?>
					</td>
					<td>
						<input type="submit" class="button" name="show" value="<?php 
echo plugin_lang_get('show_graph');
?>
"/>
					</td>
				</tr>
			</table>
		</form>
<?php 
# build the graphs if both an interval and graph type are selected
if (0 != $f_type && $f_interval > 0 && gpc_get('show', '') != '') {
    $t_width = plugin_config_get('window_width');
    $t_summary = $f_type % 2 != 0;
    $t_body = (int) ($f_type / 2);
    $f_start = $t_period->get_start_formatted();
    $f_end = $t_period->get_end_formatted();
    if ($t_body == 1 || $t_body == 3) {
        if ($f_show_as_table) {
            include config_get_global('plugin_path') . plugin_get_current() . '/pages/bug_graph_bystatus.php';
        } else {
            echo '<br /><img src="' . plugin_page('bug_graph_bystatus.php') . '&amp;width=600&amp;interval=' . $f_interval . '&amp;start_date=' . $f_start . '&amp;end_date=' . $f_end . '&amp;summary=' . $t_summary . '&amp;show_table=0" alt="Bug Graph" />';
        }
    }
    if ($t_body == 2 || $t_body == 3) {
        if ($f_show_as_table) {
            include config_get_global('plugin_path') . plugin_get_current() . '/pages/bug_graph_bycategory.php';
auth_ensure_user_authenticated();

$f_user_id		= gpc_get_int( 'user_id' );
$f_redirect_url	= gpc_get_string( 'redirect_url' );

# the check for the protected state is already done in the form, there is
# no need to duplicate it here.

# get the fields list
$t_field_name_arr = get_field_names();
$field_name_count = count($t_field_name_arr);

# check the checkboxes
for ($i=0 ; $i <$field_name_count ; $i++) {
	$t_name='print_'.utf8_strtolower(str_replace(' ','_',$t_field_name_arr[$i]));
	$t_flag = gpc_get( $t_name, null );

	if ( $t_flag === null ) {
		$t_prefs_arr[$i] = 0;
	} else {
		$t_prefs_arr[$i] = 1;
	}
}

# get user id
$t_user_id = $f_user_id;

$c_export = implode('',$t_prefs_arr);

# update preferences
$t_user_print_pref_table = db_get_table( 'user_print_pref' );
Example #13
0
 * @copyright Copyright 2000 - 2002  Kenzaburo Ito - kenito@300baud.org
 * @copyright Copyright 2002  MantisBT Team - mantisbt-dev@lists.sourceforge.net
 * @link http://www.mantisbt.org
 */
/**
 * MantisBT Core API's
 */
require_once dirname(dirname(__FILE__)) . DIRECTORY_SEPARATOR . 'core.php';
access_ensure_global_level(config_get_global('admin_site_threshold'));
# Page header, menu
html_page_top('MantisBT Administration - Moving Attachments');
echo '<div align="center"><p>';
print_bracket_link(helper_mantis_url('admin/system_utils.php'), 'Back to System Utilities');
echo '</p></div>';
# File type should be 'bug' (default) or 'project'
$f_file_type = gpc_get('type', 'bug');
$t_bug_table = db_get_table('mantis_bug_table');
$t_project_table = db_get_table('mantis_project_table');
switch ($f_file_type) {
    case 'project':
        $t_type = 'Project Files';
        $t_file_table = db_get_table('mantis_project_file_table');
        $t_query = "SELECT p.id, p.name, COUNT(f.id) disk\n\t\t\tFROM {$t_file_table} f\n\t\t\tLEFT JOIN {$t_project_table} p ON p.id = f.project_id\n\t\t\tWHERE content <> ''\n\t\t\tGROUP BY p.id, p.name\n\t\t\tORDER BY p.name";
        break;
    case 'bug':
    default:
        $t_type = 'Attachments';
        $t_file_table = db_get_table('mantis_bug_file_table');
        $t_query = "SELECT p.id, p.name, COUNT(f.id) disk\n\t\t\tFROM {$t_file_table} f\n\t\t\tJOIN {$t_bug_table} b ON b.id = f.bug_id\n\t\t\tJOIN {$t_project_table} p ON p.id = b.project_id\n\t\t\tWHERE content <> ''\n\t\t\tGROUP BY p.id, p.name\n\t\t\tORDER BY p.name";
        break;
}
Example #14
0
function filter_ensure_valid_filter($p_filter_arr)
{
    # extend current filter to add information passed via POST
    if (!isset($p_filter_arr['_version'])) {
        $p_filter_arr['_version'] = config_get('cookie_version');
    }
    $t_cookie_vers = (int) substr($p_filter_arr['_version'], 1);
    if (substr(config_get('cookie_version'), 1) > $t_cookie_vers) {
        # if the version is old, update it
        $p_filter_arr['_version'] = config_get('cookie_version');
    }
    if (!isset($p_filter_arr['_view_type'])) {
        $p_filter_arr['_view_type'] = gpc_get_string('view_type', 'simple');
    }
    if (!isset($p_filter_arr['per_page'])) {
        $p_filter_arr['per_page'] = gpc_get_int('per_page', config_get('default_limit_view'));
    }
    if (!isset($p_filter_arr['highlight_changed'])) {
        $p_filter_arr['highlight_changed'] = config_get('default_show_changed');
    }
    if (!isset($p_filter_arr['sticky_issues'])) {
        $p_filter_arr['sticky_issues'] = config_get('show_sticky_issues');
    }
    if (!isset($p_filter_arr['sort'])) {
        $p_filter_arr['sort'] = "last_updated";
    }
    if (!isset($p_filter_arr['dir'])) {
        $p_filter_arr['dir'] = "DESC";
    }
    if (!isset($p_filter_arr['platform'])) {
        $p_filter_arr['platform'] = array(0 => META_FILTER_ANY);
    }
    if (!isset($p_filter_arr['os'])) {
        $p_filter_arr['os'] = array(0 => META_FILTER_ANY);
    }
    if (!isset($p_filter_arr['os_build'])) {
        $p_filter_arr['os_build'] = array(0 => META_FILTER_ANY);
    }
    if (!isset($p_filter_arr['project_id'])) {
        $p_filter_arr['project_id'] = array(0 => META_FILTER_CURRENT);
    }
    if (!isset($p_filter_arr['start_month'])) {
        $p_filter_arr['start_month'] = gpc_get_string('start_month', date('m'));
    }
    if (!isset($p_filter_arr['start_day'])) {
        $p_filter_arr['start_day'] = gpc_get_string('start_day', 1);
    }
    if (!isset($p_filter_arr['start_year'])) {
        $p_filter_arr['start_year'] = gpc_get_string('start_year', date('Y'));
    }
    if (!isset($p_filter_arr['end_month'])) {
        $p_filter_arr['end_month'] = gpc_get_string('end_month', date('m'));
    }
    if (!isset($p_filter_arr['end_day'])) {
        $p_filter_arr['end_day'] = gpc_get_string('end_day', date('d'));
    }
    if (!isset($p_filter_arr['end_year'])) {
        $p_filter_arr['end_year'] = gpc_get_string('end_year', date('Y'));
    }
    if (!isset($p_filter_arr['search'])) {
        $p_filter_arr['search'] = '';
    }
    if (!isset($p_filter_arr['and_not_assigned'])) {
        $p_filter_arr['and_not_assigned'] = gpc_get_bool('and_not_assigned', false);
    }
    if (!isset($p_filter_arr['do_filter_by_date'])) {
        $p_filter_arr['do_filter_by_date'] = gpc_get_bool('do_filter_by_date', false);
    }
    if (!isset($p_filter_arr['view_state'])) {
        $p_filter_arr['view_state'] = gpc_get('view_state', '');
    } else {
        if ($p_filter_arr['view_state'] == 'any' || $p_filter_arr['view_state'] == 0) {
            $p_filter_arr['view_state'] = META_FILTER_ANY;
        }
    }
    if (!isset($p_filter_arr['relationship_type'])) {
        $p_filter_arr['relationship_type'] = gpc_get_int('relationship_type', -1);
    }
    if (!isset($p_filter_arr['relationship_bug'])) {
        $p_filter_arr['relationship_bug'] = gpc_get_int('relationship_bug', 0);
    }
    if (!isset($p_filter_arr['target_version'])) {
        $p_filter_arr['target_version'] = META_FILTER_ANY;
    }
    if (!isset($p_filter_arr['tag_string'])) {
        $p_filter_arr['tag_string'] = gpc_get_string('tag_string', '');
    }
    if (!isset($p_filter_arr['tag_select'])) {
        $p_filter_arr['tag_select'] = gpc_get_string('tag_select', '');
    }
    $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) && sizeof($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, META_FILTER_ANY);
            } else {
                $f_custom_fields_data[$t_cfid] = gpc_get_string('custom_field_' . $t_cfid, 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'))) {
            unset($t_fields[$i]);
        }
    }
    $t_sort_fields = split(',', $p_filter_arr['sort']);
    $t_dir_fields = split(',', $p_filter_arr['dir']);
    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(substr($t_sort, 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('show_category' => 'string', 'show_severity' => 'int', 'show_status' => 'int', 'reporter_id' => 'int', 'handler_id' => 'int', 'show_resolution' => 'int', 'show_priority' => 'int', 'show_build' => 'string', 'show_version' => 'string', 'hide_status' => 'int', 'fixed_in_version' => 'string', 'target_version' => 'string', 'user_monitor' => 'int', 'show_profile' => '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 ('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[] = db_prepare_string($t_filter_value);
                } else {
                    if ('int' == $t_multi_field_type) {
                        $t_checked_array[] = db_prepare_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) && sizeof($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[] = db_prepare_string($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;
}
        }
    }
    if ($t_workflow == $t_workflow_parent && $f_access == $t_access_current) {
        # If new value is equal to parent and access has not changed
        config_delete('status_enum_workflow', ALL_USERS, $t_project);
    } else {
        if ($t_workflow != config_get('status_enum_workflow') || $f_access != $t_access_current) {
            # Set config if value or access have changed
            config_set('status_enum_workflow', $t_workflow, NO_USER, $t_project, $f_access);
        }
    }
}
# process the access level changes
if (config_get_access('status_enum_workflow') <= $t_access) {
    # get changes to access level to change these values
    $f_access = gpc_get('status_access');
    $t_access_current = config_get_access('status_enum_workflow');
    # Build access level reference arrays (parent level and current config)
    $t_set_parent = config_get_parent($t_project, 'set_status_threshold');
    $t_set_current = config_get('set_status_threshold');
    $t_bug_submit_status = config_get('bug_submit_status');
    foreach ($t_enum_status as $t_status => $t_status_label) {
        if (!isset($t_set_parent[$t_status])) {
            if ($t_bug_submit_status == $t_status) {
                $t_set_parent[$t_status] = config_get_parent($t_project, 'report_bug_threshold');
            } else {
                $t_set_parent[$t_status] = config_get_parent($t_project, 'update_bug_status_threshold');
            }
        }
        if (!isset($t_set_current[$t_status])) {
            if ($t_bug_submit_status == $t_status) {
Example #16
0
# along with MantisBT.  If not, see <http://www.gnu.org/licenses/>.
/**
 * This upgrade moves attachments from the database to the disk
 * @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
 */
/**
 * MantisBT Core API's
 */
require_once dirname(dirname(__FILE__)) . '/core.php';
form_security_validate('move_attachments_project_select');
access_ensure_global_level(config_get_global('admin_site_threshold'));
$f_file_type = gpc_get('type');
$f_projects_to_disk = gpc_get('to_disk', null);
/**
 * Moves attachments from the specified list of projects from database to disk
 * @param string $p_type Attachment type ('bug' or 'project')
 * @param array $p_projects List of projects to process
 * @return array summary of moves per project
 */
function move_attachments_to_disk($p_type, $p_projects)
{
    if (empty($p_projects)) {
        return array();
    }
    # Build the SQL query based on attachment type
    $t_file_table = db_get_table("mantis_{$p_type}_file_table");
    switch ($p_type) {
        case 'project':
#  Autochange status Plugin for Mantis BugTracker :
#  © Hennes Hervé <*****@*****.**>
#    2015-2016
#  http://www.h-hennes.fr/blog/
auth_reauthenticate();
access_ensure_global_level(config_get('manage_plugin_threshold'));
html_page_top(plugin_lang_get('title'));
print_manage_menu();
#Gestion de la soumission du formulaire (Création )
if (gpc_get('submitCreate', false)) {
    $query = "INSERT INTO mantis_autochange_status\r\n        (`project_id`,`from_status`,`to_status`,`status_days`,`reminder`,`reminder_message`,`reminder_days`,`active`)\r\n        VALUES ( " . db_param() . "," . db_param() . "," . db_param() . "," . db_param() . "," . db_param() . "," . db_param() . "," . db_param() . "," . db_param() . ")";
    db_query_bound($query, array(gpc_get_int('project_id'), gpc_get_int('from_status'), gpc_get_int('to_status'), gpc_get_int('status_days'), gpc_get_int('reminder'), gpc_get_string('reminder_message'), gpc_get_int('reminder_days'), gpc_get_int('active')));
    print_successful_redirect(plugin_page('config', true));
}
#Gestion de la soumission du formulaire (Mise à jour )
if (gpc_get('submitEdit', false)) {
    $query = "UPDATE mantis_autochange_status " . "SET `project_id` =" . db_param() . ",`from_status`=" . db_param() . ",`to_status`=" . db_param() . ",`status_days`=" . db_param() . ",`reminder`=" . db_param() . ",`reminder_message`=" . db_param() . ",`reminder_days`=" . db_param() . ",`active`=" . db_param() . "" . " WHERE changestatus_id=" . db_param();
    db_query_bound($query, array(gpc_get_int('project_id'), gpc_get_int('from_status'), gpc_get_int('to_status'), gpc_get_int('status_days'), gpc_get_int('reminder'), gpc_get_string('reminder_message'), gpc_get_int('reminder_days'), gpc_get_int('active'), gpc_get_int('changestatus_id')));
    print_successful_redirect(plugin_page('config', true));
}
#Mise à jour récupération des données
if ($edit_id = gpc_get_int('changestatus_id', false)) {
    $change_query = db_query("SELECT * FROM mantis_autochange_status WHERE changestatus_id=" . $edit_id);
    $change_datas = db_fetch_array($change_query);
}
#Bug rencontrés avec certains workflow
include_once dirname(__FILE__) . '/functions.php';
$function = 'print_status_option_list_plugin';
$t_projects = project_cache_all();
?>
<h2><?php 
Example #18
0
#
# 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 2000 - 2002  Kenzaburo Ito - kenito@300baud.org
 * @copyright Copyright 2002  MantisBT Team   - mantisbt-dev@lists.sourceforge.net
 * @link http://www.mantisbt.org
 */
/**
 * Mantis Core API's
 */
require_once dirname(dirname(__FILE__)) . DIRECTORY_SEPARATOR . 'core.php';
access_ensure_global_level(config_get_global('admin_site_threshold'));
html_page_top();
$f_to = gpc_get('send', null);
if ($f_to !== null) {
    if ($f_to == 'all') {
        echo "Sending emails...<br />";
        email_send_all();
        echo "Done";
    } else {
        if ($f_to == 'sendordelall') {
            echo "Sending or deleting emails...<br />";
            email_send_all(true);
            echo "Done";
        } else {
            $t_email_data = email_queue_get((int) $f_to);
            // check if email was found.  This can fail if another request picks up the email first and sends it.
            echo 'Sending email...<br />';
            if ($t_email_data !== false) {
Example #19
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;
}
            $t_workflow[$t_state] = $t_workflow_row;
        }
    }
    if ($t_workflow != config_get('status_enum_workflow')) {
        config_set('status_enum_workflow', $t_workflow, NO_USER, $t_project, $f_access);
    }
}
# process the access level changes
if (config_get_access('status_enum_workflow') <= $t_access) {
    # get changes to access level to change these values
    $f_access = gpc_get('status_access');
    # walk through the status labels to set the status threshold
    $t_enum_status = explode_enum_string(config_get('status_enum_string'));
    $t_set_status = array();
    foreach ($t_statuses as $t_status_id => $t_status_label) {
        $f_level = gpc_get('access_change_' . $t_status_id);
        if (NEW_ == $t_status_id) {
            if ((int) $f_level != config_get('report_bug_threshold')) {
                config_set('report_bug_threshold', (int) $f_level, ALL_USERS, $t_project, $f_access);
            }
        } else {
            $t_set_status[$t_status_id] = (int) $f_level;
        }
    }
    if ($t_set_status != config_get('set_status_threshold')) {
        config_set('set_status_threshold', $t_set_status, ALL_USERS, $t_project, $f_access);
    }
}
?>

<br />
# --------------------------------------------------------
# $Id: admin_manage_users_edit.php,v 1.8 2002/10/07 02:54:39 vboctor Exp $
# --------------------------------------------------------
require_once 'core' . DIRECTORY_SEPARATOR . 'api.php';
login_cookie_check();
access_ensure_check_action(ACTION_USERS_EDIT);
print_html_top();
print_head_top();
print_title($g_window_title);
print_css($g_css_inc_file);
print_head_bottom();
print_body_top();
print_header($g_page_title);
print_top_page($g_top_page_inc);
print_admin_menu();
$f_user_id = gpc_get('f_user_id');
$t_user_array = user_get_row($f_user_id);
extract($t_user_array, EXTR_PREFIX_ALL, 'v');
# @@@ Need to LOCALIZE text
?>
<div align="center">
<div class="small-width">
<form method="post" action="<?php 
echo $g_admin_manage_users_update;
?>
">
<input type="hidden" name="f_user_id" value="<?php 
echo $v_id;
?>
" />
<table class="box" summary="">
$result = @db_connect(config_get_global('dsn', false), config_get_global('hostname'), config_get_global('db_username'), config_get_global('db_password'), config_get_global('database_name'));
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";
Example #23
0
/**
 * This upgrade moves attachments from the database to the disk
 * @package MantisBT
 * @copyright Copyright (C) 2000 - 2002  Kenzaburo Ito - kenito@300baud.org
 * @copyright Copyright (C) 2002 - 2011  MantisBT Team - mantisbt-dev@lists.sourceforge.net
 * @link http://www.mantisbt.org
 */
/**
 * MantisBT Core API's
 */
require_once( dirname( dirname( __FILE__ ) ) . DIRECTORY_SEPARATOR . 'core.php' );

access_ensure_global_level( config_get_global( 'admin_site_threshold' ) );

// Move type should be attachment or project.
$f_move_type = gpc_get( 'doc' );

function get_prefix( $file_path ) {
	if( substr( $file_path, 0, 1 ) == '/' ) {

		# Unix absolute
		return '';
	}
	if( substr( $file_path, 0, 1 ) == '\\' ) {

		# Windows absolute
		return '';
	}
	if( substr( $file_path, 1, 2 ) == ':\\' ) {

		# Windows absolute
Example #24
0
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('event_api.php');
require_api('form_api.php');
require_api('gpc_api.php');
require_api('html_api.php');
require_api('lang_api.php');
require_api('print_api.php');
auth_reauthenticate();
access_ensure_global_level(config_get('create_project_threshold'));
html_page_top();
print_manage_menu('manage_proj_create_page.php');
$f_parent_id = gpc_get('parent_id', null);
if (project_table_empty()) {
    echo '<br />';
    echo '<div id="create-first-project" class="important-msg">';
    echo '<ul>';
    echo '<li>' . lang_get('create_first_project') . '</li>';
    echo '</ul>';
    echo '</div>';
}
?>

<div id="manage-project-create-div" class="form-container">
	<form method="post" id="manage-project-create-form" action="manage_proj_create.php">
		<fieldset class="has-required"><?php 
echo form_security_field('manage_proj_create');
if (null !== $f_parent_id) {
/**
 * Set capability enum
 * @param string  $p_threshold         Threshold.
 * @param boolean $p_all_projects_only All projects only.
 * @return void
 */
function set_capability_enum($p_threshold, $p_all_projects_only = false)
{
    global $g_access, $g_project;
    if ($g_access >= config_get_access($p_threshold) && (ALL_PROJECTS == $g_project || !$p_all_projects_only)) {
        $f_flag = gpc_get('flag_' . $p_threshold);
        $f_access = gpc_get_int('access_' . $p_threshold);
        if ($f_flag != config_get($p_threshold) || $f_access != config_get_access($p_threshold)) {
            config_set($p_threshold, $f_flag, NO_USER, $g_project, $f_access);
        }
    }
}
Example #26
0
					</td>
					<td>
						<?php echo $t_period->period_selector( 'interval' ); ?>
					</td>
					<td>
						<?php echo get_dropdown( $t_show, 'show_table', $f_show_as_table ? 1 : 0 ); ?>
					</td>
					<td>
						<input type="submit" name="show" value="<?php echo plugin_lang_get( 'show_graph' ); ?>" />
					</td>
				</tr>
			</table>
		</form>
<?php
// build the graphs if both an interval and graph type are selected
if ( ( 0 != $f_type ) && ( $f_interval > 0 ) && ( gpc_get( 'show', '' ) != '') ) {
	$t_width = plugin_config_get( 'window_width' );
	$t_summary = ( $f_type % 2 ) != 0;
	$t_body = (int)( $f_type / 2 );
	$f_start = $t_period->get_start_formatted();
	$f_end = $t_period->get_end_formatted();
	if ( ($t_body == 1 ) || ($t_body == 3) ) {
		if ( $f_show_as_table ) {
			echo '<br /><iframe src="' . plugin_page( 'bug_graph_bystatus.php' ) . '&amp;width='.$t_width.'&amp;interval=' . $f_interval .
			     '&amp;start_date=' . $f_start . '&amp;end_date=' . $f_end .
			     '&amp;summary=' . $t_summary . '&amp;show_table=1" width="100%" height="80%" frameborder="0"' .
			     ' marginwidth="0" marginheight="0"></iframe>';
		} else {
			echo '<br /><img src="' . plugin_page( 'bug_graph_bystatus.php' ) . '&amp;width=600&amp;interval=' . $f_interval .
			     '&amp;start_date=' . $f_start . '&amp;end_date=' . $f_end .
			     '&amp;summary=' . $t_summary . '&amp;show_table=0" alt="Bug Graph" />';
Example #27
0
require_api('config_api.php');
require_api('constant_inc.php');
require_api('current_user_api.php');
require_api('email_api.php');
require_api('form_api.php');
require_api('gpc_api.php');
require_api('html_api.php');
require_api('lang_api.php');
require_api('print_api.php');
require_api('string_api.php');
require_api('user_api.php');
require_api('utility_api.php');
form_security_validate('account_update');
# If token is set, it's a password reset request from verify.php, and if
# not we need to reauthenticate the user
$t_verify_user_id = gpc_get('verify_user_id', false);
$t_account_verification = $t_verify_user_id ? token_get_value(TOKEN_ACCOUNT_VERIFY, $t_verify_user_id) : false;
if (!$t_account_verification) {
    auth_reauthenticate();
    $t_user_id = auth_get_current_user_id();
} else {
    # set a temporary cookie so the login information is passed between pages.
    auth_set_cookies($t_verify_user_id, false);
    # fake login so the user can set their password
    auth_attempt_script_login(user_get_field($t_verify_user_id, 'username'));
    $t_user_id = $t_verify_user_id;
}
auth_ensure_user_authenticated();
current_user_ensure_unprotected();
$f_email = gpc_get_string('email', '');
$f_realname = gpc_get_string('realname', '');