Skip to content

Commit

Permalink
Merge branch 'release/2.7.1'
Browse files Browse the repository at this point in the history
  • Loading branch information
cedric-anne committed Sep 15, 2021
2 parents 130551f + f34a292 commit 0f982c8
Show file tree
Hide file tree
Showing 8 changed files with 558 additions and 444 deletions.
40 changes: 40 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: "Plugin release"

on:
push:
tags:
- '*'

jobs:
create-release:
name: "Create release"
runs-on: "ubuntu-latest"
steps:
- name: "Extract tag name"
run: |
echo "tag_name=${GITHUB_REF#refs/tags/}" >> $GITHUB_ENV
- name: "Checkout"
uses: "actions/checkout@v2"
- name: "Build package"
id: "build-package"
uses: "glpi-project/tools/github-actions/[email protected]"
with:
plugin-version: ${{ env.tag_name }}
- name: "Create release"
id: "create-release"
uses: "actions/create-release@v1"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ env.tag_name }}
release_name: ${{ env.tag_name }}
draft: true
- name: "Attach package to release"
uses: "actions/upload-release-asset@v1"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create-release.outputs.upload_url }}
asset_path: ${{ steps.build-package.outputs.package-path }}
asset_name: ${{ steps.build-package.outputs.package-basename }}
asset_content_type: " application/x-bzip2"
11 changes: 10 additions & 1 deletion ajax/dropdownReplaceFindDevice.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,15 @@
header("Content-Type: text/html; charset=UTF-8");
Html::header_nocache();

Session::checkSeveralRightsOr(['uninstall:profile' => READ,
'uninstall:profile' => PluginUninstallProfile::RIGHT_REPLACE]);

global $UNINSTALL_TYPES, $UNINSTALL_DIRECT_CONNECTIONS_TYPE;

if (!in_array($_REQUEST['itemtype'], array_merge($UNINSTALL_TYPES, $UNINSTALL_DIRECT_CONNECTIONS_TYPE))) {
Html::displayErrorAndDie(__("You don't have permission to perform this action."));
}

$itemtypeisplugin = isPluginItemType($_REQUEST['itemtype']);
$item = new $_REQUEST['itemtype']();
$table = getTableForItemType($_REQUEST['itemtype']);
Expand Down Expand Up @@ -68,7 +77,7 @@
$search = Search::makeTextSearch($_REQUEST['searchText']);

$where .= " AND (`name` ".$search."
OR `id` = '".$_REQUEST['searchText']."'
OR `id` = '".intval($_REQUEST['searchText'])."'
OR `serial` ".$search."
OR `otherserial` ".$search.")";
}
Expand Down
3 changes: 3 additions & 0 deletions ajax/groups.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,9 @@
header("Content-Type: text/html; charset=UTF-8");
Html::header_nocache();

Session::checkSeveralRightsOr(['uninstall:profile' => READ,
'uninstall:profile' => PluginUninstallProfile::RIGHT_REPLACE]);

if (Session::haveRight(PluginUninstallProfile::$rightname, READ)) {
switch ($_POST["id"]) {
case 'old' :
Expand Down
3 changes: 3 additions & 0 deletions ajax/locations.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,9 @@
header("Content-Type: text/html; charset=UTF-8");
Html::header_nocache();

Session::checkSeveralRightsOr(['uninstall:profile' => READ,
'uninstall:profile' => PluginUninstallProfile::RIGHT_REPLACE]);

if (Session::haveRight(PluginUninstallUninstall::$rightname, READ)
&& $_POST['templates_id']) {
$location = PluginUninstallPreference::getLocationByUserByEntity($_POST["users_id"],
Expand Down
Loading

0 comments on commit 0f982c8

Please sign in to comment.