├── .github └── workflows │ ├── generatemo.yml │ ├── release.yml │ └── updatepot.yml ├── ISSUE_TEMPLATE.md ├── LICENSE ├── README.md ├── ajax ├── addnewvalue.php ├── dropdownCommandValue.php ├── dropdownTrackingDeviceType.php ├── index.php └── shellcommand.exec.php ├── front ├── advanced_execution.php ├── commandgroup.form.php ├── commandgroup.php ├── commandgroup_item.form.php ├── index.php ├── massiveexec.php ├── menu.php ├── shellcommand.form.php ├── shellcommand.php ├── shellcommandpath.form.php └── shellcommandpath.php ├── hook.php ├── inc ├── advanced_execution.class.php ├── commandgroup.class.php ├── commandgroup_item.class.php ├── index.php ├── menu.class.php ├── profile.class.php ├── shellcommand.class.php ├── shellcommand_item.class.php ├── shellcommandpath.class.php └── webservice.class.php ├── index.php ├── locales ├── cs_CZ.mo ├── cs_CZ.po ├── de_DE.mo ├── de_DE.po ├── en_GB.mo ├── en_GB.po ├── es_EC.po ├── es_ES.mo ├── es_ES.po ├── fr_FR.mo ├── fr_FR.po ├── glpi.pot ├── pl_PL.mo ├── pl_PL.po ├── pt_BR.mo ├── pt_BR.po ├── ro_RO.mo ├── ro_RO.po ├── ru_RU.mo ├── ru_RU.po ├── tr_TR.mo └── tr_TR.po ├── pics └── large-loading.gif ├── setup.php ├── shellcommands.css ├── shellcommands.js ├── shellcommands.png ├── shellcommands.xml ├── sql ├── empty-1.0.sql ├── empty-1.1.sql ├── empty-1.2.0.sql ├── empty-1.3.0.sql ├── empty-1.7.0.sql ├── empty-2.2.0.sql ├── empty-4.0.0.sql ├── update-1.1.sql ├── update-1.2.0.sql ├── update-1.3.0.sql └── update-1.7.0.sql └── tools ├── extract_template.sh ├── update_mo.pl └── update_po.pl /.github/workflows/generatemo.yml: -------------------------------------------------------------------------------- 1 | name: Generate MO 2 | on: 3 | push: 4 | branches: [ master ] 5 | paths: 6 | - '**.po' 7 | env: 8 | GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} 9 | jobs: 10 | run: 11 | 12 | name: Generate mo 13 | runs-on: ubuntu-latest 14 | steps: 15 | - name: Checkout repo 16 | uses: actions/checkout@v2 17 | 18 | - name: Setup Perl environment 19 | # You may pin to the exact commit or the version. 20 | # uses: shogo82148/actions-setup-perl@8d2e3d59a9516b785ed32169d48a4888eaa9b514 21 | uses: shogo82148/actions-setup-perl@v1.7.2 22 | - name: msgfmt 23 | # You may pin to the exact commit or the version. 24 | # uses: whtsky/msgfmt-action@6b2181f051b002182d01a1e1f1aff216230c5a4d 25 | uses: whtsky/msgfmt-action@20190305 26 | - name: Generate mo 27 | run: perl tools/update_mo.pl; 28 | 29 | - name: Commit changes 30 | uses: EndBug/add-and-commit@v5.1.0 31 | with: 32 | 33 | message: "Generate mo" 34 | - name: Push changes 35 | 36 | uses: actions-go/push@v1 37 | 38 | -------------------------------------------------------------------------------- /.github/workflows/release.yml: -------------------------------------------------------------------------------- 1 | 2 | on: 3 | push: 4 | # Sequence of patterns matched against refs/tags 5 | tags: 6 | - '*.*.*' # Push events to matching ex:20.15.10 7 | 8 | name: Create release with tag 9 | env: 10 | TAG_VALUE: ${GITHUB_REF/refs\/tags\//} 11 | jobs: 12 | build: 13 | name: Upload Release Asset 14 | runs-on: ubuntu-latest 15 | steps: 16 | - name: Checkout code 17 | uses: actions/checkout@v2 18 | - name: Build project # This would actually build your project, using zip for an example artifact 19 | id: build_ 20 | env: 21 | GITHUB_NAME: ${{ github.event.repository.name }} 22 | 23 | 24 | run: sudo apt-get install libxml-xpath-perl;echo $(xpath -e '/root/versions/version[num="'${GITHUB_REF/refs\/tags\//}'"]/compatibility/text()' $GITHUB_NAME.xml);echo ::set-output name=version_glpi::$(xpath -e '/root/versions/version[num="'${GITHUB_REF/refs\/tags\//}'"]/compatibility/text()' $GITHUB_NAME.xml); rm -rf $GITHUB_NAME.xml tools wiki screenshots test .git .github ISSUE_TEMPLATE.md TODO.txt $GITHUB_NAME.png;cd ..; tar jcvf glpi-$GITHUB_NAME-${GITHUB_REF/refs\/tags\//}.tar.bz2 $GITHUB_NAME;ls -al;echo ::set-output name=tag::${GITHUB_REF/refs\/tags\//};echo ${{ steps.getxml.outputs.info }}; 25 | # run: rm -rf $GITHUB_NAME.xml tools wiki screenshots test ISSUE_TEMPLATE.md TODO.txt $GITHUB_NAME.png; tar -zcvf glpi-$GITHUB_NAME-$GITHUB_TAG.tar.gz $GITHUB_NAME 26 | - name: Create Release 27 | id: create_release 28 | uses: actions/create-release@v1 29 | env: 30 | GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} 31 | with: 32 | tag_name: ${{ github.ref }} 33 | release_name: | 34 | GLPI ${{ steps.build_.outputs.version_glpi }} : Version ${{ github.ref }} disponible / available 35 | body : Version ${{ steps.build_.outputs.tag }} released for GLPI ${{ steps.build_.outputs.version_glpi }} 36 | draft: false 37 | prerelease: true 38 | - name: Upload Release Asset 39 | id: upload-release-asset 40 | uses: actions/upload-release-asset@v1 41 | env: 42 | GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} 43 | GITHUB_NAME: ${{ github.event.repository.name }} 44 | with: 45 | upload_url: ${{ steps.create_release.outputs.upload_url }} # This pulls from the CREATE RELEASE step above, referencing it's ID to get its outputs object, which include a `upload_url`. See this blog post for more info: https://jasonet.co/posts/new-features-of-github-actions/#passing-data-to-future-steps 46 | asset_path: /home/runner/work/${{ github.event.repository.name }}/glpi-${{ github.event.repository.name }}-${{ steps.build_.outputs.tag }}.tar.bz2 47 | asset_name: glpi-${{ github.event.repository.name }}-${{ steps.build_.outputs.tag }}.tar.bz2 48 | asset_content_type: application/zip 49 | 50 | -------------------------------------------------------------------------------- /.github/workflows/updatepot.yml: -------------------------------------------------------------------------------- 1 | name: Update POT 2 | on: 3 | push: 4 | branches: [ master ] 5 | paths-ignore: 6 | - 'locales/**' 7 | 8 | env: 9 | GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} 10 | jobs: 11 | run: 12 | 13 | name: Update POT 14 | 15 | runs-on: ubuntu-latest 16 | steps: 17 | - name: Checkout repo 18 | uses: actions/checkout@v2 19 | 20 | - name: install xgettext 21 | 22 | run: sudo apt-get install gettext; 23 | - name: Update POT 24 | run: sh tools/extract_template.sh; 25 | 26 | 27 | - name: Commit changes 28 | uses: EndBug/add-and-commit@v5.1.0 29 | with: 30 | message: "Update POT" 31 | - name: Push changes 32 | 33 | uses: actions-go/push@v1 34 | 35 | -------------------------------------------------------------------------------- /ISSUE_TEMPLATE.md: -------------------------------------------------------------------------------- 1 | Dear GLPi user. 2 | 3 | BEFORE SUBMITTING YOUR ISSUE, please make sure to read and follow these steps : 4 | 5 | * Verify that your question has not already been asked 6 | * Please use the below template. 7 | * Delete this text before submiting your issue. 8 | 9 | The Plugin team. 10 | 11 | ------------ 12 | * Version of the plugin : 13 | 14 | 15 | * Version of your GLPI : 16 | 17 | 18 | * Steps to reproduce (which actions have you made) : 19 | 20 | 21 | * Expected result : 22 | 23 | 24 | * Actual result : 25 | 26 | 27 | * URL of the page : 28 | 29 | 30 | * Screenshot of the problem (if pertinent) : 31 | 32 | -------------------------------------------------------------------------------- /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 | {description} 294 | Copyright (C) {year} {fullname} 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 | {signature of Ty Coon}, 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 | 341 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # shellcommands 2 | Plugin shellcommands pour GLPI 3 | 4 | Ce plugin a été archivé. Vous pouvez utiliser le plugin centreon https://github.com/pluginsGLPI/centreon à la place pour lancer des checks 5 | 6 | This plugin has been archived. You can use the centreon plugin https://github.com/pluginsGLPI/centreon instead to run checks 7 | -------------------------------------------------------------------------------- /ajax/addnewvalue.php: -------------------------------------------------------------------------------- 1 | . 27 | -------------------------------------------------------------------------- 28 | */ 29 | 30 | include('../../../inc/includes.php'); 31 | header("Content-Type: text/html; charset=UTF-8"); 32 | Html::header_nocache(); 33 | 34 | Session::checkLoginUser(); 35 | 36 | switch ($_POST['action']) { 37 | case 'add': 38 | PluginShellcommandsAdvanced_Execution::addNewValue($_POST['count']); 39 | break; 40 | } 41 | 42 | Html::ajaxFooter(); 43 | 44 | -------------------------------------------------------------------------------- /ajax/dropdownCommandValue.php: -------------------------------------------------------------------------------- 1 | . 27 | -------------------------------------------------------------------------- 28 | */ 29 | 30 | if (strpos($_SERVER['PHP_SELF'], "dropdownCommandValue.php")) { 31 | include('../../../inc/includes.php'); 32 | header("Content-Type: text/html; charset=UTF-8"); 33 | Html::header_nocache(); 34 | } 35 | 36 | if (!defined('GLPI_ROOT')) { 37 | die("Can not acces directly to this file"); 38 | } 39 | 40 | Session::checkLoginUser(); 41 | 42 | // No define value 43 | if (!isset($_POST['value'])) { 44 | $_POST['value'] = ''; 45 | } 46 | 47 | $tabValue = explode('-', $_POST['value']); 48 | $dbu = new DbUtils(); 49 | // Security 50 | if (!($item = $dbu->getItemForItemtype($_POST['itemtype'])) || sizeof($tabValue) < 2) { 51 | exit(); 52 | } 53 | 54 | $link = $tabValue[0]; 55 | $shellId = $tabValue[1]; 56 | 57 | $item->getFromDB($_POST['itemID']); 58 | $shell_item = $dbu->getItemForItemtype($_POST['command_type']); 59 | $shell_item->getFromDB($shellId); 60 | $foreign_key = $shell_item->getForeignKeyField(); 61 | 62 | $displaywith = false; 63 | 64 | if (isset($_POST['displaywith']) 65 | && is_array($_POST['displaywith']) 66 | && count($_POST['displaywith'])) { 67 | 68 | $displaywith = true; 69 | } 70 | 71 | // No define rand 72 | if (!isset($_POST['rand'])) { 73 | $_POST['rand'] = mt_rand(); 74 | } 75 | 76 | if (isset($_POST['condition']) && !empty($_POST['condition'])) { 77 | $_POST['condition'] = rawurldecode(stripslashes($_POST['condition'])); 78 | } 79 | 80 | if (!isset($_POST['emptylabel']) || $_POST['emptylabel'] == '') { 81 | $_POST['emptylabel'] = Dropdown::EMPTY_VALUE; 82 | } 83 | 84 | switch ($_POST['myname']) { 85 | case "command_name": 86 | // NAME 87 | if (strstr($link, '[NAME]')) { 88 | $tLink = str_replace("[NAME]", $item->getField('name'), $link); 89 | $shellExecute = "onClick='shellcommandsActions(\"" . PLUGIN_SHELLCOMMANDS_WEBDIR . "\", \"" . $_POST['toupdate'] . "\", 90 | " . json_encode(['id' => $shell_item->getID(), 91 | 'command_type' => $_POST['command_type'], 92 | 'itemID' => $_POST['itemID'], 93 | 'itemtype' => $_POST['itemtype'], 94 | 'value' => $tLink]) . ");'"; 95 | 96 | // DOMAIN 97 | } else if (strstr($link, '[ID]')) { 98 | $tLink = str_replace("[ID]", $item->getID(), $link); 99 | $shellExecute = "onClick='shellcommandsActions(\"" . PLUGIN_SHELLCOMMANDS_WEBDIR . "\", \"" . $_POST['toupdate'] . "\", 100 | " . json_encode(['id' => $shell_item->getID(), 101 | 'command_type' => $_POST['command_type'], 102 | 'itemID' => $_POST['itemID'], 103 | 'itemtype' => $_POST['itemtype'], 104 | 'value' => $tLink]) . ");'"; 105 | 106 | // DOMAIN 107 | } else if (strstr($link, '[DOMAIN]')) { 108 | if (isset($item->fields['domains_id'])) { 109 | $tLink = str_replace("[DOMAIN]", Dropdown::getDropdownName("glpi_domains", $item->getField('domains_id')), $link); 110 | $shellExecute = "onClick='shellcommandsActions(\"" . PLUGIN_SHELLCOMMANDS_WEBDIR . "\" , \"" . $_POST['toupdate'] . "\", 111 | " . json_encode(['id' => $shell_item->getID(), 112 | 'command_type' => $_POST['command_type'], 113 | 'itemID' => $_POST['itemID'], 114 | 'itemtype' => $_POST['itemtype'], 115 | 'value' => $tLink]) . ");'"; 116 | } 117 | 118 | // IP or MAC 119 | } else if (strstr($link, '[IP]') || strstr($link, '[MAC]')) { 120 | $ip = []; 121 | $mac = []; 122 | $resultSelectCommand[0] = Dropdown::EMPTY_VALUE; 123 | $ipCount = 0; 124 | $macCount = 0; 125 | 126 | // if ($_POST['searchText'] != $CFG_GLPI["ajax_wildcard"]) {// if search text is called (ajax dropdown) 127 | // $where = " AND `glpi_networkports`.`name` ".Search::makeTextSearch($_POST['searchText']); 128 | // } else { 129 | $where = ''; 130 | // } 131 | // 132 | // We search all ip and mac addresses 133 | $query2 = "SELECT `glpi_networkports`.*, `glpi_ipaddresses`.`name` as ip 134 | FROM `glpi_networkports` 135 | LEFT JOIN `glpi_networknames` 136 | ON (`glpi_networknames`.`items_id`=`glpi_networkports`.`id`) 137 | LEFT JOIN `glpi_ipaddresses` 138 | ON (`glpi_networknames`.`id`=`glpi_ipaddresses`.`items_id`) 139 | WHERE `glpi_networkports`.`items_id` = '" . $_POST['itemID'] . "' 140 | $where 141 | AND `glpi_networkports`.`itemtype` = '" . $item->getType() . "' 142 | ORDER BY `glpi_networkports`.`logical_number`"; 143 | 144 | $result2 = $DB->query($query2); 145 | 146 | if ($DB->numrows($result2) > 0) { 147 | while ($data2 = $DB->fetchArray($result2)) { 148 | if ((!empty($data2["ip"]) && $data2["ip"] != '0.0.0.0')) { 149 | if (!empty($data2["name"])) { 150 | $ip[$ipCount]['name'] = $data2["name"]; 151 | } else { 152 | $ip[$ipCount]['name'] = '(' . __('Network port') . ' ' . $data2["id"] . ')'; 153 | } 154 | $ip[$ipCount]['ip'] = $data2["ip"]; 155 | $ipCount++; 156 | } 157 | if (!empty($data2["mac"])) { 158 | if (!empty($data2["name"])) { 159 | $mac[$macCount]['name'] = $data2["name"]; 160 | } else { 161 | $mac[$macCount]['name'] = '(' . __('Network port') . ' ' . $data2["id"] . ')'; 162 | } 163 | $mac[$macCount]['mac'] = $data2["mac"]; 164 | $macCount++; 165 | } 166 | } 167 | } 168 | 169 | // Add IP internal switch 170 | if (strstr($link, '[IP]')) { 171 | if ($item->getType() == 'NetworkEquipment') { 172 | $shellExecute = "onClick='shellcommandsActions(\"" . PLUGIN_SHELLCOMMANDS_WEBDIR . "\", \"" . $_POST['toupdate'] . "\", 173 | " . json_encode(['id' => $shell_item->getID(), 174 | 'command_type' => $_POST['command_type'], 175 | 'itemID' => $_POST['itemID'], 176 | 'itemtype' => $_POST['itemtype'], 177 | 'value' => $item->getField('ip')]) . ");'"; 178 | } 179 | 180 | if ($ipCount > 0) { 181 | foreach ($ip as $key => $val) { 182 | $resultSelectCommand['IP-' . $shell_item->getId() . '-' . $val['ip'] . '-' . $key] = $val['ip'] . ' - ' . $val['name']; 183 | } 184 | } 185 | } 186 | 187 | // Add MAC internal switch 188 | if (strstr($link, '[MAC]')) { 189 | if ($item->getType() == 'NetworkEquipment') { 190 | $shellExecute = "onClick='shellcommandsActions(\"" . PLUGIN_SHELLCOMMANDS_WEBDIR . "\", \"" . $_POST['toupdate'] . "\", 191 | " . json_encode(['id' => $shell_item->getID(), 192 | 'command_type' => $_POST['command_type'], 193 | 'itemID' => $_POST['itemID'], 194 | 'itemtype' => $_POST['itemtype'], 195 | 'value' => $item->getField('mac')]) . ");'"; 196 | } 197 | if ($macCount > 0) { 198 | foreach ($mac as $key => $val) { 199 | $resultSelectCommand['MAC-' . $shell_item->getId() . '-' . $val['mac'] . '-' . $key] = $val['mac'] . ' - ' . $val['name']; 200 | } 201 | } 202 | } 203 | } 204 | 205 | echo " "; 206 | 207 | if (isset($resultSelectCommand) && sizeof($resultSelectCommand) > 0) { 208 | $randSelect = Dropdown::showFromArray("ip", $resultSelectCommand, ['width' => $_POST['width']]); 209 | Ajax::updateItemOnSelectEvent("dropdown_ip$randSelect", "command_ip$randSelect", PLUGIN_SHELLCOMMANDS_WEBDIR . "/ajax/dropdownCommandValue.php", 210 | ['idtable' => 'NetworkPort', 211 | 'value' => '__VALUE__', 212 | 'itemID' => $_POST['itemID'], 213 | 'itemtype' => $item->getType(), 214 | 'command_type' => $_POST['command_type'], 215 | 'toupdate' => $_POST['toupdate'], 216 | 'myname' => "command_ip"]); 217 | 218 | echo ""; 219 | 220 | } else if (isset($shellExecute)) { 221 | echo ""; 222 | } 223 | 224 | break; 225 | 226 | case "command_ip": 227 | $ipmac = $tabValue[2]; 228 | 229 | $shellExecute = "onClick='shellcommandsActions(\"" . PLUGIN_SHELLCOMMANDS_WEBDIR . "\", \"" . $_POST['toupdate'] . "\", 230 | " . json_encode(['id' => $shell_item->getID(), 231 | 'command_type' => $_POST['command_type'], 232 | 'itemID' => $_POST['itemID'], 233 | 'itemtype' => $_POST['itemtype'], 234 | 'value' => $ipmac]) . ");'"; 235 | echo " "; 236 | echo ""; 237 | break; 238 | } 239 | 240 | 241 | //if (isset($_POST["comment"]) && $_POST["comment"]) { 242 | // $paramscomment = ['value' => '__VALUE__', 'table' => $table]; 243 | // Ajax::updateItemOnSelectEvent("dropdown_" . $_POST["myname"] . $_POST["rand"], 244 | // "comment_" . $_POST["myname"] . $_POST["rand"], 245 | // $CFG_GLPI["root_doc"] . "/ajax/comments.php", $paramscomment); 246 | //} 247 | 248 | Ajax::commonDropdownUpdateItem($_POST); 249 | -------------------------------------------------------------------------------- /ajax/dropdownTrackingDeviceType.php: -------------------------------------------------------------------------------- 1 | . 27 | -------------------------------------------------------------------------- 28 | */ 29 | 30 | include('../../../inc/includes.php'); 31 | header("Content-Type: text/html; charset=UTF-8"); 32 | Html::header_nocache(); 33 | 34 | Session::checkLoginUser(); 35 | 36 | $itemtype = $_POST["itemtype"] ?? ''; 37 | 38 | // Make a select box 39 | if (isset($_POST["itemtype"]) 40 | && CommonITILObject::isPossibleToAssignType($_POST["itemtype"])) { 41 | $dbu = new DbUtils(); 42 | $table = $dbu->getTableForItemType($_POST["itemtype"]); 43 | $rand = mt_rand(); 44 | 45 | // Message for post-only 46 | if (!isset($_POST["admin"]) || ($_POST["admin"] == 0)) { 47 | echo __('Enter the first letters (user, item name, serial or asset number)'); 48 | } 49 | echo " "; 50 | $field_id = Html::cleanId("dropdown_" . $_POST['myname'] . $rand); 51 | 52 | $p = ['itemtype' => $_POST["itemtype"], 53 | 'entity_restrict' => $_POST['entity_restrict'], 54 | 'table' => $table, 55 | 'width' => $_POST["width"], 56 | 'myname' => $_POST["myname"], 57 | '_idor_token' => Session::getNewIDORToken($itemtype, [ 58 | 'entity_restrict' => $_POST['entity_restrict'], 59 | ]), 60 | ]; 61 | 62 | echo Html::jsAjaxDropdown($_POST['myname'], $field_id, 63 | $CFG_GLPI['root_doc'] . "/ajax/getDropdownFindNum.php", 64 | $p); 65 | // Auto update summary of active or just solved tickets 66 | $params = ['items_id' => '__VALUE__', 67 | 'itemtype' => $_POST['itemtype']]; 68 | 69 | Ajax::updateItemOnSelectEvent($field_id, "item_ticket_selection_information", 70 | $CFG_GLPI["root_doc"] . "/ajax/ticketiteminformation.php", 71 | $params); 72 | 73 | } 74 | -------------------------------------------------------------------------------- /ajax/index.php: -------------------------------------------------------------------------------- 1 | . 27 | -------------------------------------------------------------------------- 28 | */ 29 | -------------------------------------------------------------------------------- /ajax/shellcommand.exec.php: -------------------------------------------------------------------------------- 1 | . 27 | -------------------------------------------------------------------------- 28 | */ 29 | 30 | include("../../../inc/includes.php"); 31 | 32 | Session::checkLoginUser(); 33 | 34 | $command = new PluginShellcommandsShellcommand(); 35 | $command_item = new PluginShellcommandsShellcommand_Item(); 36 | 37 | $command->checkGlobal(READ); 38 | 39 | header("Content-Type: text/html; charset=UTF-8"); 40 | 41 | switch ($_POST['command_type']) { 42 | case 'PluginShellcommandsShellcommand' : 43 | PluginShellcommandsShellcommand_Item::lauchCommand($_POST); 44 | break; 45 | case 'PluginShellcommandsCommandGroup' : 46 | PluginShellcommandsCommandGroup_Item::lauchCommand($_POST); 47 | break; 48 | case 'PluginShellcommandsAdvanced_Execution' : 49 | PluginShellcommandsAdvanced_Execution::lauchCommand($_POST); 50 | //Toolbox::logDebug($_POST); 51 | break; 52 | } 53 | 54 | -------------------------------------------------------------------------------- /front/advanced_execution.php: -------------------------------------------------------------------------------- 1 | . 27 | -------------------------------------------------------------------------- 28 | */ 29 | 30 | include('../../../inc/includes.php'); 31 | 32 | Html::header(PluginShellcommandsAdvanced_Execution::getTypeName(2), '', "tools", "pluginshellcommandsshellcommand", "advanced_execution"); 33 | 34 | $advanced_execution = new PluginShellcommandsAdvanced_Execution(); 35 | if ($advanced_execution->canView() || Session::haveRight("config", UPDATE)) { 36 | $advanced_execution->showForm(); 37 | 38 | } else { 39 | Html::displayRightError(); 40 | } 41 | 42 | Html::footer(); 43 | -------------------------------------------------------------------------------- /front/commandgroup.form.php: -------------------------------------------------------------------------------- 1 | . 27 | -------------------------------------------------------------------------- 28 | */ 29 | 30 | include('../../../inc/includes.php'); 31 | 32 | if (empty($_GET["id"])) { 33 | $_GET["id"] = ""; 34 | } 35 | 36 | $commandgroup = new PluginShellcommandsCommandGroup(); 37 | 38 | if (isset($_POST["add"])) { 39 | // Check add rights for fields 40 | $commandgroup->check(-1, UPDATE, $_POST); 41 | $commandgroup->add($_POST); 42 | 43 | Html::back(); 44 | 45 | } else if (isset($_POST["update"])) { 46 | // Check update rights for fields 47 | $commandgroup->check($_POST['id'], UPDATE, $_POST); 48 | $commandgroup->update($_POST); 49 | 50 | Html::back(); 51 | 52 | } else if (isset($_POST["delete"])) { 53 | // Check delete rights for fields 54 | $commandgroup->check($_POST['id'], UPDATE, $_POST); 55 | $commandgroup->delete($_POST, 1); 56 | $commandgroup->redirectToList(); 57 | 58 | } else { 59 | $commandgroup->checkGlobal(READ); 60 | Html::header(PluginShellcommandsCommandGroup::getTypeName(2), '', "tools", "pluginshellcommandsshellcommand", "commandgroup"); 61 | $commandgroup->display(['id' => $_GET["id"]]); 62 | Html::footer(); 63 | } 64 | -------------------------------------------------------------------------------- /front/commandgroup.php: -------------------------------------------------------------------------------- 1 | . 27 | -------------------------------------------------------------------------- 28 | */ 29 | 30 | include('../../../inc/includes.php'); 31 | 32 | Html::header(PluginShellcommandsCommandGroup::getTypeName(2), '', "tools", "pluginshellcommandsshellcommand", "commandgroup"); 33 | 34 | $command = new PluginShellcommandsCommandGroup(); 35 | if ($command->canView() || Session::haveRight("config", UPDATE)) { 36 | Search::show("PluginShellcommandsCommandGroup"); 37 | } else { 38 | Html::displayRightError(); 39 | } 40 | 41 | Html::footer(); 42 | -------------------------------------------------------------------------------- /front/commandgroup_item.form.php: -------------------------------------------------------------------------------- 1 | . 27 | -------------------------------------------------------------------------- 28 | */ 29 | 30 | include('../../../inc/includes.php'); 31 | 32 | $group_item = new PluginShellcommandsCommandGroup_Item(); 33 | 34 | if (isset($_POST["add"])) { 35 | $group_item->check(-1, UPDATE, $_POST); 36 | $group_item->add($_POST); 37 | Html::back(); 38 | 39 | } else if (isset($_POST["up"]) || isset($_POST["up_x"])) { 40 | $group_item->orderItem($_POST, 'up'); 41 | Html::back(); 42 | 43 | } else if (isset($_POST["down"]) || isset($_POST["down_x"])) { 44 | $group_item->orderItem($_POST, 'down'); 45 | Html::back(); 46 | } 47 | -------------------------------------------------------------------------------- /front/index.php: -------------------------------------------------------------------------------- 1 | . 27 | -------------------------------------------------------------------------- 28 | */ 29 | -------------------------------------------------------------------------------- /front/massiveexec.php: -------------------------------------------------------------------------------- 1 | . 27 | -------------------------------------------------------------------------- 28 | */ 29 | include('../../../inc/includes.php'); 30 | 31 | Html::header(PluginShellcommandsShellcommand::getTypeName(2), '', "tools", "pluginshellcommandsshellcommand", "shellcommand"); 32 | 33 | $ma = $_SESSION["plugin_shellcommands"]["massiveaction"]; 34 | unset($_SESSION["plugin_shellcommands"]["massiveaction"]); 35 | 36 | $ids = $_SESSION["plugin_shellcommands"]["ids"]; 37 | unset($_SESSION["plugin_shellcommands"]["ids"]); 38 | 39 | // Launch massive action 40 | $dbu = new DbUtils(); 41 | $processor = $dbu->getItemForItemtype($ma->processor); 42 | $processor->doMassiveAction($ma, $ids); 43 | 44 | Html::footer(); 45 | -------------------------------------------------------------------------------- /front/menu.php: -------------------------------------------------------------------------------- 1 | . 27 | -------------------------------------------------------------------------- 28 | */ 29 | 30 | include('../../../inc/includes.php'); 31 | 32 | if ($_SESSION['glpiactiveprofile']['interface'] == 'central') { 33 | Html::header(PluginShellcommandsMenu::getTypeName(2), '', "tools", "pluginshellcommandsshellcommand"); 34 | } else { 35 | Html::helpHeader(PluginShellcommandsMenu::getTypeName(2)); 36 | } 37 | 38 | $menu = new PluginShellcommandsMenu(); 39 | $menu->showMenu(); 40 | 41 | if ($_SESSION['glpiactiveprofile']['interface'] == 'central') { 42 | Html::footer(); 43 | } else { 44 | Html::helpFooter(); 45 | } 46 | -------------------------------------------------------------------------------- /front/shellcommand.form.php: -------------------------------------------------------------------------------- 1 | . 27 | -------------------------------------------------------------------------- 28 | */ 29 | 30 | include('../../../inc/includes.php'); 31 | 32 | if (!isset($_GET["id"])) { 33 | $_GET["id"] = ""; 34 | } 35 | if (!isset($_GET["withtemplate"])) { 36 | $_GET["withtemplate"] = ""; 37 | } 38 | 39 | $command = new PluginShellcommandsShellcommand(); 40 | $command_item = new PluginShellcommandsShellcommand_Item(); 41 | 42 | if (isset($_POST["add"])) { 43 | $command->check(-1, UPDATE, $_POST); 44 | $newID = $command->add($_POST); 45 | Html::back(); 46 | 47 | } else if (isset($_POST["update"])) { 48 | $command->check($_POST['id'], UPDATE); 49 | $command->update($_POST); 50 | Html::back(); 51 | 52 | } else if (isset($_POST["additem"])) { 53 | if (!empty($_POST['itemtype'])) { 54 | if ($command->canCreate()) { 55 | $command_item->addItem($_POST["plugin_shellcommands_shellcommands_id"], $_POST['itemtype']); 56 | } 57 | } 58 | Html::back(); 59 | 60 | } else if (isset($_POST["deleteitem"])) { 61 | if ($command->canCreate()) { 62 | $command_item->delete(['id' => $_POST["id"]]); 63 | } 64 | Html::back(); 65 | 66 | } else { 67 | $command->checkGlobal(READ); 68 | Html::header(PluginShellcommandsShellcommand::getTypeName(2), '', "tools", "pluginshellcommandsshellcommand", "shellcommand"); 69 | $command->display(['id' => $_GET["id"]]); 70 | Html::footer(); 71 | } 72 | -------------------------------------------------------------------------------- /front/shellcommand.php: -------------------------------------------------------------------------------- 1 | . 27 | -------------------------------------------------------------------------- 28 | */ 29 | 30 | include('../../../inc/includes.php'); 31 | 32 | Html::header(PluginShellcommandsShellcommand::getTypeName(2), '', "tools", "pluginshellcommandsshellcommand", "shellcommand"); 33 | 34 | $command = new PluginShellcommandsShellcommand(); 35 | if ($command->canView() || Session::haveRight("config", UPDATE)) { 36 | 37 | Search::show("PluginShellcommandsShellcommand"); 38 | } else { 39 | Html::displayRightError(); 40 | } 41 | 42 | Html::footer(); 43 | -------------------------------------------------------------------------------- /front/shellcommandpath.form.php: -------------------------------------------------------------------------------- 1 | . 27 | -------------------------------------------------------------------------- 28 | */ 29 | 30 | include('../../../inc/includes.php'); 31 | 32 | $dropdown = new PluginShellcommandsShellcommandPath(); 33 | include(GLPI_ROOT . "/front/dropdown.common.form.php"); 34 | 35 | -------------------------------------------------------------------------------- /front/shellcommandpath.php: -------------------------------------------------------------------------------- 1 | . 27 | -------------------------------------------------------------------------- 28 | */ 29 | 30 | include('../../../inc/includes.php'); 31 | 32 | $dropdown = new PluginShellcommandsShellcommandPath(); 33 | include(GLPI_ROOT . "/front/dropdown.common.php"); 34 | 35 | -------------------------------------------------------------------------------- /hook.php: -------------------------------------------------------------------------------- 1 | . 27 | -------------------------------------------------------------------------- 28 | */ 29 | 30 | function plugin_shellcommands_install() 31 | { 32 | global $DB; 33 | 34 | include_once(PLUGIN_SHELLCOMMANDS_DIR . "/inc/profile.class.php"); 35 | 36 | $update = false; 37 | if (!$DB->tableExists("glpi_plugin_cmd_profiles") 38 | && !$DB->tableExists("glpi_plugin_shellcommands_shellcommands")) { 39 | $DB->runFile(PLUGIN_SHELLCOMMANDS_DIR . "/sql/empty-4.0.0.sql"); 40 | } elseif ($DB->tableExists("glpi_plugin_cmd_profiles") 41 | && !$DB->tableExists("glpi_plugin_cmd_path")) { 42 | $update = true; 43 | $DB->runFile(PLUGIN_SHELLCOMMANDS_DIR . "/sql/update-1.1.sql"); 44 | $DB->runFile(PLUGIN_SHELLCOMMANDS_DIR . "/sql/update-1.2.0.sql"); 45 | $DB->runFile(PLUGIN_SHELLCOMMANDS_DIR . "/sql/update-1.3.0.sql"); 46 | } elseif ($DB->tableExists("glpi_plugin_cmd_profiles") 47 | && $DB->fieldExists("glpi_plugin_cmd_profiles", "interface")) { 48 | $update = true; 49 | $DB->runFile(PLUGIN_SHELLCOMMANDS_DIR . "/sql/update-1.2.0.sql"); 50 | $DB->runFile(PLUGIN_SHELLCOMMANDS_DIR . "/sql/update-1.3.0.sql"); 51 | } elseif (!$DB->tableExists("glpi_plugin_shellcommands_shellcommands")) { 52 | $update = true; 53 | $DB->runFile(PLUGIN_SHELLCOMMANDS_DIR . "/sql/update-1.3.0.sql"); 54 | } elseif (!$DB->tableExists("glpi_plugin_shellcommands_commandgroups")) { 55 | $DB->runFile(PLUGIN_SHELLCOMMANDS_DIR . "/sql/update-1.7.0.sql"); 56 | } 57 | 58 | if ($update) { 59 | $query_ = "SELECT * 60 | FROM `glpi_plugin_shellcommands_profiles` "; 61 | $result_ = $DB->query($query_); 62 | if ($DB->numrows($result_) > 0) { 63 | while ($data = $DB->fetchArray($result_)) { 64 | $query = "UPDATE `glpi_plugin_shellcommands_profiles` 65 | SET `profiles_id` = '" . $data["id"] . "' 66 | WHERE `id` = '" . $data["id"] . "';"; 67 | $DB->query($query); 68 | } 69 | } 70 | 71 | $query = "ALTER TABLE `glpi_plugin_shellcommands_profiles` 72 | DROP `name` ;"; 73 | $DB->query($query); 74 | } 75 | 76 | PluginShellcommandsProfile::initProfile(); 77 | PluginShellcommandsProfile::createfirstAccess($_SESSION['glpiactiveprofile']['id']); 78 | $migration = new Migration("1.9.1"); 79 | $migration->dropTable('glpi_plugin_shellcommands_profiles'); 80 | 81 | return true; 82 | } 83 | 84 | function plugin_shellcommands_uninstall() 85 | { 86 | global $DB; 87 | 88 | $tables = [ 89 | "glpi_plugin_shellcommands_shellcommands", 90 | "glpi_plugin_shellcommands_shellcommands_items", 91 | "glpi_plugin_shellcommands_commandgroups", 92 | "glpi_plugin_shellcommands_commandgroups_items", 93 | "glpi_plugin_shellcommands_profiles", 94 | "glpi_plugin_shellcommands_shellcommandpaths" 95 | ]; 96 | 97 | foreach ($tables as $table) { 98 | $DB->query("DROP TABLE IF EXISTS `$table`;"); 99 | } 100 | 101 | //old versions 102 | $tables = [ 103 | "glpi_plugin_cmd", 104 | "glpi_plugin_cmd_device", 105 | "glpi_plugin_cmd_setup", 106 | "glpi_plugin_cmd_profiles", 107 | "glpi_plugin_cmd_path" 108 | ]; 109 | 110 | foreach ($tables as $table) { 111 | $DB->query("DROP TABLE IF EXISTS `$table`;"); 112 | } 113 | 114 | $tables_glpi = [ 115 | "glpi_displaypreferences", 116 | "glpi_savedsearches" 117 | ]; 118 | 119 | foreach ($tables_glpi as $table_glpi) { 120 | $DB->query("DELETE FROM `$table_glpi` WHERE `itemtype` = 'PluginShellcommandsShellcommand';"); 121 | } 122 | 123 | include_once(PLUGIN_SHELLCOMMANDS_DIR . "/inc/profile.class.php"); 124 | 125 | PluginShellcommandsProfile::removeRightsFromSession(); 126 | PluginShellcommandsProfile::removeRightsFromDB(); 127 | 128 | return true; 129 | } 130 | 131 | // Define dropdown relations 132 | function plugin_shellcommands_getDatabaseRelations() 133 | { 134 | if (Plugin::isPluginActive("shellcommands")) { 135 | return [ 136 | "glpi_plugin_shellcommands_shellcommandpaths" => ["glpi_plugin_shellcommands_shellcommands" => "plugin_shellcommands_shellcommandpaths_id"], 137 | "glpi_profiles" => ["glpi_plugin_shellcommands_profiles" => "profiles_id"], 138 | "glpi_plugin_shellcommands_shellcommands" => ["glpi_plugin_shellcommands_shellcommands_items" => "plugin_shellcommands_shellcommands_id"], 139 | "glpi_plugin_shellcommands_shellcommands" => ["glpi_plugin_shellcommands_commandgroups_items" => "plugin_shellcommands_shellcommands_id"], 140 | "glpi_plugin_shellcommands_commandgroups" => ["glpi_plugin_shellcommands_commandgroups_items" => "plugin_shellcommands_commandgroups_id"], 141 | "glpi_entities" => ["glpi_plugin_shellcommands_shellcommands" => "entities_id"] 142 | ]; 143 | } else { 144 | return []; 145 | } 146 | } 147 | 148 | // Define Dropdown tables to be manage in GLPI : 149 | function plugin_shellcommands_getDropdown() 150 | { 151 | if (Plugin::isPluginActive("shellcommands")) { 152 | return ['PluginShellcommandsShellcommandPath' => __('Path', 'shellcommands')]; 153 | } else { 154 | return []; 155 | } 156 | } 157 | 158 | function plugin_shellcommands_postinit() 159 | { 160 | foreach (PluginShellcommandsShellcommand::getTypes(true) as $type) { 161 | CommonGLPI::registerStandardTab($type, 'PluginShellcommandsShellcommand_Item'); 162 | } 163 | } 164 | 165 | /** 166 | * Register methods for Webservices plugin (if available) 167 | * 168 | * @return void 169 | */ 170 | function plugin_shellcommands_registerWebservicesMethods() 171 | { 172 | global $WEBSERVICES_METHOD; 173 | 174 | if (Plugin::isPluginActive('webservices')) { // If webservices plugin is active 175 | $WEBSERVICES_METHOD['shellcommands.list'] = ['PluginShellcommandsWebservice', 'methodList']; 176 | $WEBSERVICES_METHOD['shellcommands.run'] = ['PluginShellcommandsWebservice', 'methodRun']; 177 | } 178 | } 179 | 180 | 181 | //display custom fields in the search 182 | function plugin_shellcommands_giveItem($type, $ID, $data, $num) 183 | { 184 | global $DB; 185 | $searchopt = &Search::getOptions($type); 186 | $table = $searchopt[$ID]["table"]; 187 | $field = $searchopt[$ID]["field"]; 188 | switch ($table . '.' . $field) { 189 | //display associated items with shellcommands 190 | case "glpi_plugin_shellcommands_shellcommands_items.itemtype" : 191 | $rows = $DB->request([ 192 | 'SELECT' => 'itemtype', 193 | 'DISTINCT' => true, 194 | 'FROM' => 'glpi_plugin_shellcommands_shellcommands_items', 195 | 'WHERE' => ['plugin_shellcommands_shellcommands_id' => $data['id']], 196 | 'ORDERBY' => 'itemtype' 197 | ]); 198 | $out = ''; 199 | foreach ($rows as $row) { 200 | $itemtype = $row['itemtype']; 201 | $item = new $itemtype(); 202 | if (!class_exists($itemtype)) { 203 | continue; 204 | } 205 | $out .= $item->getTypeName() . "
"; 206 | } 207 | return $out; 208 | 209 | break; 210 | } 211 | return ""; 212 | } 213 | 214 | //force groupby for multible links to items 215 | function plugin_shellcommands_forceGroupBy($type) 216 | { 217 | return true; 218 | switch ($type) { 219 | case 'PluginShellcommandsShellcommand': 220 | return true; 221 | break; 222 | } 223 | return false; 224 | } 225 | 226 | function plugin_shellcommands_MassiveActions($type) 227 | { 228 | if (Plugin::isPluginActive("shellcommands")) { 229 | if (in_array($type, PluginShellcommandsShellcommand::getTypes(true))) { 230 | return [ 231 | 'PluginShellcommandsShellcommand' . MassiveAction::CLASS_ACTION_SEPARATOR . "generate" => __( 232 | 'Command launch', 233 | 'shellcommands' 234 | ), 235 | 'PluginShellcommandsCommandGroup' . MassiveAction::CLASS_ACTION_SEPARATOR . "generate" => __( 236 | 'Command group launch', 237 | 'shellcommands' 238 | ) 239 | ]; 240 | } 241 | } 242 | return []; 243 | } 244 | 245 | -------------------------------------------------------------------------------- /inc/advanced_execution.class.php: -------------------------------------------------------------------------------- 1 | . 27 | -------------------------------------------------------------------------- 28 | */ 29 | 30 | if (!defined('GLPI_ROOT')) { 31 | die("Sorry. You can't access directly to this file"); 32 | } 33 | 34 | class PluginShellcommandsAdvanced_Execution extends CommonDBTM { 35 | 36 | public $dohistory = true; 37 | static $rightname = 'plugin_shellcommands'; 38 | 39 | public static function getTypeName($nb = 0) { 40 | return _n('Advanced execution', 'Advanced executions', $nb, 'shellcommands'); 41 | } 42 | 43 | static function canView() { 44 | return Session::haveRight(self::$rightname, READ); 45 | } 46 | 47 | static function canCreate() { 48 | return Session::haveRightsOr(self::$rightname, [CREATE, UPDATE, DELETE]); 49 | } 50 | 51 | /** 52 | * Show form 53 | * 54 | * @global type $CFG_GLPI 55 | * 56 | * @param type $ID 57 | * @param type $options 58 | */ 59 | function showForm($ID = 0, $options = []) { 60 | global $CFG_GLPI; 61 | 62 | echo "
"; 63 | echo "
"; 64 | echo ""; 65 | echo ""; 66 | echo ""; 67 | echo ""; 68 | 69 | echo ""; 70 | echo ""; 74 | echo ""; 75 | 76 | echo ""; 77 | echo ""; 80 | echo ""; 81 | 82 | echo ""; 83 | echo ""; 86 | echo ""; 87 | 88 | echo "
" . self::getTypeName() . "
"; 71 | echo PluginShellcommandsCommandGroup::getTypeName(1) . " "; 72 | Dropdown::show('PluginShellcommandsCommandGroup', ['entity' => $_SESSION['glpiactive_entity'], 'width' => 200]); 73 | echo "
"; 78 | $this->getEditValue(); 79 | echo "
"; 84 | echo ""; 85 | echo "
"; 89 | Html::closeForm(); 90 | echo "
"; 91 | 92 | echo "
"; 93 | } 94 | 95 | /** 96 | * View custom values for items or types 97 | * 98 | * @return html 99 | */ 100 | function getEditValue() { 101 | 102 | echo ""; 103 | echo ""; 104 | echo ""; 115 | echo ""; 116 | echo "
" . _n('Item', 'Items', 2) . "
"; 105 | echo ''; 106 | echo ""; 107 | echo "'; 110 | echo ''; 113 | echo '
"; 108 | self::addNewValue(1); 109 | echo ''; 111 | self::initCustomValue(1); 112 | echo '
'; 114 | echo "
"; 117 | 118 | } 119 | 120 | /** 121 | * Init values 122 | * 123 | * @param array $count 124 | */ 125 | static function initCustomValue($count) { 126 | global $CFG_GLPI; 127 | 128 | echo ''; 129 | 130 | echo "  "; 133 | 134 | echo "  "; 137 | } 138 | 139 | /** 140 | * Add new value to form 141 | * 142 | * @param array $valueId 143 | */ 144 | static function addNewValue($valueId) { 145 | 146 | echo "
" . __('Item') . ' ' . $valueId . ' '; 147 | self::dropdownAllDevices('items', null, 0, 1, 0, $_SESSION['glpiactive_entity']); 148 | echo "
"; 149 | } 150 | 151 | /** 152 | * Launch a command 153 | * 154 | * @param array $values 155 | * 156 | * @return void 157 | */ 158 | static function lauchCommand($values) { 159 | 160 | $items_to_execute = json_decode(stripslashes($values['items_to_execute']), true); 161 | if (!empty($items_to_execute)) { 162 | foreach ($items_to_execute as $key => $items) { 163 | if (isset($items['items_id'])) { 164 | PluginShellcommandsCommandGroup_Item::lauchCommand(['itemID' => $items['items_id'], 165 | 'itemtype' => $items['itemtype'], 166 | 'id' => $values['command_group'], 167 | 'value' => null]); 168 | } 169 | } 170 | } 171 | } 172 | 173 | /** 174 | * Make a select box for Tracking All Devices 175 | * 176 | * @param $myname select name 177 | * @param $itemtype preselected value.for item type 178 | * @param $items_id preselected value for item ID (default 0) 179 | * @param $admin is an admin access ? (default 0) 180 | * @param $users_id user ID used to display my devices (default 0 181 | * @param $entity_restrict Restrict to a defined entity (default -1) 182 | * @param $tickets_id Id of the ticket 183 | * 184 | * @return nothing (print out an HTML select box) 185 | **/ 186 | static function dropdownAllDevices($myname, $itemtype, $items_id = 0, $admin = 0, $users_id = 0, 187 | $entity_restrict = -1, $tickets_id = 0) { 188 | global $CFG_GLPI; 189 | 190 | $rand = mt_rand(); 191 | 192 | if ($_SESSION["glpiactiveprofile"]["helpdesk_hardware"] == 0) { 193 | echo Html::hidden($myname, ['value' => '']); 194 | echo Html::hidden('items_id', ['value' => 0]); 195 | } else { 196 | $rand = mt_rand(); 197 | echo ""; 198 | if ($_SESSION["glpiactiveprofile"]["helpdesk_hardware"] & pow(2, 199 | Ticket::HELPDESK_ALL_HARDWARE)) { 200 | 201 | if ($users_id 202 | && ($_SESSION["glpiactiveprofile"]["helpdesk_hardware"] & pow(2, 203 | Ticket::HELPDESK_MY_HARDWARE))) { 204 | echo __('Or complete search') . " "; 205 | } 206 | 207 | $types = Ticket::getAllTypesForHelpdesk(); 208 | $emptylabel = Dropdown::EMPTY_VALUE; 209 | 210 | $rand = Dropdown::showItemTypes($myname, array_keys($types), 211 | ['emptylabel' => $emptylabel, 212 | 'value' => $itemtype, 'width' => 200]); 213 | $found_type = isset($types[$itemtype]); 214 | 215 | $width = 250; 216 | 217 | $params = ['itemtype' => '__VALUE__', 218 | 'entity_restrict' => $entity_restrict, 219 | 'admin' => $admin, 220 | 'width' => $width, 221 | 'myname' => "items_id",]; 222 | 223 | Ajax::updateItemOnSelectEvent("dropdown_$myname$rand", "results_$myname$rand", 224 | PLUGIN_SHELLCOMMANDS_WEBDIR . 225 | "/ajax/dropdownTrackingDeviceType.php", 226 | $params); 227 | echo "\n"; 228 | 229 | // Display default value if itemtype is displayed 230 | if ($found_type 231 | && $itemtype) { 232 | $dbu = new DbUtils(); 233 | if (($item = $dbu->getItemForItemtype($itemtype)) 234 | && $items_id) { 235 | if ($item->getFromDB($items_id)) { 236 | Dropdown::showFromArray('items_id', [$items_id => $item->getName()], 237 | ['value' => $items_id, 'width' => $width]); 238 | } 239 | } else { 240 | $params['itemtype'] = $itemtype; 241 | echo "'; 247 | } 248 | } 249 | echo "\n"; 250 | } 251 | echo ""; 252 | } 253 | return $rand; 254 | } 255 | 256 | } 257 | 258 | -------------------------------------------------------------------------------- /inc/commandgroup.class.php: -------------------------------------------------------------------------------- 1 | . 27 | -------------------------------------------------------------------------- 28 | */ 29 | 30 | if (!defined('GLPI_ROOT')) { 31 | die("Sorry. You can't access directly to this file"); 32 | } 33 | 34 | class PluginShellcommandsCommandGroup extends CommonDBTM { 35 | 36 | public $dohistory = true; 37 | static $rightname = 'plugin_shellcommands'; 38 | 39 | public static function getTypeName($nb = 0) { 40 | return _n('Command group', 'Command groups', $nb, 'shellcommands'); 41 | } 42 | 43 | static function canView() { 44 | return Session::haveRight(self::$rightname, READ); 45 | } 46 | 47 | static function canCreate() { 48 | return Session::haveRightsOr(self::$rightname, [CREATE, UPDATE, DELETE]); 49 | } 50 | 51 | /** 52 | * @return string 53 | */ 54 | static function getIcon() { 55 | return "ti ti-keyboard"; 56 | } 57 | 58 | function cleanDBonPurge() { 59 | 60 | $temp = new PluginShellcommandsCommandGroup_Item(); 61 | $temp->deleteByCriteria(['plugin_shellcommands_commandgroups_id' => $this->fields['id']]); 62 | } 63 | 64 | function rawSearchOptions() { 65 | $tab = []; 66 | 67 | $tab[] = [ 68 | 'id' => 'common', 69 | 'name' => self::getTypeName(2) 70 | ]; 71 | 72 | $tab[] = [ 73 | 'id' => '1', 74 | 'table' => $this->getTable(), 75 | 'field' => 'name', 76 | 'name' => __('Name'), 77 | 'datatype' => 'itemlink', 78 | ]; 79 | 80 | $tab[] = [ 81 | 'id' => '30', 82 | 'table' => $this->getTable(), 83 | 'field' => 'id', 84 | 'name' => __('ID'), 85 | 'datatype' => 'integer' 86 | ]; 87 | 88 | $tab[] = [ 89 | 'id' => '80', 90 | 'table' => 'glpi_entities', 91 | 'field' => 'completename', 92 | 'name' => __('Entity'), 93 | 'datatype' => 'dropdown' 94 | ]; 95 | 96 | $tab[] = [ 97 | 'id' => '86', 98 | 'table' => $this->getTable(), 99 | 'field' => 'is_recursive', 100 | 'name' => __('Child entities'), 101 | 'datatype' => 'bool' 102 | ]; 103 | 104 | return $tab; 105 | } 106 | 107 | function defineTabs($options = []) { 108 | $ong = []; 109 | $this->addDefaultFormTab($ong); 110 | $this->addStandardTab('PluginShellcommandsCommandGroup_Item', $ong, $options); 111 | $this->addStandardTab('Log', $ong, $options); 112 | 113 | return $ong; 114 | } 115 | 116 | function showForm($ID, $options = []) { 117 | 118 | $this->initForm($ID, $options); 119 | $this->showFormHeader($options); 120 | 121 | echo ""; 122 | echo "" . __('Name') . ""; 123 | echo ""; 124 | echo Html::input('name', ['value' => $this->fields['name'], 'size' => 40]); 125 | echo ""; 126 | 127 | echo "" . __('Check command', 'shellcommands') . ""; 128 | echo ""; 129 | Dropdown::show('PluginShellcommandsShellcommand', ['name' => "check_commands_id", 130 | 'value' => $this->fields['check_commands_id'], 131 | 'entity' => $_SESSION['glpiactive_entity']]); 132 | echo ""; 133 | echo ""; 134 | 135 | $this->showFormButtons($options); 136 | 137 | return true; 138 | } 139 | 140 | /** 141 | * Main entry of the modal window for massive actions 142 | * 143 | * @return nothing: display 144 | **/ 145 | static function showMassiveActionsSubForm(MassiveAction $ma) { 146 | 147 | switch ($ma->getAction()) { 148 | case 'generate': 149 | $itemtype = $ma->getItemtype(false); 150 | if (in_array($itemtype, PluginShellcommandsShellcommand::getTypes(true))) { 151 | echo PluginShellcommandsCommandGroup::getTypeName(1) . " "; 152 | Dropdown::show('PluginShellcommandsCommandGroup', ['name' => 'commandgroup', 'entity' => $_SESSION['glpiactive_entity'], 'comments' => false]); 153 | echo "

"; 154 | } 155 | break; 156 | } 157 | return false; 158 | } 159 | 160 | /** 161 | * @see CommonDBTM::processMassiveActionsForOneItemtype() 162 | **/ 163 | static function processMassiveActionsForOneItemtype(MassiveAction $ma, CommonDBTM $item, array $ids) { 164 | global $CFG_GLPI; 165 | 166 | switch ($ma->getAction()) { 167 | case 'generate': 168 | if ($ma->POST['commandgroup']) { 169 | $_SESSION["plugin_shellcommands"]["massiveaction"] = $ma; 170 | $_SESSION["plugin_shellcommands"]["ids"] = $ids; 171 | 172 | $ma->results['ok'] = 1; 173 | $ma->display_progress_bars = false; 174 | 175 | echo ""; 178 | 179 | } 180 | break; 181 | } 182 | } 183 | 184 | /** 185 | * Custom fonction to process shellcommand massive action 186 | **/ 187 | function doMassiveAction(MassiveAction $ma, array $ids) { 188 | 189 | if (!empty($ids)) { 190 | $input = $ma->getInput(); 191 | 192 | $itemtype = $ma->getItemType(false); 193 | $commands_id = $input['commandgroup']; 194 | 195 | switch ($ma->getAction()) { 196 | case 'generate': 197 | echo "
"; 198 | echo ""; 199 | echo ""; 200 | echo ""; 201 | echo ""; 202 | foreach ($ids as $key => $items_id) { 203 | PluginShellcommandsCommandGroup_Item::lauchCommand(['itemID' => $items_id, 204 | 'itemtype' => $itemtype, 205 | 'id' => $commands_id, 206 | 'value' => null]); 207 | } 208 | echo "
" . PluginShellcommandsCommandGroup::getTypeName(2) . "
"; 209 | echo "
"; 210 | break; 211 | } 212 | } 213 | } 214 | 215 | } 216 | 217 | -------------------------------------------------------------------------------- /inc/index.php: -------------------------------------------------------------------------------- 1 | . 27 | -------------------------------------------------------------------------- 28 | */ 29 | -------------------------------------------------------------------------------- /inc/menu.class.php: -------------------------------------------------------------------------------- 1 | . 27 | -------------------------------------------------------------------------- 28 | */ 29 | 30 | if (!defined('GLPI_ROOT')) { 31 | die("Sorry. You can't access directly to this file"); 32 | } 33 | 34 | /** 35 | * Class PluginShellcommandsMenu 36 | * 37 | * This class shows the plugin main page 38 | * 39 | * @package Shellcommands 40 | * @author Ludovic Dupont 41 | */ 42 | class PluginShellcommandsMenu extends CommonDBTM { 43 | 44 | static $rightname = 'plugin_shellcommands'; 45 | 46 | static function getTypeName($nb = 0) { 47 | return __('Shellcommands menu', 'shellcommands'); 48 | } 49 | 50 | static function canView() { 51 | return Session::haveRight(self::$rightname, READ); 52 | } 53 | 54 | static function canCreate() { 55 | return Session::haveRightsOr(self::$rightname, [CREATE, UPDATE, DELETE]); 56 | } 57 | 58 | /** 59 | * Show config menu 60 | */ 61 | function showMenu() { 62 | global $CFG_GLPI; 63 | 64 | if (!$this->canView()) { 65 | return false; 66 | } 67 | 68 | echo "
"; 69 | echo ""; 70 | echo ""; 71 | echo ""; 72 | echo ""; 73 | echo ""; 74 | 75 | // Add shell command 76 | echo ""; 81 | 82 | // Command group 83 | echo ""; 88 | 89 | // Advanced execution 90 | echo ""; 95 | 96 | echo "
" . PluginShellcommandsShellcommand::getTypeName(2) . "
"; 77 | echo ""; 78 | echo ""; 79 | echo "

" . PluginShellcommandsShellcommand::getTypeName(2) . "
"; 80 | echo "
"; 84 | echo ""; 85 | echo ""; 86 | echo "

" . PluginShellcommandsCommandGroup::getTypeName(2) . "
"; 87 | echo "
"; 91 | echo ""; 92 | echo ""; 93 | echo "

" . PluginShellcommandsAdvanced_Execution::getTypeName(2) . "
"; 94 | echo "
"; 97 | } 98 | } 99 | -------------------------------------------------------------------------------- /inc/profile.class.php: -------------------------------------------------------------------------------- 1 | . 27 | -------------------------------------------------------------------------- 28 | */ 29 | 30 | if (!defined('GLPI_ROOT')) { 31 | die("Sorry. You can't access directly to this file"); 32 | } 33 | 34 | class PluginShellcommandsProfile extends Profile { 35 | 36 | static $rightname = "profile"; 37 | 38 | function getTabNameForItem(CommonGLPI $item, $withtemplate = 0) { 39 | 40 | if ($item->getType() == 'Profile' 41 | && $item->getField('interface') != 'helpdesk') { 42 | return PluginShellcommandsShellcommand::getTypeName(2); 43 | } 44 | return ''; 45 | } 46 | 47 | static function displayTabContentForItem(CommonGLPI $item, $tabnum = 1, $withtemplate = 0) { 48 | 49 | if ($item->getType() == 'Profile') { 50 | $ID = $item->getID(); 51 | $prof = new self(); 52 | 53 | self::addDefaultProfileInfos($ID, 54 | ['shellcommands' => 0]); 55 | $prof->showForm($ID); 56 | } 57 | 58 | return true; 59 | } 60 | 61 | static function purgeProfiles(Profile $prof) { 62 | $plugprof = new ProfileRight(); 63 | foreach (self::getAllRights(true) as $right) { 64 | $plugprof->deleteByCriteria(['profiles_id' => $prof->getField("id"), 'name' => $right]); 65 | } 66 | } 67 | 68 | function showForm($profiles_id = 0, $openform = true, $closeform = true) { 69 | 70 | echo "
"; 71 | if (($canedit = Session::haveRightsOr(self::$rightname, [CREATE, UPDATE, PURGE])) 72 | && $openform) { 73 | $profile = new Profile(); 74 | echo ""; 75 | } 76 | 77 | $profile = new Profile(); 78 | $profile->getFromDB($profiles_id); 79 | 80 | $rights = $this->getAllRights(); 81 | $profile->displayRightsChoiceMatrix($rights, ['canedit' => $canedit, 82 | 'default_class' => 'tab_bg_2', 83 | 'title' => __('General')]); 84 | 85 | if ($canedit 86 | && $closeform) { 87 | echo "
"; 88 | echo Html::hidden('id', ['value' => $profiles_id]); 89 | echo Html::submit(_sx('button', 'Save'), ['name' => 'update', 'class' => 'btn btn-primary']); 90 | echo "
\n"; 91 | Html::closeForm(); 92 | } 93 | echo "
"; 94 | 95 | $this->showLegend(); 96 | 97 | } 98 | 99 | static function getAllRights($all = false) { 100 | $rights = [['itemtype' => 'PluginShellcommandsShellcommand', 101 | 'label' => _n('Shell Command', 'Shell Commands', 2, 'shellcommands'), 102 | 'field' => 'plugin_shellcommands' 103 | ]]; 104 | 105 | return $rights; 106 | } 107 | 108 | /** 109 | * Init profiles 110 | * 111 | **/ 112 | 113 | static function translateARight($old_right) { 114 | switch ($old_right) { 115 | case '': 116 | return 0; 117 | case 'r' : 118 | return READ; 119 | case 'w': 120 | return ALLSTANDARDRIGHT; 121 | case '0': 122 | case '1': 123 | return $old_right; 124 | 125 | default : 126 | return 0; 127 | } 128 | } 129 | 130 | 131 | /** 132 | * @since 0.85 133 | * Migration rights from old system to the new one for one profile 134 | * 135 | * @param $profiles_id the profile ID 136 | */ 137 | static function migrateOneProfile($profiles_id) { 138 | global $DB; 139 | //Cannot launch migration if there's nothing to migrate... 140 | if (!$DB->tableExists('glpi_plugin_shellcommands_profiles')) { 141 | return true; 142 | } 143 | 144 | foreach ($DB->request('glpi_plugin_shellcommands_profiles', 145 | "`profiles_id`='$profiles_id'") as $profile_data) { 146 | 147 | $matching = ['shellcommands' => 'plugin_shellcommands']; 148 | $current_rights = ProfileRight::getProfileRights($profiles_id, array_values($matching)); 149 | foreach ($matching as $old => $new) { 150 | if (!isset($current_rights[$old])) { 151 | $query = "UPDATE `glpi_profilerights` 152 | SET `rights`='" . self::translateARight($profile_data[$old]) . "' 153 | WHERE `name`='$new' AND `profiles_id`='$profiles_id'"; 154 | $DB->query($query); 155 | } 156 | } 157 | } 158 | } 159 | 160 | /** 161 | * Initialize profiles, and migrate it necessary 162 | */ 163 | static function initProfile() { 164 | global $DB; 165 | $profile = new self(); 166 | $dbu = new DbUtils(); 167 | //Add new rights in glpi_profilerights table 168 | foreach ($profile->getAllRights(true) as $data) { 169 | if ($dbu->countElementsInTable("glpi_profilerights", 170 | ["name" => $data['field']]) == 0) { 171 | ProfileRight::addProfileRights([$data['field']]); 172 | } 173 | } 174 | 175 | //Migration old rights in new ones 176 | foreach ($DB->request("SELECT `id` FROM `glpi_profiles`") as $prof) { 177 | self::migrateOneProfile($prof['id']); 178 | } 179 | foreach ($DB->request("SELECT * 180 | FROM `glpi_profilerights` 181 | WHERE `profiles_id`='" . $_SESSION['glpiactiveprofile']['id'] . "' 182 | AND `name` LIKE '%plugin_shellcommands%'") as $prof) { 183 | $_SESSION['glpiactiveprofile'][$prof['name']] = $prof['rights']; 184 | } 185 | } 186 | 187 | /** 188 | * Initialize profiles, and migrate it necessary 189 | */ 190 | static function changeProfile() { 191 | global $DB; 192 | 193 | foreach ($DB->request("SELECT * 194 | FROM `glpi_profilerights` 195 | WHERE `profiles_id`='" . $_SESSION['glpiactiveprofile']['id'] . "' 196 | AND `name` LIKE '%plugin_shellcommands%'") as $prof) { 197 | $_SESSION['glpiactiveprofile'][$prof['name']] = $prof['rights']; 198 | } 199 | 200 | } 201 | 202 | static function createFirstAccess($profiles_id) { 203 | self::addDefaultProfileInfos($profiles_id, 204 | ['plugin_shellcommands' => ALLSTANDARDRIGHT], true); 205 | 206 | } 207 | 208 | static function removeRightsFromSession() { 209 | foreach (self::getAllRights(true) as $right) { 210 | if (isset($_SESSION['glpiactiveprofile'][$right['field']])) { 211 | unset($_SESSION['glpiactiveprofile'][$right['field']]); 212 | } 213 | } 214 | } 215 | 216 | static function removeRightsFromDB() { 217 | $plugprof = new ProfileRight(); 218 | foreach (self::getAllRights(true) as $right) { 219 | $plugprof->deleteByCriteria(['name' => $right['field']]); 220 | } 221 | } 222 | 223 | /** 224 | * @param $profile 225 | **/ 226 | static function addDefaultProfileInfos($profiles_id, $rights, $drop_existing = false) { 227 | $dbu = new DbUtils(); 228 | $profileRight = new ProfileRight(); 229 | foreach ($rights as $right => $value) { 230 | if ($dbu->countElementsInTable('glpi_profilerights', 231 | ["profiles_id" => $profiles_id, "name" => $right]) && $drop_existing) { 232 | $profileRight->deleteByCriteria(['profiles_id' => $profiles_id, 'name' => $right]); 233 | } 234 | if (!$dbu->countElementsInTable('glpi_profilerights', 235 | ["profiles_id" => $profiles_id, "name" => $right])) { 236 | $myright['profiles_id'] = $profiles_id; 237 | $myright['name'] = $right; 238 | $myright['rights'] = $value; 239 | $profileRight->add($myright); 240 | 241 | //Add right to the current session 242 | $_SESSION['glpiactiveprofile'][$right] = $value; 243 | } 244 | } 245 | } 246 | 247 | } 248 | 249 | -------------------------------------------------------------------------------- /inc/shellcommandpath.class.php: -------------------------------------------------------------------------------- 1 | . 27 | -------------------------------------------------------------------------- 28 | */ 29 | 30 | if (!defined('GLPI_ROOT')) { 31 | die("Sorry. You can't access directly to this file"); 32 | } 33 | 34 | class PluginShellcommandsShellcommandPath extends CommonDropdown { 35 | 36 | static $rightname = 'plugin_shellcommands'; 37 | 38 | static function getTypeName($nb = 0) { 39 | 40 | return _n('Path', 'Pathes', $nb, 'shellcommands'); 41 | } 42 | 43 | static function canView() { 44 | return Session::haveRight(self::$rightname, READ); 45 | } 46 | 47 | static function canCreate() { 48 | return Session::haveRightsOr(self::$rightname, [CREATE, UPDATE, DELETE]); 49 | } 50 | 51 | 52 | } 53 | 54 | -------------------------------------------------------------------------------- /inc/webservice.class.php: -------------------------------------------------------------------------------- 1 | . 27 | -------------------------------------------------------------------------- 28 | */ 29 | 30 | if (!defined('GLPI_ROOT')) { 31 | die("Sorry. You can't access directly to this file"); 32 | } 33 | 34 | class PluginShellcommandsWebservice { 35 | 36 | /** 37 | * Method to list shellcommands by webservice 38 | * 39 | * @param array $params Options 40 | * @param string $protocol Communication protocol used 41 | * 42 | * @return array or error value 43 | */ 44 | static function methodList($params, $protocol) { 45 | if (isset ($params['help'])) { 46 | return [ 47 | 'help' => 'bool,optional' 48 | ]; 49 | } 50 | if (!Session::getLoginUserID()) { 51 | return PluginWebservicesMethodCommon::Error($protocol, WEBSERVICES_ERROR_NOTAUTHENTICATED); 52 | } 53 | 54 | $shellcommandsList = []; 55 | 56 | $command = new PluginShellcommandsShellcommand(); 57 | $commandItems = new PluginShellcommandsShellcommand_Item(); 58 | 59 | foreach ($command->find(['is_deleted' => 0], 'name ASC') as $currentCommand) { 60 | $currentCommandTargets = []; 61 | foreach ($commandItems->find(['plugin_shellcommands_shellcommands_id' => $currentCommand['id']]) as $currentItem) { 62 | $currentCommandTargets[] = $currentItem['itemtype']; 63 | } 64 | $shellcommandsList[] = [ 65 | 'id' => $currentCommand['id'], 66 | 'name' => $currentCommand['name'], 67 | 'targets' => $currentCommandTargets, 68 | ]; 69 | } 70 | 71 | return $shellcommandsList; 72 | } 73 | 74 | 75 | /** 76 | * Method to run shellcommands by webservice 77 | * 78 | * @param array $params Options 79 | * @param string $protocol Communication protocol used 80 | * 81 | * @return array or error value 82 | */ 83 | static function methodRun($params, $protocol) { 84 | global $DB; 85 | 86 | if (isset ($params['help'])) { 87 | return [ 88 | 'command_id' => 'integer,optional,multiple', 89 | 'command_name' => 'string,optional,multiple', 90 | 'target_type' => 'string,mandatory', 91 | 'target_id' => 'integer,optional,multiple', 92 | 'target_name' => 'string,optional', 93 | 'help' => 'bool,optional' 94 | ]; 95 | } 96 | if (!Session::getLoginUserID()) { 97 | return PluginWebservicesMethodCommon::Error($protocol, WEBSERVICES_ERROR_NOTAUTHENTICATED); 98 | } 99 | 100 | $executionOutputs = []; 101 | $invalidCommands = []; 102 | $invalidTargets = []; 103 | 104 | /** Parameters check **/ 105 | if ((!isset($params['command_id']) || empty($params['command_id'])) 106 | && (!isset($params['command_name']) || empty($params['command_name'])) 107 | ) { 108 | return PluginWebservicesMethodCommon::Error($protocol, WEBSERVICES_ERROR_MISSINGPARAMETER, '', 'one among "command_id" and "command_name"'); 109 | } 110 | //Post-relation: Either Shellcommand ID or name is given 111 | 112 | if ((!isset($params['target_type']) || empty($params['target_type'])) 113 | || ( 114 | (!isset($params['target_id']) || empty($params['target_id'])) 115 | && (!isset($params['target_name']) || empty($params['target_name'])) 116 | ) 117 | ) { 118 | return PluginWebservicesMethodCommon::Error($protocol, WEBSERVICES_ERROR_MISSINGPARAMETER, '', 'must specify "target_type" and one among "target_id" and "target_name"'); 119 | } 120 | //Post-relation: Either Target ID or name is given 121 | 122 | $possibleTargetTypes = PluginShellcommandsShellcommand::getTypes(true); 123 | if (!in_array($params['target_type'], $possibleTargetTypes) || !class_exists($params['target_type'])) { 124 | return PluginWebservicesMethodCommon::Error($protocol, WEBSERVICES_ERROR_BADPARAMETER, '', '"target_type" is "' . $params['target_type'] . '" must be one of: ' . implode(', ', $possibleTargetTypes) . ''); 125 | } 126 | //Post-relation: Given target type ($params['target_type']) is valid 127 | /** /Parameters check **/ 128 | 129 | /** Command determination **/ 130 | $commandIds = []; 131 | if (isset($params['command_id']) && !empty($params['command_id'])) { // ID(s) given 132 | $commandIds = (array)$params['command_id']; 133 | } else { // Name(s) given 134 | $command_names = (array)$params['command_name']; 135 | foreach ($command_names as $currentCommandName) { 136 | $command = new PluginShellcommandsShellcommand(); 137 | if ($command->getFromDBbyName($currentCommandName)) { 138 | $commandIds[] = $command->fields['id']; 139 | } else { 140 | $invalidCommands[] = $currentCommandName; 141 | } 142 | } 143 | } 144 | //Post-relation: $commandIds is an array containing either provided or found (via given name) shellcommand IDs 145 | /** /Command determination **/ 146 | 147 | /** Target determination **/ 148 | $targetIds = []; 149 | if (isset($params['target_id']) && !empty($params['target_id'])) { // ID(s) given 150 | $targetIds = (array)$params['target_id']; 151 | } else { // Name(s) given 152 | $target_names = (array)$params['target_name']; 153 | foreach ($target_names as $currentTargetName) { 154 | $target = new $params['target_type'](); 155 | if ($found = $target->find(['name' => $DB->escape($currentTargetName)])) { 156 | $targetIds = array_merge($targetIds, array_keys($found)); 157 | } else { 158 | $invalidTargets[] = $currentTargetName; 159 | } 160 | } 161 | } 162 | //Post-relation: $targetIds is an array containing either provided or found (via given name) targets IDs (of type $params['target_type']) 163 | /** /Target determination **/ 164 | 165 | $commandIds = array_unique($commandIds); 166 | $targetIds = array_unique($targetIds); 167 | 168 | foreach ($targetIds as $currentTargetId) { 169 | $item = new $params['target_type'](); 170 | $targetFound = $item->getFromDB($currentTargetId); 171 | if (!$targetFound) { 172 | $invalidTargets[] = $currentTargetId; 173 | } 174 | 175 | foreach ($commandIds as $currentCommandId) { 176 | $targetParams = PluginShellcommandsShellcommand_Item::resolveLinkOfCommand($currentCommandId, $item); 177 | if ($targetParams !== false) { 178 | foreach ((array)$targetParams as $currentTargetParam) { 179 | list($error, $executionOutput) = PluginShellcommandsShellcommand_Item::execCommand($currentCommandId, $currentTargetParam); 180 | $executionOutputs[] = trim($executionOutput); 181 | } 182 | } else { 183 | $invalidCommands[] = $currentCommandId; 184 | } 185 | } 186 | } 187 | 188 | return [ 189 | 'callResults' => implode(PHP_EOL, $executionOutputs), 190 | 'invalidCommands' => $invalidCommands, 191 | 'invalidTargets' => $invalidTargets, 192 | ]; 193 | } 194 | } 195 | 196 | -------------------------------------------------------------------------------- /index.php: -------------------------------------------------------------------------------- 1 | . 27 | -------------------------------------------------------------------------- 28 | */ 29 | -------------------------------------------------------------------------------- /locales/cs_CZ.mo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/InfotelGLPI/shellcommands/919c5ed8a52368d681418b7950bf596d09b32232/locales/cs_CZ.mo -------------------------------------------------------------------------------- /locales/cs_CZ.po: -------------------------------------------------------------------------------- 1 | # SOME DESCRIPTIVE TITLE. 2 | # Copyright (C) YEAR Shellcommands Development Team 3 | # This file is distributed under the same license as the GLPI - Shellcommands plugin package. 4 | # FIRST AUTHOR , YEAR. 5 | # 6 | # Translators: 7 | # Xavier CAILLAUD , 2020 8 | # 9 | #, fuzzy 10 | msgid "" 11 | msgstr "" 12 | "Project-Id-Version: GLPI - Shellcommands plugin 2.1.0\n" 13 | "Report-Msgid-Bugs-To: \n" 14 | "POT-Creation-Date: 2019-02-25 09:32+0100\n" 15 | "PO-Revision-Date: 2020-11-02 13:01+0000\n" 16 | "Last-Translator: Xavier CAILLAUD , 2020\n" 17 | "Language-Team: Czech (Czech Republic) (https://www.transifex.com/infotelGLPI/teams/12373/cs_CZ/)\n" 18 | "MIME-Version: 1.0\n" 19 | "Content-Type: text/plain; charset=UTF-8\n" 20 | "Content-Transfer-Encoding: 8bit\n" 21 | "Language: cs_CZ\n" 22 | "Plural-Forms: nplurals=4; plural=(n == 1 && n % 1 == 0) ? 0 : (n >= 2 && n <= 4 && n % 1 == 0) ? 1: (n % 1 != 0 ) ? 2 : 3;\n" 23 | 24 | #: hook.php:147 inc/shellcommand.class.php:116 inc/shellcommand.class.php:214 25 | #: inc/shellcommandpath.class.php:40 26 | msgid "Path" 27 | msgid_plural "Pathes" 28 | msgstr[0] "Popis umístění" 29 | msgstr[1] "Popisy umístění" 30 | msgstr[2] "Popisů umístění" 31 | msgstr[3] "Popisy umístění" 32 | 33 | #: hook.php:228 34 | msgid "Command launch" 35 | msgstr "Spuštění příkazu" 36 | 37 | #: hook.php:229 38 | msgid "Command group launch" 39 | msgstr "Spuštění skupiny příkazů" 40 | 41 | #: setup.php:65 inc/profile.class.php:101 inc/shellcommand.class.php:49 42 | #: inc/shellcommand.class.php:487 43 | msgid "Shell Command" 44 | msgid_plural "Shell Commands" 45 | msgstr[0] "Příkaz shellu" 46 | msgstr[1] "Příkazy shellu" 47 | msgstr[2] "Příkazů shellu" 48 | msgstr[3] "Příkazy shellu" 49 | 50 | #: inc/advanced_execution.class.php:40 inc/shellcommand.class.php:497 51 | msgid "Advanced execution" 52 | msgid_plural "Advanced executions" 53 | msgstr[0] "Pokročilé vykonávání" 54 | msgstr[1] "Pokročilá vykonávání" 55 | msgstr[2] "Pokročilých vykonávání" 56 | msgstr[3] "Pokročilá vykonávání" 57 | 58 | #: inc/commandgroup.class.php:40 inc/commandgroup_item.class.php:58 59 | #: inc/shellcommand.class.php:492 60 | msgid "Command group" 61 | msgid_plural "Command groups" 62 | msgstr[0] "Skupina příkazu" 63 | msgstr[1] "Skupiny příkazu" 64 | msgstr[2] "Skupin příkazu" 65 | msgstr[3] "Skupiny příkazu" 66 | 67 | #: inc/commandgroup.class.php:120 68 | msgid "Check command" 69 | msgstr "Kontrolní příkaz" 70 | 71 | #: inc/commandgroup_item.class.php:158 72 | msgid "Add a command" 73 | msgstr "Přidat příkaz" 74 | 75 | #: inc/commandgroup_item.class.php:212 76 | msgid "Add a command group" 77 | msgstr "Přidat skupinu příkazů" 78 | 79 | #: inc/commandgroup_item.class.php:398 80 | msgid "Order" 81 | msgstr "Pořadí" 82 | 83 | #: inc/commandgroup_item.class.php:546 84 | msgid "Host UP" 85 | msgstr "Stroj DOSTUPNÝ" 86 | 87 | #: inc/commandgroup_item.class.php:577 88 | msgid "Host DOWN" 89 | msgstr "Stroj NEDOSTUPNÝ" 90 | 91 | #: inc/menu.class.php:47 92 | msgid "Shellcommands menu" 93 | msgstr "Nabídka příkazů shellu" 94 | 95 | #: inc/shellcommand.class.php:124 inc/shellcommand.class.php:209 96 | msgid "Windows" 97 | msgstr "Parametry" 98 | 99 | #: inc/shellcommand.class.php:201 100 | msgid "Tag position" 101 | msgstr "Pozice štítku" 102 | 103 | #: inc/shellcommand.class.php:203 104 | msgid "Before parameters" 105 | msgstr "Před parametry" 106 | 107 | #: inc/shellcommand.class.php:203 108 | msgid "After parameters" 109 | msgstr "Za parametry" 110 | 111 | #: inc/shellcommand_item.class.php:464 112 | msgid "Associated Commands" 113 | msgstr "Přiřazené příkazy" 114 | 115 | #: inc/shellcommand_item.class.php:818 116 | msgid "There is an error with socket creation" 117 | msgstr "Chyba při vytváření soketu" 118 | 119 | #: inc/shellcommand_item.class.php:857 120 | msgid "Magic packet sending to" 121 | msgstr "Probouzecí paket odeslán na" 122 | 123 | #: inc/shellcommand_item.class.php:859 124 | msgid "The packet cannot be send" 125 | msgstr "Packet nelze poslat" 126 | -------------------------------------------------------------------------------- /locales/de_DE.mo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/InfotelGLPI/shellcommands/919c5ed8a52368d681418b7950bf596d09b32232/locales/de_DE.mo -------------------------------------------------------------------------------- /locales/de_DE.po: -------------------------------------------------------------------------------- 1 | # SOME DESCRIPTIVE TITLE. 2 | # Copyright (C) YEAR Shellcommands Development Team 3 | # This file is distributed under the same license as the GLPI - Shellcommands plugin package. 4 | # FIRST AUTHOR , YEAR. 5 | # 6 | # Translators: 7 | # Xavier CAILLAUD , 2020 8 | # Stephan , 2022 9 | # 10 | #, fuzzy 11 | msgid "" 12 | msgstr "" 13 | "Project-Id-Version: GLPI - Shellcommands plugin 2.1.0\n" 14 | "Report-Msgid-Bugs-To: \n" 15 | "POT-Creation-Date: 2022-07-26 14:02+0000\n" 16 | "PO-Revision-Date: 2020-11-02 16:20+0000\n" 17 | "Last-Translator: Stephan , 2022\n" 18 | "Language-Team: German (Germany) (https://www.transifex.com/infotelGLPI/teams/12373/de_DE/)\n" 19 | "MIME-Version: 1.0\n" 20 | "Content-Type: text/plain; charset=UTF-8\n" 21 | "Content-Transfer-Encoding: 8bit\n" 22 | "Language: de_DE\n" 23 | "Plural-Forms: nplurals=2; plural=(n != 1);\n" 24 | 25 | #: hook.php:147 inc/shellcommand.class.php:116 inc/shellcommand.class.php:214 26 | #: inc/shellcommandpath.class.php:40 27 | msgid "Path" 28 | msgid_plural "Pathes" 29 | msgstr[0] "Pfad" 30 | msgstr[1] "Pfade" 31 | 32 | #: hook.php:226 33 | msgid "Command launch" 34 | msgstr "Befehl ausführen" 35 | 36 | #: hook.php:227 37 | msgid "Command group launch" 38 | msgstr "Befehlsgruppe ausführen" 39 | 40 | #: setup.php:70 inc/profile.class.php:101 inc/shellcommand.class.php:49 41 | #: inc/shellcommand.class.php:485 42 | msgid "Shell Command" 43 | msgid_plural "Shell Commands" 44 | msgstr[0] "Shell-Befehl" 45 | msgstr[1] "Shell-Befehle" 46 | 47 | #: inc/advanced_execution.class.php:40 inc/shellcommand.class.php:495 48 | msgid "Advanced execution" 49 | msgid_plural "Advanced executions" 50 | msgstr[0] "Erweiterte Ausführung" 51 | msgstr[1] "Erweiterte Ausführungen" 52 | 53 | #: inc/commandgroup.class.php:40 inc/commandgroup_item.class.php:58 54 | #: inc/shellcommand.class.php:490 55 | msgid "Command group" 56 | msgid_plural "Command groups" 57 | msgstr[0] "Kommando-Gruppe" 58 | msgstr[1] "Befehlsgruppen" 59 | 60 | #: inc/commandgroup.class.php:127 61 | msgid "Check command" 62 | msgstr "Befehl prüfen" 63 | 64 | #: inc/commandgroup_item.class.php:158 65 | msgid "Add a command" 66 | msgstr "Befehl hinzufügen" 67 | 68 | #: inc/commandgroup_item.class.php:212 69 | msgid "Add a command group" 70 | msgstr "Eine Befehlsgruppe hinzufügen" 71 | 72 | #: inc/commandgroup_item.class.php:398 73 | msgid "Order" 74 | msgstr "Reihenfolge" 75 | 76 | #: inc/commandgroup_item.class.php:544 77 | msgid "Host UP" 78 | msgstr "Host UP" 79 | 80 | #: inc/commandgroup_item.class.php:575 81 | msgid "Host DOWN" 82 | msgstr "Host DOWN" 83 | 84 | #: inc/menu.class.php:47 85 | msgid "Shellcommands menu" 86 | msgstr "Shell-Befehle Menü" 87 | 88 | #: inc/shellcommand.class.php:124 inc/shellcommand.class.php:209 89 | msgid "Windows" 90 | msgstr "Befehlszeilenparameter" 91 | 92 | #: inc/shellcommand.class.php:201 93 | msgid "Tag position" 94 | msgstr "Tag-Position" 95 | 96 | #: inc/shellcommand.class.php:203 97 | msgid "Before parameters" 98 | msgstr "Vor Parameter" 99 | 100 | #: inc/shellcommand.class.php:203 101 | msgid "After parameters" 102 | msgstr "Nach Parameter" 103 | 104 | #: inc/shellcommand_item.class.php:442 105 | msgid "Associated Commands" 106 | msgstr "Verbundene Befehle" 107 | 108 | #: inc/shellcommand_item.class.php:795 109 | msgid "There is an error with socket creation" 110 | msgstr "Bei der Socket-Erstellung ist ein Fehler aufgetreten" 111 | 112 | #: inc/shellcommand_item.class.php:834 113 | msgid "Magic packet sending to" 114 | msgstr "Magic Packet wird gesendet an" 115 | 116 | #: inc/shellcommand_item.class.php:836 117 | msgid "The packet cannot be send" 118 | msgstr "Das Paket konnte nicht gesendet werden." 119 | -------------------------------------------------------------------------------- /locales/en_GB.mo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/InfotelGLPI/shellcommands/919c5ed8a52368d681418b7950bf596d09b32232/locales/en_GB.mo -------------------------------------------------------------------------------- /locales/en_GB.po: -------------------------------------------------------------------------------- 1 | # SOME DESCRIPTIVE TITLE. 2 | # Copyright (C) YEAR Shellcommands Development Team 3 | # This file is distributed under the same license as the GLPI - Shellcommands plugin package. 4 | # 5 | # Translators: 6 | msgid "" 7 | msgstr "" 8 | "Project-Id-Version: GLPI Project - shellcommands plugin\n" 9 | "Report-Msgid-Bugs-To: \n" 10 | "POT-Creation-Date: 2018-07-10 08:50+0200\n" 11 | "PO-Revision-Date: 2018-03-29 13:23+0000\n" 12 | "Last-Translator: Amandine Manceau\n" 13 | "Language-Team: English (United Kingdom) (http://www.transifex.com/tsmr/GLPI_shellcommands/language/en_GB/)\n" 14 | "MIME-Version: 1.0\n" 15 | "Content-Type: text/plain; charset=UTF-8\n" 16 | "Content-Transfer-Encoding: 8bit\n" 17 | "Language: en_GB\n" 18 | "Plural-Forms: nplurals=2; plural=(n != 1);\n" 19 | 20 | #: hook.php:147 inc/shellcommand.class.php:117 inc/shellcommand.class.php:216 21 | #: inc/shellcommandpath.class.php:40 22 | msgid "Path" 23 | msgid_plural "Pathes" 24 | msgstr[0] "Path" 25 | msgstr[1] "Pathes" 26 | 27 | #: hook.php:228 28 | msgid "Command launch" 29 | msgstr "Command launch" 30 | 31 | #: hook.php:229 32 | msgid "Command group launch" 33 | msgstr "Command group launch" 34 | 35 | #: setup.php:63 inc/profile.class.php:102 inc/shellcommand.class.php:49 36 | #: inc/shellcommand.class.php:489 37 | msgid "Shell Command" 38 | msgid_plural "Shell Commands" 39 | msgstr[0] "Shell Command" 40 | msgstr[1] "Shell Commands" 41 | 42 | #: inc/advanced_execution.class.php:40 inc/shellcommand.class.php:499 43 | msgid "Advanced execution" 44 | msgid_plural "Advanced executions" 45 | msgstr[0] "Advanced execution" 46 | msgstr[1] "Advanced executions" 47 | 48 | #: inc/commandgroup.class.php:40 inc/commandgroup_item.class.php:58 49 | #: inc/shellcommand.class.php:494 50 | msgid "Command group" 51 | msgid_plural "Command groups" 52 | msgstr[0] "Command group" 53 | msgstr[1] "Command groups" 54 | 55 | #: inc/commandgroup.class.php:122 56 | msgid "Check command" 57 | msgstr "Check command" 58 | 59 | #: inc/commandgroup_item.class.php:158 60 | msgid "Add a command" 61 | msgstr "Add a command" 62 | 63 | #: inc/commandgroup_item.class.php:212 64 | msgid "Add a command group" 65 | msgstr "Add a command group" 66 | 67 | #: inc/commandgroup_item.class.php:402 68 | msgid "Order" 69 | msgstr "Order" 70 | 71 | #: inc/commandgroup_item.class.php:550 72 | msgid "Host UP" 73 | msgstr "Host UP" 74 | 75 | #: inc/commandgroup_item.class.php:581 76 | msgid "Host DOWN" 77 | msgstr "Host DOWN" 78 | 79 | #: inc/menu.class.php:47 80 | msgid "Shellcommands menu" 81 | msgstr "Shellcommands menu" 82 | 83 | #: inc/shellcommand.class.php:125 inc/shellcommand.class.php:211 84 | msgid "Windows" 85 | msgstr "Windows" 86 | 87 | #: inc/shellcommand.class.php:203 88 | msgid "Tag position" 89 | msgstr "Tag position" 90 | 91 | #: inc/shellcommand.class.php:205 92 | msgid "Before parameters" 93 | msgstr "Before parameters" 94 | 95 | #: inc/shellcommand.class.php:205 96 | msgid "After parameters" 97 | msgstr "After parameters" 98 | 99 | #: inc/shellcommand_item.class.php:459 100 | msgid "Associated Commands" 101 | msgstr "Associated Commands" 102 | 103 | #: inc/shellcommand_item.class.php:814 104 | msgid "There is an error with socket creation" 105 | msgstr "There is an error with socket creation" 106 | 107 | #: inc/shellcommand_item.class.php:853 108 | msgid "Magic packet sending to" 109 | msgstr "Magic packet sending to" 110 | 111 | #: inc/shellcommand_item.class.php:855 112 | msgid "The packet cannot be send" 113 | msgstr "The packet cannot be send" 114 | -------------------------------------------------------------------------------- /locales/es_EC.po: -------------------------------------------------------------------------------- 1 | # SOME DESCRIPTIVE TITLE. 2 | # Copyright (C) YEAR Shellcommands Development Team 3 | # This file is distributed under the same license as the GLPI - Shellcommands plugin package. 4 | # FIRST AUTHOR , YEAR. 5 | # 6 | # Translators: 7 | # Soporte Infraestructura Standby, 2023 8 | # 9 | #, fuzzy 10 | msgid "" 11 | msgstr "" 12 | "Project-Id-Version: GLPI - Shellcommands plugin 2.1.0\n" 13 | "Report-Msgid-Bugs-To: \n" 14 | "POT-Creation-Date: 2022-07-26 14:02+0000\n" 15 | "PO-Revision-Date: 2020-11-02 16:20+0000\n" 16 | "Last-Translator: Soporte Infraestructura Standby, 2023\n" 17 | "Language-Team: Spanish (Ecuador) (https://app.transifex.com/infotelGLPI/teams/12373/es_EC/)\n" 18 | "MIME-Version: 1.0\n" 19 | "Content-Type: text/plain; charset=UTF-8\n" 20 | "Content-Transfer-Encoding: 8bit\n" 21 | "Language: es_EC\n" 22 | "Plural-Forms: nplurals=3; plural=n == 1 ? 0 : n != 0 && n % 1000000 == 0 ? 1 : 2;\n" 23 | 24 | #: hook.php:147 inc/shellcommand.class.php:116 inc/shellcommand.class.php:214 25 | #: inc/shellcommandpath.class.php:40 26 | msgid "Path" 27 | msgid_plural "Pathes" 28 | msgstr[0] "Rutas" 29 | msgstr[1] "Vías" 30 | msgstr[2] "Rutas" 31 | 32 | #: hook.php:226 33 | msgid "Command launch" 34 | msgstr "Inicio del comando" 35 | 36 | #: hook.php:227 37 | msgid "Command group launch" 38 | msgstr "Inicio del grupo de comandos" 39 | 40 | #: setup.php:70 inc/profile.class.php:101 inc/shellcommand.class.php:49 41 | #: inc/shellcommand.class.php:485 42 | msgid "Shell Command" 43 | msgid_plural "Shell Commands" 44 | msgstr[0] "Comandos de shell" 45 | msgstr[1] "Comandos de shell" 46 | msgstr[2] "Comandos de shell" 47 | 48 | #: inc/advanced_execution.class.php:40 inc/shellcommand.class.php:495 49 | msgid "Advanced execution" 50 | msgid_plural "Advanced executions" 51 | msgstr[0] "Ejecuciones avanzadas" 52 | msgstr[1] "Ejecuciones avanzadas" 53 | msgstr[2] "Ejecuciones avanzadas" 54 | 55 | #: inc/commandgroup.class.php:40 inc/commandgroup_item.class.php:58 56 | #: inc/shellcommand.class.php:490 57 | msgid "Command group" 58 | msgid_plural "Command groups" 59 | msgstr[0] "Grupos de comandos" 60 | msgstr[1] "Grupos de comandos" 61 | msgstr[2] "Grupos de comandos" 62 | 63 | #: inc/commandgroup.class.php:127 64 | msgid "Check command" 65 | msgstr "Comando de verificación" 66 | 67 | #: inc/commandgroup_item.class.php:158 68 | msgid "Add a command" 69 | msgstr "Agregar un comando" 70 | 71 | #: inc/commandgroup_item.class.php:212 72 | msgid "Add a command group" 73 | msgstr "Agregar un grupo de comandos" 74 | 75 | #: inc/commandgroup_item.class.php:398 76 | msgid "Order" 77 | msgstr "Orden" 78 | 79 | #: inc/commandgroup_item.class.php:544 80 | msgid "Host UP" 81 | msgstr "Anfitrión UP" 82 | 83 | #: inc/commandgroup_item.class.php:575 84 | msgid "Host DOWN" 85 | msgstr "Anfitrión DOWN" 86 | 87 | #: inc/menu.class.php:47 88 | msgid "Shellcommands menu" 89 | msgstr "Menú Shellcommands" 90 | 91 | #: inc/shellcommand.class.php:124 inc/shellcommand.class.php:209 92 | msgid "Windows" 93 | msgstr "Windows" 94 | 95 | #: inc/shellcommand.class.php:201 96 | msgid "Tag position" 97 | msgstr "Posición de la etiqueta" 98 | 99 | #: inc/shellcommand.class.php:203 100 | msgid "Before parameters" 101 | msgstr "Antes de los parámetros" 102 | 103 | #: inc/shellcommand.class.php:203 104 | msgid "After parameters" 105 | msgstr "Después de los parámetros" 106 | 107 | #: inc/shellcommand_item.class.php:442 108 | msgid "Associated Commands" 109 | msgstr "Comandos asociados" 110 | 111 | #: inc/shellcommand_item.class.php:795 112 | msgid "There is an error with socket creation" 113 | msgstr "Hay un error con la creación del socket" 114 | 115 | #: inc/shellcommand_item.class.php:834 116 | msgid "Magic packet sending to" 117 | msgstr "Envío de paquetes mágicos a" 118 | 119 | #: inc/shellcommand_item.class.php:836 120 | msgid "The packet cannot be send" 121 | msgstr "El paquete no se puede enviar" 122 | -------------------------------------------------------------------------------- /locales/es_ES.mo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/InfotelGLPI/shellcommands/919c5ed8a52368d681418b7950bf596d09b32232/locales/es_ES.mo -------------------------------------------------------------------------------- /locales/es_ES.po: -------------------------------------------------------------------------------- 1 | # SOME DESCRIPTIVE TITLE. 2 | # Copyright (C) YEAR Shellcommands Development Team 3 | # This file is distributed under the same license as the GLPI - Shellcommands plugin package. 4 | # FIRST AUTHOR , YEAR. 5 | # 6 | # Translators: 7 | # Xavier CAILLAUD , 2020 8 | # 9 | #, fuzzy 10 | msgid "" 11 | msgstr "" 12 | "Project-Id-Version: GLPI - Shellcommands plugin 2.1.0\n" 13 | "Report-Msgid-Bugs-To: \n" 14 | "POT-Creation-Date: 2019-02-25 09:32+0100\n" 15 | "PO-Revision-Date: 2020-11-02 13:01+0000\n" 16 | "Last-Translator: Xavier CAILLAUD , 2020\n" 17 | "Language-Team: Spanish (Spain) (https://www.transifex.com/infotelGLPI/teams/12373/es_ES/)\n" 18 | "MIME-Version: 1.0\n" 19 | "Content-Type: text/plain; charset=UTF-8\n" 20 | "Content-Transfer-Encoding: 8bit\n" 21 | "Language: es_ES\n" 22 | "Plural-Forms: nplurals=2; plural=(n != 1);\n" 23 | 24 | #: hook.php:147 inc/shellcommand.class.php:116 inc/shellcommand.class.php:214 25 | #: inc/shellcommandpath.class.php:40 26 | msgid "Path" 27 | msgid_plural "Pathes" 28 | msgstr[0] "Ruta" 29 | msgstr[1] "Rutas" 30 | 31 | #: hook.php:228 32 | msgid "Command launch" 33 | msgstr "Ejecutar la orden" 34 | 35 | #: hook.php:229 36 | msgid "Command group launch" 37 | msgstr "Ejecutar grupo de órdenes" 38 | 39 | #: setup.php:65 inc/profile.class.php:101 inc/shellcommand.class.php:49 40 | #: inc/shellcommand.class.php:487 41 | msgid "Shell Command" 42 | msgid_plural "Shell Commands" 43 | msgstr[0] "Orden de consola" 44 | msgstr[1] "Órdenes de consola" 45 | 46 | #: inc/advanced_execution.class.php:40 inc/shellcommand.class.php:497 47 | msgid "Advanced execution" 48 | msgid_plural "Advanced executions" 49 | msgstr[0] "Ejecución avanzada" 50 | msgstr[1] "Ejecuciones avanzada" 51 | 52 | #: inc/commandgroup.class.php:40 inc/commandgroup_item.class.php:58 53 | #: inc/shellcommand.class.php:492 54 | msgid "Command group" 55 | msgid_plural "Command groups" 56 | msgstr[0] "Grupo de órdenes" 57 | msgstr[1] "Grupos de órdenes" 58 | 59 | #: inc/commandgroup.class.php:120 60 | msgid "Check command" 61 | msgstr "Orden de comprobación" 62 | 63 | #: inc/commandgroup_item.class.php:158 64 | msgid "Add a command" 65 | msgstr "Añadir una orden" 66 | 67 | #: inc/commandgroup_item.class.php:212 68 | msgid "Add a command group" 69 | msgstr "Añadir un grupo de orden" 70 | 71 | #: inc/commandgroup_item.class.php:398 72 | msgid "Order" 73 | msgstr "Posición" 74 | 75 | #: inc/commandgroup_item.class.php:546 76 | msgid "Host UP" 77 | msgstr "Equipo Encendido" 78 | 79 | #: inc/commandgroup_item.class.php:577 80 | msgid "Host DOWN" 81 | msgstr "Equipo Apagado" 82 | 83 | #: inc/menu.class.php:47 84 | msgid "Shellcommands menu" 85 | msgstr "Menú de órdenes de consola" 86 | 87 | #: inc/shellcommand.class.php:124 inc/shellcommand.class.php:209 88 | msgid "Windows" 89 | msgstr "Windows" 90 | 91 | #: inc/shellcommand.class.php:201 92 | msgid "Tag position" 93 | msgstr "Posición de la etiqueta" 94 | 95 | #: inc/shellcommand.class.php:203 96 | msgid "Before parameters" 97 | msgstr "Antes de los parámetros" 98 | 99 | #: inc/shellcommand.class.php:203 100 | msgid "After parameters" 101 | msgstr "Después de los parámetros" 102 | 103 | #: inc/shellcommand_item.class.php:464 104 | msgid "Associated Commands" 105 | msgstr "Órdenes asociadas" 106 | 107 | #: inc/shellcommand_item.class.php:818 108 | msgid "There is an error with socket creation" 109 | msgstr "Hay un error con la creación del socket" 110 | 111 | #: inc/shellcommand_item.class.php:857 112 | msgid "Magic packet sending to" 113 | msgstr "'Magic packet' enviado a " 114 | 115 | #: inc/shellcommand_item.class.php:859 116 | msgid "The packet cannot be send" 117 | msgstr "El paquete no se puede enviar" 118 | -------------------------------------------------------------------------------- /locales/fr_FR.mo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/InfotelGLPI/shellcommands/919c5ed8a52368d681418b7950bf596d09b32232/locales/fr_FR.mo -------------------------------------------------------------------------------- /locales/fr_FR.po: -------------------------------------------------------------------------------- 1 | # SOME DESCRIPTIVE TITLE. 2 | # Copyright (C) YEAR Shellcommands Development Team 3 | # This file is distributed under the same license as the GLPI - Shellcommands plugin package. 4 | # FIRST AUTHOR , YEAR. 5 | # 6 | # Translators: 7 | # Xavier CAILLAUD , 2020 8 | # 9 | #, fuzzy 10 | msgid "" 11 | msgstr "" 12 | "Project-Id-Version: GLPI - Shellcommands plugin 2.1.0\n" 13 | "Report-Msgid-Bugs-To: \n" 14 | "POT-Creation-Date: 2019-02-25 09:32+0100\n" 15 | "PO-Revision-Date: 2020-11-02 16:20+0000\n" 16 | "Last-Translator: Xavier CAILLAUD , 2020\n" 17 | "Language-Team: French (France) (https://www.transifex.com/infotelGLPI/teams/12373/fr_FR/)\n" 18 | "MIME-Version: 1.0\n" 19 | "Content-Type: text/plain; charset=UTF-8\n" 20 | "Content-Transfer-Encoding: 8bit\n" 21 | "Language: fr_FR\n" 22 | "Plural-Forms: nplurals=2; plural=(n > 1);\n" 23 | 24 | #: hook.php:147 inc/shellcommand.class.php:116 inc/shellcommand.class.php:214 25 | #: inc/shellcommandpath.class.php:40 26 | msgid "Path" 27 | msgid_plural "Pathes" 28 | msgstr[0] "Chemin" 29 | msgstr[1] "Chemins" 30 | 31 | #: hook.php:228 32 | msgid "Command launch" 33 | msgstr "Lancement de la commande" 34 | 35 | #: hook.php:229 36 | msgid "Command group launch" 37 | msgstr "Lancement du groupe de commandes shell" 38 | 39 | #: setup.php:65 inc/profile.class.php:101 inc/shellcommand.class.php:49 40 | #: inc/shellcommand.class.php:487 41 | msgid "Shell Command" 42 | msgid_plural "Shell Commands" 43 | msgstr[0] "Commande Shell" 44 | msgstr[1] "Commandes Shell" 45 | 46 | #: inc/advanced_execution.class.php:40 inc/shellcommand.class.php:497 47 | msgid "Advanced execution" 48 | msgid_plural "Advanced executions" 49 | msgstr[0] "Exécution avancée" 50 | msgstr[1] "Exécutions avancées" 51 | 52 | #: inc/commandgroup.class.php:40 inc/commandgroup_item.class.php:58 53 | #: inc/shellcommand.class.php:492 54 | msgid "Command group" 55 | msgid_plural "Command groups" 56 | msgstr[0] "Groupe de commandes" 57 | msgstr[1] "Groupes de commandes" 58 | 59 | #: inc/commandgroup.class.php:120 60 | msgid "Check command" 61 | msgstr "Commande de vérification initiale" 62 | 63 | #: inc/commandgroup_item.class.php:158 64 | msgid "Add a command" 65 | msgstr "Ajouter une commande" 66 | 67 | #: inc/commandgroup_item.class.php:212 68 | msgid "Add a command group" 69 | msgstr "Ajouter un groupe de commandes" 70 | 71 | #: inc/commandgroup_item.class.php:398 72 | msgid "Order" 73 | msgstr "Ordre" 74 | 75 | #: inc/commandgroup_item.class.php:546 76 | msgid "Host UP" 77 | msgstr "Hôte UP" 78 | 79 | #: inc/commandgroup_item.class.php:577 80 | msgid "Host DOWN" 81 | msgstr "Hôte DOWN" 82 | 83 | #: inc/menu.class.php:47 84 | msgid "Shellcommands menu" 85 | msgstr "Menu Commandes Shell" 86 | 87 | #: inc/shellcommand.class.php:124 inc/shellcommand.class.php:209 88 | msgid "Windows" 89 | msgstr "Paramètres" 90 | 91 | #: inc/shellcommand.class.php:201 92 | msgid "Tag position" 93 | msgstr "Position de la balise" 94 | 95 | #: inc/shellcommand.class.php:203 96 | msgid "Before parameters" 97 | msgstr "Avant les paramètres" 98 | 99 | #: inc/shellcommand.class.php:203 100 | msgid "After parameters" 101 | msgstr "Après les paramètres" 102 | 103 | #: inc/shellcommand_item.class.php:464 104 | msgid "Associated Commands" 105 | msgstr "Commande(s) associée(s)" 106 | 107 | #: inc/shellcommand_item.class.php:818 108 | msgid "There is an error with socket creation" 109 | msgstr "Une erreur est survenue lors de la création du socket" 110 | 111 | #: inc/shellcommand_item.class.php:857 112 | msgid "Magic packet sending to" 113 | msgstr "Paquet magique envoyé à" 114 | 115 | #: inc/shellcommand_item.class.php:859 116 | msgid "The packet cannot be send" 117 | msgstr "Le paquet n'a pu être envoyé" 118 | -------------------------------------------------------------------------------- /locales/glpi.pot: -------------------------------------------------------------------------------- 1 | # SOME DESCRIPTIVE TITLE. 2 | # Copyright (C) YEAR Shellcommands Development Team 3 | # This file is distributed under the same license as the GLPI - Shellcommands plugin package. 4 | # FIRST AUTHOR , YEAR. 5 | # 6 | #, fuzzy 7 | msgid "" 8 | msgstr "" 9 | "Project-Id-Version: GLPI - Shellcommands plugin 2.1.0\n" 10 | "Report-Msgid-Bugs-To: \n" 11 | "POT-Creation-Date: 2024-11-02 13:42+0000\n" 12 | "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" 13 | "Last-Translator: FULL NAME \n" 14 | "Language-Team: LANGUAGE \n" 15 | "Language: \n" 16 | "MIME-Version: 1.0\n" 17 | "Content-Type: text/plain; charset=CHARSET\n" 18 | "Content-Transfer-Encoding: 8bit\n" 19 | "Plural-Forms: nplurals=INTEGER; plural=EXPRESSION;\n" 20 | 21 | #: hook.php:152 inc/shellcommand.class.php:116 inc/shellcommand.class.php:214 22 | #: inc/shellcommandpath.class.php:40 23 | msgid "Path" 24 | msgid_plural "Pathes" 25 | msgstr[0] "" 26 | msgstr[1] "" 27 | 28 | #: hook.php:232 29 | msgid "Command launch" 30 | msgstr "" 31 | 32 | #: hook.php:236 33 | msgid "Command group launch" 34 | msgstr "" 35 | 36 | #: setup.php:70 inc/profile.class.php:101 inc/shellcommand.class.php:49 37 | #: inc/shellcommand.class.php:485 38 | msgid "Shell Command" 39 | msgid_plural "Shell Commands" 40 | msgstr[0] "" 41 | msgstr[1] "" 42 | 43 | #: inc/advanced_execution.class.php:40 inc/shellcommand.class.php:495 44 | msgid "Advanced execution" 45 | msgid_plural "Advanced executions" 46 | msgstr[0] "" 47 | msgstr[1] "" 48 | 49 | #: inc/commandgroup.class.php:40 inc/commandgroup_item.class.php:58 50 | #: inc/shellcommand.class.php:490 51 | msgid "Command group" 52 | msgid_plural "Command groups" 53 | msgstr[0] "" 54 | msgstr[1] "" 55 | 56 | #: inc/commandgroup.class.php:127 57 | msgid "Check command" 58 | msgstr "" 59 | 60 | #: inc/commandgroup_item.class.php:158 61 | msgid "Add a command" 62 | msgstr "" 63 | 64 | #: inc/commandgroup_item.class.php:212 65 | msgid "Add a command group" 66 | msgstr "" 67 | 68 | #: inc/commandgroup_item.class.php:398 69 | msgid "Order" 70 | msgstr "" 71 | 72 | #: inc/commandgroup_item.class.php:544 73 | msgid "Host UP" 74 | msgstr "" 75 | 76 | #: inc/commandgroup_item.class.php:575 77 | msgid "Host DOWN" 78 | msgstr "" 79 | 80 | #: inc/menu.class.php:47 81 | msgid "Shellcommands menu" 82 | msgstr "" 83 | 84 | #: inc/shellcommand.class.php:124 inc/shellcommand.class.php:209 85 | msgid "Windows" 86 | msgstr "" 87 | 88 | #: inc/shellcommand.class.php:201 89 | msgid "Tag position" 90 | msgstr "" 91 | 92 | #: inc/shellcommand.class.php:203 93 | msgid "Before parameters" 94 | msgstr "" 95 | 96 | #: inc/shellcommand.class.php:203 97 | msgid "After parameters" 98 | msgstr "" 99 | 100 | #: inc/shellcommand_item.class.php:442 101 | msgid "Associated Commands" 102 | msgstr "" 103 | 104 | #: inc/shellcommand_item.class.php:795 105 | msgid "There is an error with socket creation" 106 | msgstr "" 107 | 108 | #: inc/shellcommand_item.class.php:834 109 | msgid "Magic packet sending to" 110 | msgstr "" 111 | 112 | #: inc/shellcommand_item.class.php:836 113 | msgid "The packet cannot be send" 114 | msgstr "" 115 | -------------------------------------------------------------------------------- /locales/pl_PL.mo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/InfotelGLPI/shellcommands/919c5ed8a52368d681418b7950bf596d09b32232/locales/pl_PL.mo -------------------------------------------------------------------------------- /locales/pl_PL.po: -------------------------------------------------------------------------------- 1 | # SOME DESCRIPTIVE TITLE. 2 | # Copyright (C) YEAR Shellcommands Development Team 3 | # This file is distributed under the same license as the GLPI - Shellcommands plugin package. 4 | # FIRST AUTHOR , YEAR. 5 | # 6 | # Translators: 7 | # Xavier CAILLAUD , 2020 8 | # 9 | #, fuzzy 10 | msgid "" 11 | msgstr "" 12 | "Project-Id-Version: GLPI - Shellcommands plugin 2.1.0\n" 13 | "Report-Msgid-Bugs-To: \n" 14 | "POT-Creation-Date: 2019-02-25 09:32+0100\n" 15 | "PO-Revision-Date: 2020-11-02 16:20+0000\n" 16 | "Last-Translator: Xavier CAILLAUD , 2020\n" 17 | "Language-Team: Polish (Poland) (https://www.transifex.com/infotelGLPI/teams/12373/pl_PL/)\n" 18 | "MIME-Version: 1.0\n" 19 | "Content-Type: text/plain; charset=UTF-8\n" 20 | "Content-Transfer-Encoding: 8bit\n" 21 | "Language: pl_PL\n" 22 | "Plural-Forms: nplurals=4; plural=(n==1 ? 0 : (n%10>=2 && n%10<=4) && (n%100<12 || n%100>14) ? 1 : n!=1 && (n%10>=0 && n%10<=1) || (n%10>=5 && n%10<=9) || (n%100>=12 && n%100<=14) ? 2 : 3);\n" 23 | 24 | #: hook.php:147 inc/shellcommand.class.php:116 inc/shellcommand.class.php:214 25 | #: inc/shellcommandpath.class.php:40 26 | msgid "Path" 27 | msgid_plural "Pathes" 28 | msgstr[0] "Ścieżka" 29 | msgstr[1] "Ścieżek" 30 | msgstr[2] "Ścieżki" 31 | msgstr[3] "Ścieżki" 32 | 33 | #: hook.php:228 34 | msgid "Command launch" 35 | msgstr "Uruchom polecenie" 36 | 37 | #: hook.php:229 38 | msgid "Command group launch" 39 | msgstr "Uruchom grupę poleceń" 40 | 41 | #: setup.php:65 inc/profile.class.php:101 inc/shellcommand.class.php:49 42 | #: inc/shellcommand.class.php:487 43 | msgid "Shell Command" 44 | msgid_plural "Shell Commands" 45 | msgstr[0] "Polecenie powłoki" 46 | msgstr[1] "Polecenia powłoki" 47 | msgstr[2] "Polecenia powłoki" 48 | msgstr[3] "Polecenia powłoki" 49 | 50 | #: inc/advanced_execution.class.php:40 inc/shellcommand.class.php:497 51 | msgid "Advanced execution" 52 | msgid_plural "Advanced executions" 53 | msgstr[0] "Zaawansowane uruchomienie" 54 | msgstr[1] "Zaawansowane uruchomienia" 55 | msgstr[2] "Zaawansowane uruchomienia" 56 | msgstr[3] "Zaawansowane uruchomienia" 57 | 58 | #: inc/commandgroup.class.php:40 inc/commandgroup_item.class.php:58 59 | #: inc/shellcommand.class.php:492 60 | msgid "Command group" 61 | msgid_plural "Command groups" 62 | msgstr[0] "Grupa komend" 63 | msgstr[1] "Grup poleceń" 64 | msgstr[2] "Grupy poleceń" 65 | msgstr[3] "Grupy poleceń" 66 | 67 | #: inc/commandgroup.class.php:120 68 | msgid "Check command" 69 | msgstr "Sprawdź polecenie" 70 | 71 | #: inc/commandgroup_item.class.php:158 72 | msgid "Add a command" 73 | msgstr "Dodaj polecenie" 74 | 75 | #: inc/commandgroup_item.class.php:212 76 | msgid "Add a command group" 77 | msgstr "Dodaj polecenie grupowe" 78 | 79 | #: inc/commandgroup_item.class.php:398 80 | msgid "Order" 81 | msgstr "Kolejność" 82 | 83 | #: inc/commandgroup_item.class.php:546 84 | msgid "Host UP" 85 | msgstr "Host włączony" 86 | 87 | #: inc/commandgroup_item.class.php:577 88 | msgid "Host DOWN" 89 | msgstr "Host wyłączony" 90 | 91 | #: inc/menu.class.php:47 92 | msgid "Shellcommands menu" 93 | msgstr "Menu poleceń" 94 | 95 | #: inc/shellcommand.class.php:124 inc/shellcommand.class.php:209 96 | msgid "Windows" 97 | msgstr "Windows" 98 | 99 | #: inc/shellcommand.class.php:201 100 | msgid "Tag position" 101 | msgstr "Pozycja TAGu" 102 | 103 | #: inc/shellcommand.class.php:203 104 | msgid "Before parameters" 105 | msgstr "Parametry przed" 106 | 107 | #: inc/shellcommand.class.php:203 108 | msgid "After parameters" 109 | msgstr "Parametry po" 110 | 111 | #: inc/shellcommand_item.class.php:464 112 | msgid "Associated Commands" 113 | msgstr "Powiązane polecenia" 114 | 115 | #: inc/shellcommand_item.class.php:818 116 | msgid "There is an error with socket creation" 117 | msgstr "Wystąpił błąd przy tworzeniu gniazda" 118 | 119 | #: inc/shellcommand_item.class.php:857 120 | msgid "Magic packet sending to" 121 | msgstr "Wysyłanie pakietu magic do" 122 | 123 | #: inc/shellcommand_item.class.php:859 124 | msgid "The packet cannot be send" 125 | msgstr "Pakiet nie może być wysłany" 126 | -------------------------------------------------------------------------------- /locales/pt_BR.mo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/InfotelGLPI/shellcommands/919c5ed8a52368d681418b7950bf596d09b32232/locales/pt_BR.mo -------------------------------------------------------------------------------- /locales/pt_BR.po: -------------------------------------------------------------------------------- 1 | # SOME DESCRIPTIVE TITLE. 2 | # Copyright (C) YEAR Shellcommands Development Team 3 | # This file is distributed under the same license as the GLPI - Shellcommands plugin package. 4 | # 5 | # Translators: 6 | # gabriel Branquinho , 2018 7 | # Rafael Fontenelle , 2013 8 | msgid "" 9 | msgstr "" 10 | "Project-Id-Version: GLPI Project - shellcommands plugin\n" 11 | "Report-Msgid-Bugs-To: \n" 12 | "POT-Creation-Date: 2018-07-10 08:50+0200\n" 13 | "PO-Revision-Date: 2018-07-12 18:23+0000\n" 14 | "Last-Translator: gabriel Branquinho \n" 15 | "Language-Team: Portuguese (Brazil) (http://www.transifex.com/tsmr/GLPI_shellcommands/language/pt_BR/)\n" 16 | "MIME-Version: 1.0\n" 17 | "Content-Type: text/plain; charset=UTF-8\n" 18 | "Content-Transfer-Encoding: 8bit\n" 19 | "Language: pt_BR\n" 20 | "Plural-Forms: nplurals=2; plural=(n > 1);\n" 21 | 22 | #: hook.php:147 inc/shellcommand.class.php:117 inc/shellcommand.class.php:216 23 | #: inc/shellcommandpath.class.php:40 24 | msgid "Path" 25 | msgid_plural "Pathes" 26 | msgstr[0] "Caminho" 27 | msgstr[1] "Caminhos" 28 | 29 | #: hook.php:228 30 | msgid "Command launch" 31 | msgstr "Execução de comando" 32 | 33 | #: hook.php:229 34 | msgid "Command group launch" 35 | msgstr "" 36 | 37 | #: setup.php:63 inc/profile.class.php:102 inc/shellcommand.class.php:49 38 | #: inc/shellcommand.class.php:489 39 | msgid "Shell Command" 40 | msgid_plural "Shell Commands" 41 | msgstr[0] "Comando de Shell" 42 | msgstr[1] "Comandos de Shell" 43 | 44 | #: inc/advanced_execution.class.php:40 inc/shellcommand.class.php:499 45 | msgid "Advanced execution" 46 | msgid_plural "Advanced executions" 47 | msgstr[0] "Execução Avançada" 48 | msgstr[1] "Execuções Avançadas" 49 | 50 | #: inc/commandgroup.class.php:40 inc/commandgroup_item.class.php:58 51 | #: inc/shellcommand.class.php:494 52 | msgid "Command group" 53 | msgid_plural "Command groups" 54 | msgstr[0] "" 55 | msgstr[1] "" 56 | 57 | #: inc/commandgroup.class.php:122 58 | msgid "Check command" 59 | msgstr "Comandos do Shell" 60 | 61 | #: inc/commandgroup_item.class.php:158 62 | msgid "Add a command" 63 | msgstr "Adicionar um comando" 64 | 65 | #: inc/commandgroup_item.class.php:212 66 | msgid "Add a command group" 67 | msgstr "" 68 | 69 | #: inc/commandgroup_item.class.php:402 70 | msgid "Order" 71 | msgstr "" 72 | 73 | #: inc/commandgroup_item.class.php:550 74 | msgid "Host UP" 75 | msgstr "" 76 | 77 | #: inc/commandgroup_item.class.php:581 78 | msgid "Host DOWN" 79 | msgstr "" 80 | 81 | #: inc/menu.class.php:47 82 | msgid "Shellcommands menu" 83 | msgstr "" 84 | 85 | #: inc/shellcommand.class.php:125 inc/shellcommand.class.php:211 86 | msgid "Windows" 87 | msgstr "Janelas" 88 | 89 | #: inc/shellcommand.class.php:203 90 | msgid "Tag position" 91 | msgstr "" 92 | 93 | #: inc/shellcommand.class.php:205 94 | msgid "Before parameters" 95 | msgstr "" 96 | 97 | #: inc/shellcommand.class.php:205 98 | msgid "After parameters" 99 | msgstr "" 100 | 101 | #: inc/shellcommand_item.class.php:459 102 | msgid "Associated Commands" 103 | msgstr "Comandos associados" 104 | 105 | #: inc/shellcommand_item.class.php:814 106 | msgid "There is an error with socket creation" 107 | msgstr "Houve um erro com a criação do socket" 108 | 109 | #: inc/shellcommand_item.class.php:853 110 | msgid "Magic packet sending to" 111 | msgstr "Pacote mágico enviando para" 112 | 113 | #: inc/shellcommand_item.class.php:855 114 | msgid "The packet cannot be send" 115 | msgstr "O pacote não pôde ser enviado" 116 | -------------------------------------------------------------------------------- /locales/ro_RO.mo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/InfotelGLPI/shellcommands/919c5ed8a52368d681418b7950bf596d09b32232/locales/ro_RO.mo -------------------------------------------------------------------------------- /locales/ro_RO.po: -------------------------------------------------------------------------------- 1 | # SOME DESCRIPTIVE TITLE. 2 | # Copyright (C) YEAR Shellcommands Development Team 3 | # This file is distributed under the same license as the GLPI - Shellcommands plugin package. 4 | # FIRST AUTHOR , YEAR. 5 | # 6 | # Translators: 7 | # Xavier CAILLAUD , 2020 8 | # 9 | #, fuzzy 10 | msgid "" 11 | msgstr "" 12 | "Project-Id-Version: GLPI - Shellcommands plugin 2.1.0\n" 13 | "Report-Msgid-Bugs-To: \n" 14 | "POT-Creation-Date: 2019-02-25 09:32+0100\n" 15 | "PO-Revision-Date: 2020-11-02 16:20+0000\n" 16 | "Last-Translator: Xavier CAILLAUD , 2020\n" 17 | "Language-Team: Romanian (Romania) (https://www.transifex.com/infotelGLPI/teams/12373/ro_RO/)\n" 18 | "MIME-Version: 1.0\n" 19 | "Content-Type: text/plain; charset=UTF-8\n" 20 | "Content-Transfer-Encoding: 8bit\n" 21 | "Language: ro_RO\n" 22 | "Plural-Forms: nplurals=3; plural=(n==1?0:(((n%100>19)||((n%100==0)&&(n!=0)))?2:1));\n" 23 | 24 | #: hook.php:147 inc/shellcommand.class.php:116 inc/shellcommand.class.php:214 25 | #: inc/shellcommandpath.class.php:40 26 | msgid "Path" 27 | msgid_plural "Pathes" 28 | msgstr[0] "Pathuri" 29 | msgstr[1] "Pathuri" 30 | msgstr[2] "Pathuri" 31 | 32 | #: hook.php:228 33 | msgid "Command launch" 34 | msgstr "Lansare comandă " 35 | 36 | #: hook.php:229 37 | msgid "Command group launch" 38 | msgstr "Lansare grup comada" 39 | 40 | #: setup.php:65 inc/profile.class.php:101 inc/shellcommand.class.php:49 41 | #: inc/shellcommand.class.php:487 42 | msgid "Shell Command" 43 | msgid_plural "Shell Commands" 44 | msgstr[0] "Comandă Shell" 45 | msgstr[1] "Comenzi Shell" 46 | msgstr[2] "Comenzi Shell " 47 | 48 | #: inc/advanced_execution.class.php:40 inc/shellcommand.class.php:497 49 | msgid "Advanced execution" 50 | msgid_plural "Advanced executions" 51 | msgstr[0] "Executie avansata" 52 | msgstr[1] "Executii avansate" 53 | msgstr[2] "Executii avansate" 54 | 55 | #: inc/commandgroup.class.php:40 inc/commandgroup_item.class.php:58 56 | #: inc/shellcommand.class.php:492 57 | msgid "Command group" 58 | msgid_plural "Command groups" 59 | msgstr[0] "Grup comanda" 60 | msgstr[1] "Grupuri comanda" 61 | msgstr[2] "Grupuri comanda" 62 | 63 | #: inc/commandgroup.class.php:120 64 | msgid "Check command" 65 | msgstr "Verifica comanda" 66 | 67 | #: inc/commandgroup_item.class.php:158 68 | msgid "Add a command" 69 | msgstr "Add o comanda" 70 | 71 | #: inc/commandgroup_item.class.php:212 72 | msgid "Add a command group" 73 | msgstr "Add o comanda group" 74 | 75 | #: inc/commandgroup_item.class.php:398 76 | msgid "Order" 77 | msgstr "Comanda" 78 | 79 | #: inc/commandgroup_item.class.php:546 80 | msgid "Host UP" 81 | msgstr "Host UP" 82 | 83 | #: inc/commandgroup_item.class.php:577 84 | msgid "Host DOWN" 85 | msgstr "Host DOWN" 86 | 87 | #: inc/menu.class.php:47 88 | msgid "Shellcommands menu" 89 | msgstr "Meniu comenzi Shell" 90 | 91 | #: inc/shellcommand.class.php:124 inc/shellcommand.class.php:209 92 | msgid "Windows" 93 | msgstr "Windows" 94 | 95 | #: inc/shellcommand.class.php:201 96 | msgid "Tag position" 97 | msgstr "Pozitie Tag" 98 | 99 | #: inc/shellcommand.class.php:203 100 | msgid "Before parameters" 101 | msgstr "Parametri inainte" 102 | 103 | #: inc/shellcommand.class.php:203 104 | msgid "After parameters" 105 | msgstr "Parametri dupa" 106 | 107 | #: inc/shellcommand_item.class.php:464 108 | msgid "Associated Commands" 109 | msgstr "Comenzi asociate" 110 | 111 | #: inc/shellcommand_item.class.php:818 112 | msgid "There is an error with socket creation" 113 | msgstr "Există o eroare cu crearea socketului" 114 | 115 | #: inc/shellcommand_item.class.php:857 116 | msgid "Magic packet sending to" 117 | msgstr "Pachet Magic trimis către" 118 | 119 | #: inc/shellcommand_item.class.php:859 120 | msgid "The packet cannot be send" 121 | msgstr "Pachetul nu poate fi trimis" 122 | -------------------------------------------------------------------------------- /locales/ru_RU.mo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/InfotelGLPI/shellcommands/919c5ed8a52368d681418b7950bf596d09b32232/locales/ru_RU.mo -------------------------------------------------------------------------------- /locales/ru_RU.po: -------------------------------------------------------------------------------- 1 | # SOME DESCRIPTIVE TITLE. 2 | # Copyright (C) YEAR Shellcommands Development Team 3 | # This file is distributed under the same license as the GLPI - Shellcommands plugin package. 4 | # FIRST AUTHOR , YEAR. 5 | # 6 | # Translators: 7 | # Xavier CAILLAUD , 2020 8 | # 9 | #, fuzzy 10 | msgid "" 11 | msgstr "" 12 | "Project-Id-Version: GLPI - Shellcommands plugin 2.1.0\n" 13 | "Report-Msgid-Bugs-To: \n" 14 | "POT-Creation-Date: 2019-02-25 09:32+0100\n" 15 | "PO-Revision-Date: 2020-11-02 13:01+0000\n" 16 | "Last-Translator: Xavier CAILLAUD , 2020\n" 17 | "Language-Team: Russian (Russia) (https://www.transifex.com/infotelGLPI/teams/12373/ru_RU/)\n" 18 | "MIME-Version: 1.0\n" 19 | "Content-Type: text/plain; charset=UTF-8\n" 20 | "Content-Transfer-Encoding: 8bit\n" 21 | "Language: ru_RU\n" 22 | "Plural-Forms: nplurals=4; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && n%10<=4 && (n%100<12 || n%100>14) ? 1 : n%10==0 || (n%10>=5 && n%10<=9) || (n%100>=11 && n%100<=14)? 2 : 3);\n" 23 | 24 | #: hook.php:147 inc/shellcommand.class.php:116 inc/shellcommand.class.php:214 25 | #: inc/shellcommandpath.class.php:40 26 | msgid "Path" 27 | msgid_plural "Pathes" 28 | msgstr[0] "Путь" 29 | msgstr[1] "Путей" 30 | msgstr[2] "Путей" 31 | msgstr[3] "Пути" 32 | 33 | #: hook.php:228 34 | msgid "Command launch" 35 | msgstr "Запуск команды" 36 | 37 | #: hook.php:229 38 | msgid "Command group launch" 39 | msgstr "Запуск группы команд" 40 | 41 | #: setup.php:65 inc/profile.class.php:101 inc/shellcommand.class.php:49 42 | #: inc/shellcommand.class.php:487 43 | msgid "Shell Command" 44 | msgid_plural "Shell Commands" 45 | msgstr[0] "Служебная команда" 46 | msgstr[1] "Служебные команды" 47 | msgstr[2] "Служебные команды" 48 | msgstr[3] "Служебные команды" 49 | 50 | #: inc/advanced_execution.class.php:40 inc/shellcommand.class.php:497 51 | msgid "Advanced execution" 52 | msgid_plural "Advanced executions" 53 | msgstr[0] "Расширенный запуск" 54 | msgstr[1] "Расширенных запусков" 55 | msgstr[2] "Расширенных запусков" 56 | msgstr[3] "Расширенный запуск" 57 | 58 | #: inc/commandgroup.class.php:40 inc/commandgroup_item.class.php:58 59 | #: inc/shellcommand.class.php:492 60 | msgid "Command group" 61 | msgid_plural "Command groups" 62 | msgstr[0] "Группа команд" 63 | msgstr[1] "Групп команд" 64 | msgstr[2] "Групп команд" 65 | msgstr[3] "Группы команд" 66 | 67 | #: inc/commandgroup.class.php:120 68 | msgid "Check command" 69 | msgstr "Команда для проверки" 70 | 71 | #: inc/commandgroup_item.class.php:158 72 | msgid "Add a command" 73 | msgstr "Добавить команду" 74 | 75 | #: inc/commandgroup_item.class.php:212 76 | msgid "Add a command group" 77 | msgstr "Создать группу команд" 78 | 79 | #: inc/commandgroup_item.class.php:398 80 | msgid "Order" 81 | msgstr "Порядок выполнения" 82 | 83 | #: inc/commandgroup_item.class.php:546 84 | msgid "Host UP" 85 | msgstr "Узел ВКЛ." 86 | 87 | #: inc/commandgroup_item.class.php:577 88 | msgid "Host DOWN" 89 | msgstr "Узел ВЫКЛ." 90 | 91 | #: inc/menu.class.php:47 92 | msgid "Shellcommands menu" 93 | msgstr "Меню служебных команд" 94 | 95 | #: inc/shellcommand.class.php:124 inc/shellcommand.class.php:209 96 | msgid "Windows" 97 | msgstr "Windows" 98 | 99 | #: inc/shellcommand.class.php:201 100 | msgid "Tag position" 101 | msgstr "Позиция тега" 102 | 103 | #: inc/shellcommand.class.php:203 104 | msgid "Before parameters" 105 | msgstr "До параметров" 106 | 107 | #: inc/shellcommand.class.php:203 108 | msgid "After parameters" 109 | msgstr "После параметров" 110 | 111 | #: inc/shellcommand_item.class.php:464 112 | msgid "Associated Commands" 113 | msgstr "Связанные команды" 114 | 115 | #: inc/shellcommand_item.class.php:818 116 | msgid "There is an error with socket creation" 117 | msgstr "Произошла ошибка при создании сокета" 118 | 119 | #: inc/shellcommand_item.class.php:857 120 | msgid "Magic packet sending to" 121 | msgstr "Осуществляется передача \"magic packet\" " 122 | 123 | #: inc/shellcommand_item.class.php:859 124 | msgid "The packet cannot be send" 125 | msgstr "Пакет не может быть отправлен" 126 | -------------------------------------------------------------------------------- /locales/tr_TR.mo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/InfotelGLPI/shellcommands/919c5ed8a52368d681418b7950bf596d09b32232/locales/tr_TR.mo -------------------------------------------------------------------------------- /locales/tr_TR.po: -------------------------------------------------------------------------------- 1 | # SOME DESCRIPTIVE TITLE. 2 | # Copyright (C) YEAR Shellcommands Development Team 3 | # This file is distributed under the same license as the GLPI - Shellcommands plugin package. 4 | # FIRST AUTHOR , YEAR. 5 | # 6 | # Translators: 7 | # Xavier CAILLAUD , 2020 8 | # 9 | #, fuzzy 10 | msgid "" 11 | msgstr "" 12 | "Project-Id-Version: GLPI - Shellcommands plugin 2.1.0\n" 13 | "Report-Msgid-Bugs-To: \n" 14 | "POT-Creation-Date: 2019-02-25 09:32+0100\n" 15 | "PO-Revision-Date: 2020-11-02 16:20+0000\n" 16 | "Last-Translator: Xavier CAILLAUD , 2020\n" 17 | "Language-Team: Turkish (Turkey) (https://www.transifex.com/infotelGLPI/teams/12373/tr_TR/)\n" 18 | "MIME-Version: 1.0\n" 19 | "Content-Type: text/plain; charset=UTF-8\n" 20 | "Content-Transfer-Encoding: 8bit\n" 21 | "Language: tr_TR\n" 22 | "Plural-Forms: nplurals=2; plural=(n > 1);\n" 23 | 24 | #: hook.php:147 inc/shellcommand.class.php:116 inc/shellcommand.class.php:214 25 | #: inc/shellcommandpath.class.php:40 26 | msgid "Path" 27 | msgid_plural "Pathes" 28 | msgstr[0] "Yol" 29 | msgstr[1] "Yol" 30 | 31 | #: hook.php:228 32 | msgid "Command launch" 33 | msgstr "Yürütülecek komut" 34 | 35 | #: hook.php:229 36 | msgid "Command group launch" 37 | msgstr "Yürütülecek komut grubu " 38 | 39 | #: setup.php:65 inc/profile.class.php:101 inc/shellcommand.class.php:49 40 | #: inc/shellcommand.class.php:487 41 | msgid "Shell Command" 42 | msgid_plural "Shell Commands" 43 | msgstr[0] "Kabuk Komutları" 44 | msgstr[1] "Kabuk Komutları" 45 | 46 | #: inc/advanced_execution.class.php:40 inc/shellcommand.class.php:497 47 | msgid "Advanced execution" 48 | msgid_plural "Advanced executions" 49 | msgstr[0] "Gelişmiş yürütmeler" 50 | msgstr[1] "Gelişmiş yürütmeler" 51 | 52 | #: inc/commandgroup.class.php:40 inc/commandgroup_item.class.php:58 53 | #: inc/shellcommand.class.php:492 54 | msgid "Command group" 55 | msgid_plural "Command groups" 56 | msgstr[0] "Komut grupları" 57 | msgstr[1] "Komut grupları" 58 | 59 | #: inc/commandgroup.class.php:120 60 | msgid "Check command" 61 | msgstr "Komutu sınayın" 62 | 63 | #: inc/commandgroup_item.class.php:158 64 | msgid "Add a command" 65 | msgstr "Komut ekleyin" 66 | 67 | #: inc/commandgroup_item.class.php:212 68 | msgid "Add a command group" 69 | msgstr "Komut grubu ekleyin" 70 | 71 | #: inc/commandgroup_item.class.php:398 72 | msgid "Order" 73 | msgstr "Sıralama" 74 | 75 | #: inc/commandgroup_item.class.php:546 76 | msgid "Host UP" 77 | msgstr "Sunucu ÇALIŞIYOR" 78 | 79 | #: inc/commandgroup_item.class.php:577 80 | msgid "Host DOWN" 81 | msgstr "Sunucu ÇALIŞMIYOR" 82 | 83 | #: inc/menu.class.php:47 84 | msgid "Shellcommands menu" 85 | msgstr "Kabuk komutları menüsü" 86 | 87 | #: inc/shellcommand.class.php:124 inc/shellcommand.class.php:209 88 | msgid "Windows" 89 | msgstr "Windows" 90 | 91 | #: inc/shellcommand.class.php:201 92 | msgid "Tag position" 93 | msgstr "Etiket konumu" 94 | 95 | #: inc/shellcommand.class.php:203 96 | msgid "Before parameters" 97 | msgstr "Parametrelerden önce" 98 | 99 | #: inc/shellcommand.class.php:203 100 | msgid "After parameters" 101 | msgstr "Parametrelerden sonra" 102 | 103 | #: inc/shellcommand_item.class.php:464 104 | msgid "Associated Commands" 105 | msgstr "İlgili Komutlar" 106 | 107 | #: inc/shellcommand_item.class.php:818 108 | msgid "There is an error with socket creation" 109 | msgstr "Soket oluşturulurken bir hata oluştu" 110 | 111 | #: inc/shellcommand_item.class.php:857 112 | msgid "Magic packet sending to" 113 | msgstr "Magic paket şuraya gönderiliyor" 114 | 115 | #: inc/shellcommand_item.class.php:859 116 | msgid "The packet cannot be send" 117 | msgstr "Paket gönderilemedi" 118 | -------------------------------------------------------------------------------- /pics/large-loading.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/InfotelGLPI/shellcommands/919c5ed8a52368d681418b7950bf596d09b32232/pics/large-loading.gif -------------------------------------------------------------------------------- /setup.php: -------------------------------------------------------------------------------- 1 | . 27 | -------------------------------------------------------------------------- 28 | */ 29 | 30 | define('PLUGIN_SHELLCOMMANDS_VERSION', '4.0.1'); 31 | 32 | if (!defined("PLUGIN_SHELLCOMMANDS_DIR")) { 33 | define("PLUGIN_SHELLCOMMANDS_DIR", Plugin::getPhpDir("shellcommands")); 34 | define("PLUGIN_SHELLCOMMANDS_NOTFULL_DIR", Plugin::getPhpDir("shellcommands",false)); 35 | define("PLUGIN_SHELLCOMMANDS_WEBDIR", Plugin::getWebDir("shellcommands")); 36 | } 37 | 38 | // Init the hooks of the plugins -Needed 39 | function plugin_init_shellcommands() { 40 | global $PLUGIN_HOOKS; 41 | 42 | $PLUGIN_HOOKS['csrf_compliant']['shellcommands'] = true; 43 | $PLUGIN_HOOKS['change_profile']['shellcommands'] = ['PluginShellcommandsProfile', 'changeProfile']; 44 | //Clean Plugin on Profile delete 45 | $PLUGIN_HOOKS['pre_item_purge']['shellcommands'] = ['Profile' => ['PluginShellcommandsProfile', 'purgeProfiles']]; 46 | 47 | $PLUGIN_HOOKS['add_css']['shellcommands'] = ['shellcommands.css']; 48 | $PLUGIN_HOOKS['add_javascript']['shellcommands'] = ['shellcommands.js']; 49 | 50 | if (Session::getLoginUserID()) { 51 | Plugin::registerClass('PluginShellcommandsProfile', ['addtabon' => 'Profile']); 52 | if (Session::haveRight("plugin_shellcommands", READ)) { 53 | // Menu 54 | $PLUGIN_HOOKS['menu_entry']['shellcommands'] = 'front/menu.php'; 55 | $PLUGIN_HOOKS['menu_toadd']['shellcommands'] = ['tools' => 'PluginShellcommandsShellcommand']; 56 | } 57 | 58 | $PLUGIN_HOOKS['use_massive_action']['shellcommands'] = 1; 59 | 60 | $PLUGIN_HOOKS['post_init']['shellcommands'] = 'plugin_shellcommands_postinit'; 61 | 62 | } 63 | 64 | $PLUGIN_HOOKS['webservices']['shellcommands'] = 'plugin_shellcommands_registerWebservicesMethods'; 65 | } 66 | 67 | // Get the name and the version of the plugin - Needed 68 | function plugin_version_shellcommands() { 69 | return [ 70 | 'name' => _n('Shell Command', 'Shell Commands', 2, 'shellcommands'), 71 | 'version' => PLUGIN_SHELLCOMMANDS_VERSION, 72 | 'license' => 'GPLv2+', 73 | 'oldname' => 'cmd', 74 | 'author' => "Infotel", 75 | 'homepage' => 'https://github.com/InfotelGLPI/shellcommands', 76 | 'requirements' => [ 77 | 'glpi' => [ 78 | 'min' => '10.0', 79 | 'max' => '11.0', 80 | 'dev' => false 81 | ] 82 | ] 83 | ]; 84 | } 85 | -------------------------------------------------------------------------------- /shellcommands.css: -------------------------------------------------------------------------------- 1 | .shellcommands_result_line { 2 | } 3 | 4 | .shellcommands_result_ok { 5 | border: 1px #BCBCBC solid; 6 | padding: 5px; 7 | width: 100px; 8 | background-color: #8EE378; 9 | text-align: center; 10 | display: inline-block; 11 | } 12 | 13 | .shellcommands_result_ko { 14 | border: 1px #BCBCBC solid; 15 | padding: 5px; 16 | width: 100px; 17 | background-color: #b81900; 18 | text-align: center; 19 | display: inline-block; 20 | } 21 | 22 | .shellcommands_result_warning { 23 | border: 1px #BCBCBC solid; 24 | padding: 5px; 25 | width: 100px; 26 | background-color: #f09134; 27 | text-align: center; 28 | display: inline-block; 29 | } 30 | 31 | .shellcommands_menu_item { 32 | border: solid 1px #CCCCCC; 33 | 34 | -moz-border-radius: 3px; 35 | -webkit-border-radius: 3px; 36 | border-radius: 3px; 37 | } 38 | 39 | td.shellcommands_menu_item:hover { 40 | border: solid 1px #535b5c; 41 | } 42 | 43 | .shellcommands_menu_a { 44 | display: block; 45 | width: 150px; 46 | /*height: 100px;*/ 47 | margin-top: 30px; 48 | } 49 | 50 | .shellcommands_show_custom_fields { 51 | margin-left: auto; 52 | margin-right: auto; 53 | } 54 | 55 | .shellcommands_show_values { 56 | padding: 10px; 57 | margin: 0px 0px 10px 0px; 58 | border: solid 1px #D5D5D5; 59 | 60 | -moz-border-radius: 5px; 61 | -webkit-border-radius: 5px; 62 | border-radius: 5px; 63 | } 64 | 65 | .shellcommands_custom_values { 66 | text-align: left; 67 | border: solid 1px #BCBCBC; 68 | background-color: #ffffff; 69 | padding: 5px; 70 | margin: 5px; 71 | 72 | -moz-border-radius: 3px; 73 | -webkit-border-radius: 3px; 74 | border-radius: 3px; 75 | } 76 | .shellcommands_font_blue { 77 | color : blue; 78 | } 79 | -------------------------------------------------------------------------------- /shellcommands.js: -------------------------------------------------------------------------------- 1 | /* 2 | ------------------------------------------------------------------------- 3 | Shellcommands plugin for GLPI 4 | Copyright (C) 2014 by the Shellcommands Development Team. 5 | ------------------------------------------------------------------------- 6 | 7 | LICENSE 8 | 9 | This file is part of Shellcommands. 10 | 11 | Shellcommands is free software; you can redistribute it and/or modify 12 | it under the terms of the GNU General Public License as published by 13 | the Free Software Foundation; either version 2 of the License, or 14 | (at your option) any later version. 15 | 16 | Shellcommands is distributed in the hope that it will be useful, 17 | but WITHOUT ANY WARRANTY; without even the implied warranty of 18 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 19 | GNU General Public License for more details. 20 | 21 | You should have received a copy of the GNU General Public License 22 | along with Shellcommands. If not, see . 23 | -------------------------------------------------------------------------- */ 24 | 25 | 26 | /** 27 | * Init shellcommands advanced execution 28 | * 29 | * @param string root_doc 30 | * @param string toobserve 31 | * @param string toupdate 32 | */ 33 | function shellcommand_advanced_execution(root_doc, toobserve, toupdate) { 34 | 35 | var command_group = $("form[name='" + toobserve + "'] select[name='plugin_shellcommands_commandgroups_id']").val(); 36 | var items = $("form[name='" + toobserve + "'] div[id^='custom_values']"); 37 | 38 | var items_to_execute = {}; 39 | 40 | $.each(items, function (index, option) { 41 | var itemtype = $("div[id='" + option.id + "'] select[name='items']"); 42 | var items_id = $("div[id='" + option.id + "'] select[name='items_id']"); 43 | if (itemtype != undefined && items_id != undefined) { 44 | items_to_execute[index] = {'itemtype': itemtype.val(), 'items_id': items_id.val()}; 45 | } 46 | }); 47 | 48 | var params = { 49 | 'command_type': 'PluginShellcommandsAdvanced_Execution', 50 | 'command_group': command_group, 51 | 'items_to_execute': JSON.stringify(items_to_execute) 52 | }; 53 | 54 | shellcommandsActions(root_doc, toupdate, params); 55 | } 56 | 57 | /** 58 | * Init shellcommands ajax actions 59 | * 60 | * @param string root_doc 61 | * @param string toupdate 62 | * @param string params 63 | */ 64 | function shellcommandsActions(root_doc, toupdate, params) { 65 | if (toupdate != '') { 66 | var item_bloc = $('#' + toupdate); 67 | // Loading 68 | item_bloc.html('
'); 69 | } 70 | 71 | // Send data 72 | $.ajax({ 73 | url: root_doc + '/ajax/shellcommand.exec.php', 74 | type: "POST", 75 | dataType: "html", 76 | data: params, 77 | 78 | success: function (response, opts) { 79 | if (toupdate != '') { 80 | item_bloc.html(response); 81 | } 82 | } 83 | }); 84 | } 85 | 86 | /** 87 | * changeNbValue : display text input 88 | * 89 | * @param newValue 90 | */ 91 | function changeNbValue(newValue) { 92 | document.getElementById('nbValue').value = newValue; 93 | return true; 94 | } 95 | 96 | 97 | /** 98 | * shellcommands_add_custom_values : add text input 99 | */ 100 | function shellcommands_add_custom_values(field_id, root_doc) { 101 | var count = $('#count_custom_values').val(); 102 | $('#count_custom_values').val(parseInt(count) + 1); 103 | 104 | $.ajax({ 105 | url: root_doc + '/ajax/addnewvalue.php', 106 | type: "POST", 107 | dataType: "html", 108 | data: { 109 | 'action': 'add', 110 | 'count': $('#count_custom_values').val() 111 | }, 112 | success: function (response, opts) { 113 | var item_bloc = $('#' + field_id); 114 | item_bloc.append(response); 115 | 116 | var scripts, scriptsFinder = /]*>([\s\S]+?)<\/script>/gi; 117 | while (scripts = scriptsFinder.exec(response)) { 118 | eval(scripts[1]); 119 | } 120 | } 121 | }); 122 | } 123 | 124 | /** 125 | * shellcommands_delete_custom_values : delete text input 126 | * 127 | * @param field_id 128 | */ 129 | function shellcommands_delete_custom_values(field_id) { 130 | var count = $('#count_custom_values').val(); 131 | if (count > 1) { 132 | $('#' + field_id + count).remove(); 133 | $('#count_custom_values').val(parseInt(count) - 1); 134 | } 135 | } 136 | -------------------------------------------------------------------------------- /shellcommands.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/InfotelGLPI/shellcommands/919c5ed8a52368d681418b7950bf596d09b32232/shellcommands.png -------------------------------------------------------------------------------- /shellcommands.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | Launch Shell Commands 4 | shellcommands 5 | stable 6 | https://raw.githubusercontent.com/InfotelGLPI/shellcommands/master/shellcommands.png 7 | 8 | 9 | 10 | 11 | 12 | 13 | - Ping (sur le nom ou l'ip),
- Tracert (sur le nom ou l'ip),
- Nslookup (sur le domaine),
- Wake on lan (sur l'ip),
- Vous associez une commande à des types de matériels et vous pouvez directement depuis le détail du matériel, et lancer vos commandes.
- Vous pouvez aussi créer de nouvelles commandes.]]>
14 | - Ping (with name or ip),
- Tracert (with name or ip),
- Nslookup (with domain),
- Wake on lan (with ip),
- You associate a command with equipment types and you can directly from equipment detail, launch commands.
- You can create new commands.]]>
n 15 |
16 |
17 | https://github.com/InfotelGLPI/shellcommands 18 | https://github.com/InfotelGLPI/shellcommands/releases 19 | https://github.com/InfotelGLPI/shellcommands/issues 20 | https://raw.githubusercontent.com/InfotelGLPI/shellcommands/master/README.md 21 | 22 | Xavier Caillaud 23 | Infotel 24 | 25 | 26 | 27 | 4.0.1 28 | ~10.0 29 | https://github.com/InfotelGLPI/shellcommands/releases/download/4.0.1/glpi-shellcommands-4.0.1.tar.bz2 30 | 31 | 32 | 4.0.0 33 | ~10.0 34 | https://github.com/InfotelGLPI/shellcommands/releases/download/4.0.0/glpi-shellcommands-4.0.0.tar.bz2 35 | 36 | 37 | 4.0.0-rc2 38 | ~10.0 39 | https://github.com/InfotelGLPI/shellcommands/releases/download/4.0.0-rc2/glpi-shellcommands-4.0.0-rc2.tar.bz2 40 | 41 | 42 | 4.0.0-rc1 43 | ~10.0 44 | https://github.com/InfotelGLPI/shellcommands/releases/download/4.0.0-rc1/glpi-shellcommands-4.0.0-rc1.tar.bz2 45 | 46 | 47 | 3.0.0 48 | 9.5 49 | 50 | 51 | 2.3.0 52 | 9.4 53 | 54 | 55 | 2.2.2 56 | 9.3 57 | 58 | 59 | 2.2.1 60 | 9.3 61 | 62 | 63 | 2.2.0 64 | 9.3 65 | 66 | 67 | 2.1.0 68 | 9.2 69 | 70 | 71 | 2.0.0 72 | 9.1 73 | 74 | 75 | 1.9.1 76 | 0.90 77 | 78 | 79 | 1.9.0 80 | 0.90 81 | 82 | 83 | 1.8.0 84 | 0.85 85 | 86 | 87 | 1.7.0 88 | 0.84 89 | 90 | 91 | 1.6.0 92 | 0.84 93 | 94 | 95 | 1.5.2 96 | 0.83.3 97 | 98 | 99 | 1.5.1 100 | 0.83 101 | 102 | 103 | 1.5.0 104 | 0.83 105 | 106 | 107 | 1.4.0 108 | 0.80 109 | 110 | 111 | 1.3.0 112 | 0.78 113 | 114 | 115 | 1.2.3 116 | 0.72 117 | 118 | 119 | 1.2.2 120 | 0.72 121 | 122 | 123 | 1.2.1 124 | 0.72 125 | 126 | 127 | 1.2.0 128 | 0.72 129 | 130 | 131 | 1.1 132 | 0.71 133 | 134 | 135 | 1.0 136 | 0.70 137 | 138 | 139 | 140 | cs_CZ 141 | de_DE 142 | en_GB 143 | es_ES 144 | fr_FR 145 | pl_PL 146 | pt_BR 147 | ro_RO 148 | ru_RU 149 | tr_TR 150 | 151 | 152 | 153 | 154 | Réseau 155 | Shell 156 | Commandes 157 | 158 | 159 | Network 160 | Shell 161 | Commands 162 | 163 | 164 |
165 | -------------------------------------------------------------------------------- /sql/empty-1.0.sql: -------------------------------------------------------------------------------- 1 | DROP TABLE IF EXISTS `glpi_plugin_cmd`; 2 | CREATE TABLE `glpi_plugin_cmd` ( 3 | `ID` int(11) NOT NULL auto_increment, 4 | `name` varchar(255) collate utf8_unicode_ci NOT NULL default '', 5 | `link` varchar(255) collate utf8_unicode_ci NOT NULL default '', 6 | `deleted` smallint(6) NOT NULL default '0', 7 | PRIMARY KEY (`ID`) 8 | ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; 9 | 10 | INSERT INTO `glpi_plugin_cmd` VALUES (1, 'Ping', '[IP]', '0'); 11 | INSERT INTO `glpi_plugin_cmd` VALUES (2, 'Tracert', '[NAME]', '0'); 12 | INSERT INTO `glpi_plugin_cmd` VALUES (3, 'Wake on Lan', '[MAC]', '0'); 13 | INSERT INTO `glpi_plugin_cmd` VALUES (4, 'Nslookup', '[DOMAIN]', '0'); 14 | 15 | DROP TABLE IF EXISTS `glpi_plugin_cmd_device`; 16 | CREATE TABLE `glpi_plugin_cmd_device` ( 17 | `ID` int(11) NOT NULL auto_increment, 18 | `FK_cmd` int(11) NOT NULL default '0', 19 | `device_type` int(11) NOT NULL default '0', 20 | PRIMARY KEY (`ID`), 21 | UNIQUE KEY `FK_cmd` (`FK_cmd`,`device_type`), 22 | KEY `FK_cmd_2` (`FK_cmd`), 23 | KEY `device_type` (`device_type`) 24 | ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; 25 | 26 | DROP TABLE IF EXISTS `glpi_plugin_cmd_setup`; 27 | CREATE TABLE `glpi_plugin_cmd_setup` ( 28 | `ID` int(11) NOT NULL auto_increment, 29 | `type` varchar(50) collate utf8_unicode_ci NOT NULL default 'linux', 30 | PRIMARY KEY (`ID`) 31 | ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; 32 | 33 | INSERT INTO `glpi_plugin_cmd_setup` ( `ID` , `type` ) VALUES ('1', 'linux'); 34 | 35 | DROP TABLE IF EXISTS `glpi_plugin_cmd_profiles`; 36 | CREATE TABLE `glpi_plugin_cmd_profiles` ( 37 | `ID` int(11) NOT NULL auto_increment, 38 | `name` varchar(255) default NULL, 39 | `interface` varchar(50) NOT NULL default 'cmd', 40 | `is_default` smallint(6) NOT NULL default '0', 41 | `cmd` char(1) default NULL, 42 | `update_cmd` char(1) default NULL, 43 | PRIMARY KEY (`ID`), 44 | KEY `interface` (`interface`) 45 | ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; -------------------------------------------------------------------------------- /sql/empty-1.1.sql: -------------------------------------------------------------------------------- 1 | DROP TABLE IF EXISTS `glpi_plugin_cmd`; 2 | CREATE TABLE `glpi_plugin_cmd` ( 3 | `ID` int(11) NOT NULL auto_increment, 4 | `name` varchar(255) collate utf8_unicode_ci NOT NULL default '', 5 | `link` varchar(255) collate utf8_unicode_ci NOT NULL default '', 6 | `deleted` smallint(6) NOT NULL default '0', 7 | PRIMARY KEY (`ID`) 8 | ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; 9 | 10 | INSERT INTO `glpi_plugin_cmd` VALUES (1, 'Ping', '[IP]', '0'); 11 | INSERT INTO `glpi_plugin_cmd` VALUES (2, 'Tracert', '[NAME]', '0'); 12 | INSERT INTO `glpi_plugin_cmd` VALUES (3, 'Wake on Lan', '[MAC]', '0'); 13 | INSERT INTO `glpi_plugin_cmd` VALUES (4, 'Nslookup', '[DOMAIN]', '0'); 14 | 15 | DROP TABLE IF EXISTS `glpi_plugin_cmd_path`; 16 | CREATE TABLE `glpi_plugin_cmd_path` ( 17 | `ID` int(11) NOT NULL auto_increment, 18 | `FK_cmd` int(11) NOT NULL, 19 | `FK_type` varchar(255) character set utf8 collate utf8_unicode_ci NOT NULL, 20 | `path` varchar(255) character set utf8 collate utf8_unicode_ci NOT NULL, 21 | PRIMARY KEY (`ID`) 22 | ) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=13 ; 23 | 24 | INSERT INTO `glpi_plugin_cmd_path` (`ID`, `FK_cmd`, `FK_type`, `path`) VALUES 25 | (1, 1, 'linux', '/bin/ping'), 26 | (2, 2, 'linux', '/usr/bin/traceroute'), 27 | (3, 4, 'linux', '/usr/bin/nslookup'), 28 | (4, 1, 'windows', 'c:\\windows\\system32\\ping.exe'), 29 | (5, 2, 'windows', 'c:\\windows\\system32\\tracert.exe'), 30 | (6, 4, 'windows', 'c:\\windows\\system32\\nslookup.exe'); 31 | 32 | DROP TABLE IF EXISTS `glpi_plugin_cmd_device`; 33 | CREATE TABLE `glpi_plugin_cmd_device` ( 34 | `ID` int(11) NOT NULL auto_increment, 35 | `FK_cmd` int(11) NOT NULL default '0', 36 | `device_type` int(11) NOT NULL default '0', 37 | PRIMARY KEY (`ID`), 38 | UNIQUE KEY `FK_cmd` (`FK_cmd`,`device_type`), 39 | KEY `FK_cmd_2` (`FK_cmd`), 40 | KEY `device_type` (`device_type`) 41 | ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; 42 | 43 | DROP TABLE IF EXISTS `glpi_plugin_cmd_setup`; 44 | CREATE TABLE `glpi_plugin_cmd_setup` ( 45 | `ID` int(11) NOT NULL auto_increment, 46 | `type` varchar(50) collate utf8_unicode_ci NOT NULL default 'linux', 47 | PRIMARY KEY (`ID`) 48 | ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; 49 | 50 | INSERT INTO `glpi_plugin_cmd_setup` ( `ID` , `type` ) VALUES ('1', 'linux'); 51 | 52 | DROP TABLE IF EXISTS `glpi_plugin_cmd_profiles`; 53 | CREATE TABLE `glpi_plugin_cmd_profiles` ( 54 | `ID` int(11) NOT NULL auto_increment, 55 | `name` varchar(255) default NULL, 56 | `interface` varchar(50) NOT NULL default 'cmd', 57 | `is_default` smallint(6) NOT NULL default '0', 58 | `cmd` char(1) default NULL, 59 | `update_cmd` char(1) default NULL, 60 | PRIMARY KEY (`ID`), 61 | KEY `interface` (`interface`) 62 | ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; -------------------------------------------------------------------------------- /sql/empty-1.2.0.sql: -------------------------------------------------------------------------------- 1 | DROP TABLE IF EXISTS `glpi_plugin_cmd`; 2 | CREATE TABLE `glpi_plugin_cmd` ( 3 | `ID` int(11) NOT NULL auto_increment, 4 | `name` varchar(255) collate utf8_unicode_ci NOT NULL default '', 5 | `link` varchar(255) collate utf8_unicode_ci NOT NULL default '', 6 | `deleted` smallint(6) NOT NULL default '0', 7 | PRIMARY KEY (`ID`) 8 | ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; 9 | 10 | INSERT INTO `glpi_plugin_cmd` VALUES (1, 'Ping', '[IP]', '0'); 11 | INSERT INTO `glpi_plugin_cmd` VALUES (2, 'Tracert', '[NAME]', '0'); 12 | INSERT INTO `glpi_plugin_cmd` VALUES (3, 'Wake on Lan', '[MAC]', '0'); 13 | INSERT INTO `glpi_plugin_cmd` VALUES (4, 'Nslookup', '[DOMAIN]', '0'); 14 | 15 | DROP TABLE IF EXISTS `glpi_plugin_cmd_path`; 16 | CREATE TABLE `glpi_plugin_cmd_path` ( 17 | `ID` int(11) NOT NULL auto_increment, 18 | `FK_cmd` int(11) NOT NULL, 19 | `FK_type` varchar(255) character set utf8 collate utf8_unicode_ci NOT NULL, 20 | `path` varchar(255) character set utf8 collate utf8_unicode_ci NOT NULL, 21 | PRIMARY KEY (`ID`) 22 | ) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=13 ; 23 | 24 | INSERT INTO `glpi_plugin_cmd_path` (`ID`, `FK_cmd`, `FK_type`, `path`) VALUES 25 | (1, 1, 'linux', '/bin/ping -c 4'), 26 | (2, 2, 'linux', '/usr/bin/traceroute'), 27 | (3, 4, 'linux', '/usr/bin/nslookup'), 28 | (4, 1, 'windows', 'c:\\windows\\system32\\ping.exe'), 29 | (5, 2, 'windows', 'c:\\windows\\system32\\tracert.exe'), 30 | (6, 4, 'windows', 'c:\\windows\\system32\\nslookup.exe'); 31 | 32 | DROP TABLE IF EXISTS `glpi_plugin_cmd_device`; 33 | CREATE TABLE `glpi_plugin_cmd_device` ( 34 | `ID` int(11) NOT NULL auto_increment, 35 | `FK_cmd` int(11) NOT NULL default '0', 36 | `device_type` int(11) NOT NULL default '0', 37 | PRIMARY KEY (`ID`), 38 | UNIQUE KEY `FK_cmd` (`FK_cmd`,`device_type`), 39 | KEY `FK_cmd_2` (`FK_cmd`), 40 | KEY `device_type` (`device_type`) 41 | ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; 42 | 43 | DROP TABLE IF EXISTS `glpi_plugin_cmd_setup`; 44 | CREATE TABLE `glpi_plugin_cmd_setup` ( 45 | `ID` int(11) NOT NULL auto_increment, 46 | `type` varchar(50) collate utf8_unicode_ci NOT NULL default 'linux', 47 | PRIMARY KEY (`ID`) 48 | ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; 49 | 50 | INSERT INTO `glpi_plugin_cmd_setup` ( `ID` , `type` ) VALUES ('1', 'linux'); 51 | 52 | DROP TABLE IF EXISTS `glpi_plugin_cmd_profiles`; 53 | CREATE TABLE `glpi_plugin_cmd_profiles` ( 54 | `ID` int(11) NOT NULL auto_increment, 55 | `name` varchar(255) default NULL, 56 | `cmd` char(1) default NULL, 57 | `update_cmd` char(1) default NULL, 58 | PRIMARY KEY (`ID`), 59 | KEY `name` (`name`) 60 | ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; -------------------------------------------------------------------------------- /sql/empty-1.3.0.sql: -------------------------------------------------------------------------------- 1 | DROP TABLE IF EXISTS `glpi_plugin_shellcommands_shellcommands`; 2 | CREATE TABLE `glpi_plugin_shellcommands_shellcommands` ( 3 | `id` int(11) NOT NULL auto_increment, 4 | `entities_id` int(11) NOT NULL default '0', 5 | `is_recursive` tinyint(1) NOT NULL default '0', 6 | `name` varchar(255) collate utf8_unicode_ci default NULL, 7 | `link` varchar(255) collate utf8_unicode_ci default NULL, 8 | `plugin_shellcommands_shellcommandpaths_id` int(11) NOT NULL default '0' COMMENT 'RELATION to glpi_plugin_shellcommands_shellcommandpaths (id)', 9 | `parameters` varchar(255) collate utf8_unicode_ci default NULL, 10 | `is_deleted` tinyint(1) NOT NULL default '0', 11 | PRIMARY KEY (`id`), 12 | KEY `name` (`name`), 13 | KEY `is_deleted` (`is_deleted`) 14 | ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; 15 | 16 | INSERT INTO `glpi_plugin_shellcommands_shellcommands` VALUES (1,0,1, 'Ping', '[IP]', '1','-c 2','0'); 17 | INSERT INTO `glpi_plugin_shellcommands_shellcommands` VALUES (2,0,1, 'Tracert', '[NAME]', '2','','0'); 18 | INSERT INTO `glpi_plugin_shellcommands_shellcommands` VALUES (3,0,1, 'Wake on Lan', '[MAC]', '0','','0'); 19 | INSERT INTO `glpi_plugin_shellcommands_shellcommands` VALUES (4,0,1, 'Nslookup', '[DOMAIN]', '3','','0'); 20 | 21 | DROP TABLE IF EXISTS `glpi_plugin_shellcommands_shellcommandpaths`; 22 | CREATE TABLE `glpi_plugin_shellcommands_shellcommandpaths` ( 23 | `id` int(11) NOT NULL auto_increment, 24 | `name` varchar(255) character set utf8 collate utf8_unicode_ci NOT NULL, 25 | `comment` text collate utf8_unicode_ci, 26 | PRIMARY KEY (`id`), 27 | KEY `name` (`name`) 28 | ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; 29 | 30 | INSERT INTO `glpi_plugin_shellcommands_shellcommandpaths` (`ID`,`name`) VALUES 31 | (1, '/bin/ping'), 32 | (2, '/usr/bin/traceroute'), 33 | (3,'/usr/bin/nslookup'), 34 | (4, 'c:\\windows\\system32\\ping.exe'), 35 | (5, 'c:\\windows\\system32\\tracert.exe'), 36 | (6, 'c:\\windows\\system32\\nslookup.exe'); 37 | 38 | DROP TABLE IF EXISTS `glpi_plugin_shellcommands_shellcommands_items`; 39 | CREATE TABLE `glpi_plugin_shellcommands_shellcommands_items` ( 40 | `id` int(11) NOT NULL auto_increment, 41 | `plugin_shellcommands_shellcommands_id` int(11) NOT NULL default '0', 42 | `itemtype` varchar(100) collate utf8_unicode_ci NOT NULL COMMENT 'see .class.php file', 43 | PRIMARY KEY (`id`), 44 | UNIQUE KEY `FK_cmd` (`plugin_shellcommands_shellcommands_id`,`itemtype`), 45 | KEY `itemtype` (`itemtype`) 46 | ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; 47 | 48 | DROP TABLE IF EXISTS `glpi_plugin_shellcommands_profiles`; 49 | CREATE TABLE `glpi_plugin_shellcommands_profiles` ( 50 | `id` int(11) NOT NULL auto_increment, 51 | `profiles_id` int(11) NOT NULL default '0' COMMENT 'RELATION to glpi_profiles (id)', 52 | `shellcommands` char(1) collate utf8_unicode_ci default NULL, 53 | PRIMARY KEY (`id`), 54 | KEY `profiles_id` (`profiles_id`) 55 | ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; 56 | 57 | INSERT INTO `glpi_displaypreferences` VALUES (NULL,'PluginShellcommandsShellcommand','2','2','0'); 58 | INSERT INTO `glpi_displaypreferences` VALUES (NULL,'PluginShellcommandsShellcommand','3','3','0'); 59 | INSERT INTO `glpi_displaypreferences` VALUES (NULL,'PluginShellcommandsShellcommand','4','4','0'); 60 | INSERT INTO `glpi_displaypreferences` VALUES (NULL,'PluginShellcommandsShellcommand','5','5','0'); -------------------------------------------------------------------------------- /sql/empty-1.7.0.sql: -------------------------------------------------------------------------------- 1 | DROP TABLE IF EXISTS `glpi_plugin_shellcommands_shellcommands`; 2 | CREATE TABLE `glpi_plugin_shellcommands_shellcommands` ( 3 | `id` int(11) NOT NULL auto_increment, 4 | `entities_id` int(11) NOT NULL default '0', 5 | `is_recursive` tinyint(1) NOT NULL default '0', 6 | `name` varchar(255) collate utf8_unicode_ci default NULL, 7 | `link` varchar(255) collate utf8_unicode_ci default NULL, 8 | `plugin_shellcommands_shellcommandpaths_id` int(11) NOT NULL default '0' COMMENT 'RELATION to glpi_plugin_shellcommands_shellcommandpaths (id)', 9 | `parameters` varchar(255) collate utf8_unicode_ci default NULL, 10 | `is_deleted` tinyint(1) NOT NULL default '0', 11 | `tag_position` tinyint(1) NOT NULL default '1', 12 | PRIMARY KEY (`id`), 13 | KEY `name` (`name`), 14 | KEY `is_deleted` (`is_deleted`) 15 | ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; 16 | 17 | INSERT INTO `glpi_plugin_shellcommands_shellcommands` VALUES (1,0,1, 'Ping', '[IP]', '1','-c 2',0,1); 18 | INSERT INTO `glpi_plugin_shellcommands_shellcommands` VALUES (2,0,1, 'Tracert', '[NAME]', '2','',0,1); 19 | INSERT INTO `glpi_plugin_shellcommands_shellcommands` VALUES (3,0,1, 'Wake on Lan', '[MAC]', '0','',0,1); 20 | INSERT INTO `glpi_plugin_shellcommands_shellcommands` VALUES (4,0,1, 'Nslookup', '[DOMAIN]', '3','',0,1); 21 | 22 | DROP TABLE IF EXISTS `glpi_plugin_shellcommands_shellcommandpaths`; 23 | CREATE TABLE `glpi_plugin_shellcommands_shellcommandpaths` ( 24 | `id` int(11) NOT NULL auto_increment, 25 | `name` varchar(255) character set utf8 collate utf8_unicode_ci NOT NULL, 26 | `comment` text collate utf8_unicode_ci, 27 | PRIMARY KEY (`id`), 28 | KEY `name` (`name`) 29 | ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; 30 | 31 | INSERT INTO `glpi_plugin_shellcommands_shellcommandpaths` (`ID`,`name`) VALUES 32 | (1, '/bin/ping'), 33 | (2, '/usr/bin/traceroute'), 34 | (3,'/usr/bin/nslookup'), 35 | (4, 'c:\\windows\\system32\\ping.exe'), 36 | (5, 'c:\\windows\\system32\\tracert.exe'), 37 | (6, 'c:\\windows\\system32\\nslookup.exe'); 38 | 39 | DROP TABLE IF EXISTS `glpi_plugin_shellcommands_shellcommands_items`; 40 | CREATE TABLE `glpi_plugin_shellcommands_shellcommands_items` ( 41 | `id` int(11) NOT NULL auto_increment, 42 | `plugin_shellcommands_shellcommands_id` int(11) NOT NULL default '0', 43 | `itemtype` varchar(100) collate utf8_unicode_ci NOT NULL COMMENT 'see .class.php file', 44 | PRIMARY KEY (`id`), 45 | UNIQUE KEY `FK_cmd` (`plugin_shellcommands_shellcommands_id`,`itemtype`), 46 | KEY `itemtype` (`itemtype`) 47 | ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; 48 | 49 | DROP TABLE IF EXISTS `glpi_plugin_shellcommands_profiles`; 50 | CREATE TABLE `glpi_plugin_shellcommands_profiles` ( 51 | `id` int(11) NOT NULL auto_increment, 52 | `profiles_id` int(11) NOT NULL default '0' COMMENT 'RELATION to glpi_profiles (id)', 53 | `shellcommands` char(1) collate utf8_unicode_ci default NULL, 54 | PRIMARY KEY (`id`), 55 | KEY `profiles_id` (`profiles_id`) 56 | ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; 57 | 58 | INSERT INTO `glpi_displaypreferences` VALUES (NULL,'PluginShellcommandsShellcommand','2','2','0'); 59 | INSERT INTO `glpi_displaypreferences` VALUES (NULL,'PluginShellcommandsShellcommand','3','3','0'); 60 | INSERT INTO `glpi_displaypreferences` VALUES (NULL,'PluginShellcommandsShellcommand','4','4','0'); 61 | INSERT INTO `glpi_displaypreferences` VALUES (NULL,'PluginShellcommandsShellcommand','5','5','0'); 62 | 63 | DROP TABLE IF EXISTS `glpi_plugin_shellcommands_commandgroups_items`; 64 | CREATE TABLE `glpi_plugin_shellcommands_commandgroups_items` ( 65 | `id` int(11) NOT NULL auto_increment, 66 | `plugin_shellcommands_shellcommands_id` int(11) NOT NULL default '0', 67 | `plugin_shellcommands_commandgroups_id` int(11) NOT NULL default '0', 68 | `rank` int(11) NOT NULL default '0', 69 | PRIMARY KEY (`id`), 70 | UNIQUE KEY `FK_cmd` (`plugin_shellcommands_shellcommands_id`,`plugin_shellcommands_commandgroups_id`), 71 | KEY `plugin_shellcommands_commandgroups_id` (`plugin_shellcommands_commandgroups_id`), 72 | KEY `plugin_shellcommands_shellcommands_id` (`plugin_shellcommands_shellcommands_id`), 73 | KEY `rank` (`rank`) 74 | ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; 75 | 76 | DROP TABLE IF EXISTS `glpi_plugin_shellcommands_commandgroups`; 77 | CREATE TABLE `glpi_plugin_shellcommands_commandgroups` ( 78 | `id` int(11) NOT NULL auto_increment, 79 | `name` varchar(255) collate utf8_unicode_ci NOT NULL, 80 | `check_commands_id` int(11) NOT NULL default '0', 81 | `entities_id` int(11) NOT NULL default '0', 82 | `is_recursive` tinyint(1) NOT NULL default '0', 83 | PRIMARY KEY (`id`), 84 | KEY `entities_id` (`entities_id`) 85 | ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; -------------------------------------------------------------------------------- /sql/empty-2.2.0.sql: -------------------------------------------------------------------------------- 1 | DROP TABLE IF EXISTS `glpi_plugin_shellcommands_shellcommands`; 2 | CREATE TABLE `glpi_plugin_shellcommands_shellcommands` ( 3 | `id` int(11) NOT NULL auto_increment, 4 | `entities_id` int(11) NOT NULL default '0', 5 | `is_recursive` tinyint(1) NOT NULL default '0', 6 | `name` varchar(255) collate utf8_unicode_ci default NULL, 7 | `link` varchar(255) collate utf8_unicode_ci default NULL, 8 | `plugin_shellcommands_shellcommandpaths_id` int(11) NOT NULL default '0' COMMENT 'RELATION to glpi_plugin_shellcommands_shellcommandpaths (id)', 9 | `parameters` varchar(255) collate utf8_unicode_ci default NULL, 10 | `is_deleted` tinyint(1) NOT NULL default '0', 11 | `tag_position` tinyint(1) NOT NULL default '1', 12 | PRIMARY KEY (`id`), 13 | KEY `name` (`name`), 14 | KEY `is_deleted` (`is_deleted`) 15 | ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; 16 | 17 | INSERT INTO `glpi_plugin_shellcommands_shellcommands` VALUES (1,0,1, 'Ping', '[IP]', '1','-c 2',0,1); 18 | INSERT INTO `glpi_plugin_shellcommands_shellcommands` VALUES (2,0,1, 'Tracert', '[NAME]', '2','',0,1); 19 | INSERT INTO `glpi_plugin_shellcommands_shellcommands` VALUES (3,0,1, 'Wake on Lan', '[MAC]', '0','',0,1); 20 | INSERT INTO `glpi_plugin_shellcommands_shellcommands` VALUES (4,0,1, 'Nslookup', '[DOMAIN]', '3','',0,1); 21 | 22 | DROP TABLE IF EXISTS `glpi_plugin_shellcommands_shellcommandpaths`; 23 | CREATE TABLE `glpi_plugin_shellcommands_shellcommandpaths` ( 24 | `id` int(11) NOT NULL auto_increment, 25 | `name` varchar(255) character set utf8 collate utf8_unicode_ci NOT NULL, 26 | `comment` text collate utf8_unicode_ci, 27 | PRIMARY KEY (`id`), 28 | KEY `name` (`name`) 29 | ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; 30 | 31 | INSERT INTO `glpi_plugin_shellcommands_shellcommandpaths` (`ID`,`name`) VALUES 32 | (1, '/bin/ping'), 33 | (2, '/usr/bin/traceroute'), 34 | (3,'/usr/bin/nslookup'), 35 | (4, 'c:\\windows\\system32\\ping.exe'), 36 | (5, 'c:\\windows\\system32\\tracert.exe'), 37 | (6, 'c:\\windows\\system32\\nslookup.exe'); 38 | 39 | DROP TABLE IF EXISTS `glpi_plugin_shellcommands_shellcommands_items`; 40 | CREATE TABLE `glpi_plugin_shellcommands_shellcommands_items` ( 41 | `id` int(11) NOT NULL auto_increment, 42 | `plugin_shellcommands_shellcommands_id` int(11) NOT NULL default '0', 43 | `itemtype` varchar(100) collate utf8_unicode_ci NOT NULL COMMENT 'see .class.php file', 44 | PRIMARY KEY (`id`), 45 | UNIQUE KEY `FK_cmd` (`plugin_shellcommands_shellcommands_id`,`itemtype`), 46 | KEY `itemtype` (`itemtype`) 47 | ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; 48 | 49 | DROP TABLE IF EXISTS `glpi_plugin_shellcommands_profiles`; 50 | CREATE TABLE `glpi_plugin_shellcommands_profiles` ( 51 | `id` int(11) NOT NULL auto_increment, 52 | `profiles_id` int(11) NOT NULL default '0' COMMENT 'RELATION to glpi_profiles (id)', 53 | `shellcommands` char(1) collate utf8_unicode_ci default NULL, 54 | PRIMARY KEY (`id`), 55 | KEY `profiles_id` (`profiles_id`) 56 | ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; 57 | 58 | INSERT INTO `glpi_displaypreferences` VALUES (NULL,'PluginShellcommandsShellcommand','2','2','0'); 59 | INSERT INTO `glpi_displaypreferences` VALUES (NULL,'PluginShellcommandsShellcommand','3','3','0'); 60 | INSERT INTO `glpi_displaypreferences` VALUES (NULL,'PluginShellcommandsShellcommand','4','4','0'); 61 | INSERT INTO `glpi_displaypreferences` VALUES (NULL,'PluginShellcommandsShellcommand','5','5','0'); 62 | 63 | DROP TABLE IF EXISTS `glpi_plugin_shellcommands_commandgroups_items`; 64 | CREATE TABLE `glpi_plugin_shellcommands_commandgroups_items` ( 65 | `id` int(11) NOT NULL auto_increment, 66 | `plugin_shellcommands_shellcommands_id` int(11) NOT NULL default '0', 67 | `plugin_shellcommands_commandgroups_id` int(11) NOT NULL default '0', 68 | `rank` int(11) NOT NULL default '0', 69 | PRIMARY KEY (`id`), 70 | UNIQUE KEY `FK_cmd` (`plugin_shellcommands_shellcommands_id`,`plugin_shellcommands_commandgroups_id`), 71 | KEY `plugin_shellcommands_commandgroups_id` (`plugin_shellcommands_commandgroups_id`), 72 | KEY `plugin_shellcommands_shellcommands_id` (`plugin_shellcommands_shellcommands_id`), 73 | KEY `rank` (`rank`) 74 | ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; 75 | 76 | DROP TABLE IF EXISTS `glpi_plugin_shellcommands_commandgroups`; 77 | CREATE TABLE `glpi_plugin_shellcommands_commandgroups` ( 78 | `id` int(11) NOT NULL auto_increment, 79 | `name` varchar(255) collate utf8_unicode_ci NOT NULL, 80 | `check_commands_id` int(11) NOT NULL default '0', 81 | `entities_id` int(11) NOT NULL default '0', 82 | `is_recursive` tinyint(1) NOT NULL default '0', 83 | PRIMARY KEY (`id`), 84 | KEY `entities_id` (`entities_id`) 85 | ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; -------------------------------------------------------------------------------- /sql/empty-4.0.0.sql: -------------------------------------------------------------------------------- 1 | DROP TABLE IF EXISTS `glpi_plugin_shellcommands_shellcommands`; 2 | CREATE TABLE `glpi_plugin_shellcommands_shellcommands` ( 3 | `id` int unsigned NOT NULL auto_increment, 4 | `entities_id` int unsigned NOT NULL default '0', 5 | `is_recursive` tinyint NOT NULL default '0', 6 | `name` varchar(255) collate utf8mb4_unicode_ci default NULL, 7 | `link` varchar(255) collate utf8mb4_unicode_ci default NULL, 8 | `plugin_shellcommands_shellcommandpaths_id` int unsigned NOT NULL default '0' COMMENT 'RELATION to glpi_plugin_shellcommands_shellcommandpaths (id)', 9 | `parameters` varchar(255) collate utf8mb4_unicode_ci default NULL, 10 | `is_deleted` tinyint NOT NULL default '0', 11 | `tag_position` tinyint NOT NULL default '1', 12 | PRIMARY KEY (`id`), 13 | KEY `name` (`name`), 14 | KEY `is_deleted` (`is_deleted`) 15 | ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC; 16 | 17 | INSERT INTO `glpi_plugin_shellcommands_shellcommands` VALUES (1,0,1, 'Ping', '[IP]', '1','-c 2',0,1); 18 | INSERT INTO `glpi_plugin_shellcommands_shellcommands` VALUES (2,0,1, 'Tracert', '[NAME]', '2','',0,1); 19 | INSERT INTO `glpi_plugin_shellcommands_shellcommands` VALUES (3,0,1, 'Wake on Lan', '[MAC]', '0','',0,1); 20 | INSERT INTO `glpi_plugin_shellcommands_shellcommands` VALUES (4,0,1, 'Nslookup', '[DOMAIN]', '3','',0,1); 21 | 22 | DROP TABLE IF EXISTS `glpi_plugin_shellcommands_shellcommandpaths`; 23 | CREATE TABLE `glpi_plugin_shellcommands_shellcommandpaths` ( 24 | `id` int unsigned NOT NULL auto_increment, 25 | `name` varchar(255) collate utf8mb4_unicode_ci NOT NULL, 26 | `comment` text collate utf8mb4_unicode_ci, 27 | PRIMARY KEY (`id`), 28 | KEY `name` (`name`) 29 | ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC; 30 | 31 | INSERT INTO `glpi_plugin_shellcommands_shellcommandpaths` (`ID`,`name`) VALUES 32 | (1, '/bin/ping'), 33 | (2, '/usr/bin/traceroute'), 34 | (3,'/usr/bin/nslookup'), 35 | (4, 'c:\\windows\\system32\\ping.exe'), 36 | (5, 'c:\\windows\\system32\\tracert.exe'), 37 | (6, 'c:\\windows\\system32\\nslookup.exe'); 38 | 39 | DROP TABLE IF EXISTS `glpi_plugin_shellcommands_shellcommands_items`; 40 | CREATE TABLE `glpi_plugin_shellcommands_shellcommands_items` ( 41 | `id` int unsigned NOT NULL auto_increment, 42 | `plugin_shellcommands_shellcommands_id` int unsigned NOT NULL default '0', 43 | `itemtype` varchar(100) collate utf8mb4_unicode_ci NOT NULL COMMENT 'see .class.php file', 44 | PRIMARY KEY (`id`), 45 | UNIQUE KEY `FK_cmd` (`plugin_shellcommands_shellcommands_id`,`itemtype`), 46 | KEY `itemtype` (`itemtype`) 47 | ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC; 48 | 49 | DROP TABLE IF EXISTS `glpi_plugin_shellcommands_profiles`; 50 | CREATE TABLE `glpi_plugin_shellcommands_profiles` ( 51 | `id` int unsigned NOT NULL auto_increment, 52 | `profiles_id` int unsigned NOT NULL default '0' COMMENT 'RELATION to glpi_profiles (id)', 53 | `shellcommands` char(1) collate utf8mb4_unicode_ci default NULL, 54 | PRIMARY KEY (`id`), 55 | KEY `profiles_id` (`profiles_id`) 56 | ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC; 57 | 58 | INSERT INTO `glpi_displaypreferences` VALUES (NULL,'PluginShellcommandsShellcommand','2','2','0'); 59 | INSERT INTO `glpi_displaypreferences` VALUES (NULL,'PluginShellcommandsShellcommand','3','3','0'); 60 | INSERT INTO `glpi_displaypreferences` VALUES (NULL,'PluginShellcommandsShellcommand','4','4','0'); 61 | INSERT INTO `glpi_displaypreferences` VALUES (NULL,'PluginShellcommandsShellcommand','5','5','0'); 62 | 63 | DROP TABLE IF EXISTS `glpi_plugin_shellcommands_commandgroups_items`; 64 | CREATE TABLE `glpi_plugin_shellcommands_commandgroups_items` ( 65 | `id` int unsigned NOT NULL auto_increment, 66 | `plugin_shellcommands_shellcommands_id` int unsigned NOT NULL default '0', 67 | `plugin_shellcommands_commandgroups_id` int unsigned NOT NULL default '0', 68 | `rank` int unsigned NOT NULL default '0', 69 | PRIMARY KEY (`id`), 70 | UNIQUE KEY `FK_cmd` (`plugin_shellcommands_shellcommands_id`,`plugin_shellcommands_commandgroups_id`), 71 | KEY `plugin_shellcommands_commandgroups_id` (`plugin_shellcommands_commandgroups_id`), 72 | KEY `plugin_shellcommands_shellcommands_id` (`plugin_shellcommands_shellcommands_id`), 73 | KEY `rank` (`rank`) 74 | ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC; 75 | 76 | DROP TABLE IF EXISTS `glpi_plugin_shellcommands_commandgroups`; 77 | CREATE TABLE `glpi_plugin_shellcommands_commandgroups` ( 78 | `id` int unsigned NOT NULL auto_increment, 79 | `name` varchar(255) collate utf8mb4_unicode_ci NOT NULL, 80 | `check_commands_id` int unsigned NOT NULL default '0', 81 | `entities_id` int unsigned NOT NULL default '0', 82 | `is_recursive` tinyint NOT NULL default '0', 83 | PRIMARY KEY (`id`), 84 | KEY `entities_id` (`entities_id`) 85 | ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC; 86 | -------------------------------------------------------------------------------- /sql/update-1.1.sql: -------------------------------------------------------------------------------- 1 | DROP TABLE IF EXISTS `glpi_plugin_cmd_path`; 2 | CREATE TABLE `glpi_plugin_cmd_path` ( 3 | `ID` int(11) NOT NULL auto_increment, 4 | `FK_cmd` int(11) NOT NULL, 5 | `FK_type` varchar(255) character set utf8 collate utf8_unicode_ci NOT NULL, 6 | `path` varchar(255) character set utf8 collate utf8_unicode_ci NOT NULL, 7 | PRIMARY KEY (`ID`) 8 | ) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=13 ; 9 | 10 | INSERT INTO `glpi_plugin_cmd_path` (`ID`, `FK_cmd`, `FK_type`, `path`) VALUES 11 | (1, 1, 'linux', '/bin/ping'), 12 | (2, 2, 'linux', '/usr/bin/traceroute'), 13 | (3, 4, 'linux', '/usr/bin/nslookup'), 14 | (4, 1, 'windows', 'c:\\windows\\system32\\ping.exe'), 15 | (5, 2, 'windows', 'c:\\windows\\system32\\tracert.exe'), 16 | (6, 4, 'windows', 'c:\\windows\\system32\\nslookup.exe'); 17 | -------------------------------------------------------------------------------- /sql/update-1.2.0.sql: -------------------------------------------------------------------------------- 1 | ALTER TABLE `glpi_plugin_cmd_profiles` DROP COLUMN `interface` , DROP COLUMN `is_default`; 2 | UPDATE `glpi_plugin_cmd_path` SET `path` = '/bin/ping -c 4' WHERE `glpi_plugin_cmd_path`.`ID` =1; -------------------------------------------------------------------------------- /sql/update-1.3.0.sql: -------------------------------------------------------------------------------- 1 | ALTER TABLE `glpi_plugin_cmd` RENAME `glpi_plugin_shellcommands_shellcommands`; 2 | ALTER TABLE `glpi_plugin_cmd_device` RENAME `glpi_plugin_shellcommands_shellcommands_items`; 3 | DROP TABLE IF EXISTS `glpi_plugin_cmd_setup`; 4 | ALTER TABLE `glpi_plugin_cmd_profiles` RENAME `glpi_plugin_shellcommands_profiles`; 5 | ALTER TABLE `glpi_plugin_cmd_path` RENAME `glpi_plugin_shellcommands_shellcommandpaths`; 6 | 7 | ALTER TABLE `glpi_plugin_shellcommands_shellcommands` 8 | CHANGE `ID` `id` int(11) NOT NULL auto_increment, 9 | ADD `entities_id` int(11) NOT NULL default '0', 10 | ADD `is_recursive` tinyint(1) NOT NULL default '0', 11 | CHANGE `name` `name` varchar(255) collate utf8_unicode_ci default NULL, 12 | CHANGE `link` `link` varchar(255) collate utf8_unicode_ci default NULL, 13 | ADD `plugin_shellcommands_shellcommandpaths_id` int(11) NOT NULL default '0' COMMENT 'RELATION to glpi_plugin_shellcommands_shellcommandpaths (id)', 14 | ADD `parameters` varchar(255) collate utf8_unicode_ci default NULL, 15 | CHANGE `deleted` `is_deleted` tinyint(1) NOT NULL default '0', 16 | ADD INDEX (`name`), 17 | ADD INDEX (`is_deleted`), 18 | ADD INDEX (`entities_id`); 19 | 20 | ALTER TABLE `glpi_plugin_shellcommands_shellcommandpaths` 21 | CHANGE `ID` `id` int(11) NOT NULL auto_increment, 22 | CHANGE `path` `name` varchar(255) collate utf8_unicode_ci default NULL, 23 | ADD `comment` text collate utf8_unicode_ci, 24 | DROP `FK_cmd`, 25 | DROP `FK_type`, 26 | ADD INDEX (`name`); 27 | 28 | ALTER TABLE `glpi_plugin_shellcommands_shellcommands_items` 29 | CHANGE `ID` `id` int(11) NOT NULL auto_increment, 30 | CHANGE `FK_cmd` `plugin_shellcommands_shellcommands_id` int(11) NOT NULL default '0', 31 | CHANGE `device_type` `itemtype` varchar(100) collate utf8_unicode_ci NOT NULL COMMENT 'see .class.php file', 32 | DROP INDEX `FK_cmd`, 33 | DROP INDEX `FK_cmd_2`, 34 | DROP INDEX `device_type`, 35 | ADD UNIQUE `FK_cmd` (`plugin_shellcommands_shellcommands_id`,`itemtype`), 36 | ADD INDEX `itemtype` (`itemtype`); 37 | 38 | ALTER TABLE `glpi_plugin_shellcommands_profiles` 39 | CHANGE `ID` `id` int(11) NOT NULL auto_increment, 40 | ADD `profiles_id` int(11) NOT NULL default '0' COMMENT 'RELATION to glpi_profiles (id)', 41 | CHANGE `cmd` `shellcommands` char(1) collate utf8_unicode_ci default NULL, 42 | DROP `update_cmd`, 43 | ADD INDEX (`profiles_id`); 44 | 45 | INSERT INTO `glpi_displaypreferences` VALUES (NULL,'PluginShellcommandsShellcommand','2','2','0'); 46 | INSERT INTO `glpi_displaypreferences` VALUES (NULL,'PluginShellcommandsShellcommand','3','3','0'); 47 | INSERT INTO `glpi_displaypreferences` VALUES (NULL,'PluginShellcommandsShellcommand','4','4','0'); 48 | INSERT INTO `glpi_displaypreferences` VALUES (NULL,'PluginShellcommandsShellcommand','5','5','0'); 49 | -------------------------------------------------------------------------------- /sql/update-1.7.0.sql: -------------------------------------------------------------------------------- 1 | ALTER TABLE `glpi_plugin_shellcommands_shellcommands` ADD `tag_position` tinyint(1) NOT NULL default '1'; 2 | 3 | DROP TABLE IF EXISTS `glpi_plugin_shellcommands_commandgroups_items`; 4 | CREATE TABLE `glpi_plugin_shellcommands_commandgroups_items` ( 5 | `id` int(11) NOT NULL auto_increment, 6 | `plugin_shellcommands_shellcommands_id` int(11) NOT NULL default '0', 7 | `plugin_shellcommands_commandgroups_id` int(11) NOT NULL default '0', 8 | `rank` int(11) NOT NULL default '0', 9 | PRIMARY KEY (`id`), 10 | UNIQUE KEY `FK_cmd` (`plugin_shellcommands_shellcommands_id`,`plugin_shellcommands_commandgroups_id`), 11 | KEY `plugin_shellcommands_commandgroups_id` (`plugin_shellcommands_commandgroups_id`), 12 | KEY `plugin_shellcommands_shellcommands_id` (`plugin_shellcommands_shellcommands_id`), 13 | KEY `rank` (`rank`) 14 | ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; 15 | 16 | DROP TABLE IF EXISTS `glpi_plugin_shellcommands_commandgroups`; 17 | CREATE TABLE `glpi_plugin_shellcommands_commandgroups` ( 18 | `id` int(11) NOT NULL auto_increment, 19 | `name` varchar(255) collate utf8_unicode_ci NOT NULL, 20 | `check_commands_id` int(11) NOT NULL default '0', 21 | `entities_id` int(11) NOT NULL default '0', 22 | `is_recursive` tinyint(1) NOT NULL default '0', 23 | PRIMARY KEY (`id`), 24 | KEY `entities_id` (`entities_id`) 25 | ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; -------------------------------------------------------------------------------- /tools/extract_template.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Only strings with domain specified are extracted (use Xt args of keyword param to set number of args needed) 4 | 5 | xgettext *.php */*.php --copyright-holder='Shellcommands Development Team' --package-name='GLPI - Shellcommands plugin' --package-version='2.1.0' -o locales/glpi.pot -L PHP --add-comments=TRANS --from-code=UTF-8 --force-po \ 6 | --keyword=_n:1,2,4t --keyword=__s:1,2t --keyword=__:1,2t --keyword=_e:1,2t --keyword=_x:1c,2,3t \ 7 | --keyword=_ex:1c,2,3t --keyword=_nx:1c,2,3,5t --keyword=_sx:1c,2,3t 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /tools/update_mo.pl: -------------------------------------------------------------------------------- 1 | #!/usr/bin/perl 2 | #!/usr/bin/perl -w 3 | 4 | if (@ARGV!=0){ 5 | print "USAGE update_mo.pl\n\n"; 6 | 7 | exit(); 8 | } 9 | 10 | 11 | opendir(DIRHANDLE,'locales')||die "ERROR: can not read current directory\n"; 12 | foreach (readdir(DIRHANDLE)){ 13 | if ($_ ne '..' && $_ ne '.'){ 14 | 15 | if(!(-l "$dir/$_")){ 16 | if (index($_,".po",0)==length($_)-3) { 17 | $lang=$_; 18 | $lang=~s/\.po//; 19 | 20 | `msgfmt locales/$_ -o locales/$lang.mo`; 21 | } 22 | } 23 | 24 | } 25 | } 26 | closedir DIRHANDLE; 27 | 28 | # 29 | # 30 | -------------------------------------------------------------------------------- /tools/update_po.pl: -------------------------------------------------------------------------------- 1 | #!/usr/bin/perl 2 | #!/usr/bin/perl -w 3 | 4 | if (@ARGV!=2){ 5 | print "USAGE update_po.pl transifex_login transifex_password\n\n"; 6 | 7 | exit(); 8 | } 9 | $user = $ARGV[0]; 10 | $password = $ARGV[1]; 11 | 12 | opendir(DIRHANDLE,'locales')||die "ERROR: can not read current directory\n"; 13 | foreach (readdir(DIRHANDLE)){ 14 | if ($_ ne '..' && $_ ne '.'){ 15 | 16 | if(!(-l "$dir/$_")){ 17 | if (index($_,".po",0)==length($_)-3) { 18 | $lang=$_; 19 | $lang=~s/\.po//; 20 | 21 | `wget --user=$user --password=$password --output-document=locales/$_ http://www.transifex.com/api/2/project/GLPI_shellcommands/resource/glpi/translation/$lang/?file=$_`; 22 | } 23 | } 24 | 25 | } 26 | } 27 | closedir DIRHANDLE; 28 | 29 | # 30 | # 31 | --------------------------------------------------------------------------------