本文整理汇总了PHP中access_has_bug_level函数的典型用法代码示例。如果您正苦于以下问题:PHP access_has_bug_level函数的具体用法?PHP access_has_bug_level怎么用?PHP access_has_bug_level使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了access_has_bug_level函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: skip
/**
* Whether to skip this event after access checks
* @return boolean
*/
function skip()
{
if (!access_has_bug_level(config_get('view_handler_threshold'), $this->issue_id)) {
return true;
}
return false;
}
示例2: mci_file_can_download_bug_attachments
function mci_file_can_download_bug_attachments($p_bug_id, $p_user_id)
{
$t_can_download = access_has_bug_level(config_get('download_attachments_threshold'), $p_bug_id);
if ($t_can_download) {
return true;
}
$t_reported_by_me = bug_is_user_reporter($p_bug_id, $p_user_id);
return $t_reported_by_me && config_get('allow_download_own_attachments');
}
示例3: action_update_product_build_validate
/**
* Validates the action on the specified bug id.
*
* @param $p_bug_id Bug ID
* @return string|null On failure: the reason why the action could not be validated. On success: null.
*/
function action_update_product_build_validate($p_bug_id)
{
$t_bug_id = (int) $p_bug_id;
if (bug_is_readonly($t_bug_id)) {
return lang_get('actiongroup_error_issue_is_readonly');
}
if (!access_has_bug_level(config_get('update_bug_threshold'), $t_bug_id)) {
return lang_get('access_denied');
}
return null;
}
示例4: mc_issue_attachment_delete
/**
* Delete an issue attachment given its id.
*
* @param string $p_username The name of the user trying to add an attachment to an issue.
* @param string $p_password The password of the user.
* @param integer $p_issue_attachment_id The id of the attachment to be deleted.
* @return true: success, false: failure
*/
function mc_issue_attachment_delete( $p_username, $p_password, $p_issue_attachment_id ) {
$t_user_id = mci_check_login( $p_username, $p_password );
if( $t_user_id === false ) {
return mci_soap_fault_login_failed();
}
$t_bug_id = file_get_field( $p_issue_attachment_id, 'bug_id' );
if( !access_has_bug_level( config_get( 'update_bug_threshold' ), $t_bug_id, $t_user_id ) ) {
return mci_soap_fault_access_denied( $t_user_id );
}
return file_delete( $p_issue_attachment_id, 'bug' );
}
示例5: action_update_severity_validate
/**
* Validates the action on the specified bug id.
*
* @return string|null On failure: the reason why the action could not be validated. On success: null.
*/
function action_update_severity_validate($p_bug_id)
{
$f_severity = gpc_get_string('severity');
$t_update_severity_threshold = config_get('update_bug_threshold');
$t_bug_id = $p_bug_id;
if (bug_is_readonly($t_bug_id)) {
return lang_get('actiongroup_error_issue_is_readonly');
}
if (!access_has_bug_level($t_update_severity_threshold, $t_bug_id)) {
return lang_get('access_denied');
}
return null;
}
示例6: action_update_product_build_validate
/**
* Validates the action on the specified bug id.
*
* @param $p_bug_id Bug ID
* @return true|array Action can be applied., bug_id => reason for failure
*/
function action_update_product_build_validate($p_bug_id)
{
$t_bug_id = (int) $p_bug_id;
if (bug_is_readonly($t_bug_id)) {
$t_failed_validation_ids = array();
$t_failed_validation_ids[$t_bug_id] = lang_get('actiongroup_error_issue_is_readonly');
return $t_failed_validation_ids;
}
if (!access_has_bug_level(config_get('update_bug_threshold'), $t_bug_id)) {
$t_failed_validation_ids = array();
$t_failed_validation_ids[$t_bug_id] = lang_get('access_denied');
return $t_failed_validation_ids;
}
return true;
}
示例7: action_update_severity_validate
/**
* Validates the action on the specified bug id.
*
* @returns true Action can be applied.
* @returns array( bug_id => reason for failure )
*/
function action_update_severity_validate($p_bug_id)
{
$f_severity = gpc_get_string('severity');
$t_failed_validation_ids = array();
$t_update_severity_threshold = config_get('update_bug_threshold');
$t_bug_id = $p_bug_id;
if (bug_is_readonly($t_bug_id)) {
$t_failed_validation_ids[$t_bug_id] = lang_get('actiongroup_error_issue_is_readonly');
return $t_failed_validation_ids;
}
if (!access_has_bug_level($t_update_severity_threshold, $t_bug_id)) {
$t_failed_validation_ids[$t_bug_id] = lang_get('access_denied');
return $t_failed_validation_ids;
}
return true;
}
示例8: action_attach_tags_validate
/**
* Validates the Attach Tags group action.
* Gets called for every bug, but performs the real tag validation only
* the first time. Any invalid tags will be skipped, as there is no simple
* or clean method of presenting these errors to the user.
* @param integer Bug ID
* @return boolean True
*/
function action_attach_tags_validate($p_bug_id)
{
global $g_action_attach_tags_valid;
if (!isset($g_action_attach_tags_valid)) {
$f_tag_string = gpc_get_string('tag_string');
$f_tag_select = gpc_get_string('tag_select');
global $g_action_attach_tags_attach, $g_action_attach_tags_create, $g_action_attach_tags_failed;
$g_action_attach_tags_attach = array();
$g_action_attach_tags_create = array();
$g_action_attach_tags_failed = array();
$t_tags = tag_parse_string($f_tag_string);
$t_can_attach = access_has_bug_level(config_get('tag_attach_threshold'), $p_bug_id);
$t_can_create = access_has_global_level(config_get('tag_create_threshold'));
foreach ($t_tags as $t_tag_row) {
if (-1 == $t_tag_row['id']) {
if ($t_can_create && $t_can_attach) {
$g_action_attach_tags_create[] = $t_tag_row;
} else {
$g_action_attach_tags_failed[] = $t_tag_row;
}
} else {
if (-2 == $t_tag_row['id']) {
$g_action_attach_tags_failed[] = $t_tag_row;
} else {
if ($t_can_attach) {
$g_action_attach_tags_attach[] = $t_tag_row;
} else {
$g_action_attach_tags_failed[] = $t_tag_row;
}
}
}
}
if (0 < $f_tag_select && tag_exists($f_tag_select)) {
if ($t_can_attach) {
$g_action_attach_tags_attach[] = tag_get($f_tag_select);
} else {
$g_action_attach_tags_failed[] = tag_get($f_tag_select);
}
}
}
global $g_action_attach_tags_attach, $g_action_attach_tags_create, $g_action_attach_tags_failed;
return true;
}
示例9: mc_issue_attachment_delete
/**
* Delete an issue attachment given its id.
*
* @param string $p_username The name of the user trying to add an attachment to an issue.
* @param string $p_password The password of the user.
* @param integer $p_issue_attachment_id The id of the attachment to be deleted.
* @return true: success, false: failure
*/
function mc_issue_attachment_delete($p_username, $p_password, $p_issue_attachment_id)
{
$t_user_id = mci_check_login($p_username, $p_password);
if ($t_user_id === false) {
return mci_soap_fault_login_failed();
}
$t_bug_id = file_get_field($p_issue_attachment_id, 'bug_id');
# Perform access control checks
$t_attachment_owner = file_get_field($p_issue_attachment_id, 'user_id');
$t_current_user_is_attachment_owner = $t_attachment_owner == $t_user_id;
# Factor in allow_delete_own_attachments=ON|OFF
if (!$t_current_user_is_attachment_owner || $t_current_user_is_attachment_owner && !config_get('allow_delete_own_attachments')) {
# Check access against delete_attachments_threshold
if (!access_has_bug_level(config_get('delete_attachments_threshold'), $t_bug_id, $t_user_id)) {
return mci_soap_fault_access_denied($t_user_id);
}
}
return file_delete($p_issue_attachment_id, 'bug');
}
示例10: worklogmenu
function worklogmenu()
{
if (ON == plugin_config_get('promote_text')) {
$bugid = gpc_get_int('id');
if (access_has_bug_level(plugin_config_get('promote_threshold'), $bugid)) {
$t_bug_p = bug_get($bugid, true);
if (OFF == plugin_config_get('project_text')) {
$proj_id = 0;
} else {
$proj_id = $t_bug_p->project_id;
}
$subject = urlencode($t_bug_p->description);
$subject .= " ";
$subject .= urlencode($t_bug_p->additional_information);
$content = category_full_name($t_bug_p->category_id);
$content .= " -> ";
$content .= urlencode($t_bug_p->summary);
if (ON == plugin_config_get('worklog_view_check')) {
$import_page = 'worklog_add_page2.php';
} else {
$import_page = 'worklog_add.php';
}
$import_page .= '&log_type=0&';
$import_page .= '&ref_log_ids=';
$import_page .= '&ref_issue_ids=';
$import_page .= '&log_begin=';
$import_page .= '&log_end=';
$import_page .= '&content=';
$import_page .= $content;
$import_page .= '&subject=';
$import_page .= $subject;
$import_page .= '&project_id=';
$import_page .= $proj_id;
if (ON == plugin_config_get('worklog_view_check')) {
return array(plugin_lang_get('import_worklog') => plugin_page($import_page) . '" target=_new>');
} else {
return array(plugin_lang_get('import_worklog') => plugin_page($import_page));
}
}
}
}
示例11: timeline_get_affected_issues
/**
* Get list of affected issues between a given time period
* @param integer $p_start_time Timestamp representing start time of the period.
* @param integer $p_end_time Timestamp representing end time of the period.
* @return array
*/
function timeline_get_affected_issues($p_start_time, $p_end_time)
{
$t_query = 'SELECT DISTINCT(bug_id) from {bug_history} WHERE date_modified >= ' . db_param() . ' AND date_modified < ' . db_param();
$t_result = db_query($t_query, array($p_start_time, $p_end_time));
$t_current_project = helper_get_current_project();
$t_all_issue_ids = array();
while (($t_row = db_fetch_array($t_result)) !== false) {
$t_all_issue_ids[] = $t_row['bug_id'];
}
bug_cache_array_rows($t_all_issue_ids);
$t_issue_ids = array();
foreach ($t_all_issue_ids as $t_issue_id) {
if ($t_current_project != ALL_PROJECTS && $t_current_project != bug_get_field($t_issue_id, 'project_id')) {
continue;
}
if (!access_has_bug_level(config_get('view_bug_threshold'), $t_issue_id)) {
continue;
}
$t_issue_ids[] = $t_issue_id;
}
return $t_issue_ids;
}
示例12: faqmenu
function faqmenu()
{
if (ON == plugin_config_get('promote_text')) {
$bugid = gpc_get_int('id');
if (access_has_bug_level(plugin_config_get('promote_threshold'), $bugid)) {
$t_bug_p = bug_get($bugid, true);
if (OFF == plugin_config_get('project_text')) {
$proj_id = 0;
} else {
$proj_id = $t_bug_p->project_id;
}
$answer = urlencode($t_bug_p->description);
$answer .= " ";
$answer .= urlencode($t_bug_p->additional_information);
$question = category_full_name($t_bug_p->category_id);
$question .= " -> ";
$question .= urlencode($t_bug_p->summary);
if (ON == plugin_config_get('faq_view_check')) {
$import_page = 'faq_add_page2.php';
} else {
$import_page = 'faq_add.php';
}
$import_page .= '&question=';
$import_page .= $question;
$import_page .= '&answere=';
$import_page .= $answer;
$import_page .= '&project_id=';
$import_page .= $proj_id;
if (ON == plugin_config_get('faq_view_check')) {
return array(plugin_lang_get('import_faq') => plugin_page($import_page) . '" target=_new>');
} else {
return array(plugin_lang_get('import_faq') => plugin_page($import_page));
}
}
}
}
示例13: print_column_handler_id
function print_column_handler_id($p_row, $p_columns_target = COLUMNS_TARGET_VIEW_PAGE)
{
echo '<td class="center">';
if ($p_row['handler_id'] > 0 && access_has_bug_level(config_get('view_handler_threshold'), $p_row['id'])) {
echo prepare_user_name($p_row['handler_id']);
}
echo '</td>';
}
示例14: lang_get
$t_failed_ids[$t_bug_id] = lang_get('bug_actiongroup_access');
}
break;
case 'VIEW_STATUS':
if (access_has_bug_level(config_get('change_view_status_threshold'), $t_bug_id)) {
$f_view_status = gpc_get_int('view_status');
# @todo we need to issue a helper_call_custom_function( 'issue_update_validate', array( $t_bug_id, $t_bug_data, $f_bugnote_text ) );
bug_set_field($t_bug_id, 'view_state', $f_view_status);
email_bug_updated($t_bug_id);
helper_call_custom_function('issue_update_notify', array($t_bug_id));
} else {
$t_failed_ids[$t_bug_id] = lang_get('bug_actiongroup_access');
}
break;
case 'SET_STICKY':
if (access_has_bug_level(config_get('set_bug_sticky_threshold'), $t_bug_id)) {
$f_sticky = bug_get_field($t_bug_id, 'sticky');
# The new value is the inverted old value
# @todo we need to issue a helper_call_custom_function( 'issue_update_validate', array( $t_bug_id, $t_bug_data, $f_bugnote_text ) );
bug_set_field($t_bug_id, 'sticky', intval(!$f_sticky));
helper_call_custom_function('issue_update_notify', array($t_bug_id));
} else {
$t_failed_ids[$t_bug_id] = lang_get('bug_actiongroup_access');
}
break;
case 'CUSTOM':
if (0 === $f_custom_field_id) {
trigger_error(ERROR_GENERIC, ERROR);
}
# @todo we need to issue a helper_call_custom_function( 'issue_update_validate', array( $t_bug_id, $t_bug_data, $f_bugnote_text ) );
$t_form_var = 'custom_field_' . $f_custom_field_id;
示例15: show_revision
function show_revision($t_revision)
{
static $s_can_drop = null;
static $s_drop_token = null;
static $s_user_access = null;
if (is_null($s_can_drop)) {
$s_can_drop = access_has_bug_level(config_get('bug_revision_drop_threshold'), $t_revision['bug_id']);
$s_drop_token = form_security_param('bug_revision_drop');
}
switch ($t_revision['type']) {
case REV_DESCRIPTION:
$t_label = lang_get('description');
break;
case REV_STEPS_TO_REPRODUCE:
$t_label = lang_get('steps_to_reproduce');
break;
case REV_ADDITIONAL_INFO:
$t_label = lang_get('additional_information');
break;
case REV_BUGNOTE:
if (is_null($s_user_access)) {
$s_user_access = access_has_bug_level(config_get('private_bugnote_threshold'), $t_revision['bug_id']);
}
if (!$s_user_access) {
return null;
}
$t_label = lang_get('bugnote');
break;
default:
$t_label = '';
}
$t_by_string = sprintf(lang_get('revision_by'), string_display_line(date(config_get('normal_date_format'), $t_revision['timestamp'])), string_display_line(user_get_name($t_revision['user_id'])));
?>
<tr class="spacer"><td><a id="revision-<?php
echo $t_revision['id'];
?>
"></a></td></tr>
<tr <?php
echo helper_alternate_class();
?>
>
<th class="category"><?php
echo lang_get('revision');
?>
</th>
<td colspan="2"><?php
echo $t_by_string;
?>
</td>
<td class="center" width="5%">
<?php
if ($s_can_drop) {
print_bracket_link('bug_revision_drop.php?id=' . $t_revision['id'] . $s_drop_token, lang_get('revision_drop'));
}
?>
</tr>
<tr <?php
echo helper_alternate_class();
?>
>
<th class="category"><?php
echo $t_label;
?>
</th>
<td colspan="3"><?php
echo string_display_links($t_revision['value']);
?>
</td>
</tr>
<?php
}