. @package archires @author Nelly Mahu-Lasson, Xavier Caillaud @copyright Copyright (c) 2016-2018 Archires 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/archires @since version 2.2 -------------------------------------------------------------------------- */ if (!defined('GLPI_ROOT')) { die("Sorry. You can't access directly to this file"); } class PluginArchiresProfile extends Profile { static $rightname = "profile"; //if profile deleted static function purgeProfiles(Profile $prof) { $plugprof = new self(); $plugprof->deleteByCriteria(['profiles_id' => $prof->getField("id")]); } function getFromDBByProfile($profiles_id) { global $DB; $query = ['FROM' => $this->getTable(), 'WHERE' => ['profiles_id' => $profiles_id]]; if ($result = $DB->request($query)) { if (count($result) != 1) { return false; } $this->fields = $result->next(); if (is_array($this->fields) && count($this->fields)) { return true; } } return false; } static function createFirstAccess($ID) { self::addDefaultProfileInfos($ID, ['plugin_archires' => ALLSTANDARDRIGHT], true); } //profiles modification function showForProfile(Profile $prof){ $canedit = Session::haveRightsOr(self::$rightname, [CREATE, UPDATE, PURGE]); if ($canedit) { echo "