当前位置: 首页>>代码示例>>PHP>>正文


PHP access_has_global_level函数代码示例

本文整理汇总了PHP中access_has_global_level函数的典型用法代码示例。如果您正苦于以下问题:PHP access_has_global_level函数的具体用法?PHP access_has_global_level怎么用?PHP access_has_global_level使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了access_has_global_level函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: 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_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) {
                    $g_action_attach_tags_create[] = $t_tag_row;
                } else {
                    $g_action_attach_tags_failed[] = $t_tag_row;
                }
            } elseif (-2 == $t_tag_row['id']) {
                $g_action_attach_tags_failed[] = $t_tag_row;
            } else {
                $g_action_attach_tags_attach[] = $t_tag_row;
            }
        }
        if (0 < $f_tag_select && tag_exists($f_tag_select)) {
            $g_action_attach_tags_attach[] = tag_get($f_tag_select);
        }
    }
    global $g_action_attach_tags_attach, $g_action_attach_tags_create, $g_action_attach_tags_failed;
    return true;
}
开发者ID:jin255ff,项目名称:company_website,代码行数:40,代码来源:bug_actiongroup_attach_tags_inc.php

示例2: mci_account_get_array_by_id

/**
 * Get username, realname and email from for a given user id
 * @param integer $p_user_id A valid user identifier.
 * @return array
 */
function mci_account_get_array_by_id($p_user_id)
{
    $t_result = array();
    $t_result['id'] = $p_user_id;
    if (user_exists($p_user_id)) {
        $t_current_user_id = auth_get_current_user_id();
        $t_access_level = user_get_field($t_current_user_id, 'access_level');
        $t_can_manage = access_has_global_level(config_get('manage_user_threshold')) && access_has_global_level($t_access_level);
        # this deviates from the behaviour of view_user_page.php, but it is more intuitive
        $t_is_same_user = $t_current_user_id === $p_user_id;
        $t_can_see_realname = access_has_project_level(config_get('show_user_realname_threshold'));
        $t_can_see_email = access_has_project_level(config_get('show_user_email_threshold'));
        $t_result['name'] = user_get_field($p_user_id, 'username');
        if ($t_is_same_user || $t_can_manage || $t_can_see_realname) {
            $t_realname = user_get_realname($p_user_id);
            if (!empty($t_realname)) {
                $t_result['real_name'] = $t_realname;
            }
        }
        if ($t_is_same_user || $t_can_manage || $t_can_see_email) {
            $t_email = user_get_email($p_user_id);
            if (!empty($t_email)) {
                $t_result['email'] = $t_email;
            }
        }
    }
    return $t_result;
}
开发者ID:gtn,项目名称:mantisbt,代码行数:33,代码来源:mc_account_api.php

示例3: options

 function options()
 {
     plugin_push_current('CustomerManagement');
     if (access_has_global_level(plugin_config_get('view_customer_fields_threshold'))) {
         $options = array(1 => lang_get('yes'), 2 => lang_get('no'));
     }
     plugin_pop_current();
     return $options;
 }
开发者ID:WilfriedMartin,项目名称:customer-management,代码行数:9,代码来源:IsBillableFilter.php

示例4: display

 public function display($p_bug, $p_columns_target)
 {
     plugin_push_current('CustomerManagement');
     if (access_has_global_level(plugin_config_get('view_customer_fields_threshold'))) {
         $bugData = CustomerManagementDao::getBugData($p_bug->id);
         if (count($bugData) > 0) {
             $group = CustomerManagementDao::getGroupForCustomer($bugData['customer_id']);
             echo string_display_line($group['name']);
         }
     }
     plugin_pop_current();
 }
开发者ID:WilfriedMartin,项目名称:customer-management,代码行数:12,代码来源:CustomerGroupColumn.php

示例5: display

 public function display($p_bug, $p_columns_target)
 {
     plugin_push_current('CustomerManagement');
     if (access_has_global_level(plugin_config_get('view_customer_fields_threshold'))) {
         $bugData = CustomerManagementDao::getBugData($p_bug->id);
         if (count($bugData) > 0) {
             $isBillable = CustomerManagementDao::getService($bugData['is_billable']);
             echo string_display_line($isBillable ? lang_get('yes') : lang_get('no'));
         }
     }
     plugin_pop_current();
 }
开发者ID:WilfriedMartin,项目名称:customer-management,代码行数:12,代码来源:IsBillableColumn.php

示例6: options

 function options()
 {
     plugin_push_current('CustomerManagement');
     if (access_has_global_level(plugin_config_get('view_customer_fields_threshold'))) {
         $options = array();
         foreach (CustomerManagementDao::findAllGroups() as $group) {
             $options[$group['id']] = $group['name'];
         }
     }
     plugin_pop_current();
     return $options;
 }
开发者ID:WilfriedMartin,项目名称:customer-management,代码行数:12,代码来源:CustomerGroupFilter.php

示例7: query

 function query($p_filter_input)
 {
     $invoice = $p_filter_input;
     if (is_blank($invoice)) {
         return;
     }
     plugin_push_current('CustomerManagement');
     if (access_has_global_level(plugin_config_get('view_customer_fields_threshold'))) {
         $t_query = CustomerManagementDao::buildFilterArrayForInvoice($invoice);
     }
     plugin_pop_current();
     return $t_query;
 }
开发者ID:WilfriedMartin,项目名称:customer-management,代码行数:13,代码来源:InvoiceFilter.php

示例8: plugin_TimeTracking_stats_get_project_array

/**
* Returns an array of time tracking stats
* @param int $p_project_id project id
* @param string $p_from Starting date (yyyy-mm-dd) inclusive, if blank, then ignored.
* @param string $p_to Ending date (yyyy-mm-dd) inclusive, if blank, then ignored.
* @return array array of bugnote stats
* @access public
*/
function plugin_TimeTracking_stats_get_project_array($p_project_id, $p_from, $p_to)
{
    $c_project_id = db_prepare_int($p_project_id);
    $c_to = "'" . date("Y-m-d", strtotime("{$p_to}") + SECONDS_PER_DAY - 1) . "'";
    $c_from = "'" . $p_from . "'";
    //strtotime( $p_from )
    if ($c_to === false || $c_from === false) {
        error_parameters(array($p_form, $p_to));
        trigger_error(ERROR_GENERIC, ERROR);
    }
    $t_timereport_table = plugin_table('data', 'TimeTracking');
    $t_bug_table = db_get_table('mantis_bug_table');
    $t_user_table = db_get_table('mantis_user_table');
    $t_project_table = db_get_table('mantis_project_table');
    if (!is_blank($c_from)) {
        $t_from_where = " AND expenditure_date >= {$c_from}";
    } else {
        $t_from_where = '';
    }
    if (!is_blank($c_to)) {
        $t_to_where = " AND expenditure_date <= {$c_to}";
    } else {
        $t_to_where = '';
    }
    if (ALL_PROJECTS != $c_project_id) {
        $t_project_where = " AND b.project_id = '{$c_project_id}'  ";
    } else {
        $t_project_where = '';
    }
    if (!access_has_global_level(plugin_config_get('view_others_threshold'))) {
        $t_user_id = auth_get_current_user_id();
        $t_user_where = " AND user = '{$t_user_id}'  ";
    } else {
        $t_user_where = '';
    }
    $t_results = array();
    $query = "SELECT u.username, p.name as project_name, bug_id, expenditure_date, hours, timestamp, info \nFROM {$t_timereport_table} tr, {$t_bug_table} b, {$t_user_table} u, {$t_project_table} p\nWHERE tr.bug_id=b.id and tr.user=u.id AND p.id = b.project_id\n{$t_project_where} {$t_from_where} {$t_to_where} {$t_user_where}\nORDER BY user, expenditure_date, bug_id";
    $result = db_query($query);
    while ($row = db_fetch_array($result)) {
        $t_results[] = $row;
    }
    return $t_results;
}
开发者ID:Hacho25,项目名称:timetracking,代码行数:51,代码来源:timetracking_api.php

示例9: ERP_print_menu

function ERP_print_menu($p_page = '')
{
    $t_pages = array('plugin_lang_get' => array('manage_config', 'manage_mailbox'), 'lang_get' => array('documentation_link' => 'view_readme', 'changelog_link' => 'view_changelog'));
    if (plugin_config_get('mail_rule_system') == TRUE) {
        $t_pages['plugin_lang_get'] = array_merge($t_pages['plugin_lang_get'], array('manage_rule'));
    }
    if (access_has_global_level(config_get('manage_plugin_threshold'))) {
        echo '<div align="center"><p>';
        foreach ($t_pages as $t_lang_function => $t_pageset) {
            foreach ($t_pageset as $t_page_lang => $t_page_name) {
                if (is_int($t_page_lang)) {
                    $t_page_lang = $t_page_name;
                }
                $t_page = $p_page !== $t_page_name ? plugin_page($t_page_name) : NULL;
                print_bracket_link($t_page, $t_lang_function($t_page_lang));
            }
        }
        echo '</p></div>';
    }
}
开发者ID:mikemol,项目名称:EmailReporting,代码行数:20,代码来源:config_api.php

示例10: post

 public function post($request)
 {
     /**
      * 	Creates a new user.
      *
      * 	The user will get a confirmation email, and will have the password provided
      * 	in the incoming representation.
      *
      * 	@param $request - The Request we're responding to
      */
     if (!access_has_global_level(config_get('manage_user_threshold'))) {
         throw new HTTPException(403, "Access denied to create user");
     }
     $new_user = new User();
     $new_user->populate_from_repr($request->body);
     $username = $new_user->mantis_data['username'];
     $password = $new_user->mantis_data['password'];
     $email = email_append_domain($new_user->mantis_data['email']);
     $access_level = $new_user->mantis_data['access_level'];
     $protected = $new_user->mantis_data['protected'];
     $enabled = $new_user->mantis_data['enabled'];
     $realname = $new_user->mantis_data['realname'];
     if (!user_is_name_valid($username)) {
         throw new HTTPException(500, "Invalid username");
     } elseif (!user_is_realname_valid($realname)) {
         throw new HTTPException(500, "Invalid realname");
     }
     user_create($username, $password, $email, $access_level, $protected, $enabled, $realname);
     $new_user_id = user_get_id_by_name($username);
     $new_user_url = User::get_url_from_mantis_id($new_user_id);
     $this->rsrc_data = $new_user_url;
     $resp = new Response();
     $resp->status = 201;
     $resp->headers[] = "location: {$new_user_url}";
     $resp->body = $this->_repr($request);
     return $resp;
 }
开发者ID:NetWielder,项目名称:mantis-rest,代码行数:37,代码来源:userlist.class.php

示例11: helper_show_queries

function helper_show_queries()
{
    # Check is authenticated before checking access level, otherwise user gets
    # redirected to login_page.php.  See #8461.
    return ON == config_get('show_queries_count') && auth_is_user_authenticated() && access_has_global_level(config_get('show_queries_threshold'));
}
开发者ID:amjadtbssm,项目名称:website,代码行数:6,代码来源:helper_api.php

示例12: helper_alternate_class

echo helper_alternate_class();
?>
>
	<td><?php 
echo $t_tag_row['id'];
?>
</td>
	<td><input type="text" <?php 
echo helper_get_tab_index();
?>
 name="name" value="<?php 
echo $t_name;
?>
"/></td>
	<td><?php 
if (access_has_global_level(config_get('tag_edit_threshold'))) {
    if (ON == config_get('use_javascript')) {
        $t_username = prepare_user_name($t_tag_row['user_id']);
        echo ajax_click_to_edit($t_username, 'user_id', 'entrypoint=user_combobox&user_id=' . $t_tag_row['user_id'] . '&access_level=' . config_get('tag_create_threshold'));
    } else {
        echo '<select ', helper_get_tab_index(), ' name="user_id">';
        print_user_option_list($t_tag_row['user_id'], ALL_PROJECTS, config_get('tag_create_threshold'));
        echo '</select>';
    }
} else {
    echo string_display_line(user_get_name($t_tag_row['user_id']));
}
?>
</td>
	<td><?php 
echo date(config_get('normal_date_format'), $t_tag_row['date_created']);
开发者ID:nourchene-benslimane,项目名称:mantisV0,代码行数:31,代码来源:tag_update_page.php

示例13: print_news_item_option_list

/**
 * Get current headlines and id  prefix with v_
 * @return void
 */
function print_news_item_option_list()
{
    $t_project_id = helper_get_current_project();
    $t_global = access_has_global_level(config_get_global('admin_site_threshold'));
    if ($t_global) {
        $t_query = 'SELECT id, headline, announcement, view_state FROM {news} ORDER BY date_posted DESC';
    } else {
        $t_query = 'SELECT id, headline, announcement, view_state FROM {news}
				WHERE project_id=' . db_param() . '
				ORDER BY date_posted DESC';
    }
    $t_result = db_query($t_query, $t_global == true ? array() : array($t_project_id));
    while ($t_row = db_fetch_array($t_result)) {
        $t_headline = string_display($t_row['headline']);
        $t_announcement = $t_row['announcement'];
        $t_view_state = $t_row['view_state'];
        $t_id = $t_row['id'];
        $t_notes = array();
        $t_note_string = '';
        if (1 == $t_announcement) {
            array_push($t_notes, lang_get('announcement'));
        }
        if (VS_PRIVATE == $t_view_state) {
            array_push($t_notes, lang_get('private'));
        }
        if (count($t_notes) > 0) {
            $t_note_string = ' [' . implode(' ', $t_notes) . ']';
        }
        echo '<option value="' . $t_id . '">' . $t_headline . $t_note_string . '</option>';
    }
}
开发者ID:gtn,项目名称:mantisbt,代码行数:35,代码来源:print_api.php

示例14: require_api

require_once 'core.php';
require_api('access_api.php');
require_api('compress_api.php');
require_api('config_api.php');
require_api('database_api.php');
require_api('form_api.php');
require_api('gpc_api.php');
require_api('helper_api.php');
require_api('html_api.php');
require_api('lang_api.php');
require_api('print_api.php');
require_api('string_api.php');
require_api('user_api.php');
access_ensure_global_level(config_get('tag_edit_threshold'));
compress_enable();
$t_can_edit = access_has_global_level(config_get('tag_edit_threshold'));
$f_filter = utf8_strtoupper(gpc_get_string('filter', config_get('default_manage_tag_prefix')));
$f_page_number = gpc_get_int('page_number', 1);
# Start Index Menu
$t_prefix_array = array('ALL');
for ($i = 'A'; $i != 'AA'; $i++) {
    $t_prefix_array[] = $i;
}
for ($i = 0; $i <= 9; $i++) {
    $t_prefix_array[] = (string) $i;
}
if ($f_filter === 'ALL') {
    $t_name_filter = '';
} else {
    $t_name_filter = $f_filter;
}
开发者ID:keetron,项目名称:mantisbt,代码行数:31,代码来源:manage_tags_page.php

示例15: helper_alternate_class

<?php 
# reset the class counter
helper_alternate_class(0);
?>

<!-- SUBPROJECTS -->
<div align="center">
<table class="width75" cellspacing="1">

<!-- Title -->
<tr>
	<td class="form-title" colspan="6">
		<?php 
echo lang_get('subprojects');
# Check the user's global access level before allowing project creation
if (access_has_global_level(config_get('create_project_threshold'))) {
    print_button('manage_proj_create_page.php?parent_id=' . $f_project_id, lang_get('create_new_subproject_link'));
}
?>
	</td>
</tr>

<!-- Subprojects -->
<form name="update_children_form" action="manage_proj_update_children.php" method="post">
<?php 
echo form_security_field('manage_proj_update_children');
?>
<input type="hidden" name="project_id" value="<?php 
echo $f_project_id;
?>
" />
开发者ID:kaos,项目名称:mantisbt,代码行数:31,代码来源:manage_proj_edit_page.php


注:本文中的access_has_global_level函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。