Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
71 changes: 0 additions & 71 deletions .eslintrc.js

This file was deleted.

16 changes: 16 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# Change Log

All notable changes to this project will be documented in this file.

The format is based on [Keep a Changelog](http://keepachangelog.com/) and this project adheres to [Semantic Versioning](http://semver.org/).

## [Unreleased]

### Fixed

- Fix plugin installation failing on raw queries executed through `DBmysql::request()`
- Fix fatal error caused by missing `bool` return types on computer group rights methods
- Fix plugin uninstallation failing and leaving package tables and display preferences behind
- Fix PHP 8.4 deprecation on implicitly nullable parameters
- Replace deprecated `Html::displayErrorAndDie()` and `Html::displayRightError()` calls with HTTP exceptions
- CI: fix PHPStan bootstrap for GLPI 11, migrate ESLint configuration to flat config, drop the stray `glpi-project/tools` composer dependency, declare a unique composer autoloader suffix
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,14 @@
"php": ">=8.1"
},
"require-dev": {
"glpi-project/tools": "^0.8.4",
"php-parallel-lint/php-parallel-lint": "^1.4",
"phpstan/extension-installer": "^1.4",
"phpstan/phpstan": "^1.10",
"phpstan/phpstan-deprecation-rules": "^1.1",
"squizlabs/php_codesniffer": "^4.0"
},
"config": {
"autoloader-suffix": "PluginDeploy",
"optimize-autoloader": true,
"platform": {
"php": "8.1"
Expand Down
22 changes: 22 additions & 0 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
import glpiEslintConfig from '../../eslint.config.mjs';

const filteredConfig = glpiEslintConfig.filter(config => !config.ignores);

export default [
...filteredConfig,
{
ignores: [
'lib/*',
'node_modules/*',
'vendor/*',
],
},
{
languageOptions: {
globals: {
GLPI_PLUGINS_PATH: true,
noUiSlider: true,
},
},
},
];
12 changes: 6 additions & 6 deletions front/package.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@

namespace GlpiPlugin\Deploy;

use Glpi\Exception\Http\AccessDeniedHttpException;
use Html;
use Search;
use Session;
Expand All @@ -38,6 +39,10 @@

Session::checkRight("dashboard", UPDATE);

if (!Package::canView()) {
throw new AccessDeniedHttpException();
}

Html::header(
Package::getTypeName(Session::getPluralNumber()),
'',
Expand All @@ -46,11 +51,6 @@
'package'
);

$package = new Package();
if ($package->canView()) {
Search::show('GlpiPlugin\Deploy\Package');
} else {
Html::displayRightError();
}
Search::show('GlpiPlugin\Deploy\Package');

Html::footer();
11 changes: 6 additions & 5 deletions hook.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,13 +32,12 @@
use GlpiPlugin\Deploy\Computer\GroupDynamic;
use GlpiPlugin\Deploy\Computer\GroupStatic;
use GlpiPlugin\Deploy\Package;
use GlpiPlugin\Deploy\PackageJob;
use GlpiPlugin\Deploy\PackageAction;
use GlpiPlugin\Deploy\PackageCheck;
use GlpiPlugin\Deploy\PackageFile;
use GlpiPlugin\Deploy\PackageJob;
use GlpiPlugin\Deploy\PackageTarget;
use GlpiPlugin\Deploy\Profile;
use GlpiPlugin\Deploy\PackageTimeslot;
use GlpiPlugin\Deploy\Repository;
use GlpiPlugin\Deploy\Timeslot;
use GlpiPlugin\Deploy\TimeslotRange;
Expand Down Expand Up @@ -71,7 +70,7 @@
* -------------------------------------------------------------------------
*/

// Define Dropdown tables to be manage in GLPI :
// Define Dropdown tables to be manage in GLPI :
function plugin_deploy_getDropdown()
{
$dropdowns = [Timeslot::class => Timeslot::getTypeName(2)];
Expand Down Expand Up @@ -103,16 +102,18 @@ function plugin_deploy_install()
/**
* Plugin uninstall process
*
* @return boolean
* @return bool
*/
function plugin_deploy_uninstall()
{
$migration = new Migration(PLUGIN_DEPLOY_VERSION);

PackageAction::uninstall($migration);
PackageCheck::uninstall($migration);
PackageFile::uninstall($migration);
PackageTarget::uninstall($migration);
Package::uninstall($migration);
PackageJob::uninstall($migration);
PackageTarget::uninstall($migration);
Profile::uninstall($migration);
Repository::uninstall($migration);
Group::uninstall($migration);
Expand Down
Loading
Loading