diff --git a/.github/workflows/auto-tag-new-version.yml b/.github/workflows/auto-tag-new-version.yml
index 1fa9434..e2ac84c 100644
--- a/.github/workflows/auto-tag-new-version.yml
+++ b/.github/workflows/auto-tag-new-version.yml
@@ -1,3 +1,32 @@
+#
+# -------------------------------------------------------------------------
+# SCCM plugin for GLPI
+# -------------------------------------------------------------------------
+#
+# LICENSE
+#
+# This file is part of SCCM.
+#
+# SCCM 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 3 of the License, or
+# (at your option) any later version.
+#
+# SCCM 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 SCCM. If not, see .
+# -------------------------------------------------------------------------
+# @author François Legastelois
+# @copyright Copyright (C) 2014-2023 by SCCM plugin team.
+# @license GPLv3 https://www.gnu.org/licenses/gpl-3.0.html
+# @link https://github.com/pluginsGLPI/sccm
+# -------------------------------------------------------------------------
+#
+
name: "Automatically tag new version"
on:
diff --git a/.github/workflows/close_stale_issue.yml b/.github/workflows/close_stale_issue.yml
index 4dde8f5..8a2decd 100644
--- a/.github/workflows/close_stale_issue.yml
+++ b/.github/workflows/close_stale_issue.yml
@@ -1,3 +1,32 @@
+#
+# -------------------------------------------------------------------------
+# SCCM plugin for GLPI
+# -------------------------------------------------------------------------
+#
+# LICENSE
+#
+# This file is part of SCCM.
+#
+# SCCM 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 3 of the License, or
+# (at your option) any later version.
+#
+# SCCM 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 SCCM. If not, see .
+# -------------------------------------------------------------------------
+# @author François Legastelois
+# @copyright Copyright (C) 2014-2023 by SCCM plugin team.
+# @license GPLv3 https://www.gnu.org/licenses/gpl-3.0.html
+# @link https://github.com/pluginsGLPI/sccm
+# -------------------------------------------------------------------------
+#
+
name: 'Close stale issues'
on:
schedule:
diff --git a/.github/workflows/continuous-integration.yml b/.github/workflows/continuous-integration.yml
index 96274ea..5fa188f 100644
--- a/.github/workflows/continuous-integration.yml
+++ b/.github/workflows/continuous-integration.yml
@@ -1,3 +1,32 @@
+#
+# -------------------------------------------------------------------------
+# SCCM plugin for GLPI
+# -------------------------------------------------------------------------
+#
+# LICENSE
+#
+# This file is part of SCCM.
+#
+# SCCM 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 3 of the License, or
+# (at your option) any later version.
+#
+# SCCM 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 SCCM. If not, see .
+# -------------------------------------------------------------------------
+# @author François Legastelois
+# @copyright Copyright (C) 2014-2023 by SCCM plugin team.
+# @license GPLv3 https://www.gnu.org/licenses/gpl-3.0.html
+# @link https://github.com/pluginsGLPI/sccm
+# -------------------------------------------------------------------------
+#
+
name: "Continuous integration"
on:
diff --git a/.github/workflows/init-script.sh b/.github/workflows/init-script.sh
index 41b75ff..2a4adff 100644
--- a/.github/workflows/init-script.sh
+++ b/.github/workflows/init-script.sh
@@ -1,5 +1,34 @@
#!/bin/bash
+#
+# -------------------------------------------------------------------------
+# SCCM plugin for GLPI
+# -------------------------------------------------------------------------
+#
+# LICENSE
+#
+# This file is part of SCCM.
+#
+# SCCM 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 3 of the License, or
+# (at your option) any later version.
+#
+# SCCM 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 SCCM. If not, see .
+# -------------------------------------------------------------------------
+# @author François Legastelois
+# @copyright Copyright (C) 2014-2023 by SCCM plugin team.
+# @license GPLv3 https://www.gnu.org/licenses/gpl-3.0.html
+# @link https://github.com/pluginsGLPI/sccm
+# -------------------------------------------------------------------------
+#
+
sudo apt-get update -yq
PHP_VERSION=$(php -r "echo PHP_MAJOR_VERSION.'.'.PHP_MINOR_VERSION;")
@@ -10,6 +39,8 @@ if [[ "$PHP_VERSION" == "7.4" ]]; then
sudo pecl install sqlsrv-5.10.1
elif [[ "$PHP_VERSION" == "8.0" ]]; then
sudo pecl install sqlsrv-5.11.0
+elif [[ "$PHP_VERSION" == "8.1" || "$PHP_VERSION" == "8.2" ]]; then
+sudo pecl install sqlsrv-5.12.0
else
sudo pecl install sqlsrv
fi
diff --git a/.github/workflows/label-commenter.yml b/.github/workflows/label-commenter.yml
index f27bb1d..6cea690 100644
--- a/.github/workflows/label-commenter.yml
+++ b/.github/workflows/label-commenter.yml
@@ -1,3 +1,32 @@
+#
+# -------------------------------------------------------------------------
+# SCCM plugin for GLPI
+# -------------------------------------------------------------------------
+#
+# LICENSE
+#
+# This file is part of SCCM.
+#
+# SCCM 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 3 of the License, or
+# (at your option) any later version.
+#
+# SCCM 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 SCCM. If not, see .
+# -------------------------------------------------------------------------
+# @author François Legastelois
+# @copyright Copyright (C) 2014-2023 by SCCM plugin team.
+# @license GPLv3 https://www.gnu.org/licenses/gpl-3.0.html
+# @link https://github.com/pluginsGLPI/sccm
+# -------------------------------------------------------------------------
+#
+
name: "Label commenter"
on:
diff --git a/.github/workflows/locales-sync.yml b/.github/workflows/locales-sync.yml
index f1efd1c..3ce985a 100644
--- a/.github/workflows/locales-sync.yml
+++ b/.github/workflows/locales-sync.yml
@@ -1,3 +1,32 @@
+#
+# -------------------------------------------------------------------------
+# SCCM plugin for GLPI
+# -------------------------------------------------------------------------
+#
+# LICENSE
+#
+# This file is part of SCCM.
+#
+# SCCM 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 3 of the License, or
+# (at your option) any later version.
+#
+# SCCM 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 SCCM. If not, see .
+# -------------------------------------------------------------------------
+# @author François Legastelois
+# @copyright Copyright (C) 2014-2023 by SCCM plugin team.
+# @license GPLv3 https://www.gnu.org/licenses/gpl-3.0.html
+# @link https://github.com/pluginsGLPI/sccm
+# -------------------------------------------------------------------------
+#
+
name: "Synchronize locales"
on:
diff --git a/.github/workflows/locales-update-source.yml b/.github/workflows/locales-update-source.yml
index 928c931..449933e 100644
--- a/.github/workflows/locales-update-source.yml
+++ b/.github/workflows/locales-update-source.yml
@@ -1,3 +1,32 @@
+#
+# -------------------------------------------------------------------------
+# SCCM plugin for GLPI
+# -------------------------------------------------------------------------
+#
+# LICENSE
+#
+# This file is part of SCCM.
+#
+# SCCM 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 3 of the License, or
+# (at your option) any later version.
+#
+# SCCM 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 SCCM. If not, see .
+# -------------------------------------------------------------------------
+# @author François Legastelois
+# @copyright Copyright (C) 2014-2023 by SCCM plugin team.
+# @license GPLv3 https://www.gnu.org/licenses/gpl-3.0.html
+# @link https://github.com/pluginsGLPI/sccm
+# -------------------------------------------------------------------------
+#
+
name: "Update locales sources"
on:
diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml
index 1332e71..89b5e7d 100644
--- a/.github/workflows/release.yml
+++ b/.github/workflows/release.yml
@@ -1,3 +1,32 @@
+#
+# -------------------------------------------------------------------------
+# SCCM plugin for GLPI
+# -------------------------------------------------------------------------
+#
+# LICENSE
+#
+# This file is part of SCCM.
+#
+# SCCM 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 3 of the License, or
+# (at your option) any later version.
+#
+# SCCM 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 SCCM. If not, see .
+# -------------------------------------------------------------------------
+# @author François Legastelois
+# @copyright Copyright (C) 2014-2023 by SCCM plugin team.
+# @license GPLv3 https://www.gnu.org/licenses/gpl-3.0.html
+# @link https://github.com/pluginsGLPI/sccm
+# -------------------------------------------------------------------------
+#
+
name: "Publish release"
on:
diff --git a/Makefile b/Makefile
new file mode 100644
index 0000000..ef1bed5
--- /dev/null
+++ b/Makefile
@@ -0,0 +1 @@
+include ../../PluginsMakefile.mk
diff --git a/composer.lock b/composer.lock
index 05fdc49..e44a40d 100644
--- a/composer.lock
+++ b/composer.lock
@@ -118,16 +118,16 @@
},
{
"name": "symfony/console",
- "version": "v6.4.30",
+ "version": "v6.4.39",
"source": {
"type": "git",
"url": "https://github.com/symfony/console.git",
- "reference": "1b2813049506b39eb3d7e64aff033fd5ca26c97e"
+ "reference": "c132f1215fe4aa45b70173cc00ce9a755dd31ec5"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/symfony/console/zipball/1b2813049506b39eb3d7e64aff033fd5ca26c97e",
- "reference": "1b2813049506b39eb3d7e64aff033fd5ca26c97e",
+ "url": "https://api.github.com/repos/symfony/console/zipball/c132f1215fe4aa45b70173cc00ce9a755dd31ec5",
+ "reference": "c132f1215fe4aa45b70173cc00ce9a755dd31ec5",
"shasum": ""
},
"require": {
@@ -192,7 +192,7 @@
"terminal"
],
"support": {
- "source": "https://github.com/symfony/console/tree/v6.4.30"
+ "source": "https://github.com/symfony/console/tree/v6.4.39"
},
"funding": [
{
@@ -212,20 +212,20 @@
"type": "tidelift"
}
],
- "time": "2025-12-05T13:47:41+00:00"
+ "time": "2026-05-12T06:50:03+00:00"
},
{
"name": "symfony/deprecation-contracts",
- "version": "v3.6.0",
+ "version": "v3.7.0",
"source": {
"type": "git",
"url": "https://github.com/symfony/deprecation-contracts.git",
- "reference": "63afe740e99a13ba87ec199bb07bbdee937a5b62"
+ "reference": "50f59d1f3ca46d41ac911f97a78626b6756af35b"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/symfony/deprecation-contracts/zipball/63afe740e99a13ba87ec199bb07bbdee937a5b62",
- "reference": "63afe740e99a13ba87ec199bb07bbdee937a5b62",
+ "url": "https://api.github.com/repos/symfony/deprecation-contracts/zipball/50f59d1f3ca46d41ac911f97a78626b6756af35b",
+ "reference": "50f59d1f3ca46d41ac911f97a78626b6756af35b",
"shasum": ""
},
"require": {
@@ -238,7 +238,7 @@
"name": "symfony/contracts"
},
"branch-alias": {
- "dev-main": "3.6-dev"
+ "dev-main": "3.7-dev"
}
},
"autoload": {
@@ -263,7 +263,7 @@
"description": "A generic function and convention to trigger deprecation notices",
"homepage": "https://symfony.com",
"support": {
- "source": "https://github.com/symfony/deprecation-contracts/tree/v3.6.0"
+ "source": "https://github.com/symfony/deprecation-contracts/tree/v3.7.0"
},
"funding": [
{
@@ -274,25 +274,29 @@
"url": "https://github.com/fabpot",
"type": "github"
},
+ {
+ "url": "https://github.com/nicolas-grekas",
+ "type": "github"
+ },
{
"url": "https://tidelift.com/funding/github/packagist/symfony/symfony",
"type": "tidelift"
}
],
- "time": "2024-09-25T14:21:43+00:00"
+ "time": "2026-04-13T15:52:40+00:00"
},
{
"name": "symfony/polyfill-ctype",
- "version": "v1.33.0",
+ "version": "v1.37.0",
"source": {
"type": "git",
"url": "https://github.com/symfony/polyfill-ctype.git",
- "reference": "a3cc8b044a6ea513310cbd48ef7333b384945638"
+ "reference": "141046a8f9477948ff284fa65be2095baafb94f2"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/a3cc8b044a6ea513310cbd48ef7333b384945638",
- "reference": "a3cc8b044a6ea513310cbd48ef7333b384945638",
+ "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/141046a8f9477948ff284fa65be2095baafb94f2",
+ "reference": "141046a8f9477948ff284fa65be2095baafb94f2",
"shasum": ""
},
"require": {
@@ -342,7 +346,7 @@
"portable"
],
"support": {
- "source": "https://github.com/symfony/polyfill-ctype/tree/v1.33.0"
+ "source": "https://github.com/symfony/polyfill-ctype/tree/v1.37.0"
},
"funding": [
{
@@ -362,20 +366,20 @@
"type": "tidelift"
}
],
- "time": "2024-09-09T11:45:10+00:00"
+ "time": "2026-04-10T16:19:22+00:00"
},
{
"name": "symfony/polyfill-intl-grapheme",
- "version": "v1.33.0",
+ "version": "v1.37.0",
"source": {
"type": "git",
"url": "https://github.com/symfony/polyfill-intl-grapheme.git",
- "reference": "380872130d3a5dd3ace2f4010d95125fde5d5c70"
+ "reference": "4864388bfbd3001ce88e234fab652acd91fdc57e"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/symfony/polyfill-intl-grapheme/zipball/380872130d3a5dd3ace2f4010d95125fde5d5c70",
- "reference": "380872130d3a5dd3ace2f4010d95125fde5d5c70",
+ "url": "https://api.github.com/repos/symfony/polyfill-intl-grapheme/zipball/4864388bfbd3001ce88e234fab652acd91fdc57e",
+ "reference": "4864388bfbd3001ce88e234fab652acd91fdc57e",
"shasum": ""
},
"require": {
@@ -424,7 +428,7 @@
"shim"
],
"support": {
- "source": "https://github.com/symfony/polyfill-intl-grapheme/tree/v1.33.0"
+ "source": "https://github.com/symfony/polyfill-intl-grapheme/tree/v1.37.0"
},
"funding": [
{
@@ -444,11 +448,11 @@
"type": "tidelift"
}
],
- "time": "2025-06-27T09:58:17+00:00"
+ "time": "2026-04-26T13:13:48+00:00"
},
{
"name": "symfony/polyfill-intl-normalizer",
- "version": "v1.33.0",
+ "version": "v1.37.0",
"source": {
"type": "git",
"url": "https://github.com/symfony/polyfill-intl-normalizer.git",
@@ -509,7 +513,7 @@
"shim"
],
"support": {
- "source": "https://github.com/symfony/polyfill-intl-normalizer/tree/v1.33.0"
+ "source": "https://github.com/symfony/polyfill-intl-normalizer/tree/v1.37.0"
},
"funding": [
{
@@ -533,16 +537,16 @@
},
{
"name": "symfony/polyfill-mbstring",
- "version": "v1.33.0",
+ "version": "v1.37.0",
"source": {
"type": "git",
"url": "https://github.com/symfony/polyfill-mbstring.git",
- "reference": "6d857f4d76bd4b343eac26d6b539585d2bc56493"
+ "reference": "6a21eb99c6973357967f6ce3708cd55a6bec6315"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/6d857f4d76bd4b343eac26d6b539585d2bc56493",
- "reference": "6d857f4d76bd4b343eac26d6b539585d2bc56493",
+ "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/6a21eb99c6973357967f6ce3708cd55a6bec6315",
+ "reference": "6a21eb99c6973357967f6ce3708cd55a6bec6315",
"shasum": ""
},
"require": {
@@ -594,7 +598,7 @@
"shim"
],
"support": {
- "source": "https://github.com/symfony/polyfill-mbstring/tree/v1.33.0"
+ "source": "https://github.com/symfony/polyfill-mbstring/tree/v1.37.0"
},
"funding": [
{
@@ -614,20 +618,20 @@
"type": "tidelift"
}
],
- "time": "2024-12-23T08:48:59+00:00"
+ "time": "2026-04-10T17:25:58+00:00"
},
{
"name": "symfony/service-contracts",
- "version": "v3.6.1",
+ "version": "v3.7.0",
"source": {
"type": "git",
"url": "https://github.com/symfony/service-contracts.git",
- "reference": "45112560a3ba2d715666a509a0bc9521d10b6c43"
+ "reference": "d25d82433a80eba6aa0e6c24b61d7370d99e444a"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/symfony/service-contracts/zipball/45112560a3ba2d715666a509a0bc9521d10b6c43",
- "reference": "45112560a3ba2d715666a509a0bc9521d10b6c43",
+ "url": "https://api.github.com/repos/symfony/service-contracts/zipball/d25d82433a80eba6aa0e6c24b61d7370d99e444a",
+ "reference": "d25d82433a80eba6aa0e6c24b61d7370d99e444a",
"shasum": ""
},
"require": {
@@ -645,7 +649,7 @@
"name": "symfony/contracts"
},
"branch-alias": {
- "dev-main": "3.6-dev"
+ "dev-main": "3.7-dev"
}
},
"autoload": {
@@ -681,7 +685,7 @@
"standards"
],
"support": {
- "source": "https://github.com/symfony/service-contracts/tree/v3.6.1"
+ "source": "https://github.com/symfony/service-contracts/tree/v3.7.0"
},
"funding": [
{
@@ -701,20 +705,20 @@
"type": "tidelift"
}
],
- "time": "2025-07-15T11:30:57+00:00"
+ "time": "2026-03-28T09:44:51+00:00"
},
{
"name": "symfony/string",
- "version": "v7.4.0",
+ "version": "v7.4.11",
"source": {
"type": "git",
"url": "https://github.com/symfony/string.git",
- "reference": "d50e862cb0a0e0886f73ca1f31b865efbb795003"
+ "reference": "965f7306a43383d02c6aca1e3f3bd2f0ea5dee15"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/symfony/string/zipball/d50e862cb0a0e0886f73ca1f31b865efbb795003",
- "reference": "d50e862cb0a0e0886f73ca1f31b865efbb795003",
+ "url": "https://api.github.com/repos/symfony/string/zipball/965f7306a43383d02c6aca1e3f3bd2f0ea5dee15",
+ "reference": "965f7306a43383d02c6aca1e3f3bd2f0ea5dee15",
"shasum": ""
},
"require": {
@@ -772,7 +776,7 @@
"utf8"
],
"support": {
- "source": "https://github.com/symfony/string/tree/v7.4.0"
+ "source": "https://github.com/symfony/string/tree/v7.4.11"
},
"funding": [
{
@@ -792,20 +796,20 @@
"type": "tidelift"
}
],
- "time": "2025-11-27T13:27:24+00:00"
+ "time": "2026-05-13T12:04:42+00:00"
},
{
"name": "twig/twig",
- "version": "v3.22.1",
+ "version": "v3.25.0",
"source": {
"type": "git",
"url": "https://github.com/twigphp/Twig.git",
- "reference": "1de2ec1fc43ab58a4b7e80b214b96bfc895750f3"
+ "reference": "0dade995be754556af4dcbf8721d45cb3271f9b4"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/twigphp/Twig/zipball/1de2ec1fc43ab58a4b7e80b214b96bfc895750f3",
- "reference": "1de2ec1fc43ab58a4b7e80b214b96bfc895750f3",
+ "url": "https://api.github.com/repos/twigphp/Twig/zipball/0dade995be754556af4dcbf8721d45cb3271f9b4",
+ "reference": "0dade995be754556af4dcbf8721d45cb3271f9b4",
"shasum": ""
},
"require": {
@@ -815,7 +819,8 @@
"symfony/polyfill-mbstring": "^1.3"
},
"require-dev": {
- "phpstan/phpstan": "^2.0",
+ "php-cs-fixer/shim": "^3.0@stable",
+ "phpstan/phpstan": "^2.0@stable",
"psr/container": "^1.0|^2.0",
"symfony/phpunit-bridge": "^5.4.9|^6.4|^7.0"
},
@@ -859,7 +864,7 @@
],
"support": {
"issues": "https://github.com/twigphp/Twig/issues",
- "source": "https://github.com/twigphp/Twig/tree/v3.22.1"
+ "source": "https://github.com/twigphp/Twig/tree/v3.25.0"
},
"funding": [
{
@@ -871,7 +876,7 @@
"type": "tidelift"
}
],
- "time": "2025-11-16T16:01:12+00:00"
+ "time": "2026-05-17T07:41:26+00:00"
}
],
"aliases": [],
diff --git a/front/config.form.php b/front/config.form.php
index 84cc52a..3320055 100644
--- a/front/config.form.php
+++ b/front/config.form.php
@@ -41,9 +41,9 @@
$config->update($_POST);
$sccm_db = new PluginSccmSccmdb();
if ($sccm_db->connect()) {
- Session::addMessageAfterRedirect("Connexion réussie !.", false, INFO, false);
+ Session::addMessageAfterRedirect(__s("Login successful", "sccm"), false, INFO, false);
} else {
- Session::addMessageAfterRedirect("Connexion incorrecte.", false, ERROR, false);
+ Session::addMessageAfterRedirect(__s("Incorrect login", "sccm"), false, ERROR, false);
}
Html::back();
diff --git a/hook.php b/hook.php
index 457ef3b..ae0e3df 100644
--- a/hook.php
+++ b/hook.php
@@ -29,6 +29,12 @@
* -------------------------------------------------------------------------
*/
+use function Safe\filetype;
+use function Safe\mkdir;
+use function Safe\rmdir;
+use function Safe\scandir;
+use function Safe\unlink;
+
function plugin_sccm_install()
{
/** @var DBmysql $DB */
@@ -78,7 +84,7 @@ function rrmdir($dir)
$objects = scandir($dir);
foreach ($objects as $object) {
if ($object !== "." && $object !== "..") {
- if (filetype($dir . "/" . $object) == "dir") {
+ if (filetype($dir . "/" . $object) === "dir") {
rrmdir($dir . "/" . $object);
} else {
unlink($dir . "/" . $object);
diff --git a/inc/config.class.php b/inc/config.class.php
index b4617ab..28d864b 100644
--- a/inc/config.class.php
+++ b/inc/config.class.php
@@ -31,34 +31,7 @@
use Glpi\Application\View\TemplateRenderer;
-/**
- * -------------------------------------------------------------------------
- * SCCM plugin for GLPI
- * -------------------------------------------------------------------------
- *
- * LICENSE
- *
- * This file is part of SCCM.
- *
- * SCCM 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 3 of the License, or
- * (at your option) any later version.
- *
- * SCCM 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 SCCM. If not, see .
- * -------------------------------------------------------------------------
- * @author François Legastelois
- * @copyright Copyright (C) 2014-2023 by SCCM plugin team.
- * @license GPLv3 https://www.gnu.org/licenses/gpl-3.0.html
- * @link https://github.com/pluginsGLPI/sccm
- * -------------------------------------------------------------------------
- */
+use function Safe\preg_match;
class PluginSccmConfig extends CommonDBTM
{
diff --git a/inc/sccm.class.php b/inc/sccm.class.php
index 8498dc4..5a536f4 100644
--- a/inc/sccm.class.php
+++ b/inc/sccm.class.php
@@ -31,6 +31,15 @@
use Glpi\Exception\Http\BadRequestHttpException;
+use function Safe\curl_exec;
+use function Safe\curl_getinfo;
+use function Safe\curl_init;
+use function Safe\curl_setopt;
+use function Safe\ini_set;
+use function Safe\realpath;
+use function Safe\simplexml_load_file;
+use function Safe\sqlsrv_fetch_array;
+
class PluginSccmSccm
{
public $devices;
@@ -633,84 +642,70 @@ public static function executePush($task)
$REP_XML = realpath(GLPI_PLUGIN_DOC_DIR . '/sccm/xml/' . $tab['CSD-MachineID'] . '.ocs');
- if ($REP_XML === false) {
- Toolbox::logInFile('sccm', "There is a problem with the path, realpath function return false.\nPath : " . $REP_XML . "\n", true);
- continue;
+ $xmlFile = simplexml_load_file($REP_XML, 'SimpleXMLElement', LIBXML_NOCDATA);
+
+ $ch = curl_init();
+ if ($PluginSccmConfig->getField('verify_ssl_cert') != "1") {
+ curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
+ curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0);
}
- $xmlFile = simplexml_load_file($REP_XML, 'SimpleXMLElement', LIBXML_NOCDATA);
- if ($xmlFile !== false) {
+ if ($PluginSccmConfig->getField('use_auth_ntlm') == "1") {
+ curl_setopt($ch, CURLOPT_HTTPAUTH, CURLAUTH_NTLM);
+ }
- $ch = curl_init();
- if ($PluginSccmConfig->getField('verify_ssl_cert') != "1") {
- curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
- curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0);
- }
+ if ($PluginSccmConfig->getField('unrestricted_auth') == "1") {
+ curl_setopt($ch, CURLOPT_UNRESTRICTED_AUTH, true);
+ }
- if ($PluginSccmConfig->getField('use_auth_ntlm') == "1") {
- curl_setopt($ch, CURLOPT_HTTPAUTH, CURLAUTH_NTLM);
- }
+ if ($PluginSccmConfig->getField('use_auth_info') == "1") {
+ curl_setopt($ch, CURLOPT_USERPWD, $PluginSccmConfig->getField('auth_info'));
+ }
- if ($PluginSccmConfig->getField('unrestricted_auth') == "1") {
- curl_setopt($ch, CURLOPT_UNRESTRICTED_AUTH, true);
- }
+ $url = ($PluginSccmConfig->getField('inventory_server_url') ?: $CFG_GLPI['url_base']) . '/front/inventory.php';
+
+ curl_setopt($ch, CURLOPT_URL, $url);
+ curl_setopt($ch, CURLOPT_HTTPHEADER, ['Content-Type: text/xml']);
+ curl_setopt($ch, CURLOPT_HEADER, true);
+ curl_setopt($ch, CURLOPT_POST, true);
+ curl_setopt($ch, CURLOPT_POSTFIELDS, $xmlFile->asXML());
+ curl_setopt($ch, CURLOPT_FOLLOWLOCATION, false);
+ curl_setopt($ch, CURLOPT_REFERER, $CFG_GLPI['url_base']);
+ curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
+ $ch_result = curl_exec($ch);
+ if ($ch_result === false) {
+ Toolbox::logInFile('sccm', curl_error($ch) . "\n", true);
+ } else {
- if ($PluginSccmConfig->getField('use_auth_info') == "1") {
- curl_setopt($ch, CURLOPT_USERPWD, $PluginSccmConfig->getField('auth_info'));
- }
+ $httpcode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
+ if ($httpcode != 200) {
+ $header_size = curl_getinfo($ch, CURLINFO_HEADER_SIZE);
+ $body = substr($ch_result, $header_size);
- $url = ($PluginSccmConfig->getField('inventory_server_url') ?: $CFG_GLPI['url_base']) . '/front/inventory.php';
-
- curl_setopt($ch, CURLOPT_URL, $url);
- curl_setopt($ch, CURLOPT_HTTPHEADER, ['Content-Type: text/xml']);
- curl_setopt($ch, CURLOPT_HEADER, true);
- curl_setopt($ch, CURLOPT_POST, true);
- curl_setopt($ch, CURLOPT_POSTFIELDS, $xmlFile->asXML());
- curl_setopt($ch, CURLOPT_FOLLOWLOCATION, false);
- curl_setopt($ch, CURLOPT_REFERER, $CFG_GLPI['url_base']);
- curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
- $ch_result = curl_exec($ch);
- if ($ch_result === false) {
- Toolbox::logInFile('sccm', curl_error($ch) . "\n", true);
+ Toolbox::logInFile('sccm', "Push KO - " . $tab['CSD-MachineID'] . " -> STATUS CODE : " . $httpcode . " \n", true);
+ Toolbox::logInFile('sccm', "ERROR RETURNED : " . $body . " \n", true);
} else {
-
- $httpcode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
- if ($httpcode != 200) {
- $header_size = curl_getinfo($ch, CURLINFO_HEADER_SIZE);
- $body = substr($ch_result, $header_size);
-
- Toolbox::logInFile('sccm', "Push KO - " . $tab['CSD-MachineID'] . " -> STATUS CODE : " . $httpcode . " \n", true);
- Toolbox::logInFile('sccm', "ERROR RETURNED : " . $body . " \n", true);
- } else {
- $task->addVolume(1);
-
- if ($PluginSccmConfig->getField('use_lasthwscan') == 1) {
- $agent = new Agent();
- if ($agent->getFromDBByCrit(["name" => $tab['CSD-MachineID']]) && (class_exists($agent->fields['itemtype']) && is_a($agent->fields['itemtype'], CommonDBTM::class, true))) {
- $asset = new $agent->fields['itemtype']();
- if ($asset->getFromDB($agent->fields['items_id'])) {
- $asset->update([
- "id" => $asset->fields['id'],
- "last_inventory_update" => $tab['vWD-LastScan']->format('Y-m-d h:i'),
- ]);
- }
+ $task->addVolume(1);
+
+ if ($PluginSccmConfig->getField('use_lasthwscan') == 1) {
+ $agent = new Agent();
+ if ($agent->getFromDBByCrit(["name" => $tab['CSD-MachineID']]) && (class_exists($agent->fields['itemtype']) && is_a($agent->fields['itemtype'], CommonDBTM::class, true))) {
+ $asset = new $agent->fields['itemtype']();
+ if ($asset->getFromDB($agent->fields['items_id'])) {
+ $asset->update([
+ "id" => $asset->fields['id'],
+ "last_inventory_update" => $tab['vWD-LastScan']->format('Y-m-d h:i'),
+ ]);
}
}
-
- Toolbox::logInFile('sccm', "Push OK - " . $tab['CSD-MachineID'] . " \n", true);
}
+ Toolbox::logInFile('sccm', "Push OK - " . $tab['CSD-MachineID'] . " \n", true);
}
- curl_close($ch);
- } else {
- $errors = "";
- foreach (libxml_get_errors() as $error) {
- $errors = $errors . $error->message . "\n";
- }
-
- Toolbox::logInFile('sccm', "Can't load the file with the path : " . $REP_XML . "\n\n" . $errors . "\n", true);
}
+
+ curl_close($ch);
}
Toolbox::logInFile('sccm', "Push completed \n", true);
diff --git a/inc/sccmdb.class.php b/inc/sccmdb.class.php
index 1648faa..24d22f9 100644
--- a/inc/sccmdb.class.php
+++ b/inc/sccmdb.class.php
@@ -31,34 +31,8 @@
use Glpi\Exception\Http\BadRequestHttpException;
-/**
- * -------------------------------------------------------------------------
- * SCCM plugin for GLPI
- * -------------------------------------------------------------------------
- *
- * LICENSE
- *
- * This file is part of SCCM.
- *
- * SCCM 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 3 of the License, or
- * (at your option) any later version.
- *
- * SCCM 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 SCCM. If not, see .
- * -------------------------------------------------------------------------
- * @author François Legastelois
- * @copyright Copyright (C) 2014-2023 by SCCM plugin team.
- * @license GPLv3 https://www.gnu.org/licenses/gpl-3.0.html
- * @link https://github.com/pluginsGLPI/sccm
- * -------------------------------------------------------------------------
- */
+use function Safe\sqlsrv_close;
+use function Safe\sqlsrv_query;
class PluginSccmSccmdb
{
diff --git a/inc/sccmxml.class.php b/inc/sccmxml.class.php
index 2b9510e..67cea52 100644
--- a/inc/sccmxml.class.php
+++ b/inc/sccmxml.class.php
@@ -29,6 +29,11 @@
* -------------------------------------------------------------------------
*/
+use function Safe\json_decode;
+use function Safe\json_encode;
+use function Safe\preg_match;
+use function Safe\preg_match_all;
+use function Safe\preg_replace;
class PluginSccmSccmxml
{
@@ -76,7 +81,7 @@ public function setAccessLog()
} elseif (!empty($this->data['SDI-UserName'])) {
$this->username = $this->data['SDI-UserName'];
} elseif (!empty($this->data['CSD-UserName'])) {
- if (preg_match_all("#\\ (.*)#", (string) $this->data['CSD-UserName'], $matches)) {
+ if (preg_match_all("#\\ (.*)#", (string) $this->data['CSD-UserName'], $matches) !== 0) {
$this->data['CSD-UserName'] = $matches[1][0];
}
diff --git a/phpstan.neon b/phpstan.neon
index eab0a78..e2e6f0f 100644
--- a/phpstan.neon
+++ b/phpstan.neon
@@ -1,15 +1,18 @@
+includes:
+ - ../../vendor/glpi-project/phpstan-glpi/extension.neon
+ - ../../vendor/phpstan/phpstan-deprecation-rules/rules.neon
+ - ../../vendor/thecodingmachine/phpstan-safe-rule/phpstan-safe-rule.neon
+
parameters:
- parallel:
- maximumNumberOfProcesses: 2
level: 5
- bootstrapFiles:
- - ../../stubs/glpi_constants.php
- - ../../vendor/autoload.php
paths:
- front
- inc
- hook.php
- setup.php
scanDirectories:
- - ../../inc
- ../../src
+ bootstrapFiles:
+ - ../../stubs/glpi_constants.php
+ - ../../vendor/autoload.php
+ treatPhpDocTypesAsCertain: false
diff --git a/psalm.xml b/psalm.xml
index 1095c55..10dfde1 100644
--- a/psalm.xml
+++ b/psalm.xml
@@ -8,15 +8,4 @@
-
-
-
-
-
diff --git a/setup.php b/setup.php
index d50bde4..b67c4a8 100644
--- a/setup.php
+++ b/setup.php
@@ -31,8 +31,11 @@
use Glpi\Plugin\Hooks;
+/** @phpstan-ignore theCodingMachineSafe.function (safe to assume this isn't already defined) */
define('PLUGIN_SCCM_VERSION', '2.5.1');
+/** @phpstan-ignore theCodingMachineSafe.function (safe to assume this isn't already defined) */
define("PLUGIN_SCCM_MIN_GLPI", "11.0.00");
+/** @phpstan-ignore theCodingMachineSafe.function (safe to assume this isn't already defined) */
define("PLUGIN_SCCM_MAX_GLPI", "11.0.99");
function plugin_init_sccm()