• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP getUserFullname函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: makeAckTab

/**
 * Get acknowledgement table.
 *
 * @param array $acknowledges
 * @param array $acknowledges['clock']
 * @param array $acknowledges['alias']
 * @param array $acknowledges['name']
 * @param array $acknowledges['surname']
 * @param array $acknowledges['message']
 *
 * @return CTableInfo
 */
function makeAckTab($acknowledges)
{
    $table = (new CTableInfo())->setHeader([_('Time'), _('User'), _('Message')]);
    foreach ($acknowledges as $acknowledge) {
        $table->addRow([zbx_date2str(DATE_TIME_FORMAT_SECONDS, $acknowledge['clock']), getUserFullname($acknowledge), zbx_nl2br($acknowledge['message'])]);
    }
    return $table;
}
开发者ID:jbfavre,项目名称:debian-zabbix,代码行数:20,代码来源:acknow.inc.php


示例2: makeAckTab

/**
 * Get acknowledgement table.
 *
 * @param array $event
 * @param array $event['acknowledges']
 * @param array $event['acknowledges']['clock']
 * @param array $event['acknowledges']['alias']
 * @param array $event['acknowledges']['message']
 *
 * @return CTableInfo
 */
function makeAckTab($event)
{
    $acknowledgeTable = new CTableInfo(_('No acknowledges found.'));
    $acknowledgeTable->setHeader(array(_('Time'), _('User'), _('Comments')));
    if (!empty($event['acknowledges']) && is_array($event['acknowledges'])) {
        foreach ($event['acknowledges'] as $acknowledge) {
            $acknowledgeTable->addRow(array(zbx_date2str(DATE_TIME_FORMAT_SECONDS, $acknowledge['clock']), getUserFullname($acknowledge), new CCol(zbx_nl2br($acknowledge['message']), 'wraptext')));
        }
    }
    return $acknowledgeTable;
}
开发者ID:omidmt,项目名称:zabbix-greenplum,代码行数:22,代码来源:acknow.inc.php


示例3: foreach

        foreach ($userGroupUsers as $user) {
            $userTypeStyle = 'enabled';
            if ($user['type'] == USER_TYPE_ZABBIX_ADMIN) {
                $userTypeStyle = 'orange';
            }
            if ($user['type'] == USER_TYPE_SUPER_ADMIN) {
                $userTypeStyle = 'disabled';
            }
            $userStatusStyle = 'enabled';
            if ($user['gui_access'] == GROUP_GUI_ACCESS_DISABLED) {
                $userStatusStyle = 'disabled';
            }
            if ($user['users_status'] == GROUP_STATUS_DISABLED) {
                $userStatusStyle = 'disabled';
            }
            $users[] = new CLink(getUserFullname($user), 'users.php?form=update&userid=' . $user['userid'], $userStatusStyle);
            $users[] = ', ';
        }
        array_pop($users);
    }
    $userGroupTable->addRow(array(new CCheckBox('group_groupid[' . $userGroupId . ']', null, null, $userGroupId), $this->data['displayNodes'] ? $usrgrp['nodename'] : null, new CLink($usrgrp['name'], 'usergrps.php?form=update&usrgrpid=' . $userGroupId), array(new CLink(_('Users'), 'users.php?&filter_usrgrpid=' . $userGroupId), ' (', count($usrgrp['users']), ')'), new CCol($users, 'wraptext'), $usersStatus, $guiAccess, $debugMode));
}
// append GO buttons
$goComboBox = new CComboBox('go');
$goOption = new CComboItem('enable_status', _('Enable selected'));
$goOption->setAttribute('confirm', _('Enable selected groups?'));
$goComboBox->addItem($goOption);
$goOption = new CComboItem('disable_status', _('Disable selected'));
$goOption->setAttribute('confirm', _('Disable selected groups?'));
$goComboBox->addItem($goOption);
$goOption = new CComboItem('enable_debug', _('Enable DEBUG'));
开发者ID:SandipSingh14,项目名称:Zabbix_,代码行数:31,代码来源:administration.usergroups.list.php


示例4: order_result

    }
    if (isset($usrgrp['users'])) {
        $userGroupUsers = $usrgrp['users'];
        order_result($userGroupUsers, 'alias');
        $users = array();
        $i = 0;
        foreach ($userGroupUsers as $user) {
            $i++;
            if ($i > $this->data['config']['max_in_table']) {
                $users[] = ' …';
                break;
            }
            if ($users) {
                $users[] = ', ';
            }
            $users[] = new CLink(getUserFullname($user), 'users.php?form=update&userid=' . $user['userid'], $user['gui_access'] == GROUP_GUI_ACCESS_DISABLED || $user['users_status'] == GROUP_STATUS_DISABLED ? 'disabled' : 'enabled');
        }
    }
    $userGroupTable->addRow(array(new CCheckBox('group_groupid[' . $userGroupId . ']', null, null, $userGroupId), new CLink($usrgrp['name'], 'usergrps.php?form=update&usrgrpid=' . $userGroupId), array(new CLink(_('Users'), 'users.php?filter_usrgrpid=' . $userGroupId), ' (', count($usrgrp['users']), ')'), new CCol($users, 'wraptext'), $guiAccess, $debugMode, $usersStatus));
}
// append GO buttons
$goComboBox = new CComboBox('action');
$goOption = new CComboItem('usergroup.massenable', _('Enable selected'));
$goOption->setAttribute('confirm', _('Enable selected groups?'));
$goComboBox->addItem($goOption);
$goOption = new CComboItem('usergroup.massdisable', _('Disable selected'));
$goOption->setAttribute('confirm', _('Disable selected groups?'));
$goComboBox->addItem($goOption);
$goOption = new CComboItem('usergroup.massenabledebug', _('Enable debug mode'));
$goOption->setAttribute('confirm', _('Enable debug mode in selected groups?'));
$goComboBox->addItem($goOption);
开发者ID:omidmt,项目名称:zabbix-greenplum,代码行数:31,代码来源:administration.usergroups.list.php


示例5: CCol

            $acknowledgesTable->addRow(array(new CCol(getUserFullname($acknowledge), 'user'), new CCol(zbx_date2str(_('d M Y H:i:s'), $acknowledge['clock']), 'time')), 'title');
            $acknowledgesTable->addRow(new CCol(zbx_nl2br($acknowledge['message']), null, 2), 'msg');
        }
        $acknowledgesTable->show();
    }
    if ($eventAcknowledged) {
        $title = _('Add comment by');
        $saveLabel = _('Save');
        $saveAndReturnLabel = _('Save and return');
    } else {
        $title = _('Acknowledge alarm by');
        $saveLabel = _('Acknowledge');
        $saveAndReturnLabel = _('Acknowledge and return');
    }
}
$messageTable = new CFormTable($title . ' "' . getUserFullname(CWebUser::$data) . '"');
$messageTable->addVar('backurl', $_REQUEST['backurl']);
if (in_array($_REQUEST['backurl'], array('tr_events.php', 'events.php'))) {
    $messageTable->addVar('eventid', $_REQUEST['eventid']);
    $messageTable->addVar('triggerid', $_REQUEST['triggerid']);
} elseif (in_array($_REQUEST['backurl'], array('screenedit.php', 'screens.php'))) {
    $messageTable->addVar('screenid', $_REQUEST['screenid']);
}
if (isset($_REQUEST['eventid'])) {
    $messageTable->addVar('eventid', $_REQUEST['eventid']);
} elseif (isset($_REQUEST['triggers'])) {
    foreach ($_REQUEST['triggers'] as $triggerId) {
        $messageTable->addVar('triggers[' . $triggerId . ']', $triggerId);
    }
} elseif (isset($_REQUEST['events'])) {
    foreach ($_REQUEST['events'] as $eventId) {
开发者ID:SandipSingh14,项目名称:Zabbix_,代码行数:31,代码来源:acknow.php


示例6: getActionMessages

/**
 * Get action messages.
 *
 * @param array  $alerts
 * @param string $alerts[n]['alertid']
 * @param string $alerts[n]['userid']
 * @param int    $alerts[n]['alerttype']
 * @param array  $alerts[n]['mediatypes']
 * @param string $alerts[n]['clock']
 * @param int    $alerts[n]['esc_step']
 * @param int    $alerts[n]['status']
 * @param int    $alerts[n]['retries']
 * @param string $alerts[n]['subject']
 * @param string $alerts[n]['sendto']
 * @param string $alerts[n]['message']
 * @param string $alerts[n]['error']
 *
 * @return CTableInfo
 */
function getActionMessages(array $alerts)
{
    $dbUsers = API::User()->get(array('output' => array('userid', 'alias', 'name', 'surname'), 'userids' => zbx_objectValues($alerts, 'userid'), 'preservekeys' => true));
    $table = new CTableInfo(_('No actions found.'));
    $table->setHeader(array(_('Time'), _('Type'), _('Status'), _('Retries left'), _('Recipient(s)'), _('Message'), _('Info')));
    foreach ($alerts as $alert) {
        if ($alert['alerttype'] != ALERT_TYPE_MESSAGE) {
            continue;
        }
        $mediaType = array_pop($alert['mediatypes']);
        $time = zbx_date2str(DATE_TIME_FORMAT_SECONDS, $alert['clock']);
        if ($alert['esc_step'] > 0) {
            $time = array(bold(_('Step') . NAME_DELIMITER), $alert['esc_step'], br(), bold(_('Time') . NAME_DELIMITER), br(), $time);
        }
        if ($alert['status'] == ALERT_STATUS_SENT) {
            $status = new CSpan(_('sent'), 'green');
            $retries = new CSpan(SPACE, 'green');
        } elseif ($alert['status'] == ALERT_STATUS_NOT_SENT) {
            $status = new CSpan(_('In progress'), 'orange');
            $retries = new CSpan(ALERT_MAX_RETRIES - $alert['retries'], 'orange');
        } else {
            $status = new CSpan(_('not sent'), 'red');
            $retries = new CSpan(0, 'red');
        }
        $recipient = $alert['userid'] ? array(bold(getUserFullname($dbUsers[$alert['userid']])), BR(), $alert['sendto']) : $alert['sendto'];
        $message = array(bold(_('Subject') . NAME_DELIMITER), br(), $alert['subject'], br(), br(), bold(_('Message') . NAME_DELIMITER));
        array_push($message, BR(), zbx_nl2br($alert['message']));
        if (zbx_empty($alert['error'])) {
            $info = '';
        } else {
            $info = new CDiv(SPACE, 'status_icon iconerror');
            $info->setHint($alert['error'], 'on');
        }
        $table->addRow(array(new CCol($time, 'top'), new CCol(isset($mediaType['description']) ? $mediaType['description'] : '', 'top'), new CCol($status, 'top'), new CCol($retries, 'top'), new CCol($recipient, 'top'), new CCol($message, 'wraptext top'), new CCol($info, 'wraptext top')));
    }
    return $table;
}
开发者ID:TonywalkerCN,项目名称:Zabbix,代码行数:56,代码来源:actions.inc.php


示例7: foreach

    foreach ($users as &$user) {
        if ($multiselect) {
            $checkBox = new CCheckBox('users[' . $user['userid'] . ']', $user['userid']);
        }
        $js_action = 'javascript: addValue(' . zbx_jsvalue($reference) . ', ' . zbx_jsvalue($user['userid']) . ', ' . $parentid . '); jQuery(this).removeAttr("onclick");';
        $alias = (new CLink($user['alias'], 'javascript:void(0);'))->setId('spanid' . $user['userid'])->onClick($js_action);
        if (isset($srcfld1)) {
            if ($srcfld1 === 'userid') {
                $data[$user['userid']]['id'] = $user['userid'];
            } elseif ($srcfld1 === 'alias') {
                $data[$user['userid']]['name'] = $user['alias'];
            }
        }
        if (isset($srcfld2)) {
            if ($srcfld2 === 'fullname') {
                $data[$user['userid']]['name'] = getUserFullname($user);
            } elseif (array_key_exists($srcfld2, $user)) {
                $data[$user['userid']][$srcfld2] = $user[$srcfld2];
            }
        }
        $table->addRow([$multiselect ? $checkBox : null, $alias, $user['name'], $user['surname']]);
    }
    unset($user);
    if ($multiselect) {
        $table->setFooter(new CCol((new CButton('select', _('Select')))->onClick("javascript: addSelectedValues('users', " . zbx_jsvalue($reference) . ', ' . $parentid . ');')));
    }
    insert_js('var popupReference = ' . zbx_jsvalue($data, true) . ';');
    $form->addItem($table);
    $widget->addItem($form)->show();
} elseif ($srctbl == 'templates') {
    $form = (new CForm())->setName('templateform')->setId('templates');
开发者ID:jbfavre,项目名称:debian-zabbix,代码行数:31,代码来源:popup.php


示例8: CFormList

/*
** Zabbix
** Copyright (C) 2001-2016 Zabbix SIA
**
** 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; either version 2 of the License, or
** (at your option) any later version.
**
** 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.
**
** You should have received a copy of the GNU General Public License
** along with this program; if not, write to the Free Software
** Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
**/
$this->includeJSfile('app/views/monitoring.acknowledge.edit.js.php');
$form_list = (new CFormList())->addRow(_('Message'), (new CTextArea('message'))->setWidth(ZBX_TEXTAREA_BIG_WIDTH)->setMaxLength(255)->setAttribute('autofocus', 'autofocus'));
if (array_key_exists('event', $data)) {
    $acknowledgesTable = (new CTable())->setAttribute('style', 'width: 100%;')->setHeader([_('Time'), _('User'), _('Message')]);
    foreach ($data['event']['acknowledges'] as $acknowledge) {
        $acknowledgesTable->addRow([(new CCol(zbx_date2str(DATE_TIME_FORMAT_SECONDS, $acknowledge['clock'])))->addClass(ZBX_STYLE_NOWRAP), (new CCol(getUserFullname($acknowledge)))->addClass(ZBX_STYLE_NOWRAP), zbx_nl2br($acknowledge['message'])]);
    }
    $form_list->addRow(_('History'), (new CDiv($acknowledgesTable))->addClass(ZBX_STYLE_TABLE_FORMS_SEPARATOR)->setAttribute('style', 'min-width: ' . ZBX_TEXTAREA_BIG_WIDTH . 'px;'));
}
$selected_events = count($data['eventids']);
$form_list->addRow(_('Acknowledge'), (new CDiv((new CRadioButtonList('acknowledge_type', (int) $data['acknowledge_type']))->makeVertical()->addValue([_n('Only selected event', 'Only selected events', $selected_events), $selected_events > 1 ? (new CDiv())->addClass(ZBX_STYLE_FORM_INPUT_MARGIN) : null, $selected_events > 1 ? new CSup(_n('%1$s event', '%1$s events', $selected_events)) : null], ZBX_ACKNOWLEDGE_SELECTED)->addValue([_('Selected and all unacknowledged PROBLEM events'), (new CDiv())->addClass(ZBX_STYLE_FORM_INPUT_MARGIN), new CSup(_n('%1$s event', '%1$s events', $data['unack_problem_events_count']))], ZBX_ACKNOWLEDGE_PROBLEM)->addValue([_('Selected and all unacknowledged events'), (new CDiv())->addClass(ZBX_STYLE_FORM_INPUT_MARGIN), new CSup(_n('%1$s event', '%1$s events', $data['unack_events_count']))], ZBX_ACKNOWLEDGE_ALL)))->setAttribute('style', 'min-width: ' . ZBX_TEXTAREA_BIG_WIDTH . 'px;')->addClass(ZBX_STYLE_TABLE_FORMS_SEPARATOR));
$footer_buttons = makeFormFooter(new CSubmitButton(_('Acknowledge'), 'action', 'acknowledge.create'), [new CRedirectButton(_('Cancel'), $data['backurl'])]);
(new CWidget())->setTitle(_('Alarm acknowledgements'))->addItem((new CForm())->setId('acknowledge_form')->addVar('eventids', $data['eventids'])->addVar('backurl', $data['backurl'])->addItem((new CTabView())->addTab('ackTab', null, $form_list)->setFooter($footer_buttons)))->show();
开发者ID:jbfavre,项目名称:debian-zabbix,代码行数:31,代码来源:monitoring.acknowledge.edit.php


示例9: get_operation_descr

/**
 * Generates array with HTML items representing operation with description
 *
 * @param int $type short or long description, use const. SHORT_DESCRIPTION and LONG_DESCRIPTION
 * @param array $data
 * @param int $data['operationtype'] type of operation: OPERATION_TYPE_MESSAGE, OPERATION_TYPE_COMMAND, ...
 * @param int $data['opmessage']['mediatypeid'] type id of message media
 * @param bool $data['opmessage']['default_msg'] should default message be used
 * @param bool $data['opmessage']['operationid'] if true $data['operationid'] will be used to retrieve default messages from DB
 * @param string $data['opmessage']['subject'] subject of message
 * @param string $data['opmessage']['message'] message it self
 * @param array $data['opmessage_usr'] list of user ids if OPERATION_TYPE_MESSAGE
 * @param array $data['opmessage_grp'] list of group ids if OPERATION_TYPE_MESSAGE
 * @param array $data['opcommand_grp'] list of group ids if OPERATION_TYPE_COMMAND
 * @param array $data['opcommand_hst'] list of host ids if OPERATION_TYPE_COMMAND
 * @param array $data['opgroup'] list of group ids if OPERATION_TYPE_GROUP_ADD or OPERATION_TYPE_GROUP_REMOVE
 * @param array $data['optemplate'] list of template ids if OPERATION_TYPE_TEMPLATE_ADD or OPERATION_TYPE_TEMPLATE_REMOVE
 * @param int $data['operationid'] id of operation
 * @param int $data['opcommand']['type'] type of command: ZBX_SCRIPT_TYPE_IPMI, ZBX_SCRIPT_TYPE_SSH, ...
 * @param string $data['opcommand']['command'] actual command
 * @param int $data['opcommand']['scriptid'] script id used if $data['opcommand']['type'] is ZBX_SCRIPT_TYPE_GLOBAL_SCRIPT
 *
 * @return array
 */
function get_operation_descr($type, $data)
{
    $result = array();
    if ($type == SHORT_DESCRIPTION) {
        switch ($data['operationtype']) {
            case OPERATION_TYPE_MESSAGE:
                $mediaTypes = API::Mediatype()->get(array('mediatypeids' => $data['opmessage']['mediatypeid'], 'output' => array('description')));
                if (empty($mediaTypes)) {
                    $mediatype = _('all media');
                } else {
                    $mediatype = reset($mediaTypes);
                    $mediatype = $mediatype['description'];
                }
                if (!empty($data['opmessage_usr'])) {
                    $users = API::User()->get(array('userids' => zbx_objectValues($data['opmessage_usr'], 'userid'), 'output' => array('userid', 'alias', 'name', 'surname')));
                    order_result($users, 'alias');
                    foreach ($users as $user) {
                        $fullnames[] = getUserFullname($user);
                    }
                    $result[] = bold(_('Send message to users') . NAME_DELIMITER);
                    $result[] = array(implode(', ', $fullnames), SPACE, _('via'), SPACE, $mediatype);
                    $result[] = BR();
                }
                if (!empty($data['opmessage_grp'])) {
                    $usrgrps = API::UserGroup()->get(array('usrgrpids' => zbx_objectValues($data['opmessage_grp'], 'usrgrpid'), 'output' => API_OUTPUT_EXTEND));
                    order_result($usrgrps, 'name');
                    $result[] = bold(_('Send message to user groups') . NAME_DELIMITER);
                    $result[] = array(implode(', ', zbx_objectValues($usrgrps, 'name')), SPACE, _('via'), SPACE, $mediatype);
                    $result[] = BR();
                }
                break;
            case OPERATION_TYPE_COMMAND:
                if (!isset($data['opcommand_grp'])) {
                    $data['opcommand_grp'] = array();
                }
                if (!isset($data['opcommand_hst'])) {
                    $data['opcommand_hst'] = array();
                }
                $hosts = API::Host()->get(array('hostids' => zbx_objectValues($data['opcommand_hst'], 'hostid'), 'output' => array('hostid', 'name')));
                foreach ($data['opcommand_hst'] as $cmd) {
                    if ($cmd['hostid'] != 0) {
                        continue;
                    }
                    $result[] = array(bold(_('Run remote commands on current host')), BR());
                    break;
                }
                if (!empty($hosts)) {
                    order_result($hosts, 'name');
                    $result[] = bold(_('Run remote commands on hosts') . NAME_DELIMITER);
                    $result[] = array(implode(', ', zbx_objectValues($hosts, 'name')), BR());
                }
                $groups = API::HostGroup()->get(array('groupids' => zbx_objectValues($data['opcommand_grp'], 'groupid'), 'output' => array('groupid', 'name')));
                if (!empty($groups)) {
                    order_result($groups, 'name');
                    $result[] = bold(_('Run remote commands on host groups') . NAME_DELIMITER);
                    $result[] = array(implode(', ', zbx_objectValues($groups, 'name')), BR());
                }
                break;
            case OPERATION_TYPE_HOST_ADD:
                $result[] = array(bold(_('Add host')), BR());
                break;
            case OPERATION_TYPE_HOST_REMOVE:
                $result[] = array(bold(_('Remove host')), BR());
                break;
            case OPERATION_TYPE_HOST_ENABLE:
                $result[] = array(bold(_('Enable host')), BR());
                break;
            case OPERATION_TYPE_HOST_DISABLE:
                $result[] = array(bold(_('Disable host')), BR());
                break;
            case OPERATION_TYPE_GROUP_ADD:
            case OPERATION_TYPE_GROUP_REMOVE:
                if (!isset($data['opgroup'])) {
                    $data['opgroup'] = array();
                }
                $groups = API::HostGroup()->get(array('groupids' => zbx_objectValues($data['opgroup'], 'groupid'), 'output' => array('groupid', 'name')));
//.........这里部分代码省略.........
开发者ID:SandipSingh14,项目名称:Zabbix_,代码行数:101,代码来源:actions.inc.php


示例10: makeActionHints

function makeActionHints($alerts, $mediatypes, $users, $status)
{
    $table = (new CTableInfo())->setHeader([_('Time'), _('User'), _('Details'), _('Status'), _('Info')]);
    $popup_rows = 0;
    foreach ($alerts as $alert) {
        switch ($status) {
            case ALERT_STATUS_NOT_SENT:
                $status_str = (new CSpan(_('In progress')))->addClass(ZBX_STYLE_YELLOW);
                break;
            case ALERT_STATUS_SENT:
                $status_str = (new CSpan($alert['alerttype'] == ALERT_TYPE_COMMAND ? _('Executed') : _('Sent')))->addClass(ZBX_STYLE_GREEN);
                break;
            default:
                $status_str = (new CSpan(_('Not sent')))->addClass(ZBX_STYLE_RED);
        }
        switch ($alert['alerttype']) {
            case ALERT_TYPE_MESSAGE:
                $user = array_key_exists($alert['userid'], $users) ? getUserFullname($users[$alert['userid']]) : '';
                $message = array_key_exists($alert['mediatypeid'], $mediatypes) ? $mediatypes[$alert['mediatypeid']]['description'] : '';
                break;
            case ALERT_TYPE_COMMAND:
                $user = '';
                $message = [bold(_('Command') . NAME_DELIMITER), BR(), zbx_nl2br($alert['message'])];
                break;
            default:
                $user = '';
                $message = '';
        }
        $table->addRow([zbx_date2str(DATE_TIME_FORMAT_SECONDS, $alert['clock']), $user, $message, $status_str, $alert['error'] === '' ? '' : makeErrorIcon($alert['error'])]);
        if (++$popup_rows == ZBX_WIDGET_ROWS) {
            break;
        }
    }
    return $table;
}
开发者ID:jbfavre,项目名称:debian-zabbix,代码行数:35,代码来源:actions.inc.php


示例11: CForm

 $form = new CForm();
 $form->setName('userform');
 $form->setAttribute('id', 'users');
 $table = new CTableInfo(_('No users found.'));
 $table->setHeader(array($multiselect ? new CCheckBox('all_users', null, "javascript: checkAll('" . $form->getName() . "', 'all_users', 'users');") : null, _('Alias'), _('Name'), _('Surname')));
 $options = array('nodeids' => $nodeId, 'output' => array('alias', 'name', 'surname', 'type', 'theme', 'lang'), 'preservekeys' => true);
 if (!is_null($writeonly)) {
     $options['editable'] = true;
 }
 $users = API::User()->get($options);
 order_result($users, 'alias');
 foreach ($users as &$user) {
     $alias = new CSpan($user['alias'], 'link');
     $alias->attr('id', 'spanid' . $user['userid']);
     if (isset($srcfld2) && $srcfld2 == 'fullname') {
         $user[$srcfld2] = getUserFullname($user);
     }
     if ($multiselect) {
         $js_action = 'javascript: addValue(' . zbx_jsvalue($reference) . ', ' . zbx_jsvalue($user['userid']) . ');';
     } else {
         $values = array($dstfld1 => $user[$srcfld1]);
         if (isset($srcfld2)) {
             $values[$dstfld2] = $user[$srcfld2];
         }
         $js_action = 'javascript: addValues(' . zbx_jsvalue($dstfrm) . ', ' . zbx_jsvalue($values) . '); close_window(); return false;';
     }
     $alias->setAttribute('onclick', $js_action . ' jQuery(this).removeAttr("onclick");');
     $table->addRow(array($multiselect ? new CCheckBox('users[' . zbx_jsValue($user[$srcfld1]) . ']', null, null, $user['userid']) : null, $alias, $user['name'], $user['surname']));
 }
 unset($user);
 if ($multiselect) {
开发者ID:itnihao,项目名称:zatree-2.2,代码行数:31,代码来源:popup.php


示例12: CLink

        $guiAccess = (new CLink($guiAccess, 'usergrps.php?action=usergroup.set_gui_access&set_gui_access=' . $nextGuiAuth . '&usrgrpid=' . $userGroupId))->addClass($guiAccessStyle)->addSID();
        $usersStatus = $usrgrp['users_status'] == GROUP_STATUS_ENABLED ? (new CLink(_('Enabled'), 'usergrps.php?action=usergroup.massdisable&usrgrpid=' . $userGroupId))->addClass(ZBX_STYLE_LINK_ACTION)->addClass(ZBX_STYLE_GREEN)->addSID() : (new CLink(_('Disabled'), 'usergrps.php?action=usergroup.massenable&usrgrpid=' . $userGroupId))->addClass(ZBX_STYLE_LINK_ACTION)->addClass(ZBX_STYLE_RED)->addSID();
    } else {
        $guiAccess = (new CSpan($guiAccess))->addClass($guiAccessStyle);
        $usersStatus = $usrgrp['users_status'] == GROUP_STATUS_ENABLED ? (new CSpan(_('Enabled')))->addClass(ZBX_STYLE_GREEN) : (new CSpan(_('Disabled')))->addClass(ZBX_STYLE_RED);
    }
    if (isset($usrgrp['users'])) {
        $userGroupUsers = $usrgrp['users'];
        order_result($userGroupUsers, 'alias');
        $users = [];
        $i = 0;
        foreach ($userGroupUsers as $user) {
            $i++;
            if ($i > $this->data['config']['max_in_table']) {
                $users[] = ' …';
                break;
            }
            if ($users) {
                $users[] = ', ';
            }
            $users[] = (new CLink(getUserFullname($user), 'users.php?form=update&userid=' . $user['userid']))->addClass(ZBX_STYLE_LINK_ALT)->addClass($user['gui_access'] == GROUP_GUI_ACCESS_DISABLED || $user['users_status'] == GROUP_STATUS_DISABLED ? ZBX_STYLE_RED : ZBX_STYLE_GREEN);
        }
    }
    $name = new CLink($usrgrp['name'], 'usergrps.php?form=update&usrgrpid=' . $userGroupId);
    $userGroupTable->addRow([new CCheckBox('group_groupid[' . $userGroupId . ']', $userGroupId), (new CCol($name))->addClass(ZBX_STYLE_NOWRAP), [new CLink(_('Users'), 'users.php?filter_usrgrpid=' . $userGroupId), CViewHelper::showNum(count($usrgrp['users']))], $users, $guiAccess, $debugMode, $usersStatus]);
}
// append table to form
$userGroupsForm->addItem([$userGroupTable, $this->data['paging'], new CActionButtonList('action', 'group_groupid', ['usergroup.massenable' => ['name' => _('Enable'), 'confirm' => _('Enable selected groups?')], 'usergroup.massdisable' => ['name' => _('Disable'), 'confirm' => _('Disable selected groups?')], 'usergroup.massenabledebug' => ['name' => _('Enable debug mode'), 'confirm' => _('Enable debug mode in selected groups?')], 'usergroup.massdisabledebug' => ['name' => _('Disable debug mode'), 'confirm' => _('Disable debug mode in selected groups?')], 'usergroup.massdelete' => ['name' => _('Delete'), 'confirm' => _('Delete selected groups?')]])]);
// append form to widget
$widget->addItem($userGroupsForm);
return $widget;
开发者ID:jbfavre,项目名称:debian-zabbix,代码行数:31,代码来源:administration.usergroups.list.php


示例13: CList

** it under the terms of the GNU General Public License as published by
** the Free Software Foundation; either version 2 of the License, or
** (at your option) any later version.
**
** 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.
**
** You should have received a copy of the GNU General Public License
** along with this program; if not, write to the Free Software
** Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
**/
$icons = (new CList())->addClass(ZBX_STYLE_TOP_NAV_ICONS)->addItem((new CForm('get', 'search.php'))->addItem([(new CTextBox('search', '', false, 255))->setAttribute('autocomplete', 'off')->addClass(ZBX_STYLE_SEARCH), (new CSubmitButton(SPACE))->addClass(ZBX_STYLE_BTN_SEARCH)]))->addItem((new CLink('Share', 'https://share.zabbix.com/'))->addClass(ZBX_STYLE_TOP_NAV_ZBBSHARE)->setAttribute('target', '_blank')->setAttribute('title', _('Zabbix Share')))->addItem((new CLink(SPACE, 'http://www.zabbix.com/documentation/3.0/'))->addClass(ZBX_STYLE_TOP_NAV_HELP)->setAttribute('target', '_blank')->setAttribute('title', _('Help')));
if (!$data['user']['is_guest']) {
    $icons->addItem((new CLink(SPACE, 'profile.php'))->addClass(ZBX_STYLE_TOP_NAV_PROFILE)->setAttribute('title', getUserFullname($data['user'])));
}
$icons->addItem((new CLink(SPACE, 'index.php?reconnect=1'))->addClass(ZBX_STYLE_TOP_NAV_SIGNOUT)->setAttribute('title', _('Sign out'))->addSID());
// 1st level menu
$top_menu = (new CDiv())->addItem(new CLink((new CDiv())->addClass(ZBX_STYLE_LOGO), 'zabbix.php?action=dashboard.view'))->addItem((new CList($data['menu']['main_menu']))->addClass(ZBX_STYLE_TOP_NAV))->addItem($icons)->addClass(ZBX_STYLE_TOP_NAV_CONTAINER)->setId('mmenu');
$sub_menu_div = (new CDiv())->addClass(ZBX_STYLE_TOP_SUBNAV_CONTAINER)->onMouseover('javascript: MMenu.submenu_mouseOver();')->onMouseout('javascript: MMenu.mouseOut();');
// 2nd level menu
foreach ($data['menu']['sub_menus'] as $label => $sub_menu) {
    $sub_menu_row = (new CList())->addClass(ZBX_STYLE_TOP_SUBNAV)->setId('sub_' . $label);
    foreach ($sub_menu as $id => $sub_page) {
        $url = new CUrl($sub_page['menu_url']);
        if ($sub_page['menu_action'] !== null) {
            $url->setArgument('action', $sub_page['menu_action']);
        }
        $url->setArgument('ddreset', 1)->removeArgument('sid');
        $sub_menu_item = new CLink($sub_page['menu_text'], $url->getUrl());
开发者ID:jbfavre,项目名称:debian-zabbix,代码行数:31,代码来源:layout.htmlpage.menu.php


示例14: CForm

// create form
$auditForm = (new CForm('get'))->setName('auditForm');
// create table
$auditTable = (new CTableInfo())->setHeader([_('Time'), _('Action'), _('Type'), _('Recipient(s)'), _('Message'), _('Status'), _('Info')]);
foreach ($this->data['alerts'] as $alert) {
    $mediatype = array_pop($alert['mediatypes']);
    if ($alert['status'] == ALERT_STATUS_SENT) {
        $status = $alert['alerttype'] == ALERT_TYPE_MESSAGE ? (new CSpan(_('Sent')))->addClass(ZBX_STYLE_GREEN) : (new CSpan(_('Executed')))->addClass(ZBX_STYLE_GREEN);
    } elseif ($alert['status'] == ALERT_STATUS_NOT_SENT) {
        $status = (new CSpan([_('In progress') . ':', BR(), _n('%1$s retry left', '%1$s retries left', ALERT_MAX_RETRIES - $alert['retries'])]))->addClass(ZBX_STYLE_YELLOW);
    } else {
        $status = (new CSpan(_('Not sent')))->addClass(ZBX_STYLE_RED);
    }
    $message = $alert['alerttype'] == ALERT_TYPE_MESSAGE ? [bold(_('Subject') . ':'), BR(), $alert['subject'], BR(), BR(), bold(_('Message') . ':'), BR(), zbx_nl2br($alert['message'])] : [bold(_('Command') . ':'), BR(), zbx_nl2br($alert['message'])];
    if (zbx_empty($alert['error'])) {
        $info = '';
    } else {
        $info = makeErrorIcon($alert['error']);
    }
    $recipient = isset($alert['userid']) && $alert['userid'] ? [bold(getUserFullname($this->data['users'][$alert['userid']])), BR(), $alert['sendto']] : $alert['sendto'];
    $auditTable->addRow([zbx_date2str(DATE_TIME_FORMAT_SECONDS, $alert['clock']), $this->data['actions'][$alert['actionid']]['name'], $mediatype ? $mediatype['description'] : '', $recipient, $message, $status, $info]);
}
// append table to form
$auditForm->addItem([$auditTable, $this->data['paging']]);
// append navigation bar js
$objData = ['id' => 'timeline_1', 'domid' => 'events', 'loadSBox' => 0, 'loadImage' => 0, 'loadScroll' => 1, 'dynamic' => 0, 'mainObject' => 1, 'periodFixed' => CProfile::get('web.auditacts.timelinefixed', 1), 'sliderMaximumTimePeriod' => ZBX_MAX_PERIOD];
zbx_add_post_js('timeControl.addObject("events", ' . zbx_jsvalue($data['timeline']) . ', ' . zbx_jsvalue($objData) . ');');
zbx_add_post_js('timeControl.processObjects();');
// append form to widget
$auditWidget->addItem($auditForm);
return $auditWidget;
开发者ID:jbfavre,项目名称:debian-zabbix,代码行数:31,代码来源:administration.auditacts.list.php


示例15: get

 /**
  * Process screen.
  *
  * @return CDiv (screen inside container)
  */
 public function get()
 {
     $sortfield = 'clock';
     $sortorder = ZBX_SORT_DOWN;
     switch ($this->screenitem['sort_triggers']) {
         case SCREEN_SORT_TRIGGERS_TIME_ASC:
             $sortfield = 'clock';
             $sortorder = ZBX_SORT_UP;
             break;
         case SCREEN_SORT_TRIGGERS_TIME_DESC:
             $sortfield = 'clock';
             $sortorder = ZBX_SORT_DOWN;
             break;
         case SCREEN_SORT_TRIGGERS_TYPE_ASC:
             $sortfield = 'description';
             $sortorder = ZBX_SORT_UP;
             break;
         case SCREEN_SORT_TRIGGERS_TYPE_DESC:
             $sortfield = 'description';
             $sortorder = ZBX_SORT_DOWN;
             break;
         case SCREEN_SORT_TRIGGERS_STATUS_ASC:
             $sortfield = 'status';
             $sortorder = ZBX_SORT_UP;
             break;
         case SCREEN_SORT_TRIGGERS_STATUS_DESC:
             $sortfield = 'status';
             $sortorder = ZBX_SORT_DOWN;
             break;
         case SCREEN_SORT_TRIGGERS_RECIPIENT_ASC:
             $sortfield = 'sendto';
             $sortorder = ZBX_SORT_UP;
             break;
         case SCREEN_SORT_TRIGGERS_RECIPIENT_DESC:
             $sortfield = 'sendto';
             $sortorder = ZBX_SORT_DOWN;
             break;
     }
     $sql = 'SELECT a.alertid,a.clock,a.sendto,a.subject,a.message,a.status,a.retries,a.error,' . 'a.userid,a.actionid,a.mediatypeid,mt.description' . ' FROM events e,alerts a' . ' LEFT JOIN media_type mt ON mt.mediatypeid=a.mediatypeid' . ' WHERE e.eventid=a.eventid' . ' AND alerttype=' . ALERT_TYPE_MESSAGE;
     if (CWebUser::getType() != USER_TYPE_SUPER_ADMIN) {
         $userid = CWebUser::$data['userid'];
         $userGroups = getUserGroupsByUserId($userid);
         $sql .= ' AND EXISTS (' . 'SELECT NULL' . ' FROM functions f,items i,hosts_groups hgg' . ' JOIN rights r' . ' ON r.id=hgg.groupid' . ' AND ' . dbConditionInt('r.groupid', $userGroups) . ' WHERE e.objectid=f.triggerid' . ' AND f.itemid=i.itemid' . ' AND i.hostid=hgg.hostid' . ' GROUP BY f.triggerid' . ' HAVING MIN(r.permission)>' . PERM_DENY . ')';
     }
     $sql .= ' ORDER BY ' . $sortfield . ' ' . $sortorder;
     $alerts = DBfetchArray(DBselect($sql, $this->screenitem['elements']));
     order_result($alerts, $sortfield, $sortorder);
     $userids = [];
     foreach ($alerts as $alert) {
         if ($alert['userid'] != 0) {
             $userids[$alert['userid']] = true;
         }
     }
     if ($userids) {
         $dbUsers = API::User()->get(['output' => ['userid', 'alias', 'name', 'surname'], 'userids' => array_keys($userids), 'preservekeys' => true]);
     }
     // indicator of sort field
     $sort_div = (new CSpan())->addClass($sortorder === ZBX_SORT_DOWN ? ZBX_STYLE_ARROW_DOWN : ZBX_STYLE_ARROW_UP);
     // create alert table
     $table = (new CTableInfo())->setHeader([$sortfield === 'clock' ? ['Time', $sort_div] : _('Time'), _('Action'), $sortfield === 'description' ? [_('Type'), $sort_div] : _('Type'), $sortfield === 'sendto' ? [_('Recipient(s)'), $sort_div] : _('Recipient(s)'), _('Message'), $sortfield === 'status' ? [_('Status'), $sort_div] : _('Status'), _('Info')]);
     $actions = API::Action()->get(['output' => ['actionid', 'name'], 'actionids' => array_unique(zbx_objectValues($alerts, 'actionid')), 'preservekeys' => true]);
     foreach ($alerts as $alert) {
         if ($alert['status'] == ALERT_STATUS_SENT) {
             $status = (new CSpan(_('Sent')))->addClass(ZBX_STYLE_GREEN);
         } elseif ($alert['status'] == ALERT_STATUS_NOT_SENT) {
             $status = (new CSpan([_('In progress') . ':', BR(), _n('%1$s retry left', '%1$s retries left', ALERT_MAX_RETRIES - $alert['retries'])]))->addClass(ZBX_STYLE_YELLOW);
         } else {
             $status = (new CSpan(_('Not sent')))->addClass(ZBX_STYLE_RED);
         }
         $recipient = $alert['userid'] != 0 ? [bold(getUserFullname($dbUsers[$alert['userid']])), BR(), $alert['sendto']] : $alert['sendto'];
         $table->addRow([zbx_date2str(DATE_TIME_FORMAT_SECONDS, $alert['clock']), $actions[$alert['actionid']]['name'], $alert['mediatypeid'] == 0 ? '' : $alert['description'], $recipient, [bold($alert['subject']), BR(), BR(), zbx_nl2br($alert['message'])], $status, $alert['error'] === '' ? '' : makeErrorIcon($alert['error'])]);
     }
     $footer = (new CList())->addItem(_s('Updated: %s', zbx_date2str(TIME_FORMAT_SECONDS)))->addClass(ZBX_STYLE_DASHBRD_WIDGET_FOOT);
     return $this->getOutput((new CUiWidget(uniqid(), [$table, $footer]))->setHeader(_('Action log')));
 }
开发者ID:jbfavre,项目名称:debian-zabbix,代码行数:80,代码来源:CScreenActions.php


示例16: accountInfo

function accountInfo()
{
    ?>
<fieldset><legend><?php 
    echo getUserFullname($_SESSION['userid']);
    ?>
</legend>
<div class="center"><a href="?action=password" title="">Change Password</a> | 
<a href="actions/logout.php" title="Logout">Logout</a></div>
</fieldset>
	<?php 
}
开发者ID:eferuzi,项目名称:kiGM,代码行数:12,代码来源:dynamiccontents.php


示例17: CComboBox

 $controls->addItem([_('Media type'), SPACE, $cmbMedia]);
 $controls->addItem([_('Period'), SPACE, new CComboBox('period', $period, 'submit()', ['daily' => _('Daily'), 'weekly' => _('Weekly'), 'monthly' => _('Monthly'), 'yearly' => _('Yearly')])]);
 if ($period != 'yearly') {
     $cmbYear = new CComboBox('year', $year, 'submit();');
     for ($y = $minYear; $y <= date('Y'); $y++) {
         $cmbYear->addItem($y, $y);
     }
     $controls->addItem([_('Year'), SPACE, $cmbYear]);
 }
 $form->addItem($controls);
 $widget->setControls($form);
 $header = [];
 $users = [];
 $db_users = DBselect('SELECT u.userid,u.alias,u.name,u.surname FROM users u ORDER BY u.alias,u.userid');
 while ($user_data = DBfetch($db_users)) {
     $header[] = (new CColHeader(getUserFullname($user_data)))->addClass('vertical_rotation');
     $users[] = $user_data['userid'];
 }
 $intervals = [];
 switch ($period) {
     case 'yearly':
         $minTime = mktime(0, 0, 0, 1, 1, $minYear);
         $dateFormat = _x('Y', DATE_FORMAT_CONTEXT);
         array_unshift($header, _('Year'));
         for ($i = $minYear; $i <= date('Y'); $i++) {
             $intervals[mktime(0, 0, 0, 1, 1, $i)] = mktime(0, 0, 0, 1, 1, $i + 1);
         }
         break;
     case 'monthly':
         $minTime = mktime(0, 0, 0, 1, 1, $year);
         $dateFormat = _x('F', DATE_FORMAT_CONTEXT);
开发者ID:jbfavre,项目名称:debian-zabbix,代码行数:31,代码来源:report4.php


示例18: get

 /**
  * Process screen.
  *
  * @return CDiv (screen inside container)
  */
 public function get()
 {
     $sortfield = 'clock';
     $sortorder = ZBX_SORT_DOWN;
     $sorttitle = _('Time');
     switch ($this->screenitem['sort_triggers']) {
         case SCREEN_SORT_TRIGGERS_TIME_ASC:
             $sortfield = 'clock';
             $sortorder = ZBX_SORT_UP;
             $sorttitle = _('Time');
             break;
         case SCREEN_SORT_TRIGGERS_TIME_DESC:
             $sortfield = 'clock';
             $sortorder = ZBX_SORT_DOWN;
             $sorttitle = _('Time');
             break;
         case SCREEN_SORT_TRIGGERS_TYPE_ASC:
             $sortfield = 'description';
             $sortorder = ZBX_SORT_UP;
             $sorttitle = _('Type');
             break;
         case SCREEN_SORT_TRIGGERS_TYPE_DESC:
             $sortfield = 'description';
             $sortorder = ZBX_SORT_DOWN;
             $sorttitle = _('Type');
             break;
         case SCREEN_SORT_TRIGGERS_STATUS_ASC:
             $sortfield = 'status';
             $sortorder = ZBX_SORT_UP;
             $sorttitle = _('Status');
             break;
         case SCREEN_SORT_TRIGGERS_STATUS_DESC:
             $sortfield = 'status';
             $sortorder = ZBX_SORT_DOWN;
             $sorttitle = _('Status');
             break;
         case SCREEN_SORT_TRIGGERS_RECIPIENT_ASC:
             $sortfield = 'sendto';
             $sortorder = ZBX_SORT_UP;
             $sorttitle = _('Recipient(s)');
             break;
         case SCREEN_SORT_TRIGGERS_RECIPIEN 

鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP getUserGroupList函数代码示例发布时间:2022-05-15
下一篇:
PHP getUserFullName函数代码示例发布时间:2022-05-15
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap