本文整理汇总了PHP中PluginMonitoringProfile::haveRight方法的典型用法代码示例。如果您正苦于以下问题:PHP PluginMonitoringProfile::haveRight方法的具体用法?PHP PluginMonitoringProfile::haveRight怎么用?PHP PluginMonitoringProfile::haveRight使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PluginMonitoringProfile
的用法示例。
在下文中一共展示了PluginMonitoringProfile::haveRight方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: defineTabs
function defineTabs($options = array())
{
global $LANG, $CFG_GLPI;
if (isset($_GET['glpi_tab'])) {
setActiveTab("PluginMonitoringDisplay", $_GET['glpi_tab']);
}
$pmDisplayview = new PluginMonitoringDisplayview();
$ong = array();
if (PluginMonitoringProfile::haveRight("servicescatalog", 'r')) {
$ong[1] = $LANG['plugin_monitoring']['servicescatalog'][0];
}
if (PluginMonitoringProfile::haveRight("componentscatalog", 'r')) {
$ong[2] = $LANG['plugin_monitoring']['componentscatalog'][0];
}
$ong[3] = $LANG['plugin_monitoring']['service'][21];
$ong[4] = $LANG['plugin_monitoring']['host'][1];
if (PluginMonitoringProfile::haveRight("view", 'r')) {
$i = 5;
$a_views = $pmDisplayview->getViews();
foreach ($a_views as $name) {
$ong[$i] = htmlentities($name);
$i++;
}
}
return $ong;
}
示例2: getTabNameForItem
function getTabNameForItem(CommonGLPI $item, $withtemplate = 0)
{
$array_ret = array();
if (PluginMonitoringProfile::haveRight("servicescatalog", 'r')) {
$array_ret[49] = self::createTabEntry(__('Monitoring', 'monitoring') . "-" . __('Services catalog', 'monitoring'));
}
return $array_ret;
}
示例3: getTabNameForItem
function getTabNameForItem(CommonGLPI $item, $withtemplate = 0)
{
$array_ret = array();
if ($item->getID() > -1) {
if (PluginMonitoringProfile::haveRight("config", 'r')) {
$array_ret[0] = self::createTabEntry(__('Monitoring', 'monitoring'));
}
}
return $array_ret;
}
示例4: getMessages
static function getMessages()
{
global $CFG_GLPI;
$pmMessage = new self();
// Display if shinken is in restart or if restarted less than 5 minutes
echo "<div id='shikenrestart'></div>";
echo "<script type=\"text/javascript\">\n var elshikenrestart = Ext.get(\"shikenrestart\");\n var mgrshikenrestart = elshikenrestart.getUpdateManager();\n mgrshikenrestart.loadScripts=true;\n mgrshikenrestart.showLoadIndicator=false;\n mgrshikenrestart.startAutoRefresh(20, \"" . $CFG_GLPI["root_doc"] . "/plugins/monitoring/ajax/updateshinkenrestartmessage.php\", \"\", \"\", true);";
echo "</script>";
$servicecatalog = '';
$confchanges = '';
if (PluginMonitoringProfile::haveRight("servicescatalog", 'w')) {
$servicecatalog = $pmMessage->servicescatalogMessage();
}
$confchanges = $pmMessage->configurationchangesMessage();
$runningshinken = $pmMessage->ShinkennotrunMessage();
$i = 0;
if ($servicecatalog != '' or $confchanges != '') {
echo "<div class='msgboxmonit msgboxmonit-orange'>";
if ($confchanges != '') {
echo $confchanges;
$i++;
}
if ($servicecatalog != '') {
if ($i > 0) {
echo "</div>";
echo "<div class='msgboxmonit msgboxmonit-orange'>";
}
echo $servicecatalog;
$i++;
}
if ($runningshinken != '') {
if ($i > 0) {
echo "</div>";
echo "<div class='msgboxmonit msgboxmonit-red'>";
}
echo $runningshinken . "!";
$i++;
}
echo "</div>";
}
}
示例5: getMessages
static function getMessages()
{
$pmMessage = new self();
$servicecatalog = '';
$confchanges = '';
if (PluginMonitoringProfile::haveRight("servicescatalog", 'w')) {
$servicecatalog = $pmMessage->servicescatalogMessage();
}
$confchanges = $pmMessage->configurationchangesMessage();
$runningshinken = $pmMessage->ShinkennotrunMessage();
$i = 0;
if ($servicecatalog != '' or $confchanges != '') {
echo "<div class='msgboxmonit msgboxmonit-orange'>";
if ($confchanges != '') {
echo $confchanges;
$i++;
}
if ($servicecatalog != '') {
if ($i > 0) {
echo "</div>";
echo "<div class='msgboxmonit msgboxmonit-orange'>";
}
echo $servicecatalog;
$i++;
}
if ($runningshinken != '') {
if ($i > 0) {
echo "</div>";
echo "<div class='msgboxmonit msgboxmonit-red'>";
}
echo $runningshinken . "!";
$i++;
}
echo "</div>";
}
}
示例6: Copyright
@package Plugin Monitoring for GLPI
@author David Durieux
@co-author
@comment
@copyright Copyright (c) 2011-2013 Plugin Monitoring for GLPI team
@license AGPL License 3.0 or (at your option) any later version
http://www.gnu.org/licenses/agpl-3.0-standalone.html
@link https://forge.indepnet.net/projects/monitoring/
@since 2011
------------------------------------------------------------------------
*/
include "../../../inc/includes.php";
Session::checkCentralAccess();
Html::header(__('Monitoring', 'monitoring'), $_SERVER["PHP_SELF"], "plugins", "monitoring", "services");
$pmService = new PluginMonitoringService();
if (isset($_POST['update'])) {
foreach ($_POST['arg'] as $key => $value) {
if ($value == '') {
unset($_POST['arg'][$key]);
}
}
$_POST['arguments'] = exportArrayToDB($_POST['arg']);
$pmService->update($_POST);
Html::back();
}
if (PluginMonitoringProfile::haveRight("componentscatalog", 'w')) {
$pmService->showCustomArguments($_GET['id']);
}
Html::footer();
示例7: plugin_get_headings_monitoring
function plugin_get_headings_monitoring($item, $withtemplate)
{
global $LANG;
switch (get_class($item)) {
case 'Computer':
case 'Device':
case 'Printer':
case 'NetworkEquipment':
$array = array();
//$array[0] = $LANG['plugin_monitoring']['title'][0]."-".$LANG['state'][0];
if ($_GET['id'] > 0) {
$array[2] = $LANG['plugin_monitoring']['title'][0] . "-" . $LANG['plugin_monitoring']['service'][0];
}
return $array;
break;
case 'User':
$array = array();
//$array[0] = $LANG['plugin_monitoring']['title'][0]."-".$LANG['state'][0];
if ($_GET['id'] > 0) {
$array[1] = $LANG['plugin_monitoring']['title'][0] . "-" . $LANG['plugin_monitoring']['contact'][0];
}
return $array;
break;
case 'PluginMonitoringServicescatalog':
$array = array();
if ($_GET['id'] > 0) {
if (PluginMonitoringProfile::haveRight("servicescatalog", 'r')) {
$array[0] = $LANG['plugin_monitoring']['businessrule'][12];
}
}
return $array;
break;
case 'Entity':
$array = array();
if (PluginMonitoringProfile::haveRight("config", 'r')) {
$array[0] = $LANG['plugin_monitoring']['title'][0];
}
return $array;
break;
case 'Central':
if (isset($_SESSION['glpi_tabs']['central'])) {
$_SESSION['plugin_monitoring_displaytab'] = $_SESSION['glpi_tabs']['central'];
} else {
$_SESSION['plugin_monitoring_displaytab'] = '';
}
$array = array();
if (PluginMonitoringProfile::haveRight("servicescatalog", 'r')) {
$array[0] = $LANG['plugin_monitoring']['title'][0] . "-" . $LANG['plugin_monitoring']['servicescatalog'][0];
}
if (PluginMonitoringProfile::haveRight("viewshomepage", 'r')) {
$pmDisplayview = new PluginMonitoringDisplayview();
$i = 5;
$a_views = $pmDisplayview->getViews(1);
foreach ($a_views as $name) {
$array[$i] = $LANG['plugin_monitoring']['title'][0] . "-" . htmlentities($name);
$i++;
}
}
return $array;
break;
case 'Profile':
$array = array();
if ($_GET['id'] > 0) {
$array[0] = $LANG['plugin_monitoring']['title'][0];
}
return $array;
break;
}
return false;
}
示例8: canView
function canView()
{
return PluginMonitoringProfile::haveRight("servicescatalog", 'r');
}
示例9: displayLine
//.........这里部分代码省略.........
echo "</td>";
if ($displayhost == '1') {
$pmComponentscatalog_Host->getFromDB($data["plugin_monitoring_componentscatalogs_hosts_id"]);
if (isset($pmComponentscatalog_Host->fields['itemtype']) and $pmComponentscatalog_Host->fields['itemtype'] != '') {
$itemtype = $pmComponentscatalog_Host->fields['itemtype'];
$item = new $itemtype();
$item->getFromDB($pmComponentscatalog_Host->fields['items_id']);
echo "<td>";
echo $item->getTypeName() . " : " . $item->getLink();
if (!is_null($pMonitoringService->fields['networkports_id']) and $pMonitoringService->fields['networkports_id'] > 0) {
$networkPort->getFromDB($pMonitoringService->fields['networkports_id']);
echo " [" . $networkPort->getLink() . "]";
}
echo "</td>";
} else {
echo "<td>" . __('Resources', 'monitoring') . "</td>";
}
}
echo "<td>" . $pMonitoringComponent->getLink();
if (!is_null($pMonitoringService->fields['networkports_id']) and $pMonitoringService->fields['networkports_id'] > 0) {
$networkPort->getFromDB($pMonitoringService->fields['networkports_id']);
echo " [" . $networkPort->getLink() . "]";
}
echo "</td>";
// $nameitem = '';
// if (isset($itemmat->fields['name'])) {
// $nameitem = "[".$itemmat->getLink(1)."]";
// }
//if ($pMonitoringService->fields['plugin_monitoring_services_id'] == '0') {
//echo "<td>".$itemmat->getLink(1)."</td>";
// } else {
// $pMonitoringServiceH->getFromDB($pMonitoringService->fields['plugin_monitoring_services_id']);
// $itemtypemat = $pMonitoringServiceH->fields['itemtype'];
// $itemmat = new $itemtypemat();
// $itemmat->getFromDB($pMonitoringServiceH->fields['items_id']);
// echo "<td>".$pMonitoringService->getLink(1).$nameitem." ".__('on', 'monitoring')." ".$itemmat->getLink(1)."</td>";
// }
// unset($itemmat);
echo "<td class='center'>";
if ($shortstate == 'red') {
echo "<table>";
echo "<tr>";
echo "<td>";
echo $data['state'];
echo "</td>";
echo "<td>";
echo "<a href='" . $CFG_GLPI['root_doc'] . "/plugins/monitoring/front/acknowledge.form.php?id=" . $data['id'] . "'>" . "<img src='" . $CFG_GLPI['root_doc'] . "/plugins/monitoring/pics/acknowledge_checked.png'" . " alt='" . __('Define an acknowledge', 'monitoring') . "'" . " title='" . __('Define an acknowledge', 'monitoring') . "'/>" . "</a>";
echo "</td>";
echo "</tr>";
echo "</table>";
} else {
echo $data['state'];
}
echo "</td>";
echo "<td>";
echo Html::convDate($data['last_check']) . ' ' . substr($data['last_check'], 11, 8);
echo "</td>";
echo "<td>";
echo $data['event'];
echo "</td>";
echo "<td align='center'>";
$segments = CalendarSegment::getSegmentsBetween($pMonitoringComponent->fields['calendars_id'], date('w', date('U')), date('H:i:s'), date('w', date('U')), date('H:i:s'));
if (count($segments) == '0') {
echo "<img src='" . $CFG_GLPI['root_doc'] . "/plugins/monitoring/pics/service_pause.png' />";
} else {
echo "<img src='" . $CFG_GLPI['root_doc'] . "/plugins/monitoring/pics/service_run.png' />";
}
echo "</td>";
if ($displayhost == '0') {
$pmUnavaibility = new PluginMonitoringUnavaibility();
$pmUnavaibility->displayValues($pMonitoringService->fields['id'], 'currentmonth', 1);
$pmUnavaibility->displayValues($pMonitoringService->fields['id'], 'lastmonth', 1);
$pmUnavaibility->displayValues($pMonitoringService->fields['id'], 'currentyear', 1);
echo "<td class='center'>";
echo "<a href='" . $CFG_GLPI['root_doc'] . "/plugins/monitoring/front/unavaibility.php?" . "field[0]=2&searchtype[0]=equals&contains[0]=" . $pMonitoringService->fields['id'] . "&sort=3&order=DESC&itemtype=PluginMonitoringUnavaibility'>\n <img src='" . $CFG_GLPI['root_doc'] . "/plugins/monitoring/pics/info.png'/></a>";
echo "</td>";
}
echo "<td>";
if ($shortstate == 'redblue') {
echo "<i>" . _n('User', 'Users', 1) . " : </i>";
$user = new User();
$user->getFromDB($data['acknowledge_users_id']);
echo $user->getName(1);
echo "<br/>";
echo "<i>" . __('Comments') . " : </i>" . $data['acknowledge_comment'];
}
echo "</td>";
if ($displayhost == '0') {
echo "<td>";
if (PluginMonitoringProfile::haveRight("componentscatalog", 'w')) {
$a_arg = importArrayFromDB($pMonitoringService->fields['arguments']);
$cnt = '';
if (count($a_arg) > 0) {
$cnt = " (" . count($a_arg) . ")";
}
echo "<a href='" . $CFG_GLPI['root_doc'] . "/plugins/monitoring/front/servicearg.form.php?id=" . $data['id'] . "'>" . __('Configure', 'monitoring') . $cnt . "</a>";
}
echo "</td>";
}
}
示例10: canUndo
function canUndo()
{
return PluginMonitoringProfile::haveRight("view", 'w');
}
示例11: canView
static function canView()
{
return PluginMonitoringProfile::haveRight("config", 'r');
}
示例12:
}
echo "</th>";
echo "<th rowspan='2'>";
if (PluginMonitoringProfile::haveRight("config", 'r')) {
echo "<a href='" . $CFG_GLPI['root_doc'] . "/plugins/monitoring/front/realm.php'>" . $LANG['plugin_monitoring']['realms'][0] . "</a>";
}
echo "</th>";
echo "</tr>";
echo "<tr class='tab_bg_1'>";
echo "<th width='18%' height='25'>";
if (PluginMonitoringProfile::haveRight("command", 'r')) {
echo "<a href='" . $CFG_GLPI['root_doc'] . "/plugins/monitoring/front/command.php'>" . $LANG['plugin_monitoring']['command'][0] . "</a>";
}
echo "</th>";
echo "<th width='18%'>";
if (PluginMonitoringProfile::haveRight("check", 'r')) {
echo "<a href='" . $CFG_GLPI['root_doc'] . "/plugins/monitoring/front/check.php'>" . $LANG['plugin_monitoring']['check'][0] . "</a>";
}
echo "</th>";
echo "<th width='18%'>";
if (haveRight('calendar', 'r')) {
echo "<a href='" . $CFG_GLPI['root_doc'] . "/front/calendar.php'>" . $LANG['buttons'][15] . "</a>";
}
echo "</th>";
echo "<th width='18%'>";
if (PluginMonitoringProfile::haveRight("config", 'r')) {
echo "<a href='" . $CFG_GLPI['root_doc'] . "/plugins/monitoring/front/rrdtemplate.php'>" . $LANG['plugin_monitoring']['rrdtemplates'][0] . "</a>";
}
echo "</th>";
echo "</table>";
commonFooter();
示例13: canCancel
function canCancel()
{
return PluginMonitoringProfile::haveRight("config", 'w');
}
示例14: checkRight
static function checkRight($module, $right)
{
global $CFG_GLPI;
if (!PluginMonitoringProfile::haveRight($module, $right)) {
// Gestion timeout session
if (!Session::getLoginUserID()) {
Html::redirect($CFG_GLPI["root_doc"] . "/index.php");
exit;
}
Html::displayRightError();
}
}
示例15: __
echo "</th>";
echo "<th rowspan='2'>";
if (PluginMonitoringProfile::haveRight("config", 'r')) {
echo "<a href='" . $CFG_GLPI['root_doc'] . "/plugins/monitoring/front/tag.php'>" . __('Tag', 'monitoring') . "</a>";
}
echo "</th>";
echo "</tr>";
echo "<tr class='tab_bg_1'>";
echo "<th width='15%' height='25'>";
if (PluginMonitoringProfile::haveRight("command", 'r')) {
echo "<a href='" . $CFG_GLPI['root_doc'] . "/plugins/monitoring/front/command.php'>" . __('Commands', 'monitoring') . "</a>";
}
echo "</th>";
echo "<th width='15%'>";
if (PluginMonitoringProfile::haveRight("check", 'r')) {
echo "<a href='" . $CFG_GLPI['root_doc'] . "/plugins/monitoring/front/check.php'>" . __('Check definition', 'monitoring') . "</a>";
}
echo "</th>";
echo "<th width='15%'>";
if (Session::haveRight('calendar', 'r')) {
echo "<a href='" . $CFG_GLPI['root_doc'] . "/front/calendar.php'>" . __('Calendar') . "</a>";
}
echo "</th>";
echo "<th width='15%'>";
if (PluginMonitoringProfile::haveRight("command", 'r')) {
echo "<a href='" . $CFG_GLPI['root_doc'] . "/plugins/monitoring/front/eventhandler.php'>" . __('Event handler', 'monitoring') . "</a>";
}
echo "</th>";
echo "</table>";
}
Html::footer();