static function checkRight($module, $right)
 {
     global $CFG_GLPI;
     if (!PluginFusioninventory::haveRight($module, $right)) {
         // Gestion timeout session
         if (!isset($_SESSION["glpiID"])) {
             glpi_header($CFG_GLPI["root_doc"] . "/index.php");
             exit;
         }
         displayRightError();
     }
 }
/**
 * Check if I have the right to access to the FAQ (profile or anonymous FAQ)
 *
 * @return Nothing : display error if not permit
**/
function checkFaqAccess()
{
    global $CFG_GLPI;
    if ($CFG_GLPI["use_public_faq"] == 0 && !haveRight("faq", "r")) {
        displayRightError();
    }
}
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
--------------------------------------------------------------------------
*/
// ----------------------------------------------------------------------
// Original Author of file: Julien Dombre
// Purpose of file:
// ----------------------------------------------------------------------
define('GLPI_ROOT', '..');
include GLPI_ROOT . "/inc/includes.php";
commonHeader($LANG['transfer'][1], '', 'admin', 'rule', 'transfer');
$transfer = new Transfer();
$transfer->checkGlobal('r');
if (isset($_POST['transfer'])) {
    if (isset($_SESSION['glpitransfer_list'])) {
        if (!haveAccessToEntity($_POST['to_entity'])) {
            displayRightError();
        }
        $transfer->moveItems($_SESSION['glpitransfer_list'], $_POST['to_entity'], $_POST);
        unset($_SESSION['glpitransfer_list']);
        echo "<strong>" . $LANG['common'][23] . "</strong><br>";
        echo "<a href=\"central.php\"><b>" . $LANG['buttons'][13] . "</b></a>";
        commonFooter();
        exit;
    }
} else {
    if (isset($_GET['clear'])) {
        unset($_SESSION['glpitransfer_list']);
        echo "<strong>" . $LANG['common'][23] . "</strong><br>";
        echo "<a href=\"central.php\"><b>" . $LANG['buttons'][13] . "</b></a>";
        commonFooter();
        exit;
 /**
  * Check global right on an object
  *
  * @param $right Right to check : c / r / w / d
  *
  * @return nothing
  **/
 function checkGlobal($right)
 {
     global $CFG_GLPI;
     if (!$this->canGlobal($right)) {
         // Gestion timeout session
         if (!getLoginUserID()) {
             glpi_header($CFG_GLPI["root_doc"] . "/index.php");
             exit;
         }
         displayRightError();
     }
 }
 static function checkRight($module, $right)
 {
     global $CFG_GLPI;
     if (!PluginMonitoringProfile::haveRight($module, $right)) {
         // Gestion timeout session
         if (!getLoginUserID()) {
             glpi_header($CFG_GLPI["root_doc"] . "/index.php");
             exit;
         }
         displayRightError();
     }
 }
 /**
  * Do automatic transfer if option is enable
  *
  * @param $line_links array : data from glpi_ocslinks table
  * @param $line_ocs array : data from ocs tables
  *
  * @return nothing
  **/
 static function transferComputer($line_links, $line_ocs)
 {
     global $DB, $DBocs, $CFG_GLPI;
     // Get all rules for the current ocsservers_id
     $rules = new RuleOcsCollection($line_links["ocsservers_id"]);
     $data = array();
     $data = $rules->processAllRules(array(), array(), $line_links["ocsid"]);
     // If entity is changing move items to the new entities_id
     if (isset($data['entities_id']) && $data['entities_id'] != $line_links['entities_id']) {
         if (!isCommandLine() && !haveAccessToEntity($data['entities_id'])) {
             displayRightError();
         }
         $transfer = new Transfer();
         $transfer->getFromDB($CFG_GLPI['transfers_id_auto']);
         $item_to_transfer = array("Computer" => array($line_links['computers_id'] => $line_links['computers_id']));
         $transfer->moveItems($item_to_transfer, $data['entities_id'], $transfer->fields);
     }
     // Update TAG
     self::updateTag($line_links, $line_ocs);
 }