本文整理汇总了PHP中enterprise_include函数的典型用法代码示例。如果您正苦于以下问题:PHP enterprise_include函数的具体用法?PHP enterprise_include怎么用?PHP enterprise_include使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了enterprise_include函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: load_file
function load_file($users_file, $group, $profile, $nivel, $pass_policy, $avatar)
{
$file_handle = fopen($users_file, "r");
global $config;
enterprise_include('include/functions_license.php', true);
$is_manager_profile = enterprise_hook('license_check_manager_profile', array($profile));
if ($is_manager_profile == ENTERPRISE_NOT_HOOK) {
$users_check = true;
} else {
if ($is_manager_profile) {
$users_check = enterprise_hook('license_check_manager_users_num');
} else {
$users_check = enterprise_hook('license_check_regular_users_num');
}
}
while (!feof($file_handle) && $users_check === true) {
$line = fgets($file_handle);
preg_match_all('/(.*),/', $line, $matches);
$values = explode(',', $line);
$id_usuario = $values[0];
$pass = $values[1];
$pass = md5($pass);
$nombre_real = $values[2];
$mail = $values[3];
$tlf = $values[4];
$desc = $values[5];
$avatar = $values[6];
$disabled = $values[7];
$id_company = $values[8];
$num_employee = $values[9];
$enable_login = $values[10];
$force_change_pass = 0;
if ($pass_policy) {
$force_change_pass = 1;
}
$value = array('id_usuario' => $id_usuario, 'nombre_real' => $nombre_real, 'password' => $pass, 'comentarios' => $desc, 'direccion' => $mail, 'telefono' => $tlf, 'nivel' => $nivel, 'avatar' => $avatar, 'disabled' => $disabled, 'id_company' => $id_company, 'num_employee' => $num_employee, 'enable_login' => $enable_login, 'force_change_pass' => $force_change_pass);
if ($id_usuario != '' && $nombre_real != '') {
if ($id_usuario == get_db_value('id_usuario', 'tusuario', 'id_usuario', $id_usuario)) {
echo ui_print_error_message(__('User ') . $id_usuario . __(' already exists'), '', true, 'h3', true);
} else {
$resul = process_sql_insert('tusuario', $value);
if ($resul == false) {
$value2 = array('id_usuario' => $id_usuario, 'id_perfil' => $profile, 'id_grupo' => $group, 'assigned_by' => $config["id_user"]);
if ($id_usuario != '') {
process_sql_insert('tusuario_perfil', $value2);
}
}
}
}
}
if ($users_check === false) {
echo ui_print_error_message(__('The number of users has reached the license limit'), '', true, 'h3', true);
}
fclose($file_handle);
echo ui_print_success_message(__('File loaded'), '', true, 'h3', true);
return;
}
示例2: check_login
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
// Load global vars
global $config;
include_once 'include/functions_setup.php';
include_once "include/functions_profile.php";
check_login();
if (!dame_admin($config["id_user"])) {
audit_db("ACL Violation", $config["REMOTE_ADDR"], "No administrator access", "Trying to access setup");
require "general/noaccess.php";
exit;
}
$is_enterprise = false;
if (file_exists("enterprise/load_enterprise.php")) {
$is_enterprise = true;
enterprise_include('godmode/setup/setup_auth.php');
}
/* Tabs list */
print_setup_tabs('auth', $is_enterprise);
$update = (bool) get_parameter("update");
if ($update) {
$config['auth_methods'] = get_parameter("auth_methods", "ldap");
$config['autocreate_remote_users'] = (int) get_parameter("autocreate_remote_users", 0);
$config['default_remote_profile'] = get_parameter("default_remote_profile", 0);
$config['default_remote_group'] = get_parameter("default_remote_group", 0);
$config['autocreate_blacklist'] = (string) get_parameter("autocreate_blacklist", "");
$config['ldap_server'] = (string) get_parameter("LDAP_server", "localhost");
$config['ldap_port'] = (int) get_parameter("LDAP_port", 389);
$config['ldap_version'] = get_parameter("ldap_version", 3);
//int??
$config['ldap_start_tls'] = (int) get_parameter("start_tls", 0);
示例3: enterprise_include
<?php
// INTEGRIA - the ITIL Management System
// http://integria.sourceforge.net
// ==================================================
// Copyright (c) 2011 Ártica Soluciones Tecnológicas
// http://www.artica.es <info@artica.es>
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License
// as published by the Free Software Foundation; version 2
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
global $config;
enterprise_include('include/functions_agenda.php', true);
function agenda_get_entry_permission($id_user, $id_entry)
{
$return = enterprise_hook('agenda_get_entry_permission_extra', array($id_user, $id_entry));
if ($return !== ENTERPRISE_NOT_HOOK) {
return $return;
}
return true;
}
function agenda_process_privacy_groups($entry_id, $public, $groups = array())
{
$return = enterprise_hook('agenda_process_privacy_groups_extra', array($entry_id, $public, $groups));
if ($return !== ENTERPRISE_NOT_HOOK) {
return $return;
}
return array();
示例4: process_sql
process_sql("INSERT INTO tconfig (`token`,`value`) VALUES ('previous_crontask', '{$current_date}')");
} else {
$previous_cron_date = get_db_sql("SELECT `value` FROM tconfig WHERE `token` = 'crontask'");
process_sql("UPDATE tconfig SET `value` = '{$previous_cron_date}' WHERE `token` = 'previous_crontask'");
}
if ($installed == 0) {
process_sql("INSERT INTO tconfig (`token`,`value`) VALUES ('crontask', '{$current_date}')");
} else {
process_sql("UPDATE tconfig SET `value` = '{$current_date}' WHERE `token` = 'crontask'");
}
// Daily check only
if (check_daily_task()) {
run_daily_check();
}
// Call enterprise crontab
enterprise_include("include/integria_cron_enterprise.php");
// Execute always (Send pending mails, SMTP)
run_mail_queue();
// if enabled, run newsletter queue
if ($config["enable_newsletter"] == 1) {
if ($config["active_validate"]) {
cron_validate_newsletter_address();
} else {
cron_validate_all_newsletter_address();
}
run_newsletter_queue();
}
// Check SLA on active incidents (max. opened time without fixing and min. response)
$incidents = get_db_all_rows_sql('SELECT * FROM tincidencia
WHERE sla_disabled = 0
AND estado NOT IN (7)');
示例5: strlen
foreach ($custom_screens as $custom_screen_id => $custom_screen) {
if (isset($custom_screen['menuEnabled']) && (bool) $custom_screen['menuEnabled']) {
//First custom screen
$custom_link = 'index.php?sec=custom_screen-'.$custom_screen_id.'&sec2=enterprise/operation/custom_screens/custom_screens&id='.$custom_screen_id;
break;
}
}
if (!empty($custom_link)) {
if ($sec == "custom_screen" )
echo "<li id='current' class='custom_screen'>";
else
echo "<li class='custom_screen'>";
echo "<a href='" . $custom_link . "'>".__('Custom screens')."</a>";
echo '<ul class="submenu custom_submenu">';
if ((int)enterprise_include('custom_screens/CustomScreensManager.php', true) != ENTERPRISE_NOT_HOOK) {
$custom_screens = CustomScreensManager::getInstance()->getCustomScreensList(false);
if (!empty($custom_screens)) {
foreach ($custom_screens as $custom_screen_id => $custom_screen) {
if (isset($custom_screen['menuEnabled']) && (bool) $custom_screen['menuEnabled']) {
if ($sec == "custom_screen-$custom_screen_id")
echo "<li id='current' class='custom_screen'>";
else
echo "<li class='custom_screen'>";
$len = strlen($custom_screen['name']);
if ($len <= 12) {
$str_custom_name = $custom_screen['name'];
$title = "";
} else {
$str_custom_name = substr($custom_screen['name'], 0, 9)."...";
示例6: check_login
// Copyright (c) 2008 Ártica Soluciones Tecnológicas
// http://www.artica.es <info@artica.es>
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License
// as published by the Free Software Foundation; version 2
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
global $config;
check_login ();
enterprise_include("include/functions_inventory.php", true);
include_once('include/functions_crm.php');
$id = (int) get_parameter ('id');
$contact = get_db_row ('tcompany_contact', 'id', $id);
$read = check_crm_acl ('other', 'cr', $config['id_user'], $contact['id_company']);
if (!$read) {
audit_db($config["id_user"], $config["REMOTE_ADDR"], "ACL Violation","Trying to access to contact inventory without permission");
include ("general/noaccess.php");
exit;
}
$inv_obj = enterprise_hook('inventory_get_objects_by_contact', array($contact["id"]));
if ($inv_obj === ENTERPRISE_NOT_HOOK) {
示例7: enterprise_include
<?php
// INTEGRIA IMS v2.0
// http://www.integriaims.com
// ===========================================================
// Copyright (c) 2007-2008 Sancho Lerena, slerena@gmail.com
// Copyright (c) 2008 Esteban Sanchez, estebans@artica.es
// Copyright (c) 2007-2008 Artica, info@artica.es
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public License
// (LGPL) as published by the Free Software Foundation; version 2
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Lesser General Public License for more details.
$enteprise_load = enterprise_include("include/functions_inventory.php");
function get_inventories($only_names = true, $exclude_id = false)
{
if ($exclude_id) {
$sql = sprintf('SELECT * FROM tinventory WHERE id != %d', $exclude_id);
$inventories = get_db_all_rows_sql($sql);
} else {
$inventories = get_db_all_rows_in_table('tinventory');
}
if ($inventories == false) {
return array();
}
if ($only_names) {
$retval = array();
foreach ($inventories as $inventory) {
$retval[$inventory['id']] = $inventory['name'];
示例8: check_login
// INTEGRIA - the ITIL Management System
// http://integria.sourceforge.net
// ==================================================
// Copyright (c) 2012 Ártica Soluciones Tecnológicas
// http://www.artica.es <info@artica.es>
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License
// as published by the Free Software Foundation; version 2
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
global $config;
check_login();
enterprise_include('include/functions_crm.php');
$manager = enterprise_hook('crm_check_acl_news', array($config['id_user']));
if ($manager === ENTERPRISE_NOT_HOOK) {
$manager = true;
} else {
if (!$manager) {
include "general/noaccess.php";
exit;
}
}
$id = (int) get_parameter('id');
$create = (bool) get_parameter('create');
$update = (bool) get_parameter('update');
$delete = (bool) get_parameter('delete');
$validate_newsletter = (bool) get_parameter('validate_newsletter', 0);
if ($validate_newsletter) {
示例9: print_groups_table
function print_groups_table($groups)
{
enterprise_include("include/functions_groups.php");
$return = enterprise_hook('print_groups_table_extra', array($groups));
if ($return === ENTERPRISE_NOT_HOOK) {
echo "<div class='divresult'>";
echo '<table width="99%" class="listing" id="table1">';
echo '<thead>';
echo '<tr>';
echo '<th class="header c0" scope="col">' . __('Users') . '</th>';
echo '<th class="header c1" scope="col">' . __('Icon') . '</th>';
echo '<th class="header c2" scope="col">' . __('Name') . '</th>';
echo '<th class="header c3" scope="col">' . __('Parent') . '</th>';
echo '<th class="header c4" scope="col">' . __('Delete') . '</th>';
echo '</tr>';
echo '</thead>';
$count = 0;
if ($groups === false) {
$groups = array();
}
if (!empty($groups)) {
foreach ($groups as $group) {
$data = array();
$num_users = get_db_value("COUNT(id_usuario)", "tusuario_perfil", "id_grupo", $group["id_grupo"]);
if ($num_users > 0) {
$users_icon = '<a href="javascript:"><img src="images/group.png" title="' . __('Show and hide the user list') . '" /></a>';
} else {
$users_icon = '';
}
$icon = '';
if ($group['icon'] != '') {
$icon = '<img src="images/groups_small/' . $group['icon'] . '" />';
}
if ($group["id_grupo"] != 1) {
$group_name = '<a href="index.php?sec=users&sec2=godmode/grupos/configurar_grupo&id=' . $group['id_grupo'] . '">' . $group['nombre'] . '</a>';
} else {
$group_name = $group["nombre"];
}
$parent = dame_nombre_grupo($group["parent"]);
//Group "all" is special not delete and no update
if ($group["id_grupo"] != 1) {
$delete_button = '<a href="index.php?sec=users&
sec2=godmode/grupos/lista_grupos&
id_grupo=' . $group["id_grupo"] . '&
delete_group=1&id=' . $group["id_grupo"] . '" onClick="if (!confirm(\'' . __('Are you sure?') . '\'))
return false;">
<img src="images/cross.png"></a>';
} else {
$delete_button = "";
}
echo '<tr id="table1-' . $count . '" style="border:1px solid #505050;" class="datos2">';
echo '<td id="table1-' . $count . '-0" style="text-align:center; width:40px;" class="datos2">' . $users_icon . '</td>';
echo '<td id="table1-' . $count . '-1" style="width:40px;" class="datos2">' . $icon . '</td>';
echo '<td id="table1-' . $count . '-2" style=" font-weight: bold;" class="datos2">' . $group_name . '</td>';
echo '<td id="table1-' . $count . '-3" style="" class="datos2">' . $parent . '</td>';
echo '<td id="table1-' . $count . '-4" style=" text-align:center; width:40px;" class="datos2">' . $delete_button . '</td>';
echo '</tr>';
echo '<tr id="table1-' . $count . '-users" style="display:none;">';
echo '<td colspan="5" style="text-align:center; background-color:#e6e6e6;">';
echo '<table width="99%" cellpadding="0" cellspacing="0" border="0px" id="table_users_' . $count . '">';
echo '<tr style="text-align:center;">';
if ($num_users > 0) {
$users_sql = "SELECT * FROM tusuario_perfil WHERE id_grupo =" . $group["id_grupo"] . " ORDER BY id_usuario";
$count_users = 0;
$new = true;
while ($user = get_db_all_row_by_steps_sql($new, $result_users, $users_sql)) {
$new = false;
if ($count_users >= 4) {
$count_users = 0;
echo '</tr>';
echo '<tr style="text-align:center;">';
}
$user_name = "<a href=\"index.php?sec=users&sec2=godmode/usuarios/configurar_usuarios&update_user=" . $user['id_usuario'] . "\"><strong>" . $user['id_usuario'] . "</strong></a>";
$user_real_name = get_db_value("nombre_real", "tusuario", "id_usuario", $user['id_usuario']);
$delete_icon = '<a href="index.php?sec=users&sec2=godmode/grupos/lista_grupos&delete_user=1&id_user_delete=' . $user['id_usuario'] . '" onClick="if (!confirm(\'' . __('Are you sure?') . '\')) return false;"><img src="images/cross.png"></a>';
$user_name = "{$user_name} ({$user_real_name}) " . $delete_icon;
echo '<td style="background-color:#e6e6e6;"">' . $user_name . '</td>';
$count_users++;
}
} else {
echo '<td style="background-color:#e6e6e6;"">' . __('There are no users') . '</td>';
}
echo '</tr>';
echo '</table>';
echo '</td>';
echo '</tr>';
echo "<script type=\"text/javascript\">\n\t\t\t\t\t \$(document).ready (function () {\n\t\t\t\t\t\t \$(\"#table1-{$count}-0\").click(function() {\n\t\t\t\t\t\t\t \$(\"#table1-{$count}-users\").toggle();\n\t\t\t\t\t\t });\n\t\t\t\t\t });\n\t\t\t\t\t </script>";
$count++;
}
}
echo '</table>';
if (empty($groups)) {
echo ui_print_error_message(__("No groups"), '', true, 'h3', true);
}
echo '</div>';
}
}
示例10: enterprise_include
<h1 id="log_f" class="error">You cannot access this file</h1>
<div>
<img src="../../images/pandora_logo.png" border="0"></a>
</div>
<div class="msg">
<span class="error"><b>ERROR:</b>
You can\'t access this file directly!</span>
</div>
</div>
</div>
</body>
</html>
');
}
//include_once($config['homedir'] . "/include/functions_profile.php");
enterprise_include('include/auth/mysql.php');
$config["user_can_update_info"] = true;
$config["user_can_update_password"] = true;
$config["admin_can_add_user"] = true;
$config["admin_can_delete_user"] = true;
$config["admin_can_disable_user"] = false;
//currently not implemented
$config["admin_can_make_admin"] = true;
/**
* Get the user id field on a mixed structure.
*
* This function is needed to make auth system more compatible and independant.
*
* @param mixed User structure to get id. It might be a row returned from
* tusuario or tusuario_perfil. If it's not a row, the int value is returned.
*
示例11: __
echo "<h3 class='suc'>" . __('Successfully updated') . "</h3>";
}
}
} else {
echo "<h3 class='error'>" . __('There was a problem updating user') . "</h3>";
}
} else {
echo "<h3 class='error'>" . __('The number of users has reached the license limit') . "</h3>";
}
}
///////////////////////////////
// CREATE USER
///////////////////////////////
if ($action == 'create') {
$enable_login = get_parameter("enable_login");
enterprise_include('include/functions_license.php', true);
$users_check = enterprise_hook('license_check_users_num');
if ($users_check === true || $users_check === ENTERPRISE_NOT_HOOK || !$enable_login) {
// Get data from POST
$nombre = strtolower(get_parameter("nombre"));
$password = get_parameter("pass1");
$password2 = get_parameter("pass2");
$nombre_real = get_parameter("nombre_real");
$lang = get_parameter("lang");
if ($password != $password2) {
echo "<h3 class='error'>" . __('Passwords don\'t match. Please repeat again') . "</h3>";
}
$direccion = rtrim(get_parameter("direccion"));
$telefono = get_parameter("telefono");
$id_company = get_parameter("id_company");
$comentarios = get_parameter("comentarios");
示例12: ui_print_error_message
} else {
extensions_call_godmode_function (basename ($sec2.".php"));
}
}
} else {
echo ui_print_error_message (__('Page not found'), '', true, 'h3', true);
}
}
else {
$custom_screen_loaded = false;
if ($is_enterprise && (int)enterprise_include('custom_screens/CustomScreensManager.php', true) != ENTERPRISE_NOT_HOOK) {
$custom_screens = CustomScreensManager::getInstance()->getCustomScreensList(false);
if (!empty($custom_screens)) {
foreach ($custom_screens as $id => $custom_screen) {
if (isset($custom_screen['homeEnabled']) && (bool) $custom_screen['homeEnabled']) {
enterprise_include('operation/custom_screens/custom_screens.php');
$custom_screen_loaded = true;
}
}
}
}
if (!$custom_screen_loaded) {
require ("general/home.php");
}
}
?>
</div>
</div>
<!-- wrap ends here -->
</div>
示例13: check_last_cron_execution
$got_alerts = 0;
$check_cron_exec = check_last_cron_execution();
$check_email_queue = check_email_queue();
$result_check_update_manager = '';
$check_alarm_calendar = check_alarm_calendar();
$check_directory_permissions = check_directory_permissions();
$check_minor_release_available = false;
$check_browser = check_browser();
if (dame_admin($config['id_user'])) {
$check_minor_release_available = db_check_minor_relase_available();
}
if ($is_login && dame_admin($config['id_user'])) {
//check if user has logged and user is admin. Check update manager once.
if ($config["enable_update_manager"]) {
if ($config["enteprise"] == 1) {
enterprise_include("include/functions_update_manager.php");
$result_check_update_manager = update_manager_check_packages_for_header();
} else {
$result_check_update_manager = update_manager_check_online_free_packages(false);
}
}
print_input_hidden('result_check_update_manager', $result_check_update_manager);
}
if (!$check_cron_exec || !$check_email_queue || $result_check_update_manager != '' || $check_alarm_calendar || $check_directory_permissions || $check_minor_release_available || $check_browser) {
$got_alerts = 1;
echo '<a href: >' . print_image('images/header_warning.png', true, array("onclick" => "openAlerts()", "alt" => __('Warning'), "id" => "alerts", 'title' => __('Warning'))) . '</a>';
}
echo '<a href="index.php?sec=users&sec2=operation/users/user_edit&id=' . $config['id_user'] . '" >';
if (dame_admin($config['id_user'])) {
echo print_image('images/header_suit.png', true, array("alt" => $config['id_user'], 'title' => $config['id_user']));
} else {
示例14: check_login
// INTEGRIA - the ITIL Management System
// http://integria.sourceforge.net
// ==================================================
// Copyright (c) 2008 Ártica Soluciones Tecnológicas
// http://www.artica.es <info@artica.es>
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License
// as published by the Free Software Foundation; version 2
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
global $config;
check_login();
//include("include/functions_user.php");
enterprise_include("include/functions_groups.php");
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;
}
// Inic vars
$id = (int) get_parameter('id');
$name = "";
$icon = "";
$id_user_default = "";
$id_user = "";
$banner = "";
$parent = "";
$forced_email = true;
$soft_limit = 5;
示例15: enterprise_include
* sla_fired Wheter the SLA was fired or not
* id_incident_type Incident type
* id_user Incident risponsable user
* first_date Begin range date (range start)
* last_date Begin range date (range end)
*
* @return array A list of matching incidents. False if no matches.
*/
// Avoid to mess AJAX with Javascript
if (defined('AJAX')) {
require_once $config["homedir"] . "/include/functions_graph.php";
}
include_once $config["homedir"] . "/include/graphs/fgraph.php";
enterprise_include("include/functions_users.php");
enterprise_include("include/functions_incidents.php");
enterprise_include($config["homedir"] . "/include/functions_groups.php");
function filter_incidents($filters, $count = false, $limit = true, $no_parents = false, $csv_mode = false)
{
global $config;
/* Set default values if none is set */
$filters['string'] = isset($filters['string']) ? $filters['string'] : '';
$filters['status'] = isset($filters['status']) ? $filters['status'] : 0;
$filters['priority'] = isset($filters['priority']) ? $filters['priority'] : -1;
$filters['id_group'] = isset($filters['id_group']) ? $filters['id_group'] : -1;
$filters['id_company'] = isset($filters['id_company']) ? $filters['id_company'] : 0;
$filters['id_inventory'] = isset($filters['id_inventory']) ? $filters['id_inventory'] : 0;
$filters['id_incident_type'] = isset($filters['id_incident_type']) ? $filters['id_incident_type'] : 0;
$filters['id_user'] = isset($filters['id_user']) ? $filters['id_user'] : '';
$filters['id_user_or_creator'] = isset($filters['id_user_or_creator']) ? $filters['id_user_or_creator'] : '';
$filters['from_date'] = isset($filters['from_date']) ? $filters['from_date'] : 0;
$filters['first_date'] = isset($filters['first_date']) ? $filters['first_date'] : '';