本文整理汇总了PHP中Event::log方法的典型用法代码示例。如果您正苦于以下问题:PHP Event::log方法的具体用法?PHP Event::log怎么用?PHP Event::log使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Event
的用法示例。
在下文中一共展示了Event::log方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: executeAddMulti
/**
* Handled Multi add item
*
* @since version 0.83 (before addMulti)
*
* @param $input array of values
**/
function executeAddMulti(array $input)
{
$this->check(-1, CREATE, $input);
for ($i = $input["_from"]; $i <= $input["_to"]; $i++) {
$input["name"] = $input["_before"] . $i . $input["_after"];
$this->add($input);
}
Event::log(0, "dropdown", 5, "setup", sprintf(__('%1$s adds several netpoints'), $_SESSION["glpiname"]));
}
示例2: post_addItem
//.........这里部分代码省略.........
}
}
// Add user groups linked to tickets
$ticket_user = new Ticket_User();
$group_ticket = new Group_Ticket();
if (isset($this->input["_users_id_requester"]) && ($this->input["_users_id_requester"] > 0 || isset($this->input["_users_id_requester_notif"]['alternative_email']) && !empty($this->input["_users_id_requester_notif"]['alternative_email']))) {
$input2 = array('tickets_id' => $this->fields['id'], 'users_id' => $this->input["_users_id_requester"], 'type' => self::REQUESTER);
if (isset($this->input["_users_id_requester_notif"])) {
foreach ($this->input["_users_id_requester_notif"] as $key => $val) {
$input2[$key] = $val;
}
}
$ticket_user->add($input2);
}
if (isset($this->input["_users_id_observer"]) && ($this->input["_users_id_observer"] > 0 || isset($this->input["_users_id_observer_notif"]['alternative_email']) && !empty($this->input["_users_id_observer_notif"]['alternative_email']))) {
$input2 = array('tickets_id' => $this->fields['id'], 'users_id' => $this->input["_users_id_observer"], 'type' => self::OBSERVER);
if (isset($this->input["_users_id_observer_notif"])) {
foreach ($this->input["_users_id_observer_notif"] as $key => $val) {
$input2[$key] = $val;
}
}
$ticket_user->add($input2);
}
if (isset($this->input["_users_id_assign"]) && $this->input["_users_id_assign"] > 0) {
$input2 = array('tickets_id' => $this->fields['id'], 'users_id' => $this->input["_users_id_assign"], 'type' => self::ASSIGN);
if (isset($this->input["_users_id_assign_notif"])) {
foreach ($this->input["_users_id_assign_notif"] as $key => $val) {
$input2[$key] = $val;
}
}
$ticket_user->add($input2);
}
if (isset($this->input["_groups_id_requester"]) && $this->input["_groups_id_requester"] > 0) {
$group_ticket->add(array('tickets_id' => $this->fields['id'], 'groups_id' => $this->input["_groups_id_requester"], 'type' => self::REQUESTER));
}
if (isset($this->input["_groups_id_assign"]) && $this->input["_groups_id_assign"] > 0) {
$group_ticket->add(array('tickets_id' => $this->fields['id'], 'groups_id' => $this->input["_groups_id_assign"], 'type' => self::ASSIGN));
}
if (isset($this->input["_groups_id_observer"]) && $this->input["_groups_id_observer"] > 0) {
$group_ticket->add(array('tickets_id' => $this->fields['id'], 'groups_id' => $this->input["_groups_id_observer"], 'type' => self::OBSERVER));
}
// Additional actors : using default notification parameters
// Observers : for mailcollector
if (isset($this->input["_additional_observers"]) && is_array($this->input["_additional_observers"]) && count($this->input["_additional_observers"])) {
$input2 = array('tickets_id' => $this->fields['id'], 'type' => self::OBSERVER);
foreach ($this->input["_additional_observers"] as $tmp) {
if (isset($tmp['users_id'])) {
foreach ($tmp as $key => $val) {
$input2[$key] = $val;
}
$ticket_user->add($input2);
}
}
}
if (isset($this->input["_additional_assigns"]) && is_array($this->input["_additional_assigns"]) && count($this->input["_additional_assigns"])) {
$input2 = array('tickets_id' => $this->fields['id'], 'type' => self::ASSIGN);
foreach ($this->input["_additional_assigns"] as $tmp) {
if (isset($tmp['users_id'])) {
foreach ($tmp as $key => $val) {
$input2[$key] = $val;
}
$ticket_user->add($input2);
}
}
}
if (isset($this->input["_additional_requesters"]) && is_array($this->input["_additional_requesters"]) && count($this->input["_additional_requesters"])) {
$input2 = array('tickets_id' => $this->fields['id'], 'type' => self::REQUESTER);
foreach ($this->input["_additional_requesters"] as $tmp) {
if (isset($tmp['users_id'])) {
foreach ($tmp as $key => $val) {
$input2[$key] = $val;
}
$ticket_user->add($input2);
}
}
}
//Action for send_validation rule
if (isset($this->input["_add_validation"]) && $this->input["_add_validation"] > 0) {
$validation = new Ticketvalidation();
$values['tickets_id'] = $this->fields['id'];
$values['users_id_validate'] = $this->input["_add_validation"];
if ($validation->can(-1, 'w', $values)) {
$validation->add($values);
Event::log($this->fields['id'], "ticket", 4, "tracking", $_SESSION["glpiname"] . " " . $LANG['log'][21]);
}
}
// Processing Email
if ($CFG_GLPI["use_mailing"]) {
// Clean reload of the ticket
$this->getFromDB($this->fields['id']);
$type = "new";
if (isset($this->fields["status"]) && $this->fields["status"] == "solved") {
$type = "solved";
}
NotificationEvent::raiseEvent($type, $this);
}
if (isset($_SESSION['glpiis_ids_visible']) && !$_SESSION['glpiis_ids_visible']) {
addMessageAfterRedirect($LANG['help'][18] . " (" . $LANG['job'][38] . " " . "<a href='" . $CFG_GLPI["root_doc"] . "/front/ticket.form.php?id=" . $this->fields['id'] . "'>" . $this->fields['id'] . "</a>)");
}
}
示例3: Problem_User
$problem_user = new Problem_User();
$problem_user->check($_POST['id'], 'd');
$problem_user->delete($_POST);
Event::log($_POST['problems_id'], "problem", 4, "maintain", sprintf(__('%s deletes an actor'), $_SESSION["glpiname"]));
Html::redirect($CFG_GLPI["root_doc"] . "/front/problem.form.php?id=" . $_POST['problems_id']);
} else {
if (isset($_POST['delete_group'])) {
$group_problem = new Group_Problem();
$group_problem->check($_POST['id'], 'd');
$group_problem->delete($_POST);
Event::log($_POST['problems_id'], "problem", 4, "maintain", sprintf(__('%s deletes an actor'), $_SESSION["glpiname"]));
Html::redirect($CFG_GLPI["root_doc"] . "/front/problem.form.php?id=" . $_POST['problems_id']);
} else {
if (isset($_POST['delete_supplier'])) {
$problem_supplier = new Problem_Supplier();
$problem_supplier->check($_POST['id'], 'd');
$problem_supplier->delete($_POST);
Event::log($_POST['problems_id'], "problem", 4, "maintain", sprintf(__('%s deletes an actor'), $_SESSION["glpiname"]));
Html::redirect($CFG_GLPI["root_doc"] . "/front/problem.form.php?id=" . $_POST['problems_id']);
} else {
Html::header(Problem::getTypeName(2), $_SERVER['PHP_SELF'], "maintain", "problem");
$problem->showForm($_GET["id"], $_GET);
Html::footer();
}
}
}
}
}
}
}
}
示例4: Supplier_Ticket
/** @file
* @brief
* @since version 0.85
*/
if (!defined('GLPI_ROOT')) {
include '../inc/includes.php';
}
$link = new Supplier_Ticket();
Session::checkLoginUser();
Html::popHeader(__('Email followup'), $_SERVER['PHP_SELF']);
if (isset($_POST["update"])) {
$link->check($_POST["id"], UPDATE);
$link->update($_POST);
echo "<script type='text/javascript' >\n";
echo "window.parent.location.reload();";
echo "</script>";
} else {
if (isset($_POST['delete'])) {
$link->check($_POST['id'], DELETE);
$link->delete($_POST);
Event::log($link->fields['tickets_id'], "ticket", 4, "tracking", sprintf(__('%s deletes an actor'), $_SESSION["glpiname"]));
Html::redirect($CFG_GLPI["root_doc"] . "/front/ticket.form.php?id=" . $link->fields['tickets_id']);
} else {
if (isset($_GET["id"])) {
$link->showSupplierNotificationForm($_GET["id"]);
} else {
Html::displayErrorAndDie('Lost');
}
}
}
Html::popFooter();
示例5: RuleAction
$ruleaction = new RuleAction(get_class($rule));
if (isset($_POST["add_action"])) {
$rulecollection->checkGlobal(CREATE);
$ruleaction->add($_POST);
Html::back();
} else {
if (isset($_POST["update"])) {
$rulecollection->checkGlobal(UPDATE);
$rule->update($_POST);
Event::log($_POST['id'], "rules", 4, "setup", sprintf(__('%s updates an item'), $_SESSION["glpiname"]));
Html::back();
} else {
if (isset($_POST["add"])) {
$rulecollection->checkGlobal(CREATE);
$newID = $rule->add($_POST);
Event::log($newID, "rules", 4, "setup", sprintf(__('%1$s adds the item %2$s'), $_SESSION["glpiname"], $newID));
Html::redirect($_SERVER['HTTP_REFERER'] . "?id={$newID}");
} else {
if (isset($_POST["purge"])) {
$rulecollection->checkGlobal(PURGE);
$rulecollection->deleteRuleOrder($_POST["ranking"]);
$rule->delete($_POST, 1);
Event::log($_POST["id"], "rules", 4, "setup", sprintf(__('%s purges an item'), $_SESSION["glpiname"]));
$rule->redirectToList();
}
}
}
}
Html::header(Rule::getTypeName(Session::getPluralNumber()), $_SERVER['PHP_SELF'], 'admin', $rulecollection->menu_type, $rulecollection->menu_option);
$rule->display(array('id' => $_GET["id"]));
Html::footer();
示例6: TicketFollowup
$fup = new TicketFollowup();
if (isset($_POST["add"])) {
$fup->check(-1, CREATE, $_POST);
$fup->add($_POST);
Event::log($fup->getField('tickets_id'), "ticket", 4, "tracking", sprintf(__('%s adds a followup'), $_SESSION["glpiname"]));
Html::back();
} else {
if (isset($_POST['add_close']) || isset($_POST['add_reopen'])) {
$ticket = new Ticket();
if ($ticket->getFromDB($_POST["tickets_id"]) && $ticket->canApprove()) {
$fup->add($_POST);
Event::log($fup->getField('tickets_id'), "ticket", 4, "tracking", sprintf(__('%s approves or refuses a solution'), $_SESSION["glpiname"]));
Html::back();
}
} else {
if (isset($_POST["update"])) {
$fup->check($_POST['id'], UPDATE);
$fup->update($_POST);
Event::log($fup->getField('tickets_id'), "ticket", 4, "tracking", sprintf(__('%s updates a followup'), $_SESSION["glpiname"]));
Html::redirect(Toolbox::getItemTypeFormURL('Ticket') . "?id=" . $fup->getField('tickets_id'));
} else {
if (isset($_POST["purge"])) {
$fup->check($_POST['id'], PURGE);
$fup->delete($_POST, 1);
Event::log($fup->getField('tickets_id'), "ticket", 4, "tracking", sprintf(__('%s purges a followup'), $_SESSION["glpiname"]));
Html::redirect(Toolbox::getItemTypeFormURL('Ticket') . "?id=" . $fup->getField('tickets_id'));
}
}
}
}
Html::displayErrorAndDie('Lost');
示例7: define
/* ----------------------------------------------------------------------
Purpose of file: Send image generated by a plugin to browser
Argument :
- plugin : name of the plugin, also the subdir in files/_plugins
- name : of the image in the files/_plugins/xxxx dir
- clean : delete the image after send it
---------------------------------------------------------------------- */
define('GLPI_ROOT', '..');
include GLPI_ROOT . "/inc/includes.php";
if (!isset($_GET["name"]) || !isset($_GET["plugin"])) {
Event::log("-1", "system", 2, "security", $_SESSION["glpiname"] . " bad usage.");
die("security");
}
if (basename($_GET["name"]) != $_GET["name"] || basename($_GET["plugin"]) != $_GET["plugin"]) {
Event::log("-1", "system", 1, "security", $_SESSION["glpiname"] . " try to use a non standard path.");
die("security");
}
$Path = GLPI_PLUGIN_DOC_DIR . "/" . $_GET["plugin"] . "/";
// Now send the file with header() magic
header("Expires: Sun, 30 Jan 1966 06:30:00 GMT");
header('Pragma: private');
/// IE BUG + SSL
header('Cache-control: private, must-revalidate');
/// IE BUG + SSL
header('Content-disposition: filename="' . $_GET["name"] . '"');
header("Content-type: image/png");
if (file_exists($Path . $_GET["name"])) {
readfile($Path . $_GET["name"]);
if (isset($_GET["clean"])) {
unlink($Path . $_GET["name"]);
示例8: array
Html::footer();
} else {
if (isset($_POST['add_ext_auth_ldap'])) {
Session::checkRight("user", User::IMPORTEXTAUTHUSERS);
if (isset($_POST['login']) && !empty($_POST['login'])) {
AuthLdap::importUserFromServers(array('name' => $_POST['login']));
}
Html::back();
} else {
if (isset($_POST['add_ext_auth_simple'])) {
if (isset($_POST['login']) && !empty($_POST['login'])) {
Session::checkRight("user", User::IMPORTEXTAUTHUSERS);
$input = array('name' => $_POST['login'], '_extauth' => 1, 'add' => 1);
$user->check(-1, CREATE, $input);
$newID = $user->add($input);
Event::log($newID, "users", 4, "setup", sprintf(__('%1$s adds the item %2$s'), $_SESSION["glpiname"], $_POST["login"]));
}
Html::back();
} else {
Session::checkRight("user", READ);
Html::header(User::getTypeName(Session::getPluralNumber()), '', "admin", "user");
$user->display(array('id' => $_GET["id"]));
Html::footer();
}
}
}
}
}
}
}
}
示例9: get_class
Html::displayRightError();
}
if (isset($_POST["id"])) {
$_GET["id"] = $_POST["id"];
} else {
if (!isset($_GET["id"])) {
$_GET["id"] = -1;
}
}
if (isset($_POST["purge"])) {
$item_device->check($_POST["id"], PURGE);
$item_device->delete($_POST, 1);
Event::log($_POST["id"], get_class($item_device), 4, "setup", sprintf(__('%s purges an item'), $_SESSION["glpiname"]));
$device = $item_device->getOnePeer(1);
Html::redirect($device->getLinkURL());
} else {
if (isset($_POST["update"])) {
$item_device->check($_POST["id"], UPDATE);
$item_device->update($_POST);
Event::log($_POST["id"], get_class($item_device), 4, "setup", sprintf(__('%s updates an item'), $_SESSION["glpiname"]));
Html::back();
} else {
Html::header($item_device->getTypeName(Session::getPluralNumber()), '', "config", "commondevice", get_class($item_device));
if (!isset($options)) {
$options = array();
}
$options['id'] = $_GET["id"];
$item_device->display($options);
Html::footer();
}
}
示例10: Login
/**
* Manage use authentication and initialize the session
*
* @param $login_name string
* @param $login_password string
* @param $noauto boolean (false by default)
*
* @return boolean (success)
*/
function Login($login_name, $login_password, $noauto = false)
{
global $DB, $CFG_GLPI;
$this->getAuthMethods();
$this->user_present = 1;
$this->auth_succeded = false;
//In case the user was deleted in the LDAP directory
$user_deleted_ldap = false;
// Trim login_name : avoid LDAP search errors
$login_name = trim($login_name);
if (!$noauto && ($authtype = self::checkAlternateAuthSystems())) {
if ($this->getAlternateAuthSystemsUserLogin($authtype) && !empty($this->user->fields['name'])) {
// Used for log when login process failed
$login_name = $this->user->fields['name'];
$this->auth_succeded = true;
$this->extauth = 1;
$this->user_present = $this->user->getFromDBbyName(addslashes($login_name));
$this->user->fields['authtype'] = $authtype;
$user_dn = false;
$ldapservers = '';
//if LDAP enabled too, get user's infos from LDAP
if (Toolbox::canUseLdap()) {
$ldapservers = array();
//User has already authenticate, at least once : it's ldap server if filled
if (isset($this->user->fields["auths_id"]) && $this->user->fields["auths_id"] > 0) {
$authldap = new AuthLdap();
//If ldap server is enabled
if ($authldap->getFromDB($this->user->fields["auths_id"]) && $authldap->fields['is_active']) {
$ldapservers[] = $authldap->fields;
}
//User has never beeen authenticated : try all active ldap server to find the right one
} else {
foreach (getAllDatasFromTable('glpi_authldaps', "`is_active`='1'") as $ldap_config) {
$ldapservers[] = $ldap_config;
}
}
foreach ($ldapservers as $ldap_method) {
$ds = AuthLdap::connectToServer($ldap_method["host"], $ldap_method["port"], $ldap_method["rootdn"], Toolbox::decrypt($ldap_method["rootdn_passwd"], GLPIKEY), $ldap_method["use_tls"], $ldap_method["deref_option"]);
if ($ds) {
$params['method'] = AuthLdap::IDENTIFIER_LOGIN;
$params['fields'][AuthLdap::IDENTIFIER_LOGIN] = $ldap_method["login_field"];
$user_dn = AuthLdap::searchUserDn($ds, array('basedn' => $ldap_method["basedn"], 'login_field' => $ldap_method['login_field'], 'search_parameters' => $params, 'user_params' => array('method' => AuthLDAP::IDENTIFIER_LOGIN, 'value' => $login_name), 'condition' => $ldap_method["condition"]));
if ($user_dn) {
$this->user->fields['auths_id'] = $ldap_method['id'];
$this->user->getFromLDAP($ds, $ldap_method, $user_dn['dn'], $login_name, !$this->user_present);
break;
}
}
}
}
if (count($ldapservers) == 0 && $authtype == self::EXTERNAL) {
// Case of using external auth and no LDAP servers, so get data from external auth
$this->user->getFromSSO();
} else {
//If user is set as present in GLPI but no LDAP DN found : it means that the user
//is not present in an ldap directory anymore
if (!$user_dn && $this->user_present) {
$user_deleted_ldap = true;
$this->user_deleted_ldap = true;
}
}
// Reset to secure it
$this->user->fields['name'] = $login_name;
$this->user->fields["last_login"] = $_SESSION["glpi_currenttime"];
} else {
$this->addToError(__('Empty login or password'));
}
}
// If not already auth
if (!$this->auth_succeded) {
if (empty($login_name) || strstr($login_name, "") || empty($login_password) || strstr($login_password, "")) {
$this->addToError(__('Empty login or password'));
} else {
// exists=0 -> user doesn't yet exist
// exists=1 -> user is present in DB with password
// exists=2 -> user is present in DB but without password
$exists = $this->userExists(array('name' => addslashes($login_name)));
// Pas en premier car sinon on ne fait pas le blankpassword
// First try to connect via le DATABASE
if ($exists == 1) {
// Without UTF8 decoding
if (!$this->auth_succeded) {
$this->auth_succeded = $this->connection_db(addslashes($login_name), $login_password);
if ($this->auth_succeded) {
$this->extauth = 0;
$this->user_present = $this->user->getFromDBbyName(addslashes($login_name));
$this->user->fields["authtype"] = self::DB_GLPI;
$this->user->fields["password"] = $login_password;
}
}
} else {
//.........这里部分代码省略.........
示例11: ProjectCost
if (!isset($_GET["id"])) {
$_GET["id"] = "";
}
if (!isset($_GET["projects_id"])) {
$_GET["projects_id"] = "";
}
$cost = new ProjectCost();
if (isset($_POST["add"])) {
$cost->check(-1, CREATE, $_POST);
if ($newID = $cost->add($_POST)) {
Event::log($_POST['projects_id'], "project", 4, "maintain", sprintf(__('%s adds a cost'), $_SESSION["glpiname"]));
}
Html::back();
} else {
if (isset($_POST["purge"])) {
$cost->check($_POST["id"], PURGE);
if ($cost->delete($_POST, 1)) {
Event::log($cost->fields['projects_id'], "project", 4, "maintain", sprintf(__('%s purges a cost'), $_SESSION["glpiname"]));
}
Html::redirect(Toolbox::getItemTypeFormURL('Project') . '?id=' . $cost->fields['projects_id']);
} else {
if (isset($_POST["update"])) {
$cost->check($_POST["id"], UPDATE);
if ($cost->update($_POST)) {
Event::log($cost->fields['projects_id'], "project", 4, "maintain", sprintf(__('%s updates a cost'), $_SESSION["glpiname"]));
}
Html::back();
}
}
}
Html::displayErrorAndDie('Lost');
示例12: post_addItem
function post_addItem()
{
global $CFG_GLPI;
// Log this event
$username = 'anonymous';
if (isset($_SESSION["glpiname"])) {
$username = $_SESSION["glpiname"];
}
Event::log($this->fields['id'], "ticket", 4, "tracking", sprintf(__('%1$s adds the item %2$s'), $username, $this->fields['id']));
if (isset($this->input["_followup"]) && is_array($this->input["_followup"]) && strlen($this->input["_followup"]['content']) > 0) {
$fup = new TicketFollowup();
$type = "new";
if (isset($this->fields["status"]) && $this->fields["status"] == self::SOLVED) {
$type = "solved";
}
$toadd = array("type" => $type, "tickets_id" => $this->fields['id']);
if (isset($this->input["_followup"]['content']) && strlen($this->input["_followup"]['content']) > 0) {
$toadd["content"] = $this->input["_followup"]['content'];
}
if (isset($this->input["_followup"]['is_private'])) {
$toadd["is_private"] = $this->input["_followup"]['is_private'];
}
$toadd['_no_notif'] = true;
$fup->add($toadd);
}
if (isset($this->input["plan"]) && count($this->input["plan"]) || isset($this->input["actiontime"]) && $this->input["actiontime"] > 0) {
$task = new TicketTask();
$type = "new";
if (isset($this->fields["status"]) && $this->fields["status"] == self::SOLVED) {
$type = "solved";
}
$toadd = array("type" => $type, "tickets_id" => $this->fields['id'], "actiontime" => $this->input["actiontime"]);
if (isset($this->input["plan"]) && count($this->input["plan"])) {
$toadd["plan"] = $this->input["plan"];
}
if (isset($_SESSION['glpitask_private'])) {
$toadd['is_private'] = $_SESSION['glpitask_private'];
}
$toadd['_no_notif'] = true;
$task->add($toadd);
}
$ticket_ticket = new Ticket_Ticket();
// From interface
if (isset($this->input['_link'])) {
$this->input['_link']['tickets_id_1'] = $this->fields['id'];
// message if ticket's ID doesn't exist
if (!empty($this->input['_link']['tickets_id_2'])) {
if ($ticket_ticket->can(-1, 'w', $this->input['_link'])) {
$ticket_ticket->add($this->input['_link']);
} else {
Session::addMessageAfterRedirect(__('Unknown ticket'), false, ERROR);
}
}
}
// From mailcollector : do not check rights
if (isset($this->input["_linkedto"])) {
$input2['tickets_id_1'] = $this->fields['id'];
$input2['tickets_id_2'] = $this->input["_linkedto"];
$input2['link'] = Ticket_Ticket::LINK_TO;
$ticket_ticket->add($input2);
}
// Manage SLA Level : add actions
if (isset($this->input["slas_id"]) && $this->input["slas_id"] > 0 && isset($this->input["slalevels_id"]) && $this->input["slalevels_id"] > 0) {
$calendars_id = Entity::getUsedConfig('calendars_id', $this->fields['entities_id']);
$sla = new SLA();
if ($sla->getFromDB($this->input["slas_id"])) {
$sla->setTicketCalendar($calendars_id);
// Add first level in working table
if ($this->input["slalevels_id"] > 0) {
$sla->addLevelToDo($this);
}
// Replay action in case of open date is set before now
}
SlaLevel_Ticket::replayForTicket($this->getID());
}
parent::post_addItem();
//Action for send_validation rule
if (isset($this->input["_add_validation"])) {
$validations_to_send = array();
if (!is_array($this->input["_add_validation"])) {
$this->input["_add_validation"] = array($this->input["_add_validation"]);
}
foreach ($this->input["_add_validation"] as $validation) {
switch ($validation) {
case 'requester_supervisor':
if (isset($this->input['_groups_id_requester']) && $this->input['_groups_id_requester']) {
$users = Group_User::getGroupUsers($this->input['_groups_id_requester'], "is_manager='1'");
foreach ($users as $data) {
$validations_to_send[] = $data['id'];
}
}
break;
case 'assign_supervisor':
if (isset($this->input['_groups_id_assign']) && $this->input['_groups_id_assign']) {
$users = Group_User::getGroupUsers($this->input['_groups_id_assign'], "is_manager='1'");
foreach ($users as $data) {
$validations_to_send[] = $data['id'];
}
}
break;
//.........这里部分代码省略.........
示例13: popHeader
if (isset($_POST["restore"])) {
$soft->check($_POST["id"], 'd');
$soft->restore($_POST);
Event::log($_POST["id"], "software", 4, "inventory", $_SESSION["glpiname"] . " " . $LANG['log'][23]);
$soft->redirectToList();
} else {
if (isset($_REQUEST["purge"])) {
$soft->check($_REQUEST["id"], 'd');
$soft->delete($_REQUEST, 1);
Event::log($_REQUEST["id"], "software", 4, "inventory", $_SESSION["glpiname"] . " " . $LANG['log'][24]);
$soft->redirectToList();
} else {
if (isset($_POST["update"])) {
$soft->check($_POST["id"], 'w');
$soft->update($_POST);
Event::log($_POST["id"], "software", 4, "inventory", $_SESSION["glpiname"] . " " . $LANG['log'][21]);
glpi_header($_SERVER['HTTP_REFERER']);
} else {
if (isset($_POST["mergesoftware"])) {
popHeader($LANG['Menu'][4]);
if (isset($_POST["id"]) && isset($_POST["item"]) && is_array($_POST["item"]) && count($_POST["item"])) {
$soft->check($_POST["id"], 'w');
$soft->merge($_POST["item"]);
}
glpi_header($_SERVER['HTTP_REFERER']);
} else {
commonHeader($LANG['Menu'][4], $_SERVER['PHP_SELF'], "inventory", "software");
$soft->showForm($_GET["id"], array('withtemplate' => $_GET["withtemplate"]));
commonFooter();
}
}
示例14: PluginFpsoftwareCommon
<?php
include '../../../inc/includes.php';
PluginFpsoftwareVersionhelper::checkRights("software", UPDATE);
$usl = new PluginFpsoftwareCommon();
if (isset($_POST["add"])) {
if ($_POST['softwarelicenses_id'] > 0) {
if ($usl->add($_POST)) {
Event::log($_POST['softwarelicenses_id'], "softwarelicense", 4, "inventory", sprintf(__('%s associates an user and a license'), $_SESSION["glpiname"]));
}
}
Html::back();
}
Html::displayErrorAndDie('Lost');
示例15: glpi_header
if (isset($_POST["update"])) {
$cartype->check($_POST["id"], 'w');
if ($cartype->update($_POST)) {
Event::log($_POST["id"], "cartridges", 4, "inventory", $_SESSION["glpiname"] . " " . $LANG['log'][21]);
}
glpi_header($_SERVER['HTTP_REFERER']);
} else {
if (isset($_POST["addtype"])) {
$cartype->check($_POST["tID"], 'w');
if ($cartype->addCompatibleType($_POST["tID"], $_POST["printermodels_id"])) {
Event::log($_POST["tID"], "cartridges", 4, "inventory", $_SESSION["glpiname"] . " " . $LANG['log'][30]);
}
glpi_header($_SERVER['HTTP_REFERER']);
} else {
if (isset($_GET["deletetype"])) {
$cartype->check($_GET["tID"], 'w');
if ($cartype->deleteCompatibleType($_GET["id"])) {
Event::log($_GET["tID"], "cartridges", 4, "inventory", $_SESSION["glpiname"] . " " . $LANG['log'][31]);
}
glpi_header($_SERVER['HTTP_REFERER']);
} else {
commonHeader($LANG['Menu'][21], $_SERVER['PHP_SELF'], "inventory", "cartridge");
$cartype->showForm($_GET["id"]);
commonFooter();
}
}
}
}
}
}
}