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


PHP give_acl函数代码示例

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


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

示例1: check_no_new_page

 function check_no_new_page()
 {
     global $config;
     global $id_grupo;
     if (!give_acl($config['id_user'], $id_grupo, "WM")) {
         return true;
     } else {
         return false;
     }
 }
开发者ID:dsyman2,项目名称:integriaims,代码行数:10,代码来源:wkp_Integria.php

示例2: check_workunit_permission

function check_workunit_permission($id_workunit)
{
    global $config;
    // Delete workunit with ACL / Project manager check
    $workunit = get_db_row('tworkunit', 'id', $id_workunit);
    if ($workunit === false) {
        return false;
    }
    $id_user = $workunit["id_user"];
    $id_task = get_db_value("id_task", "tworkunit_task", "id_workunit", $workunit["id"]);
    $id_project = get_db_value("id_project", "ttask", "id", $id_task);
    if ($id_user != $config["id_user"] && !give_acl($config["id_user"], 0, "PM") && !project_manager_check($id_project)) {
        return false;
    }
    return true;
}
开发者ID:dsyman2,项目名称:integriaims,代码行数:16,代码来源:functions_workunits.php

示例3: print_child_tree

function print_child_tree($id, $depth = 0)
{
    $children = get_inventory_children($id);
    if ($children === false || sizeof($children) == 0) {
        return;
    }
    foreach ($children as $child) {
        print_inventory_object($child['id'], $children, array(), true, true, $depth);
        if ($child['id_contract']) {
            /* Only check ACLs if the inventory has a contract */
            if (!give_acl($config['id_user'], get_inventory_group($child['id']), "VR")) {
                continue;
            } else {
                print_child_tree($child['id'], $depth + 1);
            }
        }
    }
}
开发者ID:dsyman2,项目名称:integriaims,代码行数:18,代码来源:inventory_tree.php

示例4: check_incident_access

function check_incident_access($id)
{
    global $config;
    if ($id) {
        $incident = get_incident($id);
        if ($incident !== false) {
            $id_grupo = $incident['id_grupo'];
        } else {
            echo "<h1>" . __("Ticket") . "</h1>";
            echo ui_print_error_message(__("There is no information for this ticket"), '', true, 'h3', true);
            echo "<br>";
            echo "<a style='margin-left: 90px' href='index.php?sec=incidents&sec2=operation/incidents/incident_search'>" . __("Try the search form to find the ticket") . "</a>";
            return false;
        }
    }
    if (isset($incident)) {
        //Incident creators must see their incidents
        $check_acl = enterprise_hook("incidents_check_incident_acl", array($incident));
        $standalone_check = enterprise_hook("manage_standalone", array($incident));
        if ($check_acl !== ENTERPRISE_NOT_HOOK && !$check_acl || $standalone_check !== ENTERPRISE_NOT_HOOK && !$standalone_check) {
            // Doesn't have access to this page
            audit_db($config['id_user'], $config["REMOTE_ADDR"], "ACL Violation", "Trying to access to ticket (External user) " . $id);
            include "general/noaccess.php";
            return false;
        }
    } else {
        if (!give_acl($config['id_user'], $id_grupo, "IR")) {
            // Doesn't have access to this page
            audit_db($config['id_user'], $config["REMOTE_ADDR"], "ACL Violation", "Trying to access to ticket " . $id);
            include "general/noaccess.php";
            return false;
        } else {
            //No incident but ACLs enabled
            echo ui_print_error_message(__("The ticket doesn't exist"), '', true, 'h3', true);
            return false;
        }
    }
    return true;
}
开发者ID:articaST,项目名称:integriaims,代码行数:39,代码来源:incident_summary.php

示例5: get_db_value

if ($get_group_details) {
    if (!give_acl($config["id_user"], $id, "IR")) {
        return;
    }
    $default_user = get_db_value('id_user_default', 'tgrupo', 'id_grupo', $id);
    $real_name = get_db_value('nombre_real', 'tusuario', 'id_usuario', $default_user);
    $group = array();
    $group['forced_email'] = get_db_value('forced_email', 'tgrupo', 'id_grupo', $id);
    $group['user_real_name'] = $real_name;
    $group['id_user_default'] = $default_user;
    echo json_encode($group);
    if (defined('AJAX')) {
        return;
    }
}
if (!give_acl($config["id_user"], 0, "UM")) {
    audit_db($config["id_user"], $config["REMOTE_ADDR"], "ACL Violation", "Trying to access group management");
    require "general/noaccess.php";
    exit;
}
echo '<h1>' . __('Group management') . '</h1>';
$create_group = (bool) get_parameter('create_group');
$update_group = (bool) get_parameter('update_group');
$delete_group = (bool) get_parameter('delete_group');
// Create group
if ($create_group) {
    $name = (string) get_parameter('name');
    $icon = (string) get_parameter('icon');
    $parent = (int) get_parameter('parent');
    $soft_limit = (int) get_parameter('soft_limit');
    $hard_limit = (int) get_parameter('hard_limit');
开发者ID:keunes,项目名称:integriaims,代码行数:31,代码来源:lista_grupos.php

示例6: __

if($pdf_output == 0) {
	// Prev. year
	echo "<a href='index.php?sec=users&sec2=operation/user_report/report_annual&year=$prev_year&id_user=$id_user_show&clean_output=$clean_output'><img src='images/control_rewind_blue.png' title='" . __('Previous year') . "' class='calendar_arrow'></a>";
}
echo "<span class='calendar-month' style='font-size: 0.93em; color: #FFFFFF; padding: 3px;'>$year</span>";
if($pdf_output == 0) {
	// Next. year
	echo "<a href='index.php?sec=users&sec2=operation/user_report/report_annual&year=$next_year&id_user=$id_user_show&clean_output=$clean_output'><img src='images/control_fastforward_blue.png' title='" . __('Next year') . "' class='calendar_arrow'></a>";
}
echo "</td></tr>";
echo "<tr><td colspan=4>";
echo "<form id='form-report_annual' name='xx' method=post action='index.php?sec=users&sec2=operation/user_report/report_annual'>";
echo "<table cellpadding=4 cellspacing=4 style='margin: 0px auto;'>";
echo "<tr><td>";

if (give_acl($config["id_user"], 0, "PM") && $pdf_output == 0){		

	echo "<input type='hidden' name='year' value='$year'>";
	
	echo "<td>";
	// Show user
	$params['input_id'] = 'text-id_user';
	$params['input_name'] = 'id_user';
	$params['return'] = false;
	$params['return_help'] = false;
	$params['input_value'] = $id_user_show;
	user_print_autocomplete_input($params);
	
	echo "</td>";	
			
	echo "<td>";
开发者ID:articaST,项目名称:integriaims,代码行数:31,代码来源:report_annual.php

示例7: __

    } else {
        echo "<a href='index.php?sec=customers&sec2=operation/newsletter/newsletter_definition'>" . __("Newsletters") . "</a></lI>";
    }
}
if ($show_people != MENU_HIDDEN) {
    // Users
    if ($sec == "users") {
        echo "<li id='current' class='people'>";
    } else {
        echo "<li class='people'>";
    }
    echo "<div>|</div>";
    echo "<a href='index.php?sec=users&sec2=operation/user_report/report_monthly'>" . __('People') . "</a></li>";
}
// Wiki
if (give_acl($config["id_user"], 0, "WR") && $show_wiki != MENU_HIDDEN) {
    // Wiki
    if ($sec == "wiki") {
        echo "<li id='current' class='wiki'>";
    } else {
        echo "<li class='wiki'>";
    }
    echo "<div>|</div>";
    echo "<a href='index.php?sec=wiki&sec2=operation/wiki/wiki'>" . __('Wiki') . "</a>";
    echo "<div>|</div></li>";
}
// Custom Screens
if ((int) enterprise_include('custom_screens/CustomScreensManager.php', true) != ENTERPRISE_NOT_HOOK) {
    $custom_screens = CustomScreensManager::getInstance()->getCustomScreensList(false);
    if (!empty($custom_screens)) {
        $custom_link = '';
开发者ID:dsyman2,项目名称:integriaims,代码行数:31,代码来源:main_menu.php

示例8: combo_download_categories

function combo_download_categories($id_category, $show_any = false, $label = false, $return = false)
{
    global $config;
    enterprise_include('include/functions_form.php');
    $result = enterprise_hook('combo_download_categories_extra', array($id_category, $show_any, $label, true));
    if ($result === ENTERPRISE_NOT_HOOK) {
        $sql = "SELECT * FROM tdownload_category ORDER BY 2";
        $result = process_sql($sql);
        if ($result == false) {
            $result = array();
        }
        $categories = array();
        foreach ($result as $row) {
            if (give_acl($config["id_user"], $row["id_group"], "KR")) {
                $categories[$row["id"]] = $row["name"];
            }
        }
        if ($show_any) {
            $nothing = __('Any');
        } else {
            $nothing = '';
        }
        if ($label) {
            $label = __('Category');
        } else {
            $label = false;
        }
        $result = print_select($categories, 'id_category', $id_category, '', $nothing, 0, $return, 0, false, $label);
    }
    if ($return) {
        return $result;
    } else {
        echo $result;
    }
}
开发者ID:keunes,项目名称:integriaims,代码行数:35,代码来源:functions_form.php

示例9: __

        $data[3] = "<a href='" . $config["base_url"] . "/include/newsletter.php?operation=subscribe&id=" . $newsletter["id"] . "'>" . __("Full form") . "</a><br>";
        $data[3] .= "<a href='" . $config["base_url"] . "/include/newsletter.php?operation=subscribe&id=" . $newsletter["id"] . "&clean=1'>" . __("Clean form") . "</a>";
        $data[4] = "<a href='" . $config["base_url"] . "/include/newsletter.php?operation=desubscribe&id=" . $newsletter["id"] . "'>" . __("Full form") . "</a><br>";
        $data[4] .= "<a href='" . $config["base_url"] . "/include/newsletter.php?operation=desubscribe&id=" . $newsletter["id"] . "&clean=1'>" . __("Clean form") . "</a>";
        $validated_addr = get_db_sql("SELECT COUNT(id) FROM tnewsletter_address WHERE id_newsletter = " . $newsletter["id"] . " AND validated = 1 AND status = 0");
        $data[5] = "<a href='index.php?sec=customers&sec2=operation/newsletter/address_definition&search_status=0&search_validate=0&search_newsletter=" . $newsletter["id"] . "'>" . $validated_addr . "</a>";
        $invalid_addr = get_db_sql("SELECT COUNT(id) FROM tnewsletter_address WHERE id_newsletter = " . $newsletter["id"] . " AND validated = 1 AND status = 1");
        $data[6] = "<a href='index.php?sec=customers&sec2=operation/newsletter/address_definition&search_status=1&search_validate=0&search_newsletter=" . $newsletter["id"] . "'>" . $invalid_addr . "</a>";
        $pending_validation = get_db_sql("SELECT COUNT(id) FROM tnewsletter_address WHERE id_newsletter = " . $newsletter["id"] . " AND validated = 0");
        $data[7] = "<a href='index.php?sec=customers&sec2=operation/newsletter/address_definition&search_validate=1&search_newsletter=" . $newsletter["id"] . "'>" . $pending_validation . "</a>";
        $data[8] = '<a href="index.php?sec=customers&sec2=operation/newsletter/newsletter_definition&
						validate_newsletter=1&id=' . $newsletter['id'] . '" 
						onClick="if (!confirm(\'' . __('Are you sure?') . '\'))
						return false;">
						<img src="images/accept.png" title="Forced email validation of pending addresses" ></a>';
        if (give_acl($config["id_user"], $id_group, "CN")) {
            $data[8] .= '<a href="index.php?sec=customers&sec2=operation/newsletter/newsletter_definition&
						delete=1&id=' . $newsletter['id'] . '"
						onClick="if (!confirm(\'' . __('Are you sure?') . '\'))
						return false;">
						<img src="images/cross.png"></a>';
        }
        array_push($table->data, $data);
    }
    print_table($table);
}
if ($manager) {
    echo '<form method="post" action="index.php?sec=customers&sec2=operation/newsletter/newsletter_creation&create=1">';
    echo '<div class="button" style="width: ' . $table->width . '">';
    print_submit_button(__('Create'), 'new_btn', false, 'class="sub next"');
    echo '</div>';
开发者ID:dsyman2,项目名称:integriaims,代码行数:31,代码来源:newsletter_definition.php

示例10: check_login

// GNU General Public License for more details.
// Load global vars
global $config;
check_login();
include_once 'include/functions_workunits.php';
if (!give_acl($config['id_user'], 0, "IR")) {
    audit_db($config['id_user'], $config["REMOTE_ADDR"], "ACL Violation", "Trying to access ticket viewer");
    require "general/noaccess.php";
    exit;
}
// GET ACTION PARAMETERS
$create_incident = get_parameter('create_incident');
if ($create_incident) {
    //Using simple interface an user with IW flag can create incidents
    //The incidents are not editable using simple interface
    if (!give_acl($config['id_user'], 0, "IW")) {
        audit_db($config['id_user'], $config["REMOTE_ADDR"], "ACL Forbidden", "User " . $config["id_user"] . " try to create ticket");
        no_permission();
        exit;
    }
    // Read input variables
    $title = get_parameter('title');
    $priority = get_parameter('priority_form', 2);
    $id_incident_type = get_parameter('id_incident_type', 0);
    $description = get_parameter('description');
    $group_id = get_parameter('group_id');
    // Get default variables
    $id_creator = $config["id_user"];
    $sla_disabled = 0;
    $id_task = 0;
    // N/A
开发者ID:dsyman2,项目名称:integriaims,代码行数:31,代码来源:incidents.php

示例11: get_parameter

echo "</h4>";
$search_form = (bool) get_parameter ('search_form');
$create_custom_search = (bool) get_parameter ('save-search');
$delete_custom_search = (bool) get_parameter ('delete_custom_search');
$id_search = get_parameter ('saved_searches');
$serialized_filter = get_parameter("serialized_filter");

//If serialize filter use the filter stored in a file in tmp dir
if ($serialized_filter) {
	$filter = unserialize_in_temp($config["id_user"]);
}

//Filter auxiliar array 
$filter_form = $filter;

$has_im  = give_acl ($config['id_user'], $filter_form['id_group'], "IM");

echo '<div id="msg_ok_hidden" style="display:none;">';
	echo ui_print_success_message (__('Custom filter saved'), '', true, 'h3', true);
echo '</div>';
echo '<div id="msg_error_hidden" style="display:none;">';
	echo ui_print_error_message (__('Could not create custom filter'), '', true, 'h3', true);
echo '</div>';

/* Get a custom filter*/
if ($id_search && !$delete_custom_search) {
	
	$search = get_custom_search ($id_search, 'incidents');
	
	if ($search) { 
		
开发者ID:articaST,项目名称:integriaims,代码行数:30,代码来源:incident_search_logic.php

示例12: get_incidents_on_inventory

function get_incidents_on_inventory($id_inventory, $only_names = true)
{
    $sql = sprintf('SELECT tincidencia.*
			FROM tincidencia, tincident_inventory
			WHERE tincidencia.id_incidencia = tincident_inventory.id_incident
			AND tincident_inventory.id_inventory = %d
			ORDER BY tincidencia.inicio DESC', $id_inventory);
    $all_incidents = get_db_all_rows_sql($sql);
    if ($all_incidents == false) {
        return array();
    }
    global $config;
    $incidents = array();
    foreach ($all_incidents as $incident) {
        if (give_acl($config['id_user'], $incident['id_grupo'], 'IR')) {
            if ($only_names) {
                $incidents[$incident['id']] = $incident['name'];
            } else {
                array_push($incidents, $incident);
            }
        }
    }
    return $incidents;
}
开发者ID:articaST,项目名称:integriaims,代码行数:24,代码来源:functions_db.php

示例13: __

    if (!$result['status']) {
        $result['message'] = __('Description not updated');
    }
    echo json_encode($result);
    return;
}
if ($get_file_row) {
    $id_file = (int) get_parameter("id_attachment");
    $id_company = (int) get_parameter("id");
    $file = get_db_row_filter('tattachment', array('id_company' => $id_company, 'id_attachment' => $id_file));
    $html = "";
    if ($file) {
        $link = "operation/common/download_file.php?id_attachment=" . $file["id_attachment"] . "&type=company";
        $real_filename = $config["homedir"] . "/attachment/" . $file["id_attachment"] . "_" . rawurlencode($file["filename"]);
        $html .= "<tr>";
        $html .= "<td valign=top>";
        $html .= '<a target="_blank" href="' . $link . '">' . $file['filename'] . '</a>';
        $html .= "<td valign=top class=f9>" . $file["description"];
        //$html .= "<td valign=top>". $file["id_usuario"];
        $html .= "<td valign=top>" . byte_convert($file['size']);
        $stat = stat($real_filename);
        $html .= "<td valign=top class=f9>" . date("Y-m-d H:i:s", $stat['mtime']);
        // Delete attachment
        if (give_acl($config['id_user'], $incident['id_grupo'], 'IM')) {
            $html .= "<td>" . '<a class="delete" name="delete_file_' . $file["id_attachment"] . '" href="index.php?sec=incidents&sec2=operation/incidents/incident_dashboard_detail&id=' . $id . '&tab=files&id_attachment=' . $file["id_attachment"] . '&delete_file=1#incident-operations">
			<img src="images/cross.png"></a>';
        }
    }
    echo $html;
    return;
}
开发者ID:articaST,项目名称:integriaims,代码行数:31,代码来源:companies.php

示例14: get_parameter

    require "general/noaccess.php";
    exit;
}
// Take input parameters
$id = (int) get_parameter('id');
$id_creator = get_parameter('id_creator');
// Delete incident
if (isset($_POST["quick_delete"])) {
    $id_inc = $_POST["quick_delete"];
    $sql2 = "SELECT * FROM tincidencia WHERE id_incidencia=" . $id_inc;
    $result2 = mysql_query($sql2);
    $row2 = mysql_fetch_array($result2);
    if ($row2) {
        $id_author_inc = $row2["id_usuario"];
        $email_notify = $row2["notify_email"];
        if (give_acl($config['id_user'], $row2["id_grupo"], "IM") || $config['id_user'] == $id_author_inc) {
            borrar_incidencia($id_inc);
            echo "<h3 class='suc'>" . __('Ticket successfully deleted') . "</h3>";
            audit_db($config["id_user"], $config["REMOTE_ADDR"], "Ticket deleted", "User " . $config['id_user'] . " deleted ticket #" . $id_inc);
        } else {
            audit_db($config["id_user"], $config["REMOTE_ADDR"], "ACL Forbidden", "User " . $config['id_user'] . " try to delete ticket");
            echo "<h3 class='error'>" . __('There was a problem deleting ticketticket') . "</h3>";
            no_permission();
        }
    }
}
/* Tabs code */
echo '<div id="tabs">';
/* Tabs list */
echo '<ul class="ui-tabs-nav">';
echo '<li class="ui-tabs-selected"><a href="#ui-tabs-1"><span><img src="images/zoom.png" title="' . __('Search') . '"></span></a></li>';
开发者ID:dsyman2,项目名称:integriaims,代码行数:31,代码来源:incident.php

示例15: get_parameter

	no_permission ();
}

echo '<h2>'.__('User details').'</h2>';
echo '<h4>'.$id_user.'</h4>';

$upload_avatar = (bool) get_parameter ('upload_avatar');
$update_user = (bool) get_parameter ('update_user');

$has_permission = false;
if ($id_user == $config['id_user']) {
	$has_permission = true;
} else {
	$groups = get_user_groups ($id_user);
	foreach ($groups as $group) {
		if (give_acl ($config['id_user'], $group['id'], 'UM')) {
			$has_permission = true;
			break;
		}
	}
}

/* Get fields for user */
$email = $user['direccion'];
$phone = $user['telefono'];
$real_name = $user['nombre_real'];
$avatar = $user['avatar'];
$comments = $user['comentarios'];
$lang = $user['lang'];
$id_company = $user['id_company'];
$location = $user['location'];
开发者ID:articaST,项目名称:integriaims,代码行数:31,代码来源:user_edit.php


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