├── .github
├── ISSUE_TEMPLATE
│ ├── bug_report.yml
│ └── config.yml
├── dependabot.yml
├── label-commenter-config.yml
├── pull_request_template.md
└── workflows
│ ├── auto-tag-new-version.yml
│ ├── close_stale_issue.yml
│ ├── continuous-integration.yml
│ ├── label-commenter.yml
│ ├── locales-sync.yml
│ ├── locales-update-source.yml
│ └── release.yml
├── .gitignore
├── .php-cs-fixer.php
├── .phpcs.xml
├── .tx
└── config
├── LICENSE
├── Readme.md
├── SECURITY.md
├── ajax
└── extract_json.php
├── composer.json
├── composer.lock
├── dashboards
└── readme.md
├── front
├── collections.php
├── config.form.php
├── profileright.form.php
└── selfservice.php
├── hook.php
├── inc
├── apiclient.class.php
├── config.class.php
├── dashboard.class.php
└── profileright.class.php
├── locales
├── cs_CZ.mo
├── cs_CZ.po
├── en_GB.mo
├── en_GB.po
├── en_US.mo
├── en_US.po
├── es_419.mo
├── es_419.po
├── es_AR.mo
├── es_AR.po
├── es_CO.mo
├── es_CO.po
├── es_EC.mo
├── es_EC.po
├── fi_FI.mo
├── fi_FI.po
├── fr_FR.mo
├── fr_FR.po
├── hr_HR.mo
├── hr_HR.po
├── it_IT.mo
├── it_IT.po
├── ko_KR.mo
├── ko_KR.po
├── metabase.pot
├── pt_BR.mo
├── pt_BR.po
├── pt_PT.mo
├── pt_PT.po
├── sk_SK.mo
├── sk_SK.po
├── tr_TR.mo
├── tr_TR.po
├── zh_CN.mo
└── zh_CN.po
├── logo.png
├── metabase.css
├── metabase.js
├── metabase.xml
├── phpstan.neon
├── reports
└── readme.md
├── screenshots
├── central.png
├── configuration.png
├── teclib_assets.png
└── teclib_helpdesk.png
├── setup.php
└── tools
└── HEADER
/.github/ISSUE_TEMPLATE/bug_report.yml:
--------------------------------------------------------------------------------
1 | name: Bug Report
2 | description: Create a report to help us improve metabase
3 | body:
4 | - type: markdown
5 | attributes:
6 | value: |
7 |
8 | Dear GLPI plugin user.
9 |
10 | **⚠️ Please never use standard issues to report security problems. See [security policy](https://github.com/pluginsGLPI/metabase/security/policy) for more details. ⚠️**
11 |
12 | BEFORE SUBMITTING YOUR ISSUE, please make sure to read and follow these steps:
13 |
14 | * We do not track feature requests nor enhancements here. Propose them on the [suggest dedicated site](https://suggest.glpi-project.org).
15 | * Keep this tracker in ENGLISH. If you want support in your language, the [community forum](https://forum.glpi-project.org) is the best place.
16 | * Always try to reproduce your issue at least on latest stable release.
17 |
18 | The GLPI team.
19 | - type: markdown
20 | attributes:
21 | value: |
22 | ## Professional Support
23 |
24 | We do not guarantee any processing / resolution time for community issues.
25 |
26 | If you need a quick fix or any guarantee, you should consider to buy a GLPI Network Subscription.
27 |
28 | More information here: https://glpi-project.org/subscriptions/
29 | - type: checkboxes
30 | id: terms
31 | attributes:
32 | label: Code of Conduct
33 | description: By submitting this issue, you agree to follow hereinabove rules and [Contribution guide](https://github.com/glpi-project/glpi/blob/main/CONTRIBUTING.md)
34 | options:
35 | - label: I agree to follow this project's Code of Conduct
36 | validations:
37 | required: true
38 | - type: checkboxes
39 | attributes:
40 | label: Is there an existing issue for this?
41 | description: Please search to see if an issue already exists for the bug you encountered.
42 | options:
43 | - label: I have searched the existing issues
44 | validations:
45 | required: true
46 | - type: input
47 | id: glpi-version
48 | attributes:
49 | label: GLPI Version
50 | description: What version of our GLPI are you running?
51 | validations:
52 | required: true
53 | - type: input
54 | id: plugin-version
55 | attributes:
56 | label: Plugin version
57 | description: What version of `metabase` are you running?
58 | validations:
59 | required: true
60 | - type: textarea
61 | attributes:
62 | label: Bug description
63 | description: A concise description of the problem you are experiencing and what you expected to happen.
64 | validations:
65 | required: false
66 | - type: textarea
67 | id: logs
68 | attributes:
69 | label: Relevant log output
70 | description: |
71 | Please copy and paste any relevant log output. Find them in `*-error.log` files under `glpi/files/_log/`.
72 |
73 | Tip: You can attach images or log files by clicking this area to highlight it and then dragging files in.
74 | render: shell
75 | - type: input
76 | id: url
77 | attributes:
78 | label: Page URL
79 | description: If applicable, page URL where the bug happens.
80 | validations:
81 | required: false
82 | - type: textarea
83 | attributes:
84 | label: Steps To reproduce
85 | description: Steps to reproduce the behavior.
86 | placeholder: |
87 | 1. With this config...
88 | 2. Go to...
89 | 3. Scroll down to...
90 | 4. See error...
91 | validations:
92 | required: false
93 | - type: textarea
94 | attributes:
95 | label: Your GLPI setup information
96 | description: Please copy and paste information you will find in GLPI in `Setup > General` menu, `System` tab.
97 | validations:
98 | required: false
99 | - type: textarea
100 | attributes:
101 | label: Anything else?
102 | description: Add any other context about the problem here.
103 | validations:
104 | required: false
105 |
--------------------------------------------------------------------------------
/.github/ISSUE_TEMPLATE/config.yml:
--------------------------------------------------------------------------------
1 | blank_issues_enabled: false
2 | contact_links:
3 | - name: "GLPI professional support"
4 | url: "https://services.glpi-network.com"
5 | about: "Get professional support from the editor and a network of local partners."
6 | - name: "Find an official partner"
7 | url: "https://glpi-project.org/partners/"
8 | about: "Get support to deploy GLPI in a professional manner."
9 | - name: "GLPI Community Forum"
10 | url: "https://forum.glpi-project.org"
11 | about: "Ask questions and get help from the community."
12 |
--------------------------------------------------------------------------------
/.github/dependabot.yml:
--------------------------------------------------------------------------------
1 | version: 2
2 | updates:
3 | # Ensure GitHub Actions are used in their latest version
4 | - package-ecosystem: "github-actions"
5 | directory: "/"
6 | schedule:
7 | interval: "monthly"
8 |
9 | # Strategy for composer dependencies
10 | - package-ecosystem: "composer"
11 | directory: "/"
12 | schedule:
13 | interval: "monthly"
14 | allow:
15 | - dependency-type: "direct"
16 | open-pull-requests-limit: 100
17 | versioning-strategy: "increase"
18 | groups:
19 | dev-dependencies:
20 | dependency-type: "development"
21 |
--------------------------------------------------------------------------------
/.github/label-commenter-config.yml:
--------------------------------------------------------------------------------
1 | labels:
2 | - name: "invalid"
3 | labeled:
4 | issue:
5 | body: |
6 | This issue has been closed because you did not provide the requested information.
7 | action: "close"
8 | - name: "support"
9 | labeled:
10 | issue:
11 | body: |
12 | This issue has been closed as we only track bugs here.
13 |
14 | You can get community support on [forums](https://forum.glpi-project.org/) or you can consider [taking a subscription](https://glpi-project.org/subscriptions/) to get professional support.
15 | You can also [contact GLPI editor team](https://portal.glpi-network.com/contact-us) directly.
16 | action: close
17 | - name: "feature suggestion"
18 | labeled:
19 | issue:
20 | body: |
21 | This issue has been closed as we only track bugs here.
22 |
23 | You can open a topic to discuss with community about this enhancement on [suggestion website](https://glpi.userecho.com/).
24 | You can also [contact GLPI editor team](https://portal.glpi-network.com/contact-us) directly if you are willing to sponsor this feature.
25 | action: close
26 |
--------------------------------------------------------------------------------
/.github/pull_request_template.md:
--------------------------------------------------------------------------------
1 | ## Checklist before requesting a review
2 |
3 | *Please delete options that are not relevant.*
4 |
5 | - [ ] I have performed a self-review of my code.
6 | - [ ] I have added tests (when available) that prove my fix is effective or that my feature works.
7 | - [ ] This change requires a documentation update.
8 |
9 | ## Description
10 |
11 | - It fixes # (issue number, if applicable)
12 | - Here is a brief description of what this PR does
13 |
14 | ## Screenshots (if appropriate):
15 |
16 |
--------------------------------------------------------------------------------
/.github/workflows/auto-tag-new-version.yml:
--------------------------------------------------------------------------------
1 | name: "Automatically tag new version"
2 |
3 | on:
4 | push:
5 | branches:
6 | - "main"
7 | paths:
8 | - "setup.php"
9 |
10 | jobs:
11 | auto-tag-new-version:
12 | name: "Automatically tag new version"
13 | uses: "glpi-project/plugin-release-workflows/.github/workflows/auto-tag-new-version.yml@v1"
14 | secrets:
15 | github-token: "${{ secrets.AUTOTAG_TOKEN }}"
16 |
--------------------------------------------------------------------------------
/.github/workflows/close_stale_issue.yml:
--------------------------------------------------------------------------------
1 | name: 'Close stale issues'
2 | on:
3 | schedule:
4 | - cron: '0 8 * * *'
5 |
6 | jobs:
7 | stale:
8 | if: github.repository == 'pluginsGLPI/metabase'
9 | permissions:
10 | issues: write # for actions/stale to close stale issues
11 | runs-on: ubuntu-latest
12 | steps:
13 | - uses: actions/stale@v9
14 | with:
15 | stale-issue-message: >-
16 | There has been no activity on this issue for some time and therefore it is considered stale
17 | and will be closed automatically in 10 days.
18 |
19 |
20 | If this issue is related to a bug, please try to reproduce on latest release. If the problem persist,
21 | feel free to add a comment to revive this issue.
22 |
23 | If it is related to a new feature, please open a topic to discuss with community about this enhancement
24 | on [suggestion website](https://glpi.userecho.com/).
25 |
26 |
27 | You may also consider taking a [subscription](https://glpi-project.org/subscriptions/) to get professionnal
28 | support or [contact GLPI editor team](https://portal.glpi-network.com/contact-us) directly.
29 | days-before-issue-stale: 15
30 | days-before-pr-stale: -1 # PR will be marked as stale manually.
31 | days-before-close: 5
32 | exempt-issue-labels: "bug,enhancement,question,security" # Issues with "bug", "enhancement", "question" or "security" labels will not be marked as stale
33 | exempt-all-milestones: true # Do not check issues/PR with defined milestone.
34 | ascending: true # First check older issues/PR.
35 | operations-per-run: 750 # Max API calls per run.
36 |
--------------------------------------------------------------------------------
/.github/workflows/continuous-integration.yml:
--------------------------------------------------------------------------------
1 | name: "Continuous integration"
2 |
3 | on:
4 | push:
5 | branches:
6 | - "main"
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: "10.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: "metabase"
33 | glpi-version: "${{ matrix.glpi-version }}"
34 | php-version: "${{ matrix.php-version }}"
35 | db-image: "${{ matrix.db-image }}"
36 |
--------------------------------------------------------------------------------
/.github/workflows/label-commenter.yml:
--------------------------------------------------------------------------------
1 | name: "Label commenter"
2 |
3 | on:
4 | issues:
5 | types:
6 | - "labeled"
7 | - "unlabeled"
8 |
9 | jobs:
10 | comment:
11 | permissions:
12 | contents: "read"
13 | issues: "write"
14 | runs-on: "ubuntu-latest"
15 | steps:
16 | - name: "Checkout"
17 | uses: "actions/checkout@v4"
18 |
19 | - name: "Label commenter"
20 | uses: "peaceiris/actions-label-commenter@v1"
21 |
--------------------------------------------------------------------------------
/.github/workflows/locales-sync.yml:
--------------------------------------------------------------------------------
1 | name: "Synchronize locales"
2 |
3 | on:
4 | schedule:
5 | - cron: "0 0 * * 1-5"
6 | workflow_dispatch:
7 |
8 | jobs:
9 | sync-with-transifex:
10 | name: "Sync with transifex"
11 | uses: "glpi-project/plugin-translation-workflows/.github/workflows/transifex-sync.yml@v1"
12 | secrets:
13 | github-token: "${{ secrets.LOCALES_SYNC_TOKEN }}"
14 | transifex-token: "${{ secrets.TRANSIFEX_TOKEN }}"
15 |
--------------------------------------------------------------------------------
/.github/workflows/locales-update-source.yml:
--------------------------------------------------------------------------------
1 | name: "Update locales sources"
2 |
3 | on:
4 | push:
5 | branches:
6 | - "main"
7 |
8 | jobs:
9 | push-on-transifex:
10 | name: "Push locales sources"
11 | uses: "glpi-project/plugin-translation-workflows/.github/workflows/transifex-push-sources.yml@v1"
12 | secrets:
13 | transifex-token: "${{ secrets.TRANSIFEX_TOKEN }}"
14 |
--------------------------------------------------------------------------------
/.github/workflows/release.yml:
--------------------------------------------------------------------------------
1 | name: "Publish release"
2 |
3 | on:
4 | push:
5 | tags:
6 | - '*'
7 |
8 | jobs:
9 | publish-release:
10 | permissions:
11 | contents: "write"
12 | name: "Publish release"
13 | uses: "glpi-project/plugin-release-workflows/.github/workflows/publish-release.yml@v1"
14 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | dist/
2 | vendor/
3 | .gh_token
4 | *.min.*
5 |
6 |
--------------------------------------------------------------------------------
/.php-cs-fixer.php:
--------------------------------------------------------------------------------
1 | in(__DIR__)
8 | ->name('*.php');
9 |
10 | $config = new Config();
11 |
12 | $rules = [
13 | '@PER-CS2.0' => true,
14 | 'trailing_comma_in_multiline' => ['elements' => ['arguments', 'array_destructuring', 'arrays']], // For PHP 7.4 compatibility
15 | ];
16 |
17 | return $config
18 | ->setRules($rules)
19 | ->setFinder($finder)
20 | ->setUsingCache(false);
21 |
--------------------------------------------------------------------------------
/.phpcs.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | .
4 | /.git/
5 | ^vendor/
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
--------------------------------------------------------------------------------
/.tx/config:
--------------------------------------------------------------------------------
1 | [main]
2 | host = https://www.transifex.com
3 |
4 | [o:teclib:p:glpi-project-plugin-metabase:r:metabase-pot]
5 | file_filter = locales/.po
6 | source_file = locales/metabase.pot
7 | source_lang = en
8 | type = PO
9 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | GNU GENERAL PUBLIC LICENSE
2 | Version 2, June 1991
3 |
4 | Copyright (C) 1989, 1991 Free Software Foundation, Inc.,
5 | 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
6 | Everyone is permitted to copy and distribute verbatim copies
7 | of this license document, but changing it is not allowed.
8 |
9 | Preamble
10 |
11 | The licenses for most software are designed to take away your
12 | freedom to share and change it. By contrast, the GNU General Public
13 | License is intended to guarantee your freedom to share and change free
14 | software--to make sure the software is free for all its users. This
15 | General Public License applies to most of the Free Software
16 | Foundation's software and to any other program whose authors commit to
17 | using it. (Some other Free Software Foundation software is covered by
18 | the GNU Lesser General Public License instead.) You can apply it to
19 | your programs, too.
20 |
21 | When we speak of free software, we are referring to freedom, not
22 | price. Our General Public Licenses are designed to make sure that you
23 | have the freedom to distribute copies of free software (and charge for
24 | this service if you wish), that you receive source code or can get it
25 | if you want it, that you can change the software or use pieces of it
26 | in new free programs; and that you know you can do these things.
27 |
28 | To protect your rights, we need to make restrictions that forbid
29 | anyone to deny you these rights or to ask you to surrender the rights.
30 | These restrictions translate to certain responsibilities for you if you
31 | distribute copies of the software, or if you modify it.
32 |
33 | For example, if you distribute copies of such a program, whether
34 | gratis or for a fee, you must give the recipients all the rights that
35 | you have. You must make sure that they, too, receive or can get the
36 | source code. And you must show them these terms so they know their
37 | rights.
38 |
39 | We protect your rights with two steps: (1) copyright the software, and
40 | (2) offer you this license which gives you legal permission to copy,
41 | distribute and/or modify the software.
42 |
43 | Also, for each author's protection and ours, we want to make certain
44 | that everyone understands that there is no warranty for this free
45 | software. If the software is modified by someone else and passed on, we
46 | want its recipients to know that what they have is not the original, so
47 | that any problems introduced by others will not reflect on the original
48 | authors' reputations.
49 |
50 | Finally, any free program is threatened constantly by software
51 | patents. We wish to avoid the danger that redistributors of a free
52 | program will individually obtain patent licenses, in effect making the
53 | program proprietary. To prevent this, we have made it clear that any
54 | patent must be licensed for everyone's free use or not licensed at all.
55 |
56 | The precise terms and conditions for copying, distribution and
57 | modification follow.
58 |
59 | GNU GENERAL PUBLIC LICENSE
60 | TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
61 |
62 | 0. This License applies to any program or other work which contains
63 | a notice placed by the copyright holder saying it may be distributed
64 | under the terms of this General Public License. The "Program", below,
65 | refers to any such program or work, and a "work based on the Program"
66 | means either the Program or any derivative work under copyright law:
67 | that is to say, a work containing the Program or a portion of it,
68 | either verbatim or with modifications and/or translated into another
69 | language. (Hereinafter, translation is included without limitation in
70 | the term "modification".) Each licensee is addressed as "you".
71 |
72 | Activities other than copying, distribution and modification are not
73 | covered by this License; they are outside its scope. The act of
74 | running the Program is not restricted, and the output from the Program
75 | is covered only if its contents constitute a work based on the
76 | Program (independent of having been made by running the Program).
77 | Whether that is true depends on what the Program does.
78 |
79 | 1. You may copy and distribute verbatim copies of the Program's
80 | source code as you receive it, in any medium, provided that you
81 | conspicuously and appropriately publish on each copy an appropriate
82 | copyright notice and disclaimer of warranty; keep intact all the
83 | notices that refer to this License and to the absence of any warranty;
84 | and give any other recipients of the Program a copy of this License
85 | along with the Program.
86 |
87 | You may charge a fee for the physical act of transferring a copy, and
88 | you may at your option offer warranty protection in exchange for a fee.
89 |
90 | 2. You may modify your copy or copies of the Program or any portion
91 | of it, thus forming a work based on the Program, and copy and
92 | distribute such modifications or work under the terms of Section 1
93 | above, provided that you also meet all of these conditions:
94 |
95 | a) You must cause the modified files to carry prominent notices
96 | stating that you changed the files and the date of any change.
97 |
98 | b) You must cause any work that you distribute or publish, that in
99 | whole or in part contains or is derived from the Program or any
100 | part thereof, to be licensed as a whole at no charge to all third
101 | parties under the terms of this License.
102 |
103 | c) If the modified program normally reads commands interactively
104 | when run, you must cause it, when started running for such
105 | interactive use in the most ordinary way, to print or display an
106 | announcement including an appropriate copyright notice and a
107 | notice that there is no warranty (or else, saying that you provide
108 | a warranty) and that users may redistribute the program under
109 | these conditions, and telling the user how to view a copy of this
110 | License. (Exception: if the Program itself is interactive but
111 | does not normally print such an announcement, your work based on
112 | the Program is not required to print an announcement.)
113 |
114 | These requirements apply to the modified work as a whole. If
115 | identifiable sections of that work are not derived from the Program,
116 | and can be reasonably considered independent and separate works in
117 | themselves, then this License, and its terms, do not apply to those
118 | sections when you distribute them as separate works. But when you
119 | distribute the same sections as part of a whole which is a work based
120 | on the Program, the distribution of the whole must be on the terms of
121 | this License, whose permissions for other licensees extend to the
122 | entire whole, and thus to each and every part regardless of who wrote it.
123 |
124 | Thus, it is not the intent of this section to claim rights or contest
125 | your rights to work written entirely by you; rather, the intent is to
126 | exercise the right to control the distribution of derivative or
127 | collective works based on the Program.
128 |
129 | In addition, mere aggregation of another work not based on the Program
130 | with the Program (or with a work based on the Program) on a volume of
131 | a storage or distribution medium does not bring the other work under
132 | the scope of this License.
133 |
134 | 3. You may copy and distribute the Program (or a work based on it,
135 | under Section 2) in object code or executable form under the terms of
136 | Sections 1 and 2 above provided that you also do one of the following:
137 |
138 | a) Accompany it with the complete corresponding machine-readable
139 | source code, which must be distributed under the terms of Sections
140 | 1 and 2 above on a medium customarily used for software interchange; or,
141 |
142 | b) Accompany it with a written offer, valid for at least three
143 | years, to give any third party, for a charge no more than your
144 | cost of physically performing source distribution, a complete
145 | machine-readable copy of the corresponding source code, to be
146 | distributed under the terms of Sections 1 and 2 above on a medium
147 | customarily used for software interchange; or,
148 |
149 | c) Accompany it with the information you received as to the offer
150 | to distribute corresponding source code. (This alternative is
151 | allowed only for noncommercial distribution and only if you
152 | received the program in object code or executable form with such
153 | an offer, in accord with Subsection b above.)
154 |
155 | The source code for a work means the preferred form of the work for
156 | making modifications to it. For an executable work, complete source
157 | code means all the source code for all modules it contains, plus any
158 | associated interface definition files, plus the scripts used to
159 | control compilation and installation of the executable. However, as a
160 | special exception, the source code distributed need not include
161 | anything that is normally distributed (in either source or binary
162 | form) with the major components (compiler, kernel, and so on) of the
163 | operating system on which the executable runs, unless that component
164 | itself accompanies the executable.
165 |
166 | If distribution of executable or object code is made by offering
167 | access to copy from a designated place, then offering equivalent
168 | access to copy the source code from the same place counts as
169 | distribution of the source code, even though third parties are not
170 | compelled to copy the source along with the object code.
171 |
172 | 4. You may not copy, modify, sublicense, or distribute the Program
173 | except as expressly provided under this License. Any attempt
174 | otherwise to copy, modify, sublicense or distribute the Program is
175 | void, and will automatically terminate your rights under this License.
176 | However, parties who have received copies, or rights, from you under
177 | this License will not have their licenses terminated so long as such
178 | parties remain in full compliance.
179 |
180 | 5. You are not required to accept this License, since you have not
181 | signed it. However, nothing else grants you permission to modify or
182 | distribute the Program or its derivative works. These actions are
183 | prohibited by law if you do not accept this License. Therefore, by
184 | modifying or distributing the Program (or any work based on the
185 | Program), you indicate your acceptance of this License to do so, and
186 | all its terms and conditions for copying, distributing or modifying
187 | the Program or works based on it.
188 |
189 | 6. Each time you redistribute the Program (or any work based on the
190 | Program), the recipient automatically receives a license from the
191 | original licensor to copy, distribute or modify the Program subject to
192 | these terms and conditions. You may not impose any further
193 | restrictions on the recipients' exercise of the rights granted herein.
194 | You are not responsible for enforcing compliance by third parties to
195 | this License.
196 |
197 | 7. If, as a consequence of a court judgment or allegation of patent
198 | infringement or for any other reason (not limited to patent issues),
199 | conditions are imposed on you (whether by court order, agreement or
200 | otherwise) that contradict the conditions of this License, they do not
201 | excuse you from the conditions of this License. If you cannot
202 | distribute so as to satisfy simultaneously your obligations under this
203 | License and any other pertinent obligations, then as a consequence you
204 | may not distribute the Program at all. For example, if a patent
205 | license would not permit royalty-free redistribution of the Program by
206 | all those who receive copies directly or indirectly through you, then
207 | the only way you could satisfy both it and this License would be to
208 | refrain entirely from distribution of the Program.
209 |
210 | If any portion of this section is held invalid or unenforceable under
211 | any particular circumstance, the balance of the section is intended to
212 | apply and the section as a whole is intended to apply in other
213 | circumstances.
214 |
215 | It is not the purpose of this section to induce you to infringe any
216 | patents or other property right claims or to contest validity of any
217 | such claims; this section has the sole purpose of protecting the
218 | integrity of the free software distribution system, which is
219 | implemented by public license practices. Many people have made
220 | generous contributions to the wide range of software distributed
221 | through that system in reliance on consistent application of that
222 | system; it is up to the author/donor to decide if he or she is willing
223 | to distribute software through any other system and a licensee cannot
224 | impose that choice.
225 |
226 | This section is intended to make thoroughly clear what is believed to
227 | be a consequence of the rest of this License.
228 |
229 | 8. If the distribution and/or use of the Program is restricted in
230 | certain countries either by patents or by copyrighted interfaces, the
231 | original copyright holder who places the Program under this License
232 | may add an explicit geographical distribution limitation excluding
233 | those countries, so that distribution is permitted only in or among
234 | countries not thus excluded. In such case, this License incorporates
235 | the limitation as if written in the body of this License.
236 |
237 | 9. The Free Software Foundation may publish revised and/or new versions
238 | of the General Public License from time to time. Such new versions will
239 | be similar in spirit to the present version, but may differ in detail to
240 | address new problems or concerns.
241 |
242 | Each version is given a distinguishing version number. If the Program
243 | specifies a version number of this License which applies to it and "any
244 | later version", you have the option of following the terms and conditions
245 | either of that version or of any later version published by the Free
246 | Software Foundation. If the Program does not specify a version number of
247 | this License, you may choose any version ever published by the Free Software
248 | Foundation.
249 |
250 | 10. If you wish to incorporate parts of the Program into other free
251 | programs whose distribution conditions are different, write to the author
252 | to ask for permission. For software which is copyrighted by the Free
253 | Software Foundation, write to the Free Software Foundation; we sometimes
254 | make exceptions for this. Our decision will be guided by the two goals
255 | of preserving the free status of all derivatives of our free software and
256 | of promoting the sharing and reuse of software generally.
257 |
258 | NO WARRANTY
259 |
260 | 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
261 | FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
262 | OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
263 | PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
264 | OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
265 | MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
266 | TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
267 | PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
268 | REPAIR OR CORRECTION.
269 |
270 | 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
271 | WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
272 | REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
273 | INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
274 | OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
275 | TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
276 | YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
277 | PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
278 | POSSIBILITY OF SUCH DAMAGES.
279 |
280 | END OF TERMS AND CONDITIONS
281 |
282 | How to Apply These Terms to Your New Programs
283 |
284 | If you develop a new program, and you want it to be of the greatest
285 | possible use to the public, the best way to achieve this is to make it
286 | free software which everyone can redistribute and change under these terms.
287 |
288 | To do so, attach the following notices to the program. It is safest
289 | to attach them to the start of each source file to most effectively
290 | convey the exclusion of warranty; and each file should have at least
291 | the "copyright" line and a pointer to where the full notice is found.
292 |
293 |
294 | Copyright (C)
295 |
296 | This program is free software; you can redistribute it and/or modify
297 | it under the terms of the GNU General Public License as published by
298 | the Free Software Foundation; either version 2 of the License, or
299 | (at your option) any later version.
300 |
301 | This program is distributed in the hope that it will be useful,
302 | but WITHOUT ANY WARRANTY; without even the implied warranty of
303 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
304 | GNU General Public License for more details.
305 |
306 | You should have received a copy of the GNU General Public License along
307 | with this program; if not, write to the Free Software Foundation, Inc.,
308 | 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
309 |
310 | Also add information on how to contact you by electronic and paper mail.
311 |
312 | If the program is interactive, make it output a short notice like this
313 | when it starts in an interactive mode:
314 |
315 | Gnomovision version 69, Copyright (C) year name of author
316 | Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
317 | This is free software, and you are welcome to redistribute it
318 | under certain conditions; type `show c' for details.
319 |
320 | The hypothetical commands `show w' and `show c' should show the appropriate
321 | parts of the General Public License. Of course, the commands you use may
322 | be called something other than `show w' and `show c'; they could even be
323 | mouse-clicks or menu items--whatever suits your program.
324 |
325 | You should also get your employer (if you work as a programmer) or your
326 | school, if any, to sign a "copyright disclaimer" for the program, if
327 | necessary. Here is a sample; alter the names:
328 |
329 | Yoyodyne, Inc., hereby disclaims all copyright interest in the program
330 | `Gnomovision' (which makes passes at compilers) written by James Hacker.
331 |
332 | , 1 April 1989
333 | Ty Coon, President of Vice
334 |
335 | This General Public License does not permit incorporating your program into
336 | proprietary programs. If your program is a subroutine library, you may
337 | consider it more useful to permit linking proprietary applications with the
338 | library. If this is what you want to do, use the GNU Lesser General
339 | Public License instead of this License.
340 |
--------------------------------------------------------------------------------
/Readme.md:
--------------------------------------------------------------------------------
1 | # Plugin GLPI for metabase integration
2 |
3 | 
4 |
5 | This plugin eases integration of GLPI with [Metabase](https://www.metabase.com/).
6 | It currently permits to:
7 | - [X] Connect to Metabase API.
8 | - [X] Push database configuration or use existing configured db in Metabase.
9 | - [X] Push GLPI foreign keys in Metabase datamodel
10 | - [X] Push GLPI enumeration (tickets impacts/urgency/priority/types) in Metabase datamodel
11 | - [X] Push questions, collections and dashboards (if exists).
12 | - [X] Integrate Metabase dashboards into GLPI (on Central).
13 | - [X] Profiles management (dashboards publication)
14 | - [X] import existing questions/dashboards/collection from metabase and save them as json
15 | - [ ] Check sync status
16 |
17 | [Teclib'](http://www.teclib-group.com/) provides with [GLPI Network](https://services.glpi-network.com/) distribution, additional services like support for installation, questions and dashboards conception.
18 |
19 | **[Contact Teclib'](https://services.glpi-network.com/)** for more information.
20 |
21 | ---
22 |
23 | Also, you can help us translate the plugin on [Transifex service](https://www.transifex.com/teclib/glpi-plugin-metabase/).
24 |
25 | ## Installation
26 |
27 | The plugin requires a existing instance of [Metabase](https://www.metabase.com/start/) even without database setup (but with an existing admin user).
28 |
29 | Install the glpi plugin as usual, and in plugin configuration (Setup > General, metabase tab), follow the process:
30 |
31 | - Setup host and credentials.
32 | - Choose (or create from glpi) a database.
33 | - Generate datemodel.
34 | - Push question and dashboards.
35 |
36 | ## Screenshots
37 |
38 | ### Teclib Questions and Dashboards
39 |
40 | 
41 | 
42 |
43 | ### Configuration in Setup > General
44 |
45 | 
46 |
47 | ### Display dashboards in central page
48 |
49 | 
50 |
--------------------------------------------------------------------------------
/SECURITY.md:
--------------------------------------------------------------------------------
1 | # Security Policy
2 |
3 | **⚠️ Please never use standard issues to report security problems; vulnerabilities are published once a fix release is available. ⚠️**
4 |
5 | ## Reporting a Vulnerability
6 |
7 | If you found a security issue, please contact us by:
8 |
9 | - [our huntr page](https://huntr.dev/repos/pluginsGLPI/metabase/)
10 | - a mail to \[glpi-security AT ow2.org\]
11 |
12 | You should provide us all details about the issue and the way to reproduce it.
13 | You may also provide a script that can be used to check the issue exists.
14 |
15 | Once the report will be handled, and if the issue is not yet fixed (or in progress)
16 | we'll add it to the GitHub security tab, and add you as observer. Meanwhile,
17 | you will reserve a CVE for the issue.
18 |
19 | Thank you for improving the security of GLPI and its plugins.
20 |
21 | ## Supported Versions
22 |
23 | We follow the same version support policy as GLPI.
24 | This means that we provide security patches to versions of the plugin that target a version of GLPI itself maintained from a security point of view.
25 |
--------------------------------------------------------------------------------
/ajax/extract_json.php:
--------------------------------------------------------------------------------
1 | .
24 | * -------------------------------------------------------------------------
25 | * @copyright Copyright (C) 2018-2023 by Metabase plugin team.
26 | * @license GPLv2 https://www.gnu.org/licenses/gpl-2.0.html
27 | * @link https://github.com/pluginsGLPI/metabase
28 | * -------------------------------------------------------------------------
29 | */
30 |
31 | include('../../../inc/includes.php');
32 |
33 | header('Content-Type: text/html; charset=UTF-8');
34 | Html::header_nocache();
35 | Session::checkLoginUser();
36 |
37 | if (
38 | !isset($_REQUEST['id'])
39 | || !isset($_REQUEST['type'])
40 | ) {
41 | exit;
42 | }
43 |
44 | switch ($_REQUEST['type']) {
45 | case 'question':
46 | PluginMetabaseConfig::displayQuestionJson((int) $_REQUEST['id']);
47 | break;
48 | case 'dashboard':
49 | PluginMetabaseConfig::displayDashboardJson((int) $_REQUEST['id']);
50 | break;
51 | }
52 |
--------------------------------------------------------------------------------
/composer.json:
--------------------------------------------------------------------------------
1 | {
2 | "require": {
3 | "php": ">=7.4",
4 | "lcobucci/jwt": "^4.2"
5 | },
6 | "require-dev": {
7 | "friendsofphp/php-cs-fixer": "^3.75",
8 | "glpi-project/tools": "^0.7.5",
9 | "php-parallel-lint/php-parallel-lint": "^1.4",
10 | "phpstan/extension-installer": "^1.4",
11 | "phpstan/phpstan": "^2.1",
12 | "phpstan/phpstan-deprecation-rules": "^2.0"
13 | },
14 | "provide": {
15 | "guzzlehttp/guzzle": "*",
16 | "ext-sodium": "*"
17 | },
18 | "config": {
19 | "optimize-autoloader": true,
20 | "platform": {
21 | "php": "7.4.0"
22 | },
23 | "sort-packages": true,
24 | "allow-plugins": {
25 | "phpstan/extension-installer": true
26 | }
27 | }
28 | }
29 |
--------------------------------------------------------------------------------
/dashboards/readme.md:
--------------------------------------------------------------------------------
1 | # Dashboards directory.
2 |
3 | Place here json files you want to push to metabase.
4 | This folder can contains sub folders, the plugin will parse json files recursively.
5 |
6 | For json file format, prepare your dashboards directly into metabase gui, and use extract process (from Setup > General menu) to store them here.
7 |
--------------------------------------------------------------------------------
/front/collections.php:
--------------------------------------------------------------------------------
1 | .
24 | * -------------------------------------------------------------------------
25 | * @copyright Copyright (C) 2018-2023 by Metabase plugin team.
26 | * @license GPLv2 https://www.gnu.org/licenses/gpl-2.0.html
27 | * @link https://github.com/pluginsGLPI/metabase
28 | * -------------------------------------------------------------------------
29 | */
30 |
31 | include('../../../inc/includes.php');
32 |
33 | Html::header(
34 | __('Metabase collections', 'metabase'),
35 | $_SERVER['PHP_SELF'],
36 | 'config',
37 | 'config',
38 | 'collections',
39 | );
40 |
41 | Session::checkRight('config', READ);
42 |
43 | echo '
';
44 | echo '
' . __('Reports and dashboards specifications', 'metabase') . '