Skip to content

Commit 083f378

Browse files
committed
Fix Headers
Add continuous-integration.yml Add checks
1 parent 92e4c2c commit 083f378

28 files changed

Lines changed: 873 additions & 493 deletions
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
name: "Continuous integration"
2+
3+
on:
4+
push:
5+
branches:
6+
- "master"
7+
tags:
8+
- "*"
9+
pull_request:
10+
schedule:
11+
- cron: "0 0 * * *"
12+
workflow_dispatch:
13+
14+
concurrency:
15+
group: "${{ github.workflow }}-${{ github.ref }}"
16+
cancel-in-progress: true
17+
18+
jobs:
19+
generate-ci-matrix:
20+
name: "Generate CI matrix"
21+
uses: "glpi-project/plugin-ci-workflows/.github/workflows/generate-ci-matrix.yml@v1"
22+
with:
23+
glpi-version: "11.0.x"
24+
ci:
25+
name: "GLPI ${{ matrix.glpi-version }} - php:${{ matrix.php-version }} - ${{ matrix.db-image }}"
26+
needs: "generate-ci-matrix"
27+
strategy:
28+
fail-fast: false
29+
matrix: ${{ fromJson(needs.generate-ci-matrix.outputs.matrix) }}
30+
uses: "glpi-project/plugin-ci-workflows/.github/workflows/continuous-integration.yml@v1"
31+
with:
32+
plugin-key: "transferticketentity"
33+
glpi-version: "${{ matrix.glpi-version }}"
34+
php-version: "${{ matrix.php-version }}"
35+
db-image: "${{ matrix.db-image }}"

ajax/getEntitiesRights.php

Lines changed: 32 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,32 @@
11
<?php
22

3-
/*
4-
-------------------------------------------------------------------------
5-
LICENSE
6-
7-
This file is part of Transferticketentity plugin for GLPI.
8-
9-
Transferticketentity is free software: you can redistribute it and/or modify
10-
it under the terms of the GNU Affero General Public License as published by
11-
the Free Software Foundation, either version 3 of the License, or
12-
(at your option) any later version.
13-
14-
Transferticketentity is distributed in the hope that it will be useful,
15-
but WITHOUT ANY WARRANTY; without even the implied warranty of
16-
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17-
GNU Affero General Public License for more details.
18-
19-
You should have received a copy of the GNU Affero General Public License
20-
along with Reports. If not, see <http://www.gnu.org/licenses/>.
21-
22-
@category Ticket
23-
@package Transferticketentity
24-
@author Yannick Comba, Xavier Caillaud, Infotel
25-
@copyright 2015-2026 Transferticketentity team
26-
@license AGPL License 3.0 or (at your option) any later version
27-
https://www.gnu.org/licenses/gpl-3.0.html
28-
@link https://github.com/pluginsGLPI/transferticketentity/
29-
--------------------------------------------------------------------------
3+
/**
4+
* -------------------------------------------------------------------------
5+
* LICENSE
6+
*
7+
* This file is part of Transferticketentity plugin for GLPI.
8+
*
9+
* Transferticketentity is free software: you can redistribute it and/or modify
10+
* it under the terms of the GNU Affero General Public License as published by
11+
* the Free Software Foundation, either version 3 of the License, or
12+
* (at your option) any later version.
13+
*
14+
* Transferticketentity is distributed in the hope that it will be useful,
15+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
16+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17+
* GNU Affero General Public License for more details.
18+
*
19+
* You should have received a copy of the GNU Affero General Public License
20+
* along with Reports. If not, see <http://www.gnu.org/licenses/>.
21+
*
22+
* @author Yannick Comba, Xavier Caillaud, Infotel
23+
* @category Ticket
24+
* @copyright 2015-2026 Transferticketentity team
25+
* @license AGPL License 3.0 or (at your option) any later version
26+
* @link https://github.com/pluginsGLPI/transferticketentity/
27+
* @package Transferticketentity
28+
* https://www.gnu.org/licenses/gpl-3.0.html
29+
* --------------------------------------------------------------------------
3030
*/
3131

3232
use GlpiPlugin\Transferticketentity\Entity;
@@ -35,6 +35,11 @@
3535
Html::header_nocache();
3636

3737
Session::checkRight('plugin_transferticketentity_use', READ);
38+
// This endpoint only feeds the transfer form, whose display and submission both
39+
// require `ticket` UPDATE (see Ticket::showFormMcv / launchTicketTransfer). Gate
40+
// the AJAX surface on the same capability so a profile holding only the plugin
41+
// READ right cannot enumerate target-entity groups and mandatory-policy flags.
42+
Session::checkRight('ticket', UPDATE);
3843

3944
$getEntitiesRights = Entity::getEntitiesRights();
4045

ajax/showentitygroups.php

Lines changed: 35 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,34 @@
11
<?php
22

3+
/**
4+
* -------------------------------------------------------------------------
5+
* LICENSE
6+
*
7+
* This file is part of Transferticketentity plugin for GLPI.
8+
*
9+
* Transferticketentity is free software: you can redistribute it and/or modify
10+
* it under the terms of the GNU Affero General Public License as published by
11+
* the Free Software Foundation, either version 3 of the License, or
12+
* (at your option) any later version.
13+
*
14+
* Transferticketentity is distributed in the hope that it will be useful,
15+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
16+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17+
* GNU Affero General Public License for more details.
18+
*
19+
* You should have received a copy of the GNU Affero General Public License
20+
* along with Reports. If not, see <http://www.gnu.org/licenses/>.
21+
*
22+
* @author Yannick Comba, Xavier Caillaud, Infotel
23+
* @category Ticket
24+
* @copyright 2015-2026 Transferticketentity team
25+
* @license AGPL License 3.0 or (at your option) any later version
26+
* @link https://github.com/pluginsGLPI/transferticketentity/
27+
* @package Transferticketentity
28+
* https://www.gnu.org/licenses/gpl-3.0.html
29+
* --------------------------------------------------------------------------
30+
*/
31+
332
/*
433
-------------------------------------------------------------------------
534
LICENSE
@@ -33,6 +62,11 @@
3362
use GlpiPlugin\Transferticketentity\Ticket;
3463

3564
Session::checkRight('plugin_transferticketentity_use', READ);
65+
// This endpoint only feeds the transfer form, whose display and submission both
66+
// require `ticket` UPDATE (see Ticket::showFormMcv / launchTicketTransfer). Gate
67+
// the AJAX surface on the same capability so a profile holding only the plugin
68+
// READ right cannot enumerate target-entity groups and mandatory-policy flags.
69+
Session::checkRight('ticket', UPDATE);
3670

3771
if (strpos($_SERVER['PHP_SELF'], "showentitygroups.php")) {
3872
header("Content-Type: text/html; charset=UTF-8");
@@ -68,9 +102,8 @@
68102
echo "<div class='alert alert-danger'>";
69103
echo __(
70104
"No group found with « Assigned to » right while a group is required. Transfer impossible.",
71-
"transferticketentity"
105+
"transferticketentity",
72106
);
73107
echo "</div>";
74108
}
75109
}
76-

ajax/showentitymandatorygroup.php

Lines changed: 32 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,39 +1,44 @@
11
<?php
22

3-
/*
4-
-------------------------------------------------------------------------
5-
LICENSE
6-
7-
This file is part of Transferticketentity plugin for GLPI.
8-
9-
Transferticketentity is free software: you can redistribute it and/or modify
10-
it under the terms of the GNU Affero General Public License as published by
11-
the Free Software Foundation, either version 3 of the License, or
12-
(at your option) any later version.
13-
14-
Transferticketentity is distributed in the hope that it will be useful,
15-
but WITHOUT ANY WARRANTY; without even the implied warranty of
16-
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17-
GNU Affero General Public License for more details.
18-
19-
You should have received a copy of the GNU Affero General Public License
20-
along with Reports. If not, see <http://www.gnu.org/licenses/>.
21-
22-
@category Ticket
23-
@package Transferticketentity
24-
@author Yannick Comba, Xavier Caillaud, Infotel
25-
@copyright 2015-2026 Transferticketentity team
26-
@license AGPL License 3.0 or (at your option) any later version
27-
https://www.gnu.org/licenses/gpl-3.0.html
28-
@link https://github.com/pluginsGLPI/transferticketentity/
29-
--------------------------------------------------------------------------
3+
/**
4+
* -------------------------------------------------------------------------
5+
* LICENSE
6+
*
7+
* This file is part of Transferticketentity plugin for GLPI.
8+
*
9+
* Transferticketentity is free software: you can redistribute it and/or modify
10+
* it under the terms of the GNU Affero General Public License as published by
11+
* the Free Software Foundation, either version 3 of the License, or
12+
* (at your option) any later version.
13+
*
14+
* Transferticketentity is distributed in the hope that it will be useful,
15+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
16+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17+
* GNU Affero General Public License for more details.
18+
*
19+
* You should have received a copy of the GNU Affero General Public License
20+
* along with Reports. If not, see <http://www.gnu.org/licenses/>.
21+
*
22+
* @author Yannick Comba, Xavier Caillaud, Infotel
23+
* @category Ticket
24+
* @copyright 2015-2026 Transferticketentity team
25+
* @license AGPL License 3.0 or (at your option) any later version
26+
* @link https://github.com/pluginsGLPI/transferticketentity/
27+
* @package Transferticketentity
28+
* https://www.gnu.org/licenses/gpl-3.0.html
29+
* --------------------------------------------------------------------------
3030
*/
3131

3232
use Glpi\Exception\Http\AccessDeniedHttpException;
3333
use GlpiPlugin\Transferticketentity\Entity;
3434
use GlpiPlugin\Transferticketentity\Ticket;
3535

3636
Session::checkRight('plugin_transferticketentity_use', READ);
37+
// This endpoint only feeds the transfer form, whose display and submission both
38+
// require `ticket` UPDATE (see Ticket::showFormMcv / launchTicketTransfer). Gate
39+
// the AJAX surface on the same capability so a profile holding only the plugin
40+
// READ right cannot enumerate target-entity groups and mandatory-policy flags.
41+
Session::checkRight('ticket', UPDATE);
3742

3843
if (strpos($_SERVER['PHP_SELF'], "showentitymandatorygroup.php")) {
3944
header("Content-Type: text/html; charset=UTF-8");
@@ -63,4 +68,3 @@
6368
echo "</span>";
6469
}
6570
}
66-

ajax/showentitymandatoryjustification.php

Lines changed: 32 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,39 +1,44 @@
11
<?php
22

3-
/*
4-
-------------------------------------------------------------------------
5-
LICENSE
6-
7-
This file is part of Transferticketentity plugin for GLPI.
8-
9-
Transferticketentity is free software: you can redistribute it and/or modify
10-
it under the terms of the GNU Affero General Public License as published by
11-
the Free Software Foundation, either version 3 of the License, or
12-
(at your option) any later version.
13-
14-
Transferticketentity is distributed in the hope that it will be useful,
15-
but WITHOUT ANY WARRANTY; without even the implied warranty of
16-
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17-
GNU Affero General Public License for more details.
18-
19-
You should have received a copy of the GNU Affero General Public License
20-
along with Reports. If not, see <http://www.gnu.org/licenses/>.
21-
22-
@category Ticket
23-
@package Transferticketentity
24-
@author Yannick Comba, Xavier Caillaud, Infotel
25-
@copyright 2015-2026 Transferticketentity team
26-
@license AGPL License 3.0 or (at your option) any later version
27-
https://www.gnu.org/licenses/gpl-3.0.html
28-
@link https://github.com/pluginsGLPI/transferticketentity/
29-
--------------------------------------------------------------------------
3+
/**
4+
* -------------------------------------------------------------------------
5+
* LICENSE
6+
*
7+
* This file is part of Transferticketentity plugin for GLPI.
8+
*
9+
* Transferticketentity is free software: you can redistribute it and/or modify
10+
* it under the terms of the GNU Affero General Public License as published by
11+
* the Free Software Foundation, either version 3 of the License, or
12+
* (at your option) any later version.
13+
*
14+
* Transferticketentity is distributed in the hope that it will be useful,
15+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
16+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17+
* GNU Affero General Public License for more details.
18+
*
19+
* You should have received a copy of the GNU Affero General Public License
20+
* along with Reports. If not, see <http://www.gnu.org/licenses/>.
21+
*
22+
* @author Yannick Comba, Xavier Caillaud, Infotel
23+
* @category Ticket
24+
* @copyright 2015-2026 Transferticketentity team
25+
* @license AGPL License 3.0 or (at your option) any later version
26+
* @link https://github.com/pluginsGLPI/transferticketentity/
27+
* @package Transferticketentity
28+
* https://www.gnu.org/licenses/gpl-3.0.html
29+
* --------------------------------------------------------------------------
3030
*/
3131

3232
use Glpi\Exception\Http\AccessDeniedHttpException;
3333
use GlpiPlugin\Transferticketentity\Entity;
3434
use GlpiPlugin\Transferticketentity\Ticket;
3535

3636
Session::checkRight('plugin_transferticketentity_use', READ);
37+
// This endpoint only feeds the transfer form, whose display and submission both
38+
// require `ticket` UPDATE (see Ticket::showFormMcv / launchTicketTransfer). Gate
39+
// the AJAX surface on the same capability so a profile holding only the plugin
40+
// READ right cannot enumerate target-entity groups and mandatory-policy flags.
41+
Session::checkRight('ticket', UPDATE);
3742

3843
if (strpos($_SERVER['PHP_SELF'], "showentitymandatoryjustification.php")) {
3944
header("Content-Type: text/html; charset=UTF-8");
@@ -63,4 +68,3 @@
6368
echo "</span>";
6469
}
6570
}
66-

front/entity.form.php

Lines changed: 31 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,34 @@
11
<?php
22

3+
/**
4+
* -------------------------------------------------------------------------
5+
* LICENSE
6+
*
7+
* This file is part of Transferticketentity plugin for GLPI.
8+
*
9+
* Transferticketentity is free software: you can redistribute it and/or modify
10+
* it under the terms of the GNU Affero General Public License as published by
11+
* the Free Software Foundation, either version 3 of the License, or
12+
* (at your option) any later version.
13+
*
14+
* Transferticketentity is distributed in the hope that it will be useful,
15+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
16+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17+
* GNU Affero General Public License for more details.
18+
*
19+
* You should have received a copy of the GNU Affero General Public License
20+
* along with Reports. If not, see <http://www.gnu.org/licenses/>.
21+
*
22+
* @author Yannick Comba, Xavier Caillaud, Infotel
23+
* @category Ticket
24+
* @copyright 2015-2026 Transferticketentity team
25+
* @license AGPL License 3.0 or (at your option) any later version
26+
* @link https://github.com/pluginsGLPI/transferticketentity/
27+
* @package Transferticketentity
28+
* https://www.gnu.org/licenses/gpl-3.0.html
29+
* --------------------------------------------------------------------------
30+
*/
31+
332
/*
433
-------------------------------------------------------------------------
534
LICENSE
@@ -66,10 +95,10 @@
6695
Session::addMessageAfterRedirect(
6796
__(
6897
"The category is mandatory in the ticket template assigned to the entity",
69-
'transferticketentity'
98+
'transferticketentity',
7099
),
71100
true,
72-
ERROR
101+
ERROR,
73102
);
74103
} else {
75104
// Never trust the raw POST id: pin both id and entities_id to the row

0 commit comments

Comments
 (0)