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


PHP add_audit函数代码示例

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


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

示例1: doAction

 protected function doAction()
 {
     $script = [];
     $this->getInputs($script, ['scriptid', 'name', 'type', 'execute_on', 'command', 'description', 'usrgrpid', 'groupid', 'host_access']);
     $script['confirmation'] = $this->getInput('confirmation', '');
     if ($this->getInput('type', ZBX_SCRIPT_TYPE_CUSTOM_SCRIPT) == ZBX_SCRIPT_TYPE_IPMI && $this->hasInput('commandipmi')) {
         $script['command'] = $this->getInput('commandipmi');
     }
     if ($this->getInput('hgstype', 1) == 0) {
         $script['groupid'] = 0;
     }
     DBstart();
     $result = API::Script()->update($script);
     if ($result) {
         $scriptId = reset($result['scriptids']);
         add_audit(AUDIT_ACTION_UPDATE, AUDIT_RESOURCE_SCRIPT, 'Name [' . $this->getInput('name', '') . '] id [' . $scriptId . ']');
     }
     $result = DBend($result);
     if ($result) {
         $response = new CControllerResponseRedirect('zabbix.php?action=script.list&uncheck=1');
         $response->setMessageOk(_('Script updated'));
     } else {
         $response = new CControllerResponseRedirect('zabbix.php?action=script.edit&scriptid=' . $this->getInput('scriptid'));
         $response->setFormData($this->getInputAll());
         $response->setMessageError(_('Cannot update script'));
     }
     $this->setResponse($response);
 }
开发者ID:jbfavre,项目名称:debian-zabbix,代码行数:28,代码来源:CControllerScriptUpdate.php

示例2: add_audit_if

function add_audit_if($condition, $action, $resourcetype, $details)
{
    if ($condition) {
        return add_audit($action, $resourcetype, $details);
    }
    return false;
}
开发者ID:songyuanjie,项目名称:zabbix-stats,代码行数:7,代码来源:audit.inc.php

示例3: doAction

 protected function doAction()
 {
     $proxy = [];
     $this->getInputs($proxy, ['host', 'status', 'description', 'tls_connect', 'tls_accept', 'tls_issuer', 'tls_subject', 'tls_psk_identity', 'tls_psk']);
     if ($this->getInput('status', HOST_STATUS_PROXY_ACTIVE) == HOST_STATUS_PROXY_PASSIVE) {
         $proxy['interface'] = [];
         $this->getInputs($proxy['interface'], ['dns', 'ip', 'useip', 'port']);
     }
     DBstart();
     if ($this->hasInput('proxy_hostids')) {
         // skip discovered hosts
         $proxy['hosts'] = API::Host()->get(['output' => ['hostid'], 'hostids' => $this->getInput('proxy_hostids'), 'filter' => ['flags' => ZBX_FLAG_DISCOVERY_NORMAL]]);
     }
     $result = API::Proxy()->create([$proxy]);
     if ($result) {
         add_audit(AUDIT_ACTION_ADD, AUDIT_RESOURCE_PROXY, '[' . $this->getInput('host', '') . '] [' . reset($result['proxyids']) . ']');
     }
     $result = DBend($result);
     if ($result) {
         $response = new CControllerResponseRedirect('zabbix.php?action=proxy.list&uncheck=1');
         $response->setMessageOk(_('Proxy added'));
     } else {
         $response = new CControllerResponseRedirect('zabbix.php?action=proxy.edit');
         $response->setFormData($this->getInputAll());
         $response->setMessageError(_('Cannot add proxy'));
     }
     $this->setResponse($response);
 }
开发者ID:jbfavre,项目名称:debian-zabbix,代码行数:28,代码来源:CControllerProxyCreate.php

示例4: doAction

 protected function doAction()
 {
     $scriptids = $this->getInput('scriptids');
     DBstart();
     $result = API::Script()->delete($scriptids);
     if ($result) {
         foreach ($scriptids as $scriptid) {
             add_audit(AUDIT_ACTION_DELETE, AUDIT_RESOURCE_SCRIPT, _('Script') . ' [' . $scriptid . ']');
         }
     }
     $result = DBend($result);
     $deleted = count($scriptids);
     $response = new CControllerResponseRedirect('zabbix.php?action=script.list&uncheck=1');
     if ($result) {
         $response->setMessageOk(_n('Script deleted', 'Scripts deleted', $deleted));
     } else {
         $response->setMessageError(_n('Cannot delete script', 'Cannot delete scripts', $deleted));
     }
     $this->setResponse($response);
 }
开发者ID:jbfavre,项目名称:debian-zabbix,代码行数:20,代码来源:CControllerScriptDelete.php

示例5: DBfetch

        // get groups that use this authentication method
        $result = DBfetch(DBselect('SELECT COUNT(g.usrgrpid) AS cnt_usrgrp FROM usrgrp g WHERE g.gui_access=' . GROUP_GUI_ACCESS_INTERNAL));
        if ($result['cnt_usrgrp'] > 0) {
            info(_n('There is "%1$d" group with Internal GUI access.', 'There are "%1$d" groups with Internal GUI access.', $result['cnt_usrgrp']));
        }
        $messageSuccess = _('Authentication method changed to HTTP');
        $messageFailed = _('Cannot change authentication method to HTTP');
        DBstart();
        $result = update_config($config);
        if ($result) {
            // reset all sessions
            if ($isAuthenticationTypeChanged) {
                $result &= DBexecute('UPDATE sessions SET status=' . ZBX_SESSION_PASSIVE . ' WHERE sessionid<>' . zbx_dbstr(CWebUser::$data['sessionid']));
            }
            $isAuthenticationTypeChanged = false;
            add_audit(AUDIT_ACTION_UPDATE, AUDIT_RESOURCE_ZABBIX_CONFIG, $messageSuccess);
        }
        $result = DBend($result);
        show_messages($result, $messageSuccess, $messageFailed);
    }
}
show_messages();
/*
 * Display
 */
$data = array('form_refresh' => getRequest('form_refresh'), 'config' => $config, 'is_authentication_type_changed' => $isAuthenticationTypeChanged, 'user' => getRequest('user', CWebUser::$data['alias']), 'user_password' => getRequest('user_password', ''), 'user_list' => null, 'change_bind_password' => getRequest('change_bind_password'));
// get tab title
$data['title'] = authentication2str($config['authentication_type']);
// get user list
if (getUserGuiAccess(CWebUser::$data['userid']) == GROUP_GUI_ACCESS_INTERNAL) {
    $data['user_list'] = DBfetchArray(DBselect('SELECT u.alias,u.userid FROM users u ORDER BY u.alias'));
开发者ID:omidmt,项目名称:zabbix-greenplum,代码行数:31,代码来源:authentication.php

示例6: delete

 /**
  * Delete proxy.
  *
  * @param string|array $proxyIds
  *
  * @return array
  */
 public function delete($proxyIds)
 {
     $proxyIds = zbx_toArray($proxyIds);
     // deprecated input support
     if ($proxyIds && is_array($proxyIds[0])) {
         $this->deprecated('Passing objects is deprecated, use an array of IDs instead.');
         foreach ($proxyIds as $proxyId) {
             if (!check_db_fields(array('proxyid' => null), $proxyId)) {
                 self::exception(ZBX_API_ERROR_PARAMETERS, _('No proxy ID given.'));
             }
         }
         $proxyIds = zbx_objectValues($proxyIds, 'proxyid');
     }
     $this->validateDelete($proxyIds);
     $dbProxies = DBselect('SELECT h.hostid,h.host' . ' FROM hosts h' . ' WHERE ' . dbConditionInt('h.hostid', $proxyIds));
     $dbProxies = DBfetchArrayAssoc($dbProxies, 'hostid');
     $actionIds = array();
     // get conditions
     $dbActions = DBselect('SELECT DISTINCT c.actionid' . ' FROM conditions c' . ' WHERE c.conditiontype=' . CONDITION_TYPE_PROXY . ' AND ' . dbConditionString('c.value', $proxyIds));
     while ($dbAction = DBfetch($dbActions)) {
         $actionIds[$dbAction['actionid']] = $dbAction['actionid'];
     }
     if ($actionIds) {
         DB::update('actions', array('values' => array('status' => ACTION_STATUS_DISABLED), 'where' => array('actionid' => $actionIds)));
     }
     // delete action conditions
     DB::delete('conditions', array('conditiontype' => CONDITION_TYPE_PROXY, 'value' => $proxyIds));
     // delete interface
     DB::delete('interface', array('hostid' => $proxyIds));
     // delete host
     DB::delete('hosts', array('hostid' => $proxyIds));
     // TODO: remove info from API
     foreach ($dbProxies as $proxy) {
         info(_s('Deleted: Proxy "%1$s".', $proxy['host']));
         add_audit(AUDIT_ACTION_DELETE, AUDIT_RESOURCE_PROXY, '[' . $proxy['host'] . '] [' . $proxy['hostid'] . ']');
     }
     return array('proxyids' => $proxyIds);
 }
开发者ID:itnihao,项目名称:zatree-2.2,代码行数:45,代码来源:CProxy.php

示例7: add_audit

            add_audit(AUDIT_ACTION_UPDATE, AUDIT_RESOURCE_SCENARIO, _('Scenario') . ' [' . $httptest_data['name'] . '] [' . $id . '] ' . _('Host') . ' [' . $host['host'] . ']' . _('Scenario disabled'));
        }
    }
    show_messages($go_result, _('Scenario disabled'), null);
} elseif ($_REQUEST['go'] == 'clean_history' && isset($_REQUEST['group_httptestid'])) {
    $go_result = false;
    $group_httptestid = $_REQUEST['group_httptestid'];
    foreach ($group_httptestid as $id) {
        if (!($httptest_data = get_httptest_by_httptestid($id))) {
            continue;
        }
        if (delete_history_by_httptestid($id)) {
            $go_result = true;
            DBexecute('UPDATE httptest SET nextcheck=0 WHERE httptestid=' . $id);
            $host = get_host_by_applicationid($httptest_data['applicationid']);
            add_audit(AUDIT_ACTION_UPDATE, AUDIT_RESOURCE_SCENARIO, _('Scenario') . ' [' . $httptest_data['name'] . '] [' . $id . '] ' . _('Host') . ' [' . $host['host'] . ']' . _('History cleared'));
        }
    }
    show_messages($go_result, _('History cleared'), null);
} elseif ($_REQUEST['go'] == 'delete' && isset($_REQUEST['group_httptestid'])) {
    $go_result = API::WebCheck()->delete($_REQUEST['group_httptestid']);
    show_messages($go_result, _('Scenario deleted'), null);
}
if ($_REQUEST['go'] != 'none' && isset($go_result) && $go_result) {
    $url = new CUrl();
    $path = $url->getPath();
    insert_js('cookie.eraseArray("' . $path . '")');
}
show_messages();
/*
 * Display
开发者ID:quanta-computing,项目名称:debian-packages,代码行数:31,代码来源:httpconf.php

示例8: delete

 /**
  * Delete web scenario.
  *
  * @param array $httpTestIds
  * @param bool  $nopermissions
  *
  * @return array
  */
 public function delete(array $httpTestIds, $nopermissions = false)
 {
     if (empty($httpTestIds)) {
         return true;
     }
     $delHttpTests = $this->get(array('httptestids' => $httpTestIds, 'output' => API_OUTPUT_EXTEND, 'editable' => true, 'selectHosts' => API_OUTPUT_EXTEND, 'preservekeys' => true));
     if (!$nopermissions) {
         foreach ($httpTestIds as $httpTestId) {
             if (!empty($delHttpTests[$httpTestId]['templateid'])) {
                 self::exception(ZBX_API_ERROR_PARAMETERS, _s('Cannot delete templated web scenario "%1$s".', $delHttpTests[$httpTestId]['name']));
             }
             if (!isset($delHttpTests[$httpTestId])) {
                 self::exception(ZBX_API_ERROR_PARAMETERS, _('No permissions to referred object or it does not exist!'));
             }
         }
     }
     $parentHttpTestIds = $httpTestIds;
     $childHttpTestIds = array();
     do {
         $dbTests = DBselect('SELECT ht.httptestid FROM httptest ht WHERE ' . dbConditionInt('ht.templateid', $parentHttpTestIds));
         $parentHttpTestIds = array();
         while ($dbTest = DBfetch($dbTests)) {
             $parentHttpTestIds[] = $dbTest['httptestid'];
             $childHttpTestIds[$dbTest['httptestid']] = $dbTest['httptestid'];
         }
     } while (!empty($parentHttpTestIds));
     $options = array('httptestids' => $childHttpTestIds, 'output' => API_OUTPUT_EXTEND, 'nopermissions' => true, 'preservekeys' => true, 'selectHosts' => API_OUTPUT_EXTEND);
     $delHttpTestChilds = $this->get($options);
     $delHttpTests = zbx_array_merge($delHttpTests, $delHttpTestChilds);
     $httpTestIds = array_merge($httpTestIds, $childHttpTestIds);
     $itemidsDel = array();
     $dbTestItems = DBselect('SELECT hsi.itemid' . ' FROM httptestitem hsi' . ' WHERE ' . dbConditionInt('hsi.httptestid', $httpTestIds));
     while ($testitem = DBfetch($dbTestItems)) {
         $itemidsDel[] = $testitem['itemid'];
     }
     $dbStepItems = DBselect('SELECT DISTINCT hsi.itemid' . ' FROM httpstepitem hsi,httpstep hs' . ' WHERE ' . dbConditionInt('hs.httptestid', $httpTestIds) . ' AND hs.httpstepid=hsi.httpstepid');
     while ($stepitem = DBfetch($dbStepItems)) {
         $itemidsDel[] = $stepitem['itemid'];
     }
     if (!empty($itemidsDel)) {
         API::Item()->delete($itemidsDel, true);
     }
     DB::delete('httptest', array('httptestid' => $httpTestIds));
     // TODO: REMOVE
     foreach ($delHttpTests as $httpTest) {
         $host = reset($httpTest['hosts']);
         info(_s('Deleted: Web scenario "%1$s" on "%2$s".', $httpTest['name'], $host['host']));
         add_audit(AUDIT_ACTION_DELETE, AUDIT_RESOURCE_SCENARIO, 'Web scenario [' . $httpTest['name'] . '] [' . $httpTest['httptestid'] . '] Host [' . $host['name'] . ']');
     }
     return array('httptestids' => $httpTestIds);
 }
开发者ID:omidmt,项目名称:zabbix-greenplum,代码行数:59,代码来源:CHttpTest.php

示例9: get_request

     $maintenanceids = get_request('maintenanceid', array());
     if (isset($_REQUEST['maintenanceids'])) {
         $maintenanceids = $_REQUEST['maintenanceids'];
     }
     zbx_value2array($maintenanceids);
     $maintenances = array();
     foreach ($maintenanceids as $id => $maintenanceid) {
         $maintenances[$maintenanceid] = get_maintenance_by_maintenanceid($maintenanceid);
     }
     DBstart();
     $result = delete_maintenance($maintenanceids);
     $result = DBend($result);
     show_messages($result, S_MAINTENANCE_DELETED, S_CANNOT_DELETE_MAINTENANCE);
     if ($result) {
         foreach ($maintenances as $maintenanceid => $maintenance) {
             add_audit(AUDIT_ACTION_DELETE, AUDIT_RESOURCE_MAINTENANCE, 'Id [' . $maintenanceid . '] ' . S_NAME . ' [' . $maintenance['name'] . ']');
         }
         unset($_REQUEST['form']);
         unset($_REQUEST['maintenanceid']);
     }
 } else {
     if (inarr_isset(array('add_timeperiod', 'new_timeperiod'))) {
         $new_timeperiod = $_REQUEST['new_timeperiod'];
         // START TIME
         $new_timeperiod['start_time'] = $new_timeperiod['hour'] * 3600 + $new_timeperiod['minute'] * 60;
         //--
         // PERIOD
         $new_timeperiod['period'] = $new_timeperiod['period_days'] * 86400 + $new_timeperiod['period_hours'] * 3600 + $new_timeperiod['period_minutes'] * 60;
         //--
         // DAYSOFWEEK
         if (!isset($new_timeperiod['dayofweek'])) {
开发者ID:phedders,项目名称:zabbix,代码行数:31,代码来源:maintenance.php

示例10: array

$page["title"] = "S_TRIGGER_COMMENTS";
$page["file"] = "tr_comments.php";
include_once "include/page_header.php";
//		VAR			TYPE	OPTIONAL FLAGS	VALIDATION	EXCEPTION
$fields = array("triggerid" => array(T_ZBX_INT, O_MAND, P_SYS, DB_ID, null), "comments" => array(T_ZBX_STR, O_OPT, null, null, 'isset({save})'), "save" => array(T_ZBX_STR, O_OPT, P_SYS | P_ACT, null, null), "cancel" => array(T_ZBX_STR, O_OPT, P_SYS | P_ACT, null, null));
check_fields($fields);
$sql = 'SELECT * ' . ' FROM items i, functions f ' . ' WHERE i.itemid=f.itemid ' . ' AND f.triggerid=' . $_REQUEST['triggerid'] . ' AND ' . DBin_node('f.triggerid');
if (!($db_data = DBfetch(DBselect($sql)))) {
    fatal_error(S_NO_TRIGGER_DEFINED);
}
$available_triggers = get_accessible_triggers(PERM_READ_ONLY, array($db_data['hostid']));
if (!isset($available_triggers[$_REQUEST['triggerid']])) {
    access_deny();
}
$trigger_hostid = $db_data['hostid'];
if (isset($_REQUEST["save"])) {
    $result = update_trigger_comments($_REQUEST["triggerid"], $_REQUEST["comments"]);
    show_messages($result, S_COMMENT_UPDATED, S_CANNOT_UPDATE_COMMENT);
    if ($result) {
        add_audit(AUDIT_ACTION_UPDATE, AUDIT_RESOURCE_TRIGGER, S_TRIGGER . " [" . $_REQUEST["triggerid"] . "] [" . expand_trigger_description($_REQUEST["triggerid"]) . "] " . S_COMMENTS . " [" . $_REQUEST["comments"] . "]");
    }
} else {
    if (isset($_REQUEST["cancel"])) {
        redirect('tr_status.php?hostid=' . $trigger_hostid);
        exit;
    }
}
show_table_header(S_TRIGGER_COMMENTS_BIG);
echo SBR;
insert_trigger_comment_form($_REQUEST["triggerid"]);
include_once "include/page_footer.php";
开发者ID:rennhak,项目名称:zabbix,代码行数:31,代码来源:tr_comments.php

示例11: delete

 /**
  * Delete proxy.
  *
  * @param array	$proxyIds
  *
  * @return array
  */
 public function delete(array $proxyIds)
 {
     $this->validateDelete($proxyIds);
     $dbProxies = DBselect('SELECT h.hostid,h.host' . ' FROM hosts h' . ' WHERE ' . dbConditionInt('h.hostid', $proxyIds));
     $dbProxies = DBfetchArrayAssoc($dbProxies, 'hostid');
     $actionIds = array();
     // get conditions
     $dbActions = DBselect('SELECT DISTINCT c.actionid' . ' FROM conditions c' . ' WHERE c.conditiontype=' . CONDITION_TYPE_PROXY . ' AND ' . dbConditionString('c.value', $proxyIds));
     while ($dbAction = DBfetch($dbActions)) {
         $actionIds[$dbAction['actionid']] = $dbAction['actionid'];
     }
     if ($actionIds) {
         DB::update('actions', array('values' => array('status' => ACTION_STATUS_DISABLED), 'where' => array('actionid' => $actionIds)));
     }
     // delete action conditions
     DB::delete('conditions', array('conditiontype' => CONDITION_TYPE_PROXY, 'value' => $proxyIds));
     // delete interface
     DB::delete('interface', array('hostid' => $proxyIds));
     // delete host
     DB::delete('hosts', array('hostid' => $proxyIds));
     // TODO: remove info from API
     foreach ($dbProxies as $proxy) {
         info(_s('Deleted: Proxy "%1$s".', $proxy['host']));
         add_audit(AUDIT_ACTION_DELETE, AUDIT_RESOURCE_PROXY, '[' . $proxy['host'] . '] [' . $proxy['hostid'] . ']');
     }
     return array('proxyids' => $proxyIds);
 }
开发者ID:omidmt,项目名称:zabbix-greenplum,代码行数:34,代码来源:CProxy.php

示例12: define

** Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
**/
define('ZBX_PAGE_NO_AUTHORIZATION', true);
define('ZBX_NOT_ALLOW_ALL_NODES', true);
define('ZBX_HIDE_NODE_SELECTION', true);
define('ZBX_PAGE_NO_MENU', true);
require_once dirname(__FILE__) . '/include/config.inc.php';
require_once dirname(__FILE__) . '/include/forms.inc.php';
$page['title'] = _('ZABBIX');
$page['file'] = 'index.php';
// VAR	TYPE	OPTIONAL	FLAGS	VALIDATION	EXCEPTION
$fields = array('name' => array(T_ZBX_STR, O_NO, null, NOT_EMPTY, 'isset({enter})', _('Username')), 'password' => array(T_ZBX_STR, O_OPT, null, null, 'isset({enter})'), 'sessionid' => array(T_ZBX_STR, O_OPT, null, null, null), 'reconnect' => array(T_ZBX_INT, O_OPT, P_SYS, BETWEEN(0, 65535), null), 'enter' => array(T_ZBX_STR, O_OPT, P_SYS, null, null), 'autologin' => array(T_ZBX_INT, O_OPT, null, null, null), 'request' => array(T_ZBX_STR, O_OPT, null, null, null));
check_fields($fields);
// logout
if (isset($_REQUEST['reconnect'])) {
    add_audit(AUDIT_ACTION_LOGOUT, AUDIT_RESOURCE_USER, _('Manual Logout'));
    CWebUser::logout();
}
$config = select_config();
if ($config['authentication_type'] == ZBX_AUTH_HTTP) {
    if (!empty($_SERVER['PHP_AUTH_USER'])) {
        $_REQUEST['enter'] = _('Sign in');
        $_REQUEST['name'] = $_SERVER['PHP_AUTH_USER'];
    } else {
        access_deny();
    }
}
// login via form
if (isset($_REQUEST['enter']) && $_REQUEST['enter'] == _('Sign in')) {
    // try to login
    if (CWebUser::login(get_request('name', ''), get_request('password', ''))) {
开发者ID:quanta-computing,项目名称:debian-packages,代码行数:31,代码来源:index.php

示例13: delete

 /**
  * Delete drules.
  *
  * @param array $dRuleIds
  *
  * @return array
  */
 public function delete(array $dRuleIds)
 {
     $this->validateDelete($dRuleIds);
     $actionIds = array();
     $conditionIds = array();
     $dCheckIds = array();
     $dbChecks = DBselect('SELECT dc.dcheckid FROM dchecks dc WHERE ' . dbConditionInt('dc.druleid', $dRuleIds));
     while ($dbCheck = DBfetch($dbChecks)) {
         $dCheckIds[] = $dbCheck['dcheckid'];
     }
     $dbConditions = DBselect('SELECT c.conditionid,c.actionid' . ' FROM conditions c' . ' WHERE (c.conditiontype=' . CONDITION_TYPE_DRULE . ' AND ' . dbConditionString('c.value', $dRuleIds) . ')' . ' OR (c.conditiontype=' . CONDITION_TYPE_DCHECK . ' AND ' . dbConditionString('c.value', $dCheckIds) . ')');
     while ($dbCondition = DBfetch($dbConditions)) {
         $conditionIds[] = $dbCondition['conditionid'];
         $actionIds[] = $dbCondition['actionid'];
     }
     if ($actionIds) {
         DB::update('actions', array('values' => array('status' => ACTION_STATUS_DISABLED), 'where' => array('actionid' => array_unique($actionIds))));
     }
     if ($conditionIds) {
         DB::delete('conditions', array('conditionid' => $conditionIds));
     }
     $result = DB::delete('drules', array('druleid' => $dRuleIds));
     if ($result) {
         foreach ($dRuleIds as $dRuleId) {
             add_audit(AUDIT_ACTION_DELETE, AUDIT_RESOURCE_DISCOVERY_RULE, '[' . $dRuleId . ']');
         }
     }
     return array('druleids' => $dRuleIds);
 }
开发者ID:omidmt,项目名称:zabbix-greenplum,代码行数:36,代码来源:CDRule.php

示例14: add_audit

            if ($result) {
                add_audit(AUDIT_ACTION_DELETE, AUDIT_RESOURCE_SCRIPT, S_SCRIPT . ' [' . $scriptid . ']');
            }
            show_messages($result, S_SCRIPT_DELETED, S_CANNOT_DELETE_SCRIPT);
            if ($result) {
                unset($_REQUEST['form']);
                unset($_REQUEST['scriptid']);
            }
        } else {
            if ($_REQUEST['go'] == 'delete' && isset($_REQUEST['scripts'])) {
                $scripts = $_REQUEST['scripts'];
                $result = true;
                foreach ($scripts as $scriptid) {
                    $result &= delete_script($scriptid);
                    if ($result) {
                        add_audit(AUDIT_ACTION_DELETE, AUDIT_RESOURCE_SCRIPT, S_SCRIPT . ' [' . $scriptid . ']');
                    }
                }
                show_messages($result, S_SCRIPT_DELETED, S_CANNOT_DELETE_SCRIPT);
                if ($result) {
                    unset($_REQUEST['form']);
                    unset($_REQUEST['scriptid']);
                }
            }
        }
    }
}
$row_count = 0;
if (isset($_REQUEST['form'])) {
    $available_groups = get_accessible_groups_by_user($USER_DETAILS, PERM_READ_ONLY);
    show_table_header(S_SCRIPTS);
开发者ID:phedders,项目名称:zabbix,代码行数:31,代码来源:scripts.php

示例15: foreach

                $config['authentication_type'] = ZBX_AUTH_HTTP;
                foreach ($config as $id => $value) {
                    if (isset($_REQUEST[$id])) {
                        $config[$id] = $_REQUEST[$id];
                    } else {
                        unset($config[$id]);
                    }
                }
                // If we do save and auth_type changed or is set to LDAP, reset all sessions
                if ($cur_auth_type != $config['authentication_type']) {
                    DBexecute('UPDATE sessions SET status=' . ZBX_SESSION_PASSIVE . ' WHERE sessionid<>' . zbx_dbstr($USER_DETAILS['sessionid']));
                }
                $result = update_config($config);
                show_messages($result, S_HTTP_AUTH . SPACE . S_UPDATED, S_CANNOT_UPDATE . SPACE . S_HTTP_AUTH);
                if ($result) {
                    add_audit(AUDIT_ACTION_UPDATE, AUDIT_RESOURCE_ZABBIX_CONFIG, S_HTTP_AUTH);
                }
            }
        }
    }
}
show_messages();
$config = select_config();
switch ($config['authentication_type']) {
    case ZBX_AUTH_INTERNAL:
        $auth = S_ZABBIX_INTERNAL_AUTH;
        break;
    case ZBX_AUTH_LDAP:
        $auth = S_LDAP_AUTH;
        break;
    case ZBX_AUTH_HTTP:
开发者ID:songyuanjie,项目名称:zabbix-stats,代码行数:31,代码来源:authentication.php


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