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


PHP Session::checkRight方法代码示例

本文整理汇总了PHP中Session::checkRight方法的典型用法代码示例。如果您正苦于以下问题:PHP Session::checkRight方法的具体用法?PHP Session::checkRight怎么用?PHP Session::checkRight使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Session的用法示例。


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

示例1: plugin_reports_rulelist

function plugin_reports_rulelist($rulecollection, $title)
{
    Session::checkRight($rulecollection::$rightname, READ);
    $rulecollection->getCollectionDatas(true, true);
    echo "<div class='center'>";
    echo "<table class='tab_cadre' cellpadding='5'>\n";
    echo "<tr><th colspan='6'><a href='" . $_SERVER["PHP_SELF"] . "'>" . __('rules_report_title', 'reports') . "</a> - " . $title . "</th></tr>";
    echo "<tr><th>" . __('Name') . "</th>";
    echo "<th>" . __('Description') . "</th>";
    echo "<th colspan='2'>" . _n('Criterion', 'Criteria', 2) . "</th>";
    echo "<th>" . _n('Action', 'Actions', 2) . "</th>";
    echo "<th>" . __('Active') . "</th></tr>\n";
    foreach ($rulecollection->RuleList->list as $rule) {
        echo "<tr class='tab_bg_1'>";
        echo "<td>" . $rule->fields["name"] . "</td>";
        echo "<td>" . $rule->fields["description"] . "</td>";
        if ($rule->fields["match"] == Rule::AND_MATCHING) {
            echo "<td>" . __('and') . "</td>";
        } else {
            echo "<td>" . __('or') . "</td>";
        }
        echo "<td>";
        foreach ($rule->criterias as $criteria) {
            echo $rule->getCriteriaName($criteria->fields["criteria"]) . " " . RuleCriteria::getConditionByID($criteria->fields["condition"], get_class($rule)) . " " . $rule->getCriteriaDisplayPattern($criteria->fields["criteria"], $criteria->fields["condition"], $criteria->fields["pattern"]) . "<br>";
        }
        echo "</td>";
        echo "<td>";
        foreach ($rule->actions as $action) {
            echo $rule->getActionName($action->fields["field"]) . " " . RuleAction::getActionByID($action->fields["action_type"]) . " " . stripslashes($rule->getActionValue($action->fields["field"], $action->fields["action_type"], $action->fields["value"])) . "<br>";
        }
        echo "</td>";
        if ($rule->fields["is_active"]) {
            echo "<td>" . __('Yes') . "</td>";
        } else {
            echo "<td>" . __('No') . "</td>";
        }
        echo "</tr>\n";
    }
    echo "</table></div>\n";
}
开发者ID:paisdelconocimiento,项目名称:glpi-smartcities,代码行数:40,代码来源:rules.php

示例2: ReservationItem

GLPI 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 GLPI. If not, see <http://www.gnu.org/licenses/>.
--------------------------------------------------------------------------
*/
/** @file
* @brief
*/
include '../inc/includes.php';
Session::checkCentralAccess();
Session::checkRight("reservation_central", "w");
if (!isset($_GET["id"])) {
    $_GET["id"] = '';
}
$ri = new ReservationItem();
if (isset($_POST["add"])) {
    $ri->check(-1, 'w', $_POST);
    if ($newID = $ri->add($_POST)) {
        Event::log($newID, "reservationitem", 4, "inventory", sprintf(__('%1$s adds the item %2$s (%3$d)'), $_SESSION["glpiname"], $_POST["itemtype"], $_POST["items_id"]));
    }
    Html::back();
} else {
    if (isset($_POST["delete"])) {
        $ri->check($_POST["id"], 'd');
        $ri->delete($_POST);
        Event::log($_POST['id'], "reservationitem", 4, "inventory", sprintf(__('%s deletes an item'), $_SESSION["glpiname"]));
开发者ID:gaforeror,项目名称:glpi,代码行数:30,代码来源:reservationitem.form.php

示例3: Config

(at your option) any later version.

GLPI 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 GLPI. If not, see <http://www.gnu.org/licenses/>.
--------------------------------------------------------------------------
*/
/** @file
* @brief
*/
include '../inc/includes.php';
Session::checkRight("config", "w");
$config = new Config();
$config_ldap = new AuthLDAP();
if (!isset($_GET['id'])) {
    $_GET['id'] = "";
}
//LDAP Server add/update/delete
if (isset($_POST["update"])) {
    $config_ldap->update($_POST);
    Html::back();
} else {
    if (isset($_POST["add"])) {
        //If no name has been given to this configuration, then go back to the page without adding
        if ($_POST["name"] != "") {
            if ($newID = $config_ldap->add($_POST)) {
                if (AuthLdap::testLDAPConnection($newID)) {
开发者ID:gaforeror,项目名称:glpi,代码行数:31,代码来源:authldap.form.php

示例4: Infocom

                        $tmp['id'] = $key;
                        $order_item->update($tmp);
                        // Update infocom
                        $ic = new Infocom();
                        $ic->getFromDBforDevice($order_item->fields['itemtype'], $order_item->fields['items_id']);
                        $config = PluginOrderConfig::getConfig();
                        if ($config->canAddBillDetails()) {
                            if ($bill->getFromDB($_POST["plugin_order_bills_id"])) {
                                $fields['id'] = $ic->fields['id'];
                                $fields['bill'] = $bill->fields['number'];
                                $fields['warranty_date'] = $bill->fields['billdate'];
                            }
                        }
                        $ic->update($fields);
                    }
                }
            }
            break;
    }
    PluginOrderOrder::updateBillState($order_item->fields['plugin_order_orders_id']);
    Html::back();
}
$dropdown = new PluginOrderBill();
Session::checkRight("plugin_order_bill", READ);
Html::header(PluginOrderBill::getTypeName(1), $_SERVER['PHP_SELF'], "management", "PluginOrderMenu", "bill");
if (isset($_REQUEST['id'])) {
    $bill->display($_REQUEST);
} else {
    $bill->show();
}
Html::footer();
开发者ID:equinoxefr,项目名称:order,代码行数:31,代码来源:bill.form.php

示例5: displayTabContentForItem

 static function displayTabContentForItem(CommonGLPI $item, $tabnum = 1, $withtemplate = 0)
 {
     switch ($item->getType()) {
         case 'Preference':
             self::showForUser(Session::getLoginUserID());
             return true;
         case __CLASS__:
             switch ($tabnum) {
                 case 1:
                     $item->showFormGlobal($_GET['_target'], $_GET["displaytype"]);
                     return true;
                 case 2:
                     Session::checkRight(self::$rightname, self::PERSONAL);
                     $item->showFormPerso($_GET['_target'], $_GET["displaytype"]);
                     return true;
             }
     }
     return false;
 }
开发者ID:stweil,项目名称:glpi,代码行数:19,代码来源:displaypreference.class.php

示例6: Copyright

Copyright (C) 2003-2013 by the INDEPNET Development Team.

http://indepnet.net/   http://glpi-project.org
-------------------------------------------------------------------------

LICENSE

This file is part of GLPI.

GLPI 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.

GLPI 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 GLPI. If not, see <http://www.gnu.org/licenses/>.
--------------------------------------------------------------------------
*/
/** @file
* @brief
*/
include '../inc/includes.php';
Session::checkRight("profile", "r");
Html::header(Profile::getTypeName(2), $_SERVER['PHP_SELF'], "admin", "profile");
Search::show('Profile');
Html::footer();
开发者ID:gaforeror,项目名称:glpi,代码行数:31,代码来源:profile.php

示例7: Copyright

This file is part of Webservices plugin for GLPI.

Webservices is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.

Webservices 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 Affero General Public License for more details.

You should have received a copy of the GNU Affero General Public License
along with Webservices. If not, see <http://www.gnu.org/licenses/>.

@package   Webservices
@author    Nelly Mahu-Lasson
@copyright Copyright (c) 2009-2015 Webservices plugin 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.glpi-project.org/projects/webservices
@link      http://www.glpi-project.org/
@since     2009
--------------------------------------------------------------------------
*/
include "../../../inc/includes.php";
Plugin::load('webservices');
Session::checkRight("config", UPDATE);
Html::header(__('Web Services', 'webservices'), $_SERVER['PHP_SELF'], "config", "pluginWebservicesClient");
Search::show('PluginWebservicesClient');
Html::footer();
开发者ID:JULIO8,项目名称:respaldo_glpi,代码行数:31,代码来源:client.php

示例8: header

This file is part of GLPI.

GLPI 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.

GLPI 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 GLPI. If not, see <http://www.gnu.org/licenses/>.
--------------------------------------------------------------------------
*/
/** @file
* @brief
*/
$AJAX_INCLUDE = 1;
include '../inc/includes.php';
header("Content-Type: text/html; charset=UTF-8");
Html::header_nocache();
Session::checkRight('ticket', UPDATE);
if ($_POST["actortype"] > 0) {
    $ticket = new Ticket();
    $rand = mt_rand();
    $ticket->showActorAddForm($_POST["actortype"], $rand, $_SESSION['glpiactive_entity'], array(), true, false, false);
    echo "&nbsp;<input type='submit' name='add_actor' class='submit' value=\"" . _sx('button', 'Add') . "\">";
}
开发者ID:kipman,项目名称:glpi,代码行数:30,代码来源:dropdownMassiveActionAddActor.php

示例9: array

                                             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();
                                             }
                                         }
                                     }
                                 }
                             }
                         }
                     }
                 }
             }
         }
     }
 }
开发者ID:paisdelconocimiento,项目名称:glpi-smartcities,代码行数:31,代码来源:user.form.php

示例10: NetworkEquipment

(at your option) any later version.

GLPI 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 GLPI. If not, see <http://www.gnu.org/licenses/>.
--------------------------------------------------------------------------
*/
/** @file
* @brief
*/
include '../inc/includes.php';
Session::checkRight("networking", READ);
if (!isset($_GET["id"])) {
    $_GET["id"] = "";
}
if (!isset($_GET["withtemplate"])) {
    $_GET["withtemplate"] = "";
}
$netdevice = new NetworkEquipment();
if (isset($_POST["add"])) {
    $netdevice->check(-1, CREATE, $_POST);
    if ($newID = $netdevice->add($_POST)) {
        Event::log($newID, "networkequipment", 4, "inventory", sprintf(__('%1$s adds the item %2$s'), $_SESSION["glpiname"], $_POST["name"]));
        if ($_SESSION['glpibackcreated']) {
            Html::redirect($netdevice->getFormURL() . "?id=" . $newID);
        }
    }
开发者ID:btry,项目名称:glpi,代码行数:31,代码来源:networkequipment.form.php

示例11: Plugin

<?php

include "../../../inc/includes.php";
Session::checkRight("entity", UPDATE);
// Check if plugin is activated...
$plugin = new Plugin();
if ($plugin->isActivated("formcreator")) {
    $target = new PluginFormcreatorTarget();
    // Add a new target
    if (isset($_POST["add"]) && !empty($_POST['plugin_formcreator_forms_id'])) {
        Session::checkRight("entity", UPDATE);
        $target->add($_POST);
        Html::back();
        // Delete a target
    } elseif (isset($_POST["delete_target"])) {
        Session::checkRight("entity", UPDATE);
        $target->delete($_POST);
        Html::redirect($CFG_GLPI["root_doc"] . '/plugins/formcreator/front/form.form.php?id=' . $_POST['plugin_formcreator_forms_id']);
    } else {
        Html::back();
    }
    // Or display a "Not found" error
} else {
    Html::displayNotFoundError();
}
开发者ID:jcr0ch4,项目名称:formcreator,代码行数:25,代码来源:target.form.php

示例12: Copyright

  ------------------------------------------------------------------------

  @package   Plugin Monitoring for GLPI
  @author    David Durieux
  @co-author
  @comment
  @copyright Copyright (c) 2011-2014 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     2013

  ------------------------------------------------------------------------
*/
include "../../../inc/includes.php";
Session::checkRight("plugin_monitoring_eventhandler", READ);
Html::header(__('Monitoring', 'monitoring'), $_SERVER["PHP_SELF"], "plugins", "PluginMonitoringDashboard", "eventhandler");
$pMonitoringEventhandler = new PluginMonitoringEventhandler();
if (isset($_POST["add"])) {
    $pMonitoringEventhandler->add($_POST);
    Html::back();
} else {
    if (isset($_POST["update"])) {
        $pMonitoringEventhandler->update($_POST);
        Html::back();
    } else {
        if (isset($_POST["purge"])) {
            $pMonitoringEventhandler->delete($_POST);
            $pMonitoringEventhandler->redirectToList();
        }
    }
开发者ID:paisdelconocimiento,项目名称:glpi-smartcities,代码行数:31,代码来源:eventhandler.form.php

示例13: Copyright

 You should have received a copy of the GNU General Public License
 along with Genericobject. If not, see <http://www.gnu.org/licenses/>.
 --------------------------------------------------------------------------
 @package   genericobject
 @author    the genericobject plugin team
 @copyright Copyright (c) 2010-2011 Order plugin team
 @license   GPLv2+
            http://www.gnu.org/licenses/gpl.txt
 @link      https://forge.indepnet.net/projects/genericobject
 @link      http://www.glpi-project.org/
 @since     2009
 ---------------------------------------------------------------------- */
 
include ("../../../inc/includes.php");

if (isset($_GET['itemtype'])) {
   $itemtype = $_GET['itemtype'];
   $types = PluginGenericobjectType::getTypes();
//   $type = new PluginGenericobjectType();
//   $type->getFromDBByType($_GET['itemtype']);
//   Html::redirect(Toolbox::getItemTypeFormURL('PluginGenericobjectType').'?id='.$type->getID());

   Session::checkRight(PluginGenericobjectProfile::getProfileNameForItemtype($itemtype), READ);
   Html::header(__("Type of objects", "genericobject"), $_SERVER['PHP_SELF'], "assets",
                $_GET['itemtype']);
   Search::Show($_GET['itemtype']);

}

Html::footer();
开发者ID:euqip,项目名称:glpi-smartcities,代码行数:30,代码来源:object.php

示例14: header

-------------------------------------------------------------------------

LICENSE

This file is part of GLPI.

GLPI 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.

GLPI 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 GLPI. If not, see <http://www.gnu.org/licenses/>.
--------------------------------------------------------------------------
*/
/** @file
* @brief
*/
if (strpos($_SERVER['PHP_SELF'], "dropdownNotificationTemplate.php")) {
    include '../inc/includes.php';
    header("Content-Type: text/html; charset=UTF-8");
    Html::header_nocache();
}
Session::checkRight("notification", UPDATE);
NotificationTemplate::dropdownTemplates('notificationtemplates_id', $_POST['itemtype']);
开发者ID:jose-martins,项目名称:glpi,代码行数:30,代码来源:dropdownNotificationTemplate.php

示例15: showForm

 function showForm(Printer $item, $options = array())
 {
     global $DB;
     Session::checkRight('plugin_fusioninventory_printer', READ);
     $id = $item->getID();
     if (!($data = $this->find("`printers_id`='" . $id . "'", '', 1))) {
         // Add in database if not exist
         $input = array();
         $input['printers_id'] = $id;
         $_SESSION['glpi_plugins_fusinvsnmp_table'] = 'glpi_printers';
         $ID_tn = $this->add($input);
         $this->getFromDB($ID_tn);
     } else {
         foreach ($data as $datas) {
             $this->fields = $datas;
         }
     }
     // Form printer informations
     echo "<div align='center'>";
     echo "<form method='post' name='snmp_form' id='snmp_form'\n                 action=\"" . $options['target'] . "\">";
     echo "<table class='tab_cadre' cellpadding='5' width='950'>";
     echo "<tr class='tab_bg_1'>";
     echo "<th colspan='4'>";
     echo __('SNMP information', 'fusioninventory');
     echo "</th>";
     echo "</tr>";
     echo "<tr class='tab_bg_1'>";
     echo "<td align='center'>";
     echo __('Sysdescr', 'fusioninventory');
     echo "</td>";
     echo "<td>";
     echo "<textarea name='sysdescr' cols='45' rows='5'>";
     echo $this->fields['sysdescr'];
     echo "</textarea>";
     echo "</td>";
     echo "<td align='center'>";
     echo __('Last inventory', 'fusioninventory') . "&nbsp;:";
     echo "</td>";
     echo "<td>";
     echo Html::convDateTime($this->fields['last_fusioninventory_update']);
     echo "</td>";
     echo "</tr>";
     echo "<tr class='tab_bg_1'>";
     echo "<td align='center'></td>";
     echo "<td align='center'>";
     echo "</td>";
     echo "<td align='center'>" . __('SNMP authentication', 'fusioninventory') . "&nbsp;:</td>";
     echo "<td align='center'>";
     PluginFusioninventoryConfigSecurity::auth_dropdown($this->fields["plugin_fusioninventory_configsecurities_id"]);
     echo "</td>";
     echo "</tr>";
     echo "<tr class='tab_bg_2 center'>";
     echo "<td colspan='4'>";
     echo "<div align='center'>";
     echo "<input type='hidden' name='id' value='" . $id . "'>";
     echo "<input type='submit' name='update' value=\"" . __('Update') . "\" class='submit' >";
     echo "</td>";
     echo "</tr>";
     echo "</table>";
     Html::closeForm();
     echo "</div>";
 }
开发者ID:paisdelconocimiento,项目名称:glpi-smartcities,代码行数:62,代码来源:printer.class.php


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