├── .editorconfig ├── .gitignore ├── CHANGELOG.md ├── CONTRIBUTING.md ├── LICENSE.md ├── README.md ├── composer.json ├── composer.lock └── src ├── Contracts └── EloquentLDAPUserInterface.php ├── Providers ├── EloquentLDAPServiceProvider.php └── EloquentLDAPUserProvider.php ├── config └── config.php └── migrations └── 2015_08_02_013709_eloquent_ldap_setup_tables.php /.editorconfig: -------------------------------------------------------------------------------- 1 | ; This file is for unifying the coding style for different editors and IDEs. 2 | ; More information at http://editorconfig.org 3 | 4 | root = true 5 | 6 | [*] 7 | charset = utf-8 8 | indent_size = 4 9 | indent_style = space 10 | end_of_line = lf 11 | insert_final_newline = true 12 | trim_trailing_whitespace = true 13 | 14 | [*.md] 15 | trim_trailing_whitespace = false 16 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Laravel 5 # 2 | ############# 3 | /vendor/ 4 | .env 5 | storage/ 6 | 7 | # Test/Dev pages # 8 | ################## 9 | public/phpinfo.php 10 | 11 | # NodeJS # 12 | ########## 13 | node_modules/ 14 | phantomjsdriver.log 15 | config.js 16 | dump.rdb 17 | npm-debug.log 18 | 19 | # JetBrains IDE family # 20 | ######################## 21 | .idea 22 | config/ide-helper.php 23 | _ide_helper.php 24 | ideconfig 25 | _ide_helper* 26 | .phpstorm.meta.php 27 | 28 | # Logs # 29 | ################# 30 | *.log 31 | *.sql 32 | 33 | # include sqlite db resource # 34 | ############################### 35 | .sqlite 36 | 37 | # OS generated files # 38 | ################################## 39 | .DS_Store 40 | .DS_Store? 41 | # ._* 42 | .Spotlight-V100 43 | .Trashes 44 | ehthumbs.db 45 | Thumbs.db 46 | -------------------------------------------------------------------------------- /CHANGELOG.md: -------------------------------------------------------------------------------- 1 | # Changelog 2 | 3 | All Notable changes to `eloquent-ldap` will be documented in this file 4 | 5 | ### 0.1.0 6 | - Initial release!! Yeah! 7 | -------------------------------------------------------------------------------- /CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | # Contributing 2 | 3 | Contributions are **welcome** and will be fully **credited**. 4 | 5 | Contributions are accepted via Pull Requests on [Github](https://github.com/sroutier/eloquent-ldap). 6 | 7 | 8 | ## Pull Requests 9 | 10 | - **[PSR-2 Coding Standard](https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-2-coding-style-guide.md)** - The easiest way to apply the conventions is to install [PHP Code Sniffer](http://pear.php.net/package/PHP_CodeSniffer). 11 | 12 | - **Add tests!** - Your patch won't be accepted if it doesn't have tests. 13 | 14 | - **Document any change in behaviour** - Make sure the `README.md` and any other relevant documentation are kept up-to-date. 15 | 16 | - **Consider our release cycle** - We try to follow [SemVer v2.0.0](http://semver.org/). Randomly breaking public APIs is not an option. 17 | 18 | - **Create feature branches** - Don't ask us to pull from your master branch. 19 | 20 | - **One pull request per feature** - If you want to do more than one thing, send multiple pull requests. 21 | 22 | - **Send coherent history** - Make sure each individual commit in your pull request is meaningful. If you had to make multiple intermediate commits while developing, please [squash them](http://www.git-scm.com/book/en/v2/Git-Tools-Rewriting-History#Changing-Multiple-Commit-Messages) before submitting. 23 | 24 | 25 | ## Running Tests 26 | 27 | ``` bash 28 | $ composer test 29 | ``` 30 | 31 | 32 | **Happy coding**! 33 | -------------------------------------------------------------------------------- /LICENSE.md: -------------------------------------------------------------------------------- 1 | # The GNU GENERAL PUBLIC LICENSE Version 3 (GPLv3) 2 | 3 | Copyright (c) 2015 Sebastien Routier 4 | 5 | GNU GENERAL PUBLIC LICENSE 6 | 7 | Version 3, 29 June 2007 8 | 9 | Copyright © 2007 Free Software Foundation, Inc. 10 | 11 | Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. 12 | 13 | Preamble 14 | 15 | The GNU General Public License is a free, copyleft license for software and other kinds of works. 16 | 17 | The licenses for most software and other practical works are designed to take away your freedom to share and change the works. By contrast, the GNU General Public License is intended to guarantee your freedom to share and change all versions of a program--to make sure it remains free software for all its users. We, the Free Software Foundation, use the GNU General Public License for most of our software; it applies also to any other work released this way by its authors. You can apply it to your programs, too. 18 | 19 | When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for them if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs, and that you know you can do these things. 20 | 21 | To protect your rights, we need to prevent others from denying you these rights or asking you to surrender the rights. Therefore, you have certain responsibilities if you distribute copies of the software, or if you modify it: responsibilities to respect the freedom of others. 22 | 23 | For example, if you distribute copies of such a program, whether gratis or for a fee, you must pass on to the recipients the same freedoms that you received. You must make sure that they, too, receive or can get the source code. And you must show them these terms so they know their rights. 24 | 25 | Developers that use the GNU GPL protect your rights with two steps: (1) assert copyright on the software, and (2) offer you this License giving you legal permission to copy, distribute and/or modify it. 26 | 27 | For the developers' and authors' protection, the GPL clearly explains that there is no warranty for this free software. For both users' and authors' sake, the GPL requires that modified versions be marked as changed, so that their problems will not be attributed erroneously to authors of previous versions. 28 | 29 | Some devices are designed to deny users access to install or run modified versions of the software inside them, although the manufacturer can do so. This is fundamentally incompatible with the aim of protecting users' freedom to change the software. The systematic pattern of such abuse occurs in the area of products for individuals to use, which is precisely where it is most unacceptable. Therefore, we have designed this version of the GPL to prohibit the practice for those products. If such problems arise substantially in other domains, we stand ready to extend this provision to those domains in future versions of the GPL, as needed to protect the freedom of users. 30 | 31 | Finally, every program is threatened constantly by software patents. States should not allow patents to restrict development and use of software on general-purpose computers, but in those that do, we wish to avoid the special danger that patents applied to a free program could make it effectively proprietary. To prevent this, the GPL assures that patents cannot be used to render the program non-free. 32 | 33 | The precise terms and conditions for copying, distribution and modification follow. 34 | 35 | TERMS AND CONDITIONS 36 | 37 | 0. Definitions. 38 | “This License” refers to version 3 of the GNU General Public License. 39 | 40 | “Copyright” also means copyright-like laws that apply to other kinds of works, such as semiconductor masks. 41 | 42 | “The Program” refers to any copyrightable work licensed under this License. Each licensee is addressed as “you”. “Licensees” and “recipients” may be individuals or organizations. 43 | 44 | To “modify” a work means to copy from or adapt all or part of the work in a fashion requiring copyright permission, other than the making of an exact copy. The resulting work is called a “modified version” of the earlier work or a work “based on” the earlier work. 45 | 46 | A “covered work” means either the unmodified Program or a work based on the Program. 47 | 48 | To “propagate” a work means to do anything with it that, without permission, would make you directly or secondarily liable for infringement under applicable copyright law, except executing it on a computer or modifying a private copy. Propagation includes copying, distribution (with or without modification), making available to the public, and in some countries other activities as well. 49 | 50 | To “convey” a work means any kind of propagation that enables other parties to make or receive copies. Mere interaction with a user through a computer network, with no transfer of a copy, is not conveying. 51 | 52 | An interactive user interface displays “Appropriate Legal Notices” to the extent that it includes a convenient and prominently visible feature that (1) displays an appropriate copyright notice, and (2) tells the user that there is no warranty for the work (except to the extent that warranties are provided), that licensees may convey the work under this License, and how to view a copy of this License. If the interface presents a list of user commands or options, such as a menu, a prominent item in the list meets this criterion. 53 | 54 | 1. Source Code. 55 | The “source code” for a work means the preferred form of the work for making modifications to it. “Object code” means any non-source form of a work. 56 | 57 | A “Standard Interface” means an interface that either is an official standard defined by a recognized standards body, or, in the case of interfaces specified for a particular programming language, one that is widely used among developers working in that language. 58 | 59 | The “System Libraries” of an executable work include anything, other than the work as a whole, that (a) is included in the normal form of packaging a Major Component, but which is not part of that Major Component, and (b) serves only to enable use of the work with that Major Component, or to implement a Standard Interface for which an implementation is available to the public in source code form. A “Major Component”, in this context, means a major essential component (kernel, window system, and so on) of the specific operating system (if any) on which the executable work runs, or a compiler used to produce the work, or an object code interpreter used to run it. 60 | 61 | The “Corresponding Source” for a work in object code form means all the source code needed to generate, install, and (for an executable work) run the object code and to modify the work, including scripts to control those activities. However, it does not include the work's System Libraries, or general-purpose tools or generally available free programs which are used unmodified in performing those activities but which are not part of the work. For example, Corresponding Source includes interface definition files associated with source files for the work, and the source code for shared libraries and dynamically linked subprograms that the work is specifically designed to require, such as by intimate data communication or control flow between those subprograms and other parts of the work. 62 | 63 | The Corresponding Source need not include anything that users can regenerate automatically from other parts of the Corresponding Source. 64 | 65 | The Corresponding Source for a work in source code form is that same work. 66 | 67 | 2. Basic Permissions. 68 | All rights granted under this License are granted for the term of copyright on the Program, and are irrevocable provided the stated conditions are met. This License explicitly affirms your unlimited permission to run the unmodified Program. The output from running a covered work is covered by this License only if the output, given its content, constitutes a covered work. This License acknowledges your rights of fair use or other equivalent, as provided by copyright law. 69 | 70 | You may make, run and propagate covered works that you do not convey, without conditions so long as your license otherwise remains in force. You may convey covered works to others for the sole purpose of having them make modifications exclusively for you, or provide you with facilities for running those works, provided that you comply with the terms of this License in conveying all material for which you do not control copyright. Those thus making or running the covered works for you must do so exclusively on your behalf, under your direction and control, on terms that prohibit them from making any copies of your copyrighted material outside their relationship with you. 71 | 72 | Conveying under any other circumstances is permitted solely under the conditions stated below. Sublicensing is not allowed; section 10 makes it unnecessary. 73 | 74 | 3. Protecting Users' Legal Rights From Anti-Circumvention Law. 75 | No covered work shall be deemed part of an effective technological measure under any applicable law fulfilling obligations under article 11 of the WIPO copyright treaty adopted on 20 December 1996, or similar laws prohibiting or restricting circumvention of such measures. 76 | 77 | When you convey a covered work, you waive any legal power to forbid circumvention of technological measures to the extent such circumvention is effected by exercising rights under this License with respect to the covered work, and you disclaim any intention to limit operation or modification of the work as a means of enforcing, against the work's users, your or third parties' legal rights to forbid circumvention of technological measures. 78 | 79 | 4. Conveying Verbatim Copies. 80 | You may convey verbatim copies of the Program's source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice; keep intact all notices stating that this License and any non-permissive terms added in accord with section 7 apply to the code; keep intact all notices of the absence of any warranty; and give all recipients a copy of this License along with the Program. 81 | 82 | You may charge any price or no price for each copy that you convey, and you may offer support or warranty protection for a fee. 83 | 84 | 5. Conveying Modified Source Versions. 85 | You may convey a work based on the Program, or the modifications to produce it from the Program, in the form of source code under the terms of section 4, provided that you also meet all of these conditions: 86 | 87 | a) The work must carry prominent notices stating that you modified it, and giving a relevant date. 88 | b) The work must carry prominent notices stating that it is released under this License and any conditions added under section 7. This requirement modifies the requirement in section 4 to “keep intact all notices”. 89 | c) You must license the entire work, as a whole, under this License to anyone who comes into possession of a copy. This License will therefore apply, along with any applicable section 7 additional terms, to the whole of the work, and all its parts, regardless of how they are packaged. This License gives no permission to license the work in any other way, but it does not invalidate such permission if you have separately received it. 90 | d) If the work has interactive user interfaces, each must display Appropriate Legal Notices; however, if the Program has interactive interfaces that do not display Appropriate Legal Notices, your work need not make them do so. 91 | A compilation of a covered work with other separate and independent works, which are not by their nature extensions of the covered work, and which are not combined with it such as to form a larger program, in or on a volume of a storage or distribution medium, is called an “aggregate” if the compilation and its resulting copyright are not used to limit the access or legal rights of the compilation's users beyond what the individual works permit. Inclusion of a covered work in an aggregate does not cause this License to apply to the other parts of the aggregate. 92 | 93 | 6. Conveying Non-Source Forms. 94 | You may convey a covered work in object code form under the terms of sections 4 and 5, provided that you also convey the machine-readable Corresponding Source under the terms of this License, in one of these ways: 95 | 96 | a) Convey the object code in, or embodied in, a physical product (including a physical distribution medium), accompanied by the Corresponding Source fixed on a durable physical medium customarily used for software interchange. 97 | b) Convey the object code in, or embodied in, a physical product (including a physical distribution medium), accompanied by a written offer, valid for at least three years and valid for as long as you offer spare parts or customer support for that product model, to give anyone who possesses the object code either (1) a copy of the Corresponding Source for all the software in the product that is covered by this License, on a durable physical medium customarily used for software interchange, for a price no more than your reasonable cost of physically performing this conveying of source, or (2) access to copy the Corresponding Source from a network server at no charge. 98 | c) Convey individual copies of the object code with a copy of the written offer to provide the Corresponding Source. This alternative is allowed only occasionally and noncommercially, and only if you received the object code with such an offer, in accord with subsection 6b. 99 | d) Convey the object code by offering access from a designated place (gratis or for a charge), and offer equivalent access to the Corresponding Source in the same way through the same place at no further charge. You need not require recipients to copy the Corresponding Source along with the object code. If the place to copy the object code is a network server, the Corresponding Source may be on a different server (operated by you or a third party) that supports equivalent copying facilities, provided you maintain clear directions next to the object code saying where to find the Corresponding Source. Regardless of what server hosts the Corresponding Source, you remain obligated to ensure that it is available for as long as needed to satisfy these requirements. 100 | e) Convey the object code using peer-to-peer transmission, provided you inform other peers where the object code and Corresponding Source of the work are being offered to the general public at no charge under subsection 6d. 101 | A separable portion of the object code, whose source code is excluded from the Corresponding Source as a System Library, need not be included in conveying the object code work. 102 | 103 | A “User Product” is either (1) a “consumer product”, which means any tangible personal property which is normally used for personal, family, or household purposes, or (2) anything designed or sold for incorporation into a dwelling. In determining whether a product is a consumer product, doubtful cases shall be resolved in favor of coverage. For a particular product received by a particular user, “normally used” refers to a typical or common use of that class of product, regardless of the status of the particular user or of the way in which the particular user actually uses, or expects or is expected to use, the product. A product is a consumer product regardless of whether the product has substantial commercial, industrial or non-consumer uses, unless such uses represent the only significant mode of use of the product. 104 | 105 | “Installation Information” for a User Product means any methods, procedures, authorization keys, or other information required to install and execute modified versions of a covered work in that User Product from a modified version of its Corresponding Source. The information must suffice to ensure that the continued functioning of the modified object code is in no case prevented or interfered with solely because modification has been made. 106 | 107 | If you convey an object code work under this section in, or with, or specifically for use in, a User Product, and the conveying occurs as part of a transaction in which the right of possession and use of the User Product is transferred to the recipient in perpetuity or for a fixed term (regardless of how the transaction is characterized), the Corresponding Source conveyed under this section must be accompanied by the Installation Information. But this requirement does not apply if neither you nor any third party retains the ability to install modified object code on the User Product (for example, the work has been installed in ROM). 108 | 109 | The requirement to provide Installation Information does not include a requirement to continue to provide support service, warranty, or updates for a work that has been modified or installed by the recipient, or for the User Product in which it has been modified or installed. Access to a network may be denied when the modification itself materially and adversely affects the operation of the network or violates the rules and protocols for communication across the network. 110 | 111 | Corresponding Source conveyed, and Installation Information provided, in accord with this section must be in a format that is publicly documented (and with an implementation available to the public in source code form), and must require no special password or key for unpacking, reading or copying. 112 | 113 | 7. Additional Terms. 114 | “Additional permissions” are terms that supplement the terms of this License by making exceptions from one or more of its conditions. Additional permissions that are applicable to the entire Program shall be treated as though they were included in this License, to the extent that they are valid under applicable law. If additional permissions apply only to part of the Program, that part may be used separately under those permissions, but the entire Program remains governed by this License without regard to the additional permissions. 115 | 116 | When you convey a copy of a covered work, you may at your option remove any additional permissions from that copy, or from any part of it. (Additional permissions may be written to require their own removal in certain cases when you modify the work.) You may place additional permissions on material, added by you to a covered work, for which you have or can give appropriate copyright permission. 117 | 118 | Notwithstanding any other provision of this License, for material you add to a covered work, you may (if authorized by the copyright holders of that material) supplement the terms of this License with terms: 119 | 120 | a) Disclaiming warranty or limiting liability differently from the terms of sections 15 and 16 of this License; or 121 | b) Requiring preservation of specified reasonable legal notices or author attributions in that material or in the Appropriate Legal Notices displayed by works containing it; or 122 | c) Prohibiting misrepresentation of the origin of that material, or requiring that modified versions of such material be marked in reasonable ways as different from the original version; or 123 | d) Limiting the use for publicity purposes of names of licensors or authors of the material; or 124 | e) Declining to grant rights under trademark law for use of some trade names, trademarks, or service marks; or 125 | f) Requiring indemnification of licensors and authors of that material by anyone who conveys the material (or modified versions of it) with contractual assumptions of liability to the recipient, for any liability that these contractual assumptions directly impose on those licensors and authors. 126 | All other non-permissive additional terms are considered “further restrictions” within the meaning of section 10. If the Program as you received it, or any part of it, contains a notice stating that it is governed by this License along with a term that is a further restriction, you may remove that term. If a license document contains a further restriction but permits relicensing or conveying under this License, you may add to a covered work material governed by the terms of that license document, provided that the further restriction does not survive such relicensing or conveying. 127 | 128 | If you add terms to a covered work in accord with this section, you must place, in the relevant source files, a statement of the additional terms that apply to those files, or a notice indicating where to find the applicable terms. 129 | 130 | Additional terms, permissive or non-permissive, may be stated in the form of a separately written license, or stated as exceptions; the above requirements apply either way. 131 | 132 | 8. Termination. 133 | You may not propagate or modify a covered work except as expressly provided under this License. Any attempt otherwise to propagate or modify it is void, and will automatically terminate your rights under this License (including any patent licenses granted under the third paragraph of section 11). 134 | 135 | However, if you cease all violation of this License, then your license from a particular copyright holder is reinstated (a) provisionally, unless and until the copyright holder explicitly and finally terminates your license, and (b) permanently, if the copyright holder fails to notify you of the violation by some reasonable means prior to 60 days after the cessation. 136 | 137 | Moreover, your license from a particular copyright holder is reinstated permanently if the copyright holder notifies you of the violation by some reasonable means, this is the first time you have received notice of violation of this License (for any work) from that copyright holder, and you cure the violation prior to 30 days after your receipt of the notice. 138 | 139 | Termination of your rights under this section does not terminate the licenses of parties who have received copies or rights from you under this License. If your rights have been terminated and not permanently reinstated, you do not qualify to receive new licenses for the same material under section 10. 140 | 141 | 9. Acceptance Not Required for Having Copies. 142 | You are not required to accept this License in order to receive or run a copy of the Program. Ancillary propagation of a covered work occurring solely as a consequence of using peer-to-peer transmission to receive a copy likewise does not require acceptance. However, nothing other than this License grants you permission to propagate or modify any covered work. These actions infringe copyright if you do not accept this License. Therefore, by modifying or propagating a covered work, you indicate your acceptance of this License to do so. 143 | 144 | 10. Automatic Licensing of Downstream Recipients. 145 | Each time you convey a covered work, the recipient automatically receives a license from the original licensors, to run, modify and propagate that work, subject to this License. You are not responsible for enforcing compliance by third parties with this License. 146 | 147 | An “entity transaction” is a transaction transferring control of an organization, or substantially all assets of one, or subdividing an organization, or merging organizations. If propagation of a covered work results from an entity transaction, each party to that transaction who receives a copy of the work also receives whatever licenses to the work the party's predecessor in interest had or could give under the previous paragraph, plus a right to possession of the Corresponding Source of the work from the predecessor in interest, if the predecessor has it or can get it with reasonable efforts. 148 | 149 | You may not impose any further restrictions on the exercise of the rights granted or affirmed under this License. For example, you may not impose a license fee, royalty, or other charge for exercise of rights granted under this License, and you may not initiate litigation (including a cross-claim or counterclaim in a lawsuit) alleging that any patent claim is infringed by making, using, selling, offering for sale, or importing the Program or any portion of it. 150 | 151 | 11. Patents. 152 | A “contributor” is a copyright holder who authorizes use under this License of the Program or a work on which the Program is based. The work thus licensed is called the contributor's “contributor version”. 153 | 154 | A contributor's “essential patent claims” are all patent claims owned or controlled by the contributor, whether already acquired or hereafter acquired, that would be infringed by some manner, permitted by this License, of making, using, or selling its contributor version, but do not include claims that would be infringed only as a consequence of further modification of the contributor version. For purposes of this definition, “control” includes the right to grant patent sublicenses in a manner consistent with the requirements of this License. 155 | 156 | Each contributor grants you a non-exclusive, worldwide, royalty-free patent license under the contributor's essential patent claims, to make, use, sell, offer for sale, import and otherwise run, modify and propagate the contents of its contributor version. 157 | 158 | In the following three paragraphs, a “patent license” is any express agreement or commitment, however denominated, not to enforce a patent (such as an express permission to practice a patent or covenant not to sue for patent infringement). To “grant” such a patent license to a party means to make such an agreement or commitment not to enforce a patent against the party. 159 | 160 | If you convey a covered work, knowingly relying on a patent license, and the Corresponding Source of the work is not available for anyone to copy, free of charge and under the terms of this License, through a publicly available network server or other readily accessible means, then you must either (1) cause the Corresponding Source to be so available, or (2) arrange to deprive yourself of the benefit of the patent license for this particular work, or (3) arrange, in a manner consistent with the requirements of this License, to extend the patent license to downstream recipients. “Knowingly relying” means you have actual knowledge that, but for the patent license, your conveying the covered work in a country, or your recipient's use of the covered work in a country, would infringe one or more identifiable patents in that country that you have reason to believe are valid. 161 | 162 | If, pursuant to or in connection with a single transaction or arrangement, you convey, or propagate by procuring conveyance of, a covered work, and grant a patent license to some of the parties receiving the covered work authorizing them to use, propagate, modify or convey a specific copy of the covered work, then the patent license you grant is automatically extended to all recipients of the covered work and works based on it. 163 | 164 | A patent license is “discriminatory” if it does not include within the scope of its coverage, prohibits the exercise of, or is conditioned on the non-exercise of one or more of the rights that are specifically granted under this License. You may not convey a covered work if you are a party to an arrangement with a third party that is in the business of distributing software, under which you make payment to the third party based on the extent of your activity of conveying the work, and under which the third party grants, to any of the parties who would receive the covered work from you, a discriminatory patent license (a) in connection with copies of the covered work conveyed by you (or copies made from those copies), or (b) primarily for and in connection with specific products or compilations that contain the covered work, unless you entered into that arrangement, or that patent license was granted, prior to 28 March 2007. 165 | 166 | Nothing in this License shall be construed as excluding or limiting any implied license or other defenses to infringement that may otherwise be available to you under applicable patent law. 167 | 168 | 12. No Surrender of Others' Freedom. 169 | If conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot convey a covered work so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not convey it at all. For example, if you agree to terms that obligate you to collect a royalty for further conveying from those to whom you convey the Program, the only way you could satisfy both those terms and this License would be to refrain entirely from conveying the Program. 170 | 171 | 13. Use with the GNU Affero General Public License. 172 | Notwithstanding any other provision of this License, you have permission to link or combine any covered work with a work licensed under version 3 of the GNU Affero General Public License into a single combined work, and to convey the resulting work. The terms of this License will continue to apply to the part which is the covered work, but the special requirements of the GNU Affero General Public License, section 13, concerning interaction through a network will apply to the combination as such. 173 | 174 | 14. Revised Versions of this License. 175 | The Free Software Foundation may publish revised and/or new versions of the GNU General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. 176 | 177 | Each version is given a distinguishing version number. If the Program specifies that a certain numbered version of the GNU General Public License “or any later version” applies to it, you have the option of following the terms and conditions either of that numbered version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of the GNU General Public License, you may choose any version ever published by the Free Software Foundation. 178 | 179 | If the Program specifies that a proxy can decide which future versions of the GNU General Public License can be used, that proxy's public statement of acceptance of a version permanently authorizes you to choose that version for the Program. 180 | 181 | Later license versions may give you additional or different permissions. However, no additional obligations are imposed on any author or copyright holder as a result of your choosing to follow a later version. 182 | 183 | 15. Disclaimer of Warranty. 184 | THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM “AS IS” WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 185 | 186 | 16. Limitation of Liability. 187 | IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. 188 | 189 | 17. Interpretation of Sections 15 and 16. 190 | If the disclaimer of warranty and limitation of liability provided above cannot be given local legal effect according to their terms, reviewing courts shall apply local law that most closely approximates an absolute waiver of all civil liability in connection with the Program, unless a warranty or assumption of liability accompanies a copy of the Program in return for a fee. 191 | 192 | END OF TERMS AND CONDITIONS 193 | 194 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # eloquent-ldap 2 | 3 | [![Latest Version on Packagist][ico-version]][link-packagist] 4 | [![Software License][ico-license]](LICENSE.md) 5 | 6 | A Laravel package that first tries to log the user against the internal 7 | database, if that fails, it tries against the configured LDAP/AD 8 | server. Optionally it will create a local user record on first 9 | login of an LDAP user, as well as grant that user permissions 10 | to local groups that have matching names of the LDAP groups 11 | that the user is a member of. 12 | 13 | 14 | ## Version Compatibility 15 | 16 | Laravel | LERN 17 | :---------|:---------- 18 | 5.1.x | 1.x 19 | 5.5.x | 2.x 20 | 21 | 22 | ## Install 23 | 24 | Via Composer 25 | 26 | ``` bash 27 | $ composer require sroutier/eloquent-ldap 28 | ``` 29 | 30 | ## Declare provider 31 | 32 | Add this declaration in the provider array of your `./config/app.php` file: 33 | 34 | ``` php 35 | Sroutier\EloquentLDAP\Providers\EloquentLDAPServiceProvider::class, 36 | ``` 37 | 38 | ## Publish assets 39 | 40 | To publish the assets, config file and migration scripts, run this command: 41 | 42 | ``` bash 43 | $ php artisan vendor:publish --provider="Sroutier\EloquentLDAP\Providers\EloquentLDAPServiceProvider" 44 | ``` 45 | 46 | This will publish a config file and a migration file. 47 | 48 | ## Migration 49 | 50 | The migration script will add a new column `auth_type` to the schema of the 51 | `users` table, and one column `resync_on_login` to the `groups` table. You 52 | should already have both tables, but if you do not or if you want to use 53 | different tables for those purposes, the migration to create those 54 | tables is provided as an example, but commented out. You will 55 | want to review the migration script and adjust according to 56 | your scenario. 57 | 58 | Once ready, run the migration script with this command: 59 | 60 | ``` bash 61 | $ php artisan migrate 62 | ``` 63 | 64 | ## Configure 65 | 66 | The recommended way to configure this package is by defining the following 67 | variables in you `.env` file and adjusting the values there. For a 68 | detailed explanation of each setting, refer to the config file 69 | that you published above. 70 | 71 | The configuration that you will need will vary based on the type or server that you wish to authenticate against. 72 | Below are example config section for both options, Lightweight Directory Access Protocol (LDAP) and Microsoft 73 | Active Directory (MSAD). 74 | 75 | ### Microsoft Active Directory server. 76 | 77 | Below is a section of a ```.env``` config file that shows how to configure your system to access a Microsoft Active 78 | Directory server: 79 | 80 | ``` 81 | eloquent-ldap.enabled=true 82 | eloquent-ldap.debug=false 83 | eloquent-ldap.server_type=MSAD 84 | eloquent-ldap.create_accounts=true 85 | eloquent-ldap.replicate_group_membership=true 86 | eloquent-ldap.resync_on_login=true 87 | eloquent-ldap.group_model=App\Models\Role 88 | eloquent-ldap.label_internal=internal 89 | eloquent-ldap.label_ldap=ldap 90 | eloquent-ldap.account_suffix=@company.com 91 | eloquent-ldap.base_dn=DC=department,DC=company,DC=com 92 | eloquent-ldap.server=ldapsrv01.company.com 93 | eloquent-ldap.port=389 94 | eloquent-ldap.user_name=ldap_reader 95 | eloquent-ldap.password=PaSsWoRd 96 | eloquent-ldap.return_real_primary_group=true 97 | eloquent-ldap.secured=false 98 | eloquent-ldap.secured_port=636 99 | eloquent-ldap.recursive_groups=true 100 | eloquent-ldap.sso=false 101 | eloquent-ldap.username_field=samaccountname 102 | eloquent-ldap.email_field=userprincipalname 103 | eloquent-ldap.first_name_field=givenname 104 | eloquent-ldap.last_name_field=sn 105 | eloquent-ldap.user_filter=(&(objectcategory=person)(samaccountname=%username)) 106 | ``` 107 | 108 | ### Lightweight Directory Access Protocol server. 109 | 110 | Below is a section of a ```.env``` config file that shows how to configure your system to access a Lightweight 111 | Directory Access Protocol server: 112 | 113 | ``` 114 | eloquent-ldap.enabled=true 115 | eloquent-ldap.debug=false 116 | eloquent-ldap.server_type=LDAP 117 | eloquent-ldap.create_accounts=true 118 | eloquent-ldap.replicate_group_membership=false 119 | eloquent-ldap.resync_on_login=false 120 | eloquent-ldap.group_model=App\Models\Role 121 | eloquent-ldap.label_internal=internal 122 | eloquent-ldap.label_ldap=ldap 123 | eloquent-ldap.account_suffix= 124 | eloquent-ldap.base_dn=dc=example,dc=com 125 | eloquent-ldap.server=ldap.forumsys.com 126 | eloquent-ldap.port=389 127 | eloquent-ldap.user_name=cn=read-only-admin,dc=example,dc=com 128 | eloquent-ldap.password=password 129 | eloquent-ldap.return_real_primary_group=true 130 | eloquent-ldap.secured=false 131 | eloquent-ldap.secured_port=636 132 | eloquent-ldap.recursive_groups=true 133 | eloquent-ldap.sso=false 134 | eloquent-ldap.username_field=uid 135 | eloquent-ldap.email_field=mail 136 | eloquent-ldap.first_name_field= 137 | eloquent-ldap.last_name_field=sn 138 | eloquent-ldap.user_filter=(&(objectclass=person)(uid=%username)) 139 | ``` 140 | 141 | **_NOTE:_** THe configuration options above will allow you to connect and authenticate users using the publicly 142 | available OpenLDAP test server hosted by 143 | [Forum Systems](http://www.forumsys.com/en/tutorials/integration-how-to/ldap/online-ldap-test-server/). 144 | 145 | ### MSAD vs LDAP 146 | 147 | A couple of difference in how to configure the system depending on which server type is being used are worth pointing 148 | out. 149 | 150 | * eloquent-ldap.server_type: Can be either LDAP or MSAD. Lets the system know how to interact with the authentication server. 151 | * eloquent-ldap.replicate_group_membership: Currently only supported for MSAD servers. 152 | * eloquent-ldap.resync_on_login: Currently only supported for MSAD servers. 153 | * eloquent-ldap.account_suffix: 154 | * LDAP: Should remain empty for LDAP servers. 155 | * MSAD: Should contain the static part of the users email address. 156 | * eloquent-ldap.user_name: 157 | * LDAP: Should be the complete DN of the user to bind with. 158 | * MSAD: Simply the name of the user to bind with. 159 | * eloquent-ldap.return_real_primary_group: 160 | * LDAP: Not used. 161 | * MSAD: Fix Microsoft AD not following standards may incur extra processing. 162 | 163 | ## Usage 164 | 165 | The `users` table/model must have the following columns/attributes named 166 | `username`, `first_name`, `last_name` and `email`. The migration 167 | script provided with this package has an example of how to 168 | create such a table but it is commented out. 169 | 170 | The user model must have the `auth-type` attribute added to its `fillable` array 171 | to allow setting the column in the database. 172 | 173 | Also your login view and `AuthController` must accept a user name and password. 174 | They can accept other fields if you want, such as email, security token, 175 | etc... But the first time a new user tries to log in, since he will not 176 | be found in the local database, the package will need the user name to 177 | authenticate against the LDAP server. 178 | 179 | ## Example 180 | 181 | For a concrete example of this package used in an active project, see 182 | [sroutier/laravel-5.1-enterprise-starter-kit](https://github.com/sroutier/laravel-5.1-enterprise-starter-kit). 183 | Note that in that project this package is used in combination with 184 | [Zizaco/entrust](https://github.com/zizaco/entrust) to provide 185 | role based authorization, therefore there is no group model, 186 | but instead a role model. 187 | 188 | ## Change log 189 | 190 | Please see [CHANGELOG](CHANGELOG.md) for more information what has changed recently. 191 | 192 | ## Contributing 193 | 194 | Please see [CONTRIBUTING](CONTRIBUTING.md) for details. 195 | 196 | ## Security 197 | 198 | If you discover any security related issues, please email sroutier@gmail.com instead of using the issue tracker. 199 | 200 | ## Credits 201 | 202 | - [Sebastien Routier](https://github.com/sroutier) 203 | - [All Contributors](https://github.com/sroutier/eloquent-ldap/graphs/contributors) 204 | 205 | ## License 206 | 207 | The GNU General Public License Version 3 (GPLv3). Please see [License File](LICENSE.md) for more information. 208 | 209 | [ico-version]: https://img.shields.io/badge/packagist-v0.1.2-orange.svg 210 | [ico-license]: https://img.shields.io/badge/licence-GPLv3-brightgreen.svg 211 | 212 | [link-packagist]: https://packagist.org/packages/sroutier/eloquent-ldap 213 | -------------------------------------------------------------------------------- /composer.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "sroutier/eloquent-ldap", 3 | "description": "A Laravel package that first tries to log the user against the internal database if that fails, it tries against the configured LDAP/AD server.", 4 | "keywords": [ 5 | "ldap", 6 | "active directory", 7 | "ad", 8 | "authentication", 9 | "auth", 10 | "ldap-eloquent", 11 | "eloquent", 12 | "laravel" 13 | ], 14 | "homepage": "https://github.com/sroutier/eloquent-ldap", 15 | "license": "GPL-3.0", 16 | "authors": [ 17 | { 18 | "name": "Sebastien Routier", 19 | "email": "sroutier@gmail.com" 20 | } 21 | ], 22 | "require": { 23 | "illuminate/support": "5.5.*", 24 | "php" : ">=7.0.0", 25 | "adldap2/adldap2": "~8.0" 26 | }, 27 | "require-dev": { 28 | "phpunit/phpunit": "~6.0" 29 | }, 30 | "autoload": { 31 | "psr-4": { 32 | "Sroutier\\EloquentLDAP\\": "src" 33 | } 34 | }, 35 | "autoload-dev": { 36 | "psr-4": { 37 | "Sroutier\\EloquentLDAP\\Test\\": "tests" 38 | } 39 | }, 40 | "scripts": { 41 | "test": "phpunit" 42 | }, 43 | "extra": { 44 | "branch-alias": { 45 | "dev-master": "1.0-dev" 46 | }, 47 | "laravel": { 48 | "providers": [ 49 | "Sroutier\\EloquentLDAP\\Providers\\EloquentLDAPServiceProvider" 50 | ] 51 | } 52 | } 53 | } 54 | -------------------------------------------------------------------------------- /composer.lock: -------------------------------------------------------------------------------- 1 | { 2 | "_readme": [ 3 | "This file locks the dependencies of your project to a known state", 4 | "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file", 5 | "This file is @generated automatically" 6 | ], 7 | "hash": "768bb73d17deca199a5174d24041aee2", 8 | "content-hash": "508c1492e96cfc5e214b1ebecbb65e2d", 9 | "packages": [ 10 | { 11 | "name": "adldap2/adldap2", 12 | "version": "v5.2.17", 13 | "source": { 14 | "type": "git", 15 | "url": "https://github.com/Adldap2/Adldap2.git", 16 | "reference": "b72cd7ec6d9734e2a8ba8af69b5b279ee24c325f" 17 | }, 18 | "dist": { 19 | "type": "zip", 20 | "url": "https://api.github.com/repos/Adldap2/Adldap2/zipball/b72cd7ec6d9734e2a8ba8af69b5b279ee24c325f", 21 | "reference": "b72cd7ec6d9734e2a8ba8af69b5b279ee24c325f", 22 | "shasum": "" 23 | }, 24 | "require": { 25 | "doctrine/collections": "1.3.*", 26 | "ext-ldap": "*", 27 | "php": ">=5.4.26" 28 | }, 29 | "require-dev": { 30 | "mockery/mockery": "0.9.*", 31 | "phpunit/phpunit": "4.6.*" 32 | }, 33 | "type": "library", 34 | "autoload": { 35 | "psr-4": { 36 | "Adldap\\": "src/" 37 | } 38 | }, 39 | "notification-url": "https://packagist.org/downloads/", 40 | "license": [ 41 | "MIT" 42 | ], 43 | "authors": [ 44 | { 45 | "name": "Steve Bauman", 46 | "email": "steven_bauman@outlook.com", 47 | "role": "Developer" 48 | } 49 | ], 50 | "description": "A PHP LDAP Library for Active Directory Manipulation.", 51 | "keywords": [ 52 | "active directory", 53 | "ad", 54 | "adLDAP", 55 | "adldap2", 56 | "directory", 57 | "ldap", 58 | "windows" 59 | ], 60 | "time": "2016-03-29 14:34:03" 61 | }, 62 | { 63 | "name": "doctrine/collections", 64 | "version": "v1.3.0", 65 | "source": { 66 | "type": "git", 67 | "url": "https://github.com/doctrine/collections.git", 68 | "reference": "6c1e4eef75f310ea1b3e30945e9f06e652128b8a" 69 | }, 70 | "dist": { 71 | "type": "zip", 72 | "url": "https://api.github.com/repos/doctrine/collections/zipball/6c1e4eef75f310ea1b3e30945e9f06e652128b8a", 73 | "reference": "6c1e4eef75f310ea1b3e30945e9f06e652128b8a", 74 | "shasum": "" 75 | }, 76 | "require": { 77 | "php": ">=5.3.2" 78 | }, 79 | "require-dev": { 80 | "phpunit/phpunit": "~4.0" 81 | }, 82 | "type": "library", 83 | "extra": { 84 | "branch-alias": { 85 | "dev-master": "1.2.x-dev" 86 | } 87 | }, 88 | "autoload": { 89 | "psr-0": { 90 | "Doctrine\\Common\\Collections\\": "lib/" 91 | } 92 | }, 93 | "notification-url": "https://packagist.org/downloads/", 94 | "license": [ 95 | "MIT" 96 | ], 97 | "authors": [ 98 | { 99 | "name": "Roman Borschel", 100 | "email": "roman@code-factory.org" 101 | }, 102 | { 103 | "name": "Benjamin Eberlei", 104 | "email": "kontakt@beberlei.de" 105 | }, 106 | { 107 | "name": "Guilherme Blanco", 108 | "email": "guilhermeblanco@gmail.com" 109 | }, 110 | { 111 | "name": "Jonathan Wage", 112 | "email": "jonwage@gmail.com" 113 | }, 114 | { 115 | "name": "Johannes Schmitt", 116 | "email": "schmittjoh@gmail.com" 117 | } 118 | ], 119 | "description": "Collections Abstraction library", 120 | "homepage": "http://www.doctrine-project.org", 121 | "keywords": [ 122 | "array", 123 | "collections", 124 | "iterator" 125 | ], 126 | "time": "2015-04-14 22:21:58" 127 | }, 128 | { 129 | "name": "doctrine/inflector", 130 | "version": "v1.1.0", 131 | "source": { 132 | "type": "git", 133 | "url": "https://github.com/doctrine/inflector.git", 134 | "reference": "90b2128806bfde671b6952ab8bea493942c1fdae" 135 | }, 136 | "dist": { 137 | "type": "zip", 138 | "url": "https://api.github.com/repos/doctrine/inflector/zipball/90b2128806bfde671b6952ab8bea493942c1fdae", 139 | "reference": "90b2128806bfde671b6952ab8bea493942c1fdae", 140 | "shasum": "" 141 | }, 142 | "require": { 143 | "php": ">=5.3.2" 144 | }, 145 | "require-dev": { 146 | "phpunit/phpunit": "4.*" 147 | }, 148 | "type": "library", 149 | "extra": { 150 | "branch-alias": { 151 | "dev-master": "1.1.x-dev" 152 | } 153 | }, 154 | "autoload": { 155 | "psr-0": { 156 | "Doctrine\\Common\\Inflector\\": "lib/" 157 | } 158 | }, 159 | "notification-url": "https://packagist.org/downloads/", 160 | "license": [ 161 | "MIT" 162 | ], 163 | "authors": [ 164 | { 165 | "name": "Roman Borschel", 166 | "email": "roman@code-factory.org" 167 | }, 168 | { 169 | "name": "Benjamin Eberlei", 170 | "email": "kontakt@beberlei.de" 171 | }, 172 | { 173 | "name": "Guilherme Blanco", 174 | "email": "guilhermeblanco@gmail.com" 175 | }, 176 | { 177 | "name": "Jonathan Wage", 178 | "email": "jonwage@gmail.com" 179 | }, 180 | { 181 | "name": "Johannes Schmitt", 182 | "email": "schmittjoh@gmail.com" 183 | } 184 | ], 185 | "description": "Common String Manipulations with regard to casing and singular/plural rules.", 186 | "homepage": "http://www.doctrine-project.org", 187 | "keywords": [ 188 | "inflection", 189 | "pluralize", 190 | "singularize", 191 | "string" 192 | ], 193 | "time": "2015-11-06 14:35:42" 194 | }, 195 | { 196 | "name": "illuminate/contracts", 197 | "version": "v5.2.31", 198 | "source": { 199 | "type": "git", 200 | "url": "https://github.com/illuminate/contracts.git", 201 | "reference": "411b851962c211078ade7664a6976e77a78cd2a5" 202 | }, 203 | "dist": { 204 | "type": "zip", 205 | "url": "https://api.github.com/repos/illuminate/contracts/zipball/411b851962c211078ade7664a6976e77a78cd2a5", 206 | "reference": "411b851962c211078ade7664a6976e77a78cd2a5", 207 | "shasum": "" 208 | }, 209 | "require": { 210 | "php": ">=5.5.9" 211 | }, 212 | "type": "library", 213 | "extra": { 214 | "branch-alias": { 215 | "dev-master": "5.2-dev" 216 | } 217 | }, 218 | "autoload": { 219 | "psr-4": { 220 | "Illuminate\\Contracts\\": "" 221 | } 222 | }, 223 | "notification-url": "https://packagist.org/downloads/", 224 | "license": [ 225 | "MIT" 226 | ], 227 | "authors": [ 228 | { 229 | "name": "Taylor Otwell", 230 | "email": "taylorotwell@gmail.com" 231 | } 232 | ], 233 | "description": "The Illuminate Contracts package.", 234 | "homepage": "http://laravel.com", 235 | "time": "2016-03-07 20:37:17" 236 | }, 237 | { 238 | "name": "illuminate/support", 239 | "version": "v5.2.31", 240 | "source": { 241 | "type": "git", 242 | "url": "https://github.com/illuminate/support.git", 243 | "reference": "cb5b004610baabe6b4bf532e6e4ff9eaca5eb25b" 244 | }, 245 | "dist": { 246 | "type": "zip", 247 | "url": "https://api.github.com/repos/illuminate/support/zipball/cb5b004610baabe6b4bf532e6e4ff9eaca5eb25b", 248 | "reference": "cb5b004610baabe6b4bf532e6e4ff9eaca5eb25b", 249 | "shasum": "" 250 | }, 251 | "require": { 252 | "doctrine/inflector": "~1.0", 253 | "ext-mbstring": "*", 254 | "illuminate/contracts": "5.2.*", 255 | "paragonie/random_compat": "~1.4", 256 | "php": ">=5.5.9" 257 | }, 258 | "suggest": { 259 | "illuminate/filesystem": "Required to use the composer class (5.2.*).", 260 | "jeremeamia/superclosure": "Required to be able to serialize closures (~2.2).", 261 | "symfony/polyfill-php56": "Required to use the hash_equals function on PHP 5.5 (~1.0).", 262 | "symfony/process": "Required to use the composer class (2.8.*|3.0.*).", 263 | "symfony/var-dumper": "Improves the dd function (2.8.*|3.0.*)." 264 | }, 265 | "type": "library", 266 | "extra": { 267 | "branch-alias": { 268 | "dev-master": "5.2-dev" 269 | } 270 | }, 271 | "autoload": { 272 | "psr-4": { 273 | "Illuminate\\Support\\": "" 274 | }, 275 | "files": [ 276 | "helpers.php" 277 | ] 278 | }, 279 | "notification-url": "https://packagist.org/downloads/", 280 | "license": [ 281 | "MIT" 282 | ], 283 | "authors": [ 284 | { 285 | "name": "Taylor Otwell", 286 | "email": "taylorotwell@gmail.com" 287 | } 288 | ], 289 | "description": "The Illuminate Support package.", 290 | "homepage": "http://laravel.com", 291 | "time": "2016-04-21 13:28:36" 292 | }, 293 | { 294 | "name": "paragonie/random_compat", 295 | "version": "v1.4.1", 296 | "source": { 297 | "type": "git", 298 | "url": "https://github.com/paragonie/random_compat.git", 299 | "reference": "c7e26a21ba357863de030f0b9e701c7d04593774" 300 | }, 301 | "dist": { 302 | "type": "zip", 303 | "url": "https://api.github.com/repos/paragonie/random_compat/zipball/c7e26a21ba357863de030f0b9e701c7d04593774", 304 | "reference": "c7e26a21ba357863de030f0b9e701c7d04593774", 305 | "shasum": "" 306 | }, 307 | "require": { 308 | "php": ">=5.2.0" 309 | }, 310 | "require-dev": { 311 | "phpunit/phpunit": "4.*|5.*" 312 | }, 313 | "suggest": { 314 | "ext-libsodium": "Provides a modern crypto API that can be used to generate random bytes." 315 | }, 316 | "type": "library", 317 | "autoload": { 318 | "files": [ 319 | "lib/random.php" 320 | ] 321 | }, 322 | "notification-url": "https://packagist.org/downloads/", 323 | "license": [ 324 | "MIT" 325 | ], 326 | "authors": [ 327 | { 328 | "name": "Paragon Initiative Enterprises", 329 | "email": "security@paragonie.com", 330 | "homepage": "https://paragonie.com" 331 | } 332 | ], 333 | "description": "PHP 5.x polyfill for random_bytes() and random_int() from PHP 7", 334 | "keywords": [ 335 | "csprng", 336 | "pseudorandom", 337 | "random" 338 | ], 339 | "time": "2016-03-18 20:34:03" 340 | } 341 | ], 342 | "packages-dev": [ 343 | { 344 | "name": "doctrine/annotations", 345 | "version": "v1.2.7", 346 | "source": { 347 | "type": "git", 348 | "url": "https://github.com/doctrine/annotations.git", 349 | "reference": "f25c8aab83e0c3e976fd7d19875f198ccf2f7535" 350 | }, 351 | "dist": { 352 | "type": "zip", 353 | "url": "https://api.github.com/repos/doctrine/annotations/zipball/f25c8aab83e0c3e976fd7d19875f198ccf2f7535", 354 | "reference": "f25c8aab83e0c3e976fd7d19875f198ccf2f7535", 355 | "shasum": "" 356 | }, 357 | "require": { 358 | "doctrine/lexer": "1.*", 359 | "php": ">=5.3.2" 360 | }, 361 | "require-dev": { 362 | "doctrine/cache": "1.*", 363 | "phpunit/phpunit": "4.*" 364 | }, 365 | "type": "library", 366 | "extra": { 367 | "branch-alias": { 368 | "dev-master": "1.3.x-dev" 369 | } 370 | }, 371 | "autoload": { 372 | "psr-0": { 373 | "Doctrine\\Common\\Annotations\\": "lib/" 374 | } 375 | }, 376 | "notification-url": "https://packagist.org/downloads/", 377 | "license": [ 378 | "MIT" 379 | ], 380 | "authors": [ 381 | { 382 | "name": "Roman Borschel", 383 | "email": "roman@code-factory.org" 384 | }, 385 | { 386 | "name": "Benjamin Eberlei", 387 | "email": "kontakt@beberlei.de" 388 | }, 389 | { 390 | "name": "Guilherme Blanco", 391 | "email": "guilhermeblanco@gmail.com" 392 | }, 393 | { 394 | "name": "Jonathan Wage", 395 | "email": "jonwage@gmail.com" 396 | }, 397 | { 398 | "name": "Johannes Schmitt", 399 | "email": "schmittjoh@gmail.com" 400 | } 401 | ], 402 | "description": "Docblock Annotations Parser", 403 | "homepage": "http://www.doctrine-project.org", 404 | "keywords": [ 405 | "annotations", 406 | "docblock", 407 | "parser" 408 | ], 409 | "time": "2015-08-31 12:32:49" 410 | }, 411 | { 412 | "name": "doctrine/instantiator", 413 | "version": "1.0.5", 414 | "source": { 415 | "type": "git", 416 | "url": "https://github.com/doctrine/instantiator.git", 417 | "reference": "8e884e78f9f0eb1329e445619e04456e64d8051d" 418 | }, 419 | "dist": { 420 | "type": "zip", 421 | "url": "https://api.github.com/repos/doctrine/instantiator/zipball/8e884e78f9f0eb1329e445619e04456e64d8051d", 422 | "reference": "8e884e78f9f0eb1329e445619e04456e64d8051d", 423 | "shasum": "" 424 | }, 425 | "require": { 426 | "php": ">=5.3,<8.0-DEV" 427 | }, 428 | "require-dev": { 429 | "athletic/athletic": "~0.1.8", 430 | "ext-pdo": "*", 431 | "ext-phar": "*", 432 | "phpunit/phpunit": "~4.0", 433 | "squizlabs/php_codesniffer": "~2.0" 434 | }, 435 | "type": "library", 436 | "extra": { 437 | "branch-alias": { 438 | "dev-master": "1.0.x-dev" 439 | } 440 | }, 441 | "autoload": { 442 | "psr-4": { 443 | "Doctrine\\Instantiator\\": "src/Doctrine/Instantiator/" 444 | } 445 | }, 446 | "notification-url": "https://packagist.org/downloads/", 447 | "license": [ 448 | "MIT" 449 | ], 450 | "authors": [ 451 | { 452 | "name": "Marco Pivetta", 453 | "email": "ocramius@gmail.com", 454 | "homepage": "http://ocramius.github.com/" 455 | } 456 | ], 457 | "description": "A small, lightweight utility to instantiate objects in PHP without invoking their constructors", 458 | "homepage": "https://github.com/doctrine/instantiator", 459 | "keywords": [ 460 | "constructor", 461 | "instantiate" 462 | ], 463 | "time": "2015-06-14 21:17:01" 464 | }, 465 | { 466 | "name": "doctrine/lexer", 467 | "version": "v1.0.1", 468 | "source": { 469 | "type": "git", 470 | "url": "https://github.com/doctrine/lexer.git", 471 | "reference": "83893c552fd2045dd78aef794c31e694c37c0b8c" 472 | }, 473 | "dist": { 474 | "type": "zip", 475 | "url": "https://api.github.com/repos/doctrine/lexer/zipball/83893c552fd2045dd78aef794c31e694c37c0b8c", 476 | "reference": "83893c552fd2045dd78aef794c31e694c37c0b8c", 477 | "shasum": "" 478 | }, 479 | "require": { 480 | "php": ">=5.3.2" 481 | }, 482 | "type": "library", 483 | "extra": { 484 | "branch-alias": { 485 | "dev-master": "1.0.x-dev" 486 | } 487 | }, 488 | "autoload": { 489 | "psr-0": { 490 | "Doctrine\\Common\\Lexer\\": "lib/" 491 | } 492 | }, 493 | "notification-url": "https://packagist.org/downloads/", 494 | "license": [ 495 | "MIT" 496 | ], 497 | "authors": [ 498 | { 499 | "name": "Roman Borschel", 500 | "email": "roman@code-factory.org" 501 | }, 502 | { 503 | "name": "Guilherme Blanco", 504 | "email": "guilhermeblanco@gmail.com" 505 | }, 506 | { 507 | "name": "Johannes Schmitt", 508 | "email": "schmittjoh@gmail.com" 509 | } 510 | ], 511 | "description": "Base library for a lexer that can be used in Top-Down, Recursive Descent Parsers.", 512 | "homepage": "http://www.doctrine-project.org", 513 | "keywords": [ 514 | "lexer", 515 | "parser" 516 | ], 517 | "time": "2014-09-09 13:34:57" 518 | }, 519 | { 520 | "name": "guzzle/guzzle", 521 | "version": "v3.9.3", 522 | "source": { 523 | "type": "git", 524 | "url": "https://github.com/guzzle/guzzle3.git", 525 | "reference": "0645b70d953bc1c067bbc8d5bc53194706b628d9" 526 | }, 527 | "dist": { 528 | "type": "zip", 529 | "url": "https://api.github.com/repos/guzzle/guzzle3/zipball/0645b70d953bc1c067bbc8d5bc53194706b628d9", 530 | "reference": "0645b70d953bc1c067bbc8d5bc53194706b628d9", 531 | "shasum": "" 532 | }, 533 | "require": { 534 | "ext-curl": "*", 535 | "php": ">=5.3.3", 536 | "symfony/event-dispatcher": "~2.1" 537 | }, 538 | "replace": { 539 | "guzzle/batch": "self.version", 540 | "guzzle/cache": "self.version", 541 | "guzzle/common": "self.version", 542 | "guzzle/http": "self.version", 543 | "guzzle/inflection": "self.version", 544 | "guzzle/iterator": "self.version", 545 | "guzzle/log": "self.version", 546 | "guzzle/parser": "self.version", 547 | "guzzle/plugin": "self.version", 548 | "guzzle/plugin-async": "self.version", 549 | "guzzle/plugin-backoff": "self.version", 550 | "guzzle/plugin-cache": "self.version", 551 | "guzzle/plugin-cookie": "self.version", 552 | "guzzle/plugin-curlauth": "self.version", 553 | "guzzle/plugin-error-response": "self.version", 554 | "guzzle/plugin-history": "self.version", 555 | "guzzle/plugin-log": "self.version", 556 | "guzzle/plugin-md5": "self.version", 557 | "guzzle/plugin-mock": "self.version", 558 | "guzzle/plugin-oauth": "self.version", 559 | "guzzle/service": "self.version", 560 | "guzzle/stream": "self.version" 561 | }, 562 | "require-dev": { 563 | "doctrine/cache": "~1.3", 564 | "monolog/monolog": "~1.0", 565 | "phpunit/phpunit": "3.7.*", 566 | "psr/log": "~1.0", 567 | "symfony/class-loader": "~2.1", 568 | "zendframework/zend-cache": "2.*,<2.3", 569 | "zendframework/zend-log": "2.*,<2.3" 570 | }, 571 | "suggest": { 572 | "guzzlehttp/guzzle": "Guzzle 5 has moved to a new package name. The package you have installed, Guzzle 3, is deprecated." 573 | }, 574 | "type": "library", 575 | "extra": { 576 | "branch-alias": { 577 | "dev-master": "3.9-dev" 578 | } 579 | }, 580 | "autoload": { 581 | "psr-0": { 582 | "Guzzle": "src/", 583 | "Guzzle\\Tests": "tests/" 584 | } 585 | }, 586 | "notification-url": "https://packagist.org/downloads/", 587 | "license": [ 588 | "MIT" 589 | ], 590 | "authors": [ 591 | { 592 | "name": "Michael Dowling", 593 | "email": "mtdowling@gmail.com", 594 | "homepage": "https://github.com/mtdowling" 595 | }, 596 | { 597 | "name": "Guzzle Community", 598 | "homepage": "https://github.com/guzzle/guzzle/contributors" 599 | } 600 | ], 601 | "description": "PHP HTTP client. This library is deprecated in favor of https://packagist.org/packages/guzzlehttp/guzzle", 602 | "homepage": "http://guzzlephp.org/", 603 | "keywords": [ 604 | "client", 605 | "curl", 606 | "framework", 607 | "http", 608 | "http client", 609 | "rest", 610 | "web service" 611 | ], 612 | "time": "2015-03-18 18:23:50" 613 | }, 614 | { 615 | "name": "jms/metadata", 616 | "version": "1.5.1", 617 | "source": { 618 | "type": "git", 619 | "url": "https://github.com/schmittjoh/metadata.git", 620 | "reference": "22b72455559a25777cfd28c4ffda81ff7639f353" 621 | }, 622 | "dist": { 623 | "type": "zip", 624 | "url": "https://api.github.com/repos/schmittjoh/metadata/zipball/22b72455559a25777cfd28c4ffda81ff7639f353", 625 | "reference": "22b72455559a25777cfd28c4ffda81ff7639f353", 626 | "shasum": "" 627 | }, 628 | "require": { 629 | "php": ">=5.3.0" 630 | }, 631 | "require-dev": { 632 | "doctrine/cache": "~1.0" 633 | }, 634 | "type": "library", 635 | "extra": { 636 | "branch-alias": { 637 | "dev-master": "1.5.x-dev" 638 | } 639 | }, 640 | "autoload": { 641 | "psr-0": { 642 | "Metadata\\": "src/" 643 | } 644 | }, 645 | "notification-url": "https://packagist.org/downloads/", 646 | "license": [ 647 | "Apache" 648 | ], 649 | "authors": [ 650 | { 651 | "name": "Johannes Schmitt", 652 | "email": "schmittjoh@gmail.com", 653 | "homepage": "https://github.com/schmittjoh", 654 | "role": "Developer of wrapped JMSSerializerBundle" 655 | } 656 | ], 657 | "description": "Class/method/property metadata management in PHP", 658 | "keywords": [ 659 | "annotations", 660 | "metadata", 661 | "xml", 662 | "yaml" 663 | ], 664 | "time": "2014-07-12 07:13:19" 665 | }, 666 | { 667 | "name": "jms/parser-lib", 668 | "version": "1.0.0", 669 | "source": { 670 | "type": "git", 671 | "url": "https://github.com/schmittjoh/parser-lib.git", 672 | "reference": "c509473bc1b4866415627af0e1c6cc8ac97fa51d" 673 | }, 674 | "dist": { 675 | "type": "zip", 676 | "url": "https://api.github.com/repos/schmittjoh/parser-lib/zipball/c509473bc1b4866415627af0e1c6cc8ac97fa51d", 677 | "reference": "c509473bc1b4866415627af0e1c6cc8ac97fa51d", 678 | "shasum": "" 679 | }, 680 | "require": { 681 | "phpoption/phpoption": ">=0.9,<2.0-dev" 682 | }, 683 | "type": "library", 684 | "extra": { 685 | "branch-alias": { 686 | "dev-master": "1.0-dev" 687 | } 688 | }, 689 | "autoload": { 690 | "psr-0": { 691 | "JMS\\": "src/" 692 | } 693 | }, 694 | "notification-url": "https://packagist.org/downloads/", 695 | "license": [ 696 | "Apache2" 697 | ], 698 | "description": "A library for easily creating recursive-descent parsers.", 699 | "time": "2012-11-18 18:08:43" 700 | }, 701 | { 702 | "name": "jms/serializer", 703 | "version": "1.1.0", 704 | "source": { 705 | "type": "git", 706 | "url": "https://github.com/schmittjoh/serializer.git", 707 | "reference": "fe13a1f993ea3456e195b7820692f2eb2b6bbb48" 708 | }, 709 | "dist": { 710 | "type": "zip", 711 | "url": "https://api.github.com/repos/schmittjoh/serializer/zipball/fe13a1f993ea3456e195b7820692f2eb2b6bbb48", 712 | "reference": "fe13a1f993ea3456e195b7820692f2eb2b6bbb48", 713 | "shasum": "" 714 | }, 715 | "require": { 716 | "doctrine/annotations": "1.*", 717 | "doctrine/instantiator": "~1.0.3", 718 | "jms/metadata": "~1.1", 719 | "jms/parser-lib": "1.*", 720 | "php": ">=5.4.0", 721 | "phpcollection/phpcollection": "~0.1" 722 | }, 723 | "conflict": { 724 | "twig/twig": "<1.12" 725 | }, 726 | "require-dev": { 727 | "doctrine/orm": "~2.1", 728 | "doctrine/phpcr-odm": "~1.0.1", 729 | "jackalope/jackalope-doctrine-dbal": "1.0.*", 730 | "phpunit/phpunit": "~4.0", 731 | "propel/propel1": "~1.7", 732 | "symfony/filesystem": "2.*", 733 | "symfony/form": "~2.1", 734 | "symfony/translation": "~2.0", 735 | "symfony/validator": "~2.0", 736 | "symfony/yaml": "2.*", 737 | "twig/twig": "~1.12|~2.0" 738 | }, 739 | "suggest": { 740 | "symfony/yaml": "Required if you'd like to serialize data to YAML format." 741 | }, 742 | "type": "library", 743 | "extra": { 744 | "branch-alias": { 745 | "dev-master": "1.1-dev" 746 | } 747 | }, 748 | "autoload": { 749 | "psr-0": { 750 | "JMS\\Serializer": "src/" 751 | } 752 | }, 753 | "notification-url": "https://packagist.org/downloads/", 754 | "license": [ 755 | "Apache2" 756 | ], 757 | "authors": [ 758 | { 759 | "name": "Johannes M. Schmitt", 760 | "email": "schmittjoh@gmail.com" 761 | } 762 | ], 763 | "description": "Library for (de-)serializing data of any complexity; supports XML, JSON, and YAML.", 764 | "homepage": "http://jmsyst.com/libs/serializer", 765 | "keywords": [ 766 | "deserialization", 767 | "jaxb", 768 | "json", 769 | "serialization", 770 | "xml" 771 | ], 772 | "time": "2015-10-27 09:24:41" 773 | }, 774 | { 775 | "name": "phpcollection/phpcollection", 776 | "version": "0.4.0", 777 | "source": { 778 | "type": "git", 779 | "url": "https://github.com/schmittjoh/php-collection.git", 780 | "reference": "b8bf55a0a929ca43b01232b36719f176f86c7e83" 781 | }, 782 | "dist": { 783 | "type": "zip", 784 | "url": "https://api.github.com/repos/schmittjoh/php-collection/zipball/b8bf55a0a929ca43b01232b36719f176f86c7e83", 785 | "reference": "b8bf55a0a929ca43b01232b36719f176f86c7e83", 786 | "shasum": "" 787 | }, 788 | "require": { 789 | "phpoption/phpoption": "1.*" 790 | }, 791 | "type": "library", 792 | "extra": { 793 | "branch-alias": { 794 | "dev-master": "0.3-dev" 795 | } 796 | }, 797 | "autoload": { 798 | "psr-0": { 799 | "PhpCollection": "src/" 800 | } 801 | }, 802 | "notification-url": "https://packagist.org/downloads/", 803 | "license": [ 804 | "Apache2" 805 | ], 806 | "authors": [ 807 | { 808 | "name": "Johannes Schmitt", 809 | "email": "schmittjoh@gmail.com", 810 | "homepage": "https://github.com/schmittjoh", 811 | "role": "Developer of wrapped JMSSerializerBundle" 812 | } 813 | ], 814 | "description": "General-Purpose Collection Library for PHP", 815 | "keywords": [ 816 | "collection", 817 | "list", 818 | "map", 819 | "sequence", 820 | "set" 821 | ], 822 | "time": "2014-03-11 13:46:42" 823 | }, 824 | { 825 | "name": "phpdocumentor/reflection-docblock", 826 | "version": "2.0.4", 827 | "source": { 828 | "type": "git", 829 | "url": "https://github.com/phpDocumentor/ReflectionDocBlock.git", 830 | "reference": "d68dbdc53dc358a816f00b300704702b2eaff7b8" 831 | }, 832 | "dist": { 833 | "type": "zip", 834 | "url": "https://api.github.com/repos/phpDocumentor/ReflectionDocBlock/zipball/d68dbdc53dc358a816f00b300704702b2eaff7b8", 835 | "reference": "d68dbdc53dc358a816f00b300704702b2eaff7b8", 836 | "shasum": "" 837 | }, 838 | "require": { 839 | "php": ">=5.3.3" 840 | }, 841 | "require-dev": { 842 | "phpunit/phpunit": "~4.0" 843 | }, 844 | "suggest": { 845 | "dflydev/markdown": "~1.0", 846 | "erusev/parsedown": "~1.0" 847 | }, 848 | "type": "library", 849 | "extra": { 850 | "branch-alias": { 851 | "dev-master": "2.0.x-dev" 852 | } 853 | }, 854 | "autoload": { 855 | "psr-0": { 856 | "phpDocumentor": [ 857 | "src/" 858 | ] 859 | } 860 | }, 861 | "notification-url": "https://packagist.org/downloads/", 862 | "license": [ 863 | "MIT" 864 | ], 865 | "authors": [ 866 | { 867 | "name": "Mike van Riel", 868 | "email": "mike.vanriel@naenius.com" 869 | } 870 | ], 871 | "time": "2015-02-03 12:10:50" 872 | }, 873 | { 874 | "name": "phpoption/phpoption", 875 | "version": "1.5.0", 876 | "source": { 877 | "type": "git", 878 | "url": "https://github.com/schmittjoh/php-option.git", 879 | "reference": "94e644f7d2051a5f0fcf77d81605f152eecff0ed" 880 | }, 881 | "dist": { 882 | "type": "zip", 883 | "url": "https://api.github.com/repos/schmittjoh/php-option/zipball/94e644f7d2051a5f0fcf77d81605f152eecff0ed", 884 | "reference": "94e644f7d2051a5f0fcf77d81605f152eecff0ed", 885 | "shasum": "" 886 | }, 887 | "require": { 888 | "php": ">=5.3.0" 889 | }, 890 | "require-dev": { 891 | "phpunit/phpunit": "4.7.*" 892 | }, 893 | "type": "library", 894 | "extra": { 895 | "branch-alias": { 896 | "dev-master": "1.3-dev" 897 | } 898 | }, 899 | "autoload": { 900 | "psr-0": { 901 | "PhpOption\\": "src/" 902 | } 903 | }, 904 | "notification-url": "https://packagist.org/downloads/", 905 | "license": [ 906 | "Apache2" 907 | ], 908 | "authors": [ 909 | { 910 | "name": "Johannes M. Schmitt", 911 | "email": "schmittjoh@gmail.com" 912 | } 913 | ], 914 | "description": "Option Type for PHP", 915 | "keywords": [ 916 | "language", 917 | "option", 918 | "php", 919 | "type" 920 | ], 921 | "time": "2015-07-25 16:39:46" 922 | }, 923 | { 924 | "name": "phpspec/prophecy", 925 | "version": "v1.6.0", 926 | "source": { 927 | "type": "git", 928 | "url": "https://github.com/phpspec/prophecy.git", 929 | "reference": "3c91bdf81797d725b14cb62906f9a4ce44235972" 930 | }, 931 | "dist": { 932 | "type": "zip", 933 | "url": "https://api.github.com/repos/phpspec/prophecy/zipball/3c91bdf81797d725b14cb62906f9a4ce44235972", 934 | "reference": "3c91bdf81797d725b14cb62906f9a4ce44235972", 935 | "shasum": "" 936 | }, 937 | "require": { 938 | "doctrine/instantiator": "^1.0.2", 939 | "php": "^5.3|^7.0", 940 | "phpdocumentor/reflection-docblock": "~2.0", 941 | "sebastian/comparator": "~1.1", 942 | "sebastian/recursion-context": "~1.0" 943 | }, 944 | "require-dev": { 945 | "phpspec/phpspec": "~2.0" 946 | }, 947 | "type": "library", 948 | "extra": { 949 | "branch-alias": { 950 | "dev-master": "1.5.x-dev" 951 | } 952 | }, 953 | "autoload": { 954 | "psr-0": { 955 | "Prophecy\\": "src/" 956 | } 957 | }, 958 | "notification-url": "https://packagist.org/downloads/", 959 | "license": [ 960 | "MIT" 961 | ], 962 | "authors": [ 963 | { 964 | "name": "Konstantin Kudryashov", 965 | "email": "ever.zet@gmail.com", 966 | "homepage": "http://everzet.com" 967 | }, 968 | { 969 | "name": "Marcello Duarte", 970 | "email": "marcello.duarte@gmail.com" 971 | } 972 | ], 973 | "description": "Highly opinionated mocking framework for PHP 5.3+", 974 | "homepage": "https://github.com/phpspec/prophecy", 975 | "keywords": [ 976 | "Double", 977 | "Dummy", 978 | "fake", 979 | "mock", 980 | "spy", 981 | "stub" 982 | ], 983 | "time": "2016-02-15 07:46:21" 984 | }, 985 | { 986 | "name": "phpunit/php-code-coverage", 987 | "version": "2.2.4", 988 | "source": { 989 | "type": "git", 990 | "url": "https://github.com/sebastianbergmann/php-code-coverage.git", 991 | "reference": "eabf68b476ac7d0f73793aada060f1c1a9bf8979" 992 | }, 993 | "dist": { 994 | "type": "zip", 995 | "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/eabf68b476ac7d0f73793aada060f1c1a9bf8979", 996 | "reference": "eabf68b476ac7d0f73793aada060f1c1a9bf8979", 997 | "shasum": "" 998 | }, 999 | "require": { 1000 | "php": ">=5.3.3", 1001 | "phpunit/php-file-iterator": "~1.3", 1002 | "phpunit/php-text-template": "~1.2", 1003 | "phpunit/php-token-stream": "~1.3", 1004 | "sebastian/environment": "^1.3.2", 1005 | "sebastian/version": "~1.0" 1006 | }, 1007 | "require-dev": { 1008 | "ext-xdebug": ">=2.1.4", 1009 | "phpunit/phpunit": "~4" 1010 | }, 1011 | "suggest": { 1012 | "ext-dom": "*", 1013 | "ext-xdebug": ">=2.2.1", 1014 | "ext-xmlwriter": "*" 1015 | }, 1016 | "type": "library", 1017 | "extra": { 1018 | "branch-alias": { 1019 | "dev-master": "2.2.x-dev" 1020 | } 1021 | }, 1022 | "autoload": { 1023 | "classmap": [ 1024 | "src/" 1025 | ] 1026 | }, 1027 | "notification-url": "https://packagist.org/downloads/", 1028 | "license": [ 1029 | "BSD-3-Clause" 1030 | ], 1031 | "authors": [ 1032 | { 1033 | "name": "Sebastian Bergmann", 1034 | "email": "sb@sebastian-bergmann.de", 1035 | "role": "lead" 1036 | } 1037 | ], 1038 | "description": "Library that provides collection, processing, and rendering functionality for PHP code coverage information.", 1039 | "homepage": "https://github.com/sebastianbergmann/php-code-coverage", 1040 | "keywords": [ 1041 | "coverage", 1042 | "testing", 1043 | "xunit" 1044 | ], 1045 | "time": "2015-10-06 15:47:00" 1046 | }, 1047 | { 1048 | "name": "phpunit/php-file-iterator", 1049 | "version": "1.4.1", 1050 | "source": { 1051 | "type": "git", 1052 | "url": "https://github.com/sebastianbergmann/php-file-iterator.git", 1053 | "reference": "6150bf2c35d3fc379e50c7602b75caceaa39dbf0" 1054 | }, 1055 | "dist": { 1056 | "type": "zip", 1057 | "url": "https://api.github.com/repos/sebastianbergmann/php-file-iterator/zipball/6150bf2c35d3fc379e50c7602b75caceaa39dbf0", 1058 | "reference": "6150bf2c35d3fc379e50c7602b75caceaa39dbf0", 1059 | "shasum": "" 1060 | }, 1061 | "require": { 1062 | "php": ">=5.3.3" 1063 | }, 1064 | "type": "library", 1065 | "extra": { 1066 | "branch-alias": { 1067 | "dev-master": "1.4.x-dev" 1068 | } 1069 | }, 1070 | "autoload": { 1071 | "classmap": [ 1072 | "src/" 1073 | ] 1074 | }, 1075 | "notification-url": "https://packagist.org/downloads/", 1076 | "license": [ 1077 | "BSD-3-Clause" 1078 | ], 1079 | "authors": [ 1080 | { 1081 | "name": "Sebastian Bergmann", 1082 | "email": "sb@sebastian-bergmann.de", 1083 | "role": "lead" 1084 | } 1085 | ], 1086 | "description": "FilterIterator implementation that filters files based on a list of suffixes.", 1087 | "homepage": "https://github.com/sebastianbergmann/php-file-iterator/", 1088 | "keywords": [ 1089 | "filesystem", 1090 | "iterator" 1091 | ], 1092 | "time": "2015-06-21 13:08:43" 1093 | }, 1094 | { 1095 | "name": "phpunit/php-text-template", 1096 | "version": "1.2.1", 1097 | "source": { 1098 | "type": "git", 1099 | "url": "https://github.com/sebastianbergmann/php-text-template.git", 1100 | "reference": "31f8b717e51d9a2afca6c9f046f5d69fc27c8686" 1101 | }, 1102 | "dist": { 1103 | "type": "zip", 1104 | "url": "https://api.github.com/repos/sebastianbergmann/php-text-template/zipball/31f8b717e51d9a2afca6c9f046f5d69fc27c8686", 1105 | "reference": "31f8b717e51d9a2afca6c9f046f5d69fc27c8686", 1106 | "shasum": "" 1107 | }, 1108 | "require": { 1109 | "php": ">=5.3.3" 1110 | }, 1111 | "type": "library", 1112 | "autoload": { 1113 | "classmap": [ 1114 | "src/" 1115 | ] 1116 | }, 1117 | "notification-url": "https://packagist.org/downloads/", 1118 | "license": [ 1119 | "BSD-3-Clause" 1120 | ], 1121 | "authors": [ 1122 | { 1123 | "name": "Sebastian Bergmann", 1124 | "email": "sebastian@phpunit.de", 1125 | "role": "lead" 1126 | } 1127 | ], 1128 | "description": "Simple template engine.", 1129 | "homepage": "https://github.com/sebastianbergmann/php-text-template/", 1130 | "keywords": [ 1131 | "template" 1132 | ], 1133 | "time": "2015-06-21 13:50:34" 1134 | }, 1135 | { 1136 | "name": "phpunit/php-timer", 1137 | "version": "1.0.7", 1138 | "source": { 1139 | "type": "git", 1140 | "url": "https://github.com/sebastianbergmann/php-timer.git", 1141 | "reference": "3e82f4e9fc92665fafd9157568e4dcb01d014e5b" 1142 | }, 1143 | "dist": { 1144 | "type": "zip", 1145 | "url": "https://api.github.com/repos/sebastianbergmann/php-timer/zipball/3e82f4e9fc92665fafd9157568e4dcb01d014e5b", 1146 | "reference": "3e82f4e9fc92665fafd9157568e4dcb01d014e5b", 1147 | "shasum": "" 1148 | }, 1149 | "require": { 1150 | "php": ">=5.3.3" 1151 | }, 1152 | "type": "library", 1153 | "autoload": { 1154 | "classmap": [ 1155 | "src/" 1156 | ] 1157 | }, 1158 | "notification-url": "https://packagist.org/downloads/", 1159 | "license": [ 1160 | "BSD-3-Clause" 1161 | ], 1162 | "authors": [ 1163 | { 1164 | "name": "Sebastian Bergmann", 1165 | "email": "sb@sebastian-bergmann.de", 1166 | "role": "lead" 1167 | } 1168 | ], 1169 | "description": "Utility class for timing", 1170 | "homepage": "https://github.com/sebastianbergmann/php-timer/", 1171 | "keywords": [ 1172 | "timer" 1173 | ], 1174 | "time": "2015-06-21 08:01:12" 1175 | }, 1176 | { 1177 | "name": "phpunit/php-token-stream", 1178 | "version": "1.4.8", 1179 | "source": { 1180 | "type": "git", 1181 | "url": "https://github.com/sebastianbergmann/php-token-stream.git", 1182 | "reference": "3144ae21711fb6cac0b1ab4cbe63b75ce3d4e8da" 1183 | }, 1184 | "dist": { 1185 | "type": "zip", 1186 | "url": "https://api.github.com/repos/sebastianbergmann/php-token-stream/zipball/3144ae21711fb6cac0b1ab4cbe63b75ce3d4e8da", 1187 | "reference": "3144ae21711fb6cac0b1ab4cbe63b75ce3d4e8da", 1188 | "shasum": "" 1189 | }, 1190 | "require": { 1191 | "ext-tokenizer": "*", 1192 | "php": ">=5.3.3" 1193 | }, 1194 | "require-dev": { 1195 | "phpunit/phpunit": "~4.2" 1196 | }, 1197 | "type": "library", 1198 | "extra": { 1199 | "branch-alias": { 1200 | "dev-master": "1.4-dev" 1201 | } 1202 | }, 1203 | "autoload": { 1204 | "classmap": [ 1205 | "src/" 1206 | ] 1207 | }, 1208 | "notification-url": "https://packagist.org/downloads/", 1209 | "license": [ 1210 | "BSD-3-Clause" 1211 | ], 1212 | "authors": [ 1213 | { 1214 | "name": "Sebastian Bergmann", 1215 | "email": "sebastian@phpunit.de" 1216 | } 1217 | ], 1218 | "description": "Wrapper around PHP's tokenizer extension.", 1219 | "homepage": "https://github.com/sebastianbergmann/php-token-stream/", 1220 | "keywords": [ 1221 | "tokenizer" 1222 | ], 1223 | "time": "2015-09-15 10:49:45" 1224 | }, 1225 | { 1226 | "name": "phpunit/phpunit", 1227 | "version": "4.8.24", 1228 | "source": { 1229 | "type": "git", 1230 | "url": "https://github.com/sebastianbergmann/phpunit.git", 1231 | "reference": "a1066c562c52900a142a0e2bbf0582994671385e" 1232 | }, 1233 | "dist": { 1234 | "type": "zip", 1235 | "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/a1066c562c52900a142a0e2bbf0582994671385e", 1236 | "reference": "a1066c562c52900a142a0e2bbf0582994671385e", 1237 | "shasum": "" 1238 | }, 1239 | "require": { 1240 | "ext-dom": "*", 1241 | "ext-json": "*", 1242 | "ext-pcre": "*", 1243 | "ext-reflection": "*", 1244 | "ext-spl": "*", 1245 | "php": ">=5.3.3", 1246 | "phpspec/prophecy": "^1.3.1", 1247 | "phpunit/php-code-coverage": "~2.1", 1248 | "phpunit/php-file-iterator": "~1.4", 1249 | "phpunit/php-text-template": "~1.2", 1250 | "phpunit/php-timer": ">=1.0.6", 1251 | "phpunit/phpunit-mock-objects": "~2.3", 1252 | "sebastian/comparator": "~1.1", 1253 | "sebastian/diff": "~1.2", 1254 | "sebastian/environment": "~1.3", 1255 | "sebastian/exporter": "~1.2", 1256 | "sebastian/global-state": "~1.0", 1257 | "sebastian/version": "~1.0", 1258 | "symfony/yaml": "~2.1|~3.0" 1259 | }, 1260 | "suggest": { 1261 | "phpunit/php-invoker": "~1.1" 1262 | }, 1263 | "bin": [ 1264 | "phpunit" 1265 | ], 1266 | "type": "library", 1267 | "extra": { 1268 | "branch-alias": { 1269 | "dev-master": "4.8.x-dev" 1270 | } 1271 | }, 1272 | "autoload": { 1273 | "classmap": [ 1274 | "src/" 1275 | ] 1276 | }, 1277 | "notification-url": "https://packagist.org/downloads/", 1278 | "license": [ 1279 | "BSD-3-Clause" 1280 | ], 1281 | "authors": [ 1282 | { 1283 | "name": "Sebastian Bergmann", 1284 | "email": "sebastian@phpunit.de", 1285 | "role": "lead" 1286 | } 1287 | ], 1288 | "description": "The PHP Unit Testing framework.", 1289 | "homepage": "https://phpunit.de/", 1290 | "keywords": [ 1291 | "phpunit", 1292 | "testing", 1293 | "xunit" 1294 | ], 1295 | "time": "2016-03-14 06:16:08" 1296 | }, 1297 | { 1298 | "name": "phpunit/phpunit-mock-objects", 1299 | "version": "2.3.8", 1300 | "source": { 1301 | "type": "git", 1302 | "url": "https://github.com/sebastianbergmann/phpunit-mock-objects.git", 1303 | "reference": "ac8e7a3db35738d56ee9a76e78a4e03d97628983" 1304 | }, 1305 | "dist": { 1306 | "type": "zip", 1307 | "url": "https://api.github.com/repos/sebastianbergmann/phpunit-mock-objects/zipball/ac8e7a3db35738d56ee9a76e78a4e03d97628983", 1308 | "reference": "ac8e7a3db35738d56ee9a76e78a4e03d97628983", 1309 | "shasum": "" 1310 | }, 1311 | "require": { 1312 | "doctrine/instantiator": "^1.0.2", 1313 | "php": ">=5.3.3", 1314 | "phpunit/php-text-template": "~1.2", 1315 | "sebastian/exporter": "~1.2" 1316 | }, 1317 | "require-dev": { 1318 | "phpunit/phpunit": "~4.4" 1319 | }, 1320 | "suggest": { 1321 | "ext-soap": "*" 1322 | }, 1323 | "type": "library", 1324 | "extra": { 1325 | "branch-alias": { 1326 | "dev-master": "2.3.x-dev" 1327 | } 1328 | }, 1329 | "autoload": { 1330 | "classmap": [ 1331 | "src/" 1332 | ] 1333 | }, 1334 | "notification-url": "https://packagist.org/downloads/", 1335 | "license": [ 1336 | "BSD-3-Clause" 1337 | ], 1338 | "authors": [ 1339 | { 1340 | "name": "Sebastian Bergmann", 1341 | "email": "sb@sebastian-bergmann.de", 1342 | "role": "lead" 1343 | } 1344 | ], 1345 | "description": "Mock Object library for PHPUnit", 1346 | "homepage": "https://github.com/sebastianbergmann/phpunit-mock-objects/", 1347 | "keywords": [ 1348 | "mock", 1349 | "xunit" 1350 | ], 1351 | "time": "2015-10-02 06:51:40" 1352 | }, 1353 | { 1354 | "name": "scrutinizer/ocular", 1355 | "version": "1.3.0", 1356 | "source": { 1357 | "type": "git", 1358 | "url": "https://github.com/scrutinizer-ci/ocular.git", 1359 | "reference": "72dcffcd4fbafeff41bf51da349df33170f487e5" 1360 | }, 1361 | "dist": { 1362 | "type": "zip", 1363 | "url": "https://api.github.com/repos/scrutinizer-ci/ocular/zipball/72dcffcd4fbafeff41bf51da349df33170f487e5", 1364 | "reference": "72dcffcd4fbafeff41bf51da349df33170f487e5", 1365 | "shasum": "" 1366 | }, 1367 | "require": { 1368 | "guzzle/guzzle": "~3.0", 1369 | "jms/serializer": "^1.0.0", 1370 | "phpoption/phpoption": "~1.0", 1371 | "symfony/console": "~2.0|~3.0", 1372 | "symfony/process": "~2.3|~3.0" 1373 | }, 1374 | "require-dev": { 1375 | "phpunit/phpunit": "^4.8.0", 1376 | "symfony/filesystem": "~2.0|~3.0" 1377 | }, 1378 | "bin": [ 1379 | "bin/ocular" 1380 | ], 1381 | "type": "library", 1382 | "autoload": { 1383 | "psr-4": { 1384 | "Scrutinizer\\Ocular\\": "src/Scrutinizer/Ocular" 1385 | } 1386 | }, 1387 | "notification-url": "https://packagist.org/downloads/", 1388 | "time": "2015-12-16 14:33:15" 1389 | }, 1390 | { 1391 | "name": "sebastian/comparator", 1392 | "version": "1.2.0", 1393 | "source": { 1394 | "type": "git", 1395 | "url": "https://github.com/sebastianbergmann/comparator.git", 1396 | "reference": "937efb279bd37a375bcadf584dec0726f84dbf22" 1397 | }, 1398 | "dist": { 1399 | "type": "zip", 1400 | "url": "https://api.github.com/repos/sebastianbergmann/comparator/zipball/937efb279bd37a375bcadf584dec0726f84dbf22", 1401 | "reference": "937efb279bd37a375bcadf584dec0726f84dbf22", 1402 | "shasum": "" 1403 | }, 1404 | "require": { 1405 | "php": ">=5.3.3", 1406 | "sebastian/diff": "~1.2", 1407 | "sebastian/exporter": "~1.2" 1408 | }, 1409 | "require-dev": { 1410 | "phpunit/phpunit": "~4.4" 1411 | }, 1412 | "type": "library", 1413 | "extra": { 1414 | "branch-alias": { 1415 | "dev-master": "1.2.x-dev" 1416 | } 1417 | }, 1418 | "autoload": { 1419 | "classmap": [ 1420 | "src/" 1421 | ] 1422 | }, 1423 | "notification-url": "https://packagist.org/downloads/", 1424 | "license": [ 1425 | "BSD-3-Clause" 1426 | ], 1427 | "authors": [ 1428 | { 1429 | "name": "Jeff Welch", 1430 | "email": "whatthejeff@gmail.com" 1431 | }, 1432 | { 1433 | "name": "Volker Dusch", 1434 | "email": "github@wallbash.com" 1435 | }, 1436 | { 1437 | "name": "Bernhard Schussek", 1438 | "email": "bschussek@2bepublished.at" 1439 | }, 1440 | { 1441 | "name": "Sebastian Bergmann", 1442 | "email": "sebastian@phpunit.de" 1443 | } 1444 | ], 1445 | "description": "Provides the functionality to compare PHP values for equality", 1446 | "homepage": "http://www.github.com/sebastianbergmann/comparator", 1447 | "keywords": [ 1448 | "comparator", 1449 | "compare", 1450 | "equality" 1451 | ], 1452 | "time": "2015-07-26 15:48:44" 1453 | }, 1454 | { 1455 | "name": "sebastian/diff", 1456 | "version": "1.4.1", 1457 | "source": { 1458 | "type": "git", 1459 | "url": "https://github.com/sebastianbergmann/diff.git", 1460 | "reference": "13edfd8706462032c2f52b4b862974dd46b71c9e" 1461 | }, 1462 | "dist": { 1463 | "type": "zip", 1464 | "url": "https://api.github.com/repos/sebastianbergmann/diff/zipball/13edfd8706462032c2f52b4b862974dd46b71c9e", 1465 | "reference": "13edfd8706462032c2f52b4b862974dd46b71c9e", 1466 | "shasum": "" 1467 | }, 1468 | "require": { 1469 | "php": ">=5.3.3" 1470 | }, 1471 | "require-dev": { 1472 | "phpunit/phpunit": "~4.8" 1473 | }, 1474 | "type": "library", 1475 | "extra": { 1476 | "branch-alias": { 1477 | "dev-master": "1.4-dev" 1478 | } 1479 | }, 1480 | "autoload": { 1481 | "classmap": [ 1482 | "src/" 1483 | ] 1484 | }, 1485 | "notification-url": "https://packagist.org/downloads/", 1486 | "license": [ 1487 | "BSD-3-Clause" 1488 | ], 1489 | "authors": [ 1490 | { 1491 | "name": "Kore Nordmann", 1492 | "email": "mail@kore-nordmann.de" 1493 | }, 1494 | { 1495 | "name": "Sebastian Bergmann", 1496 | "email": "sebastian@phpunit.de" 1497 | } 1498 | ], 1499 | "description": "Diff implementation", 1500 | "homepage": "https://github.com/sebastianbergmann/diff", 1501 | "keywords": [ 1502 | "diff" 1503 | ], 1504 | "time": "2015-12-08 07:14:41" 1505 | }, 1506 | { 1507 | "name": "sebastian/environment", 1508 | "version": "1.3.5", 1509 | "source": { 1510 | "type": "git", 1511 | "url": "https://github.com/sebastianbergmann/environment.git", 1512 | "reference": "dc7a29032cf72b54f36dac15a1ca5b3a1b6029bf" 1513 | }, 1514 | "dist": { 1515 | "type": "zip", 1516 | "url": "https://api.github.com/repos/sebastianbergmann/environment/zipball/dc7a29032cf72b54f36dac15a1ca5b3a1b6029bf", 1517 | "reference": "dc7a29032cf72b54f36dac15a1ca5b3a1b6029bf", 1518 | "shasum": "" 1519 | }, 1520 | "require": { 1521 | "php": ">=5.3.3" 1522 | }, 1523 | "require-dev": { 1524 | "phpunit/phpunit": "~4.4" 1525 | }, 1526 | "type": "library", 1527 | "extra": { 1528 | "branch-alias": { 1529 | "dev-master": "1.3.x-dev" 1530 | } 1531 | }, 1532 | "autoload": { 1533 | "classmap": [ 1534 | "src/" 1535 | ] 1536 | }, 1537 | "notification-url": "https://packagist.org/downloads/", 1538 | "license": [ 1539 | "BSD-3-Clause" 1540 | ], 1541 | "authors": [ 1542 | { 1543 | "name": "Sebastian Bergmann", 1544 | "email": "sebastian@phpunit.de" 1545 | } 1546 | ], 1547 | "description": "Provides functionality to handle HHVM/PHP environments", 1548 | "homepage": "http://www.github.com/sebastianbergmann/environment", 1549 | "keywords": [ 1550 | "Xdebug", 1551 | "environment", 1552 | "hhvm" 1553 | ], 1554 | "time": "2016-02-26 18:40:46" 1555 | }, 1556 | { 1557 | "name": "sebastian/exporter", 1558 | "version": "1.2.1", 1559 | "source": { 1560 | "type": "git", 1561 | "url": "https://github.com/sebastianbergmann/exporter.git", 1562 | "reference": "7ae5513327cb536431847bcc0c10edba2701064e" 1563 | }, 1564 | "dist": { 1565 | "type": "zip", 1566 | "url": "https://api.github.com/repos/sebastianbergmann/exporter/zipball/7ae5513327cb536431847bcc0c10edba2701064e", 1567 | "reference": "7ae5513327cb536431847bcc0c10edba2701064e", 1568 | "shasum": "" 1569 | }, 1570 | "require": { 1571 | "php": ">=5.3.3", 1572 | "sebastian/recursion-context": "~1.0" 1573 | }, 1574 | "require-dev": { 1575 | "phpunit/phpunit": "~4.4" 1576 | }, 1577 | "type": "library", 1578 | "extra": { 1579 | "branch-alias": { 1580 | "dev-master": "1.2.x-dev" 1581 | } 1582 | }, 1583 | "autoload": { 1584 | "classmap": [ 1585 | "src/" 1586 | ] 1587 | }, 1588 | "notification-url": "https://packagist.org/downloads/", 1589 | "license": [ 1590 | "BSD-3-Clause" 1591 | ], 1592 | "authors": [ 1593 | { 1594 | "name": "Jeff Welch", 1595 | "email": "whatthejeff@gmail.com" 1596 | }, 1597 | { 1598 | "name": "Volker Dusch", 1599 | "email": "github@wallbash.com" 1600 | }, 1601 | { 1602 | "name": "Bernhard Schussek", 1603 | "email": "bschussek@2bepublished.at" 1604 | }, 1605 | { 1606 | "name": "Sebastian Bergmann", 1607 | "email": "sebastian@phpunit.de" 1608 | }, 1609 | { 1610 | "name": "Adam Harvey", 1611 | "email": "aharvey@php.net" 1612 | } 1613 | ], 1614 | "description": "Provides the functionality to export PHP variables for visualization", 1615 | "homepage": "http://www.github.com/sebastianbergmann/exporter", 1616 | "keywords": [ 1617 | "export", 1618 | "exporter" 1619 | ], 1620 | "time": "2015-06-21 07:55:53" 1621 | }, 1622 | { 1623 | "name": "sebastian/global-state", 1624 | "version": "1.1.1", 1625 | "source": { 1626 | "type": "git", 1627 | "url": "https://github.com/sebastianbergmann/global-state.git", 1628 | "reference": "bc37d50fea7d017d3d340f230811c9f1d7280af4" 1629 | }, 1630 | "dist": { 1631 | "type": "zip", 1632 | "url": "https://api.github.com/repos/sebastianbergmann/global-state/zipball/bc37d50fea7d017d3d340f230811c9f1d7280af4", 1633 | "reference": "bc37d50fea7d017d3d340f230811c9f1d7280af4", 1634 | "shasum": "" 1635 | }, 1636 | "require": { 1637 | "php": ">=5.3.3" 1638 | }, 1639 | "require-dev": { 1640 | "phpunit/phpunit": "~4.2" 1641 | }, 1642 | "suggest": { 1643 | "ext-uopz": "*" 1644 | }, 1645 | "type": "library", 1646 | "extra": { 1647 | "branch-alias": { 1648 | "dev-master": "1.0-dev" 1649 | } 1650 | }, 1651 | "autoload": { 1652 | "classmap": [ 1653 | "src/" 1654 | ] 1655 | }, 1656 | "notification-url": "https://packagist.org/downloads/", 1657 | "license": [ 1658 | "BSD-3-Clause" 1659 | ], 1660 | "authors": [ 1661 | { 1662 | "name": "Sebastian Bergmann", 1663 | "email": "sebastian@phpunit.de" 1664 | } 1665 | ], 1666 | "description": "Snapshotting of global state", 1667 | "homepage": "http://www.github.com/sebastianbergmann/global-state", 1668 | "keywords": [ 1669 | "global state" 1670 | ], 1671 | "time": "2015-10-12 03:26:01" 1672 | }, 1673 | { 1674 | "name": "sebastian/recursion-context", 1675 | "version": "1.0.2", 1676 | "source": { 1677 | "type": "git", 1678 | "url": "https://github.com/sebastianbergmann/recursion-context.git", 1679 | "reference": "913401df809e99e4f47b27cdd781f4a258d58791" 1680 | }, 1681 | "dist": { 1682 | "type": "zip", 1683 | "url": "https://api.github.com/repos/sebastianbergmann/recursion-context/zipball/913401df809e99e4f47b27cdd781f4a258d58791", 1684 | "reference": "913401df809e99e4f47b27cdd781f4a258d58791", 1685 | "shasum": "" 1686 | }, 1687 | "require": { 1688 | "php": ">=5.3.3" 1689 | }, 1690 | "require-dev": { 1691 | "phpunit/phpunit": "~4.4" 1692 | }, 1693 | "type": "library", 1694 | "extra": { 1695 | "branch-alias": { 1696 | "dev-master": "1.0.x-dev" 1697 | } 1698 | }, 1699 | "autoload": { 1700 | "classmap": [ 1701 | "src/" 1702 | ] 1703 | }, 1704 | "notification-url": "https://packagist.org/downloads/", 1705 | "license": [ 1706 | "BSD-3-Clause" 1707 | ], 1708 | "authors": [ 1709 | { 1710 | "name": "Jeff Welch", 1711 | "email": "whatthejeff@gmail.com" 1712 | }, 1713 | { 1714 | "name": "Sebastian Bergmann", 1715 | "email": "sebastian@phpunit.de" 1716 | }, 1717 | { 1718 | "name": "Adam Harvey", 1719 | "email": "aharvey@php.net" 1720 | } 1721 | ], 1722 | "description": "Provides functionality to recursively process PHP variables", 1723 | "homepage": "http://www.github.com/sebastianbergmann/recursion-context", 1724 | "time": "2015-11-11 19:50:13" 1725 | }, 1726 | { 1727 | "name": "sebastian/version", 1728 | "version": "1.0.6", 1729 | "source": { 1730 | "type": "git", 1731 | "url": "https://github.com/sebastianbergmann/version.git", 1732 | "reference": "58b3a85e7999757d6ad81c787a1fbf5ff6c628c6" 1733 | }, 1734 | "dist": { 1735 | "type": "zip", 1736 | "url": "https://api.github.com/repos/sebastianbergmann/version/zipball/58b3a85e7999757d6ad81c787a1fbf5ff6c628c6", 1737 | "reference": "58b3a85e7999757d6ad81c787a1fbf5ff6c628c6", 1738 | "shasum": "" 1739 | }, 1740 | "type": "library", 1741 | "autoload": { 1742 | "classmap": [ 1743 | "src/" 1744 | ] 1745 | }, 1746 | "notification-url": "https://packagist.org/downloads/", 1747 | "license": [ 1748 | "BSD-3-Clause" 1749 | ], 1750 | "authors": [ 1751 | { 1752 | "name": "Sebastian Bergmann", 1753 | "email": "sebastian@phpunit.de", 1754 | "role": "lead" 1755 | } 1756 | ], 1757 | "description": "Library that helps with managing the version number of Git-hosted PHP projects", 1758 | "homepage": "https://github.com/sebastianbergmann/version", 1759 | "time": "2015-06-21 13:59:46" 1760 | }, 1761 | { 1762 | "name": "symfony/console", 1763 | "version": "v3.0.4", 1764 | "source": { 1765 | "type": "git", 1766 | "url": "https://github.com/symfony/console.git", 1767 | "reference": "6b1175135bc2a74c08a28d89761272de8beed8cd" 1768 | }, 1769 | "dist": { 1770 | "type": "zip", 1771 | "url": "https://api.github.com/repos/symfony/console/zipball/6b1175135bc2a74c08a28d89761272de8beed8cd", 1772 | "reference": "6b1175135bc2a74c08a28d89761272de8beed8cd", 1773 | "shasum": "" 1774 | }, 1775 | "require": { 1776 | "php": ">=5.5.9", 1777 | "symfony/polyfill-mbstring": "~1.0" 1778 | }, 1779 | "require-dev": { 1780 | "psr/log": "~1.0", 1781 | "symfony/event-dispatcher": "~2.8|~3.0", 1782 | "symfony/process": "~2.8|~3.0" 1783 | }, 1784 | "suggest": { 1785 | "psr/log": "For using the console logger", 1786 | "symfony/event-dispatcher": "", 1787 | "symfony/process": "" 1788 | }, 1789 | "type": "library", 1790 | "extra": { 1791 | "branch-alias": { 1792 | "dev-master": "3.0-dev" 1793 | } 1794 | }, 1795 | "autoload": { 1796 | "psr-4": { 1797 | "Symfony\\Component\\Console\\": "" 1798 | }, 1799 | "exclude-from-classmap": [ 1800 | "/Tests/" 1801 | ] 1802 | }, 1803 | "notification-url": "https://packagist.org/downloads/", 1804 | "license": [ 1805 | "MIT" 1806 | ], 1807 | "authors": [ 1808 | { 1809 | "name": "Fabien Potencier", 1810 | "email": "fabien@symfony.com" 1811 | }, 1812 | { 1813 | "name": "Symfony Community", 1814 | "homepage": "https://symfony.com/contributors" 1815 | } 1816 | ], 1817 | "description": "Symfony Console Component", 1818 | "homepage": "https://symfony.com", 1819 | "time": "2016-03-16 17:00:50" 1820 | }, 1821 | { 1822 | "name": "symfony/event-dispatcher", 1823 | "version": "v2.8.4", 1824 | "source": { 1825 | "type": "git", 1826 | "url": "https://github.com/symfony/event-dispatcher.git", 1827 | "reference": "47d2d8cade9b1c3987573d2943bb9352536cdb87" 1828 | }, 1829 | "dist": { 1830 | "type": "zip", 1831 | "url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/47d2d8cade9b1c3987573d2943bb9352536cdb87", 1832 | "reference": "47d2d8cade9b1c3987573d2943bb9352536cdb87", 1833 | "shasum": "" 1834 | }, 1835 | "require": { 1836 | "php": ">=5.3.9" 1837 | }, 1838 | "require-dev": { 1839 | "psr/log": "~1.0", 1840 | "symfony/config": "~2.0,>=2.0.5|~3.0.0", 1841 | "symfony/dependency-injection": "~2.6|~3.0.0", 1842 | "symfony/expression-language": "~2.6|~3.0.0", 1843 | "symfony/stopwatch": "~2.3|~3.0.0" 1844 | }, 1845 | "suggest": { 1846 | "symfony/dependency-injection": "", 1847 | "symfony/http-kernel": "" 1848 | }, 1849 | "type": "library", 1850 | "extra": { 1851 | "branch-alias": { 1852 | "dev-master": "2.8-dev" 1853 | } 1854 | }, 1855 | "autoload": { 1856 | "psr-4": { 1857 | "Symfony\\Component\\EventDispatcher\\": "" 1858 | }, 1859 | "exclude-from-classmap": [ 1860 | "/Tests/" 1861 | ] 1862 | }, 1863 | "notification-url": "https://packagist.org/downloads/", 1864 | "license": [ 1865 | "MIT" 1866 | ], 1867 | "authors": [ 1868 | { 1869 | "name": "Fabien Potencier", 1870 | "email": "fabien@symfony.com" 1871 | }, 1872 | { 1873 | "name": "Symfony Community", 1874 | "homepage": "https://symfony.com/contributors" 1875 | } 1876 | ], 1877 | "description": "Symfony EventDispatcher Component", 1878 | "homepage": "https://symfony.com", 1879 | "time": "2016-03-07 14:04:32" 1880 | }, 1881 | { 1882 | "name": "symfony/polyfill-mbstring", 1883 | "version": "v1.1.1", 1884 | "source": { 1885 | "type": "git", 1886 | "url": "https://github.com/symfony/polyfill-mbstring.git", 1887 | "reference": "1289d16209491b584839022f29257ad859b8532d" 1888 | }, 1889 | "dist": { 1890 | "type": "zip", 1891 | "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/1289d16209491b584839022f29257ad859b8532d", 1892 | "reference": "1289d16209491b584839022f29257ad859b8532d", 1893 | "shasum": "" 1894 | }, 1895 | "require": { 1896 | "php": ">=5.3.3" 1897 | }, 1898 | "suggest": { 1899 | "ext-mbstring": "For best performance" 1900 | }, 1901 | "type": "library", 1902 | "extra": { 1903 | "branch-alias": { 1904 | "dev-master": "1.1-dev" 1905 | } 1906 | }, 1907 | "autoload": { 1908 | "psr-4": { 1909 | "Symfony\\Polyfill\\Mbstring\\": "" 1910 | }, 1911 | "files": [ 1912 | "bootstrap.php" 1913 | ] 1914 | }, 1915 | "notification-url": "https://packagist.org/downloads/", 1916 | "license": [ 1917 | "MIT" 1918 | ], 1919 | "authors": [ 1920 | { 1921 | "name": "Nicolas Grekas", 1922 | "email": "p@tchwork.com" 1923 | }, 1924 | { 1925 | "name": "Symfony Community", 1926 | "homepage": "https://symfony.com/contributors" 1927 | } 1928 | ], 1929 | "description": "Symfony polyfill for the Mbstring extension", 1930 | "homepage": "https://symfony.com", 1931 | "keywords": [ 1932 | "compatibility", 1933 | "mbstring", 1934 | "polyfill", 1935 | "portable", 1936 | "shim" 1937 | ], 1938 | "time": "2016-01-20 09:13:37" 1939 | }, 1940 | { 1941 | "name": "symfony/process", 1942 | "version": "v3.0.4", 1943 | "source": { 1944 | "type": "git", 1945 | "url": "https://github.com/symfony/process.git", 1946 | "reference": "e6f1f98bbd355d209a992bfff45e7edfbd4a0776" 1947 | }, 1948 | "dist": { 1949 | "type": "zip", 1950 | "url": "https://api.github.com/repos/symfony/process/zipball/e6f1f98bbd355d209a992bfff45e7edfbd4a0776", 1951 | "reference": "e6f1f98bbd355d209a992bfff45e7edfbd4a0776", 1952 | "shasum": "" 1953 | }, 1954 | "require": { 1955 | "php": ">=5.5.9" 1956 | }, 1957 | "type": "library", 1958 | "extra": { 1959 | "branch-alias": { 1960 | "dev-master": "3.0-dev" 1961 | } 1962 | }, 1963 | "autoload": { 1964 | "psr-4": { 1965 | "Symfony\\Component\\Process\\": "" 1966 | }, 1967 | "exclude-from-classmap": [ 1968 | "/Tests/" 1969 | ] 1970 | }, 1971 | "notification-url": "https://packagist.org/downloads/", 1972 | "license": [ 1973 | "MIT" 1974 | ], 1975 | "authors": [ 1976 | { 1977 | "name": "Fabien Potencier", 1978 | "email": "fabien@symfony.com" 1979 | }, 1980 | { 1981 | "name": "Symfony Community", 1982 | "homepage": "https://symfony.com/contributors" 1983 | } 1984 | ], 1985 | "description": "Symfony Process Component", 1986 | "homepage": "https://symfony.com", 1987 | "time": "2016-03-30 10:41:14" 1988 | }, 1989 | { 1990 | "name": "symfony/yaml", 1991 | "version": "v3.0.4", 1992 | "source": { 1993 | "type": "git", 1994 | "url": "https://github.com/symfony/yaml.git", 1995 | "reference": "0047c8366744a16de7516622c5b7355336afae96" 1996 | }, 1997 | "dist": { 1998 | "type": "zip", 1999 | "url": "https://api.github.com/repos/symfony/yaml/zipball/0047c8366744a16de7516622c5b7355336afae96", 2000 | "reference": "0047c8366744a16de7516622c5b7355336afae96", 2001 | "shasum": "" 2002 | }, 2003 | "require": { 2004 | "php": ">=5.5.9" 2005 | }, 2006 | "type": "library", 2007 | "extra": { 2008 | "branch-alias": { 2009 | "dev-master": "3.0-dev" 2010 | } 2011 | }, 2012 | "autoload": { 2013 | "psr-4": { 2014 | "Symfony\\Component\\Yaml\\": "" 2015 | }, 2016 | "exclude-from-classmap": [ 2017 | "/Tests/" 2018 | ] 2019 | }, 2020 | "notification-url": "https://packagist.org/downloads/", 2021 | "license": [ 2022 | "MIT" 2023 | ], 2024 | "authors": [ 2025 | { 2026 | "name": "Fabien Potencier", 2027 | "email": "fabien@symfony.com" 2028 | }, 2029 | { 2030 | "name": "Symfony Community", 2031 | "homepage": "https://symfony.com/contributors" 2032 | } 2033 | ], 2034 | "description": "Symfony Yaml Component", 2035 | "homepage": "https://symfony.com", 2036 | "time": "2016-03-04 07:55:57" 2037 | } 2038 | ], 2039 | "aliases": [], 2040 | "minimum-stability": "stable", 2041 | "stability-flags": [], 2042 | "prefer-stable": false, 2043 | "prefer-lowest": false, 2044 | "platform": { 2045 | "php": ">=5.5.9" 2046 | }, 2047 | "platform-dev": [] 2048 | } 2049 | -------------------------------------------------------------------------------- /src/Contracts/EloquentLDAPUserInterface.php: -------------------------------------------------------------------------------- 1 | publishes([ 19 | __DIR__.'/../migrations/' => database_path('migrations') 20 | ], 'migrations'); 21 | 22 | $this->publishes([ 23 | __DIR__.'/../config/config.php' => config_path('eloquent-ldap.php'), 24 | ], 'config'); 25 | 26 | // use the vendor configuration file as fallback 27 | $this->mergeConfigFrom( 28 | __DIR__.'/../config/config.php', 'eloquent-ldap' 29 | ); 30 | } 31 | 32 | /** 33 | * Register any package services. 34 | * 35 | * @return void 36 | */ 37 | public function register() 38 | { 39 | 40 | Auth::provider('eloquent-ldap', function ($app, array $config) { 41 | // Return an instance of Illuminate\Contracts\Auth\UserProvider... 42 | return new EloquentLDAPUserProvider($app); 43 | }); 44 | 45 | } 46 | } -------------------------------------------------------------------------------- /src/Providers/EloquentLDAPUserProvider.php: -------------------------------------------------------------------------------- 1 | app = $app; 69 | $this->hasher = $this->app['hash']; 70 | $this->user_model = $this->getUserModel(); 71 | $this->group_model = Settings::get('eloquent-ldap.group_model'); 72 | } 73 | 74 | public function getUserModel() 75 | { 76 | return $this->app['config']['auth.providers.users.model']; 77 | } 78 | 79 | /** 80 | * Retrieve a user by their unique identifier. 81 | * 82 | * @param mixed $identifier 83 | * @return \Illuminate\Contracts\Auth\Authenticatable|null 84 | */ 85 | public function retrieveById($identifier) 86 | { 87 | return $this->createUserModel()->newQuery()->find($identifier); 88 | } 89 | 90 | /** 91 | * Retrieve a user by their unique identifier and "remember me" token. 92 | * 93 | * @param mixed $identifier 94 | * @param string $token 95 | * @return \Illuminate\Contracts\Auth\Authenticatable|null 96 | */ 97 | public function retrieveByToken($identifier, $token) 98 | { 99 | $userModel = $this->createUserModel(); 100 | 101 | return $userModel->newQuery() 102 | ->where($userModel->getKeyName(), $identifier) 103 | ->where($userModel->getRememberTokenName(), $token) 104 | ->first(); 105 | } 106 | 107 | /** 108 | * Update the "remember me" token for the given user in storage. 109 | * 110 | * @param \Illuminate\Contracts\Auth\Authenticatable $user 111 | * @param string $token 112 | * @return void 113 | */ 114 | public function updateRememberToken(UserContract $user, $token) 115 | { 116 | $user->setRememberToken($token); 117 | 118 | $user->save(); 119 | } 120 | 121 | /** 122 | * Retrieve a user by the given credentials. 123 | * 124 | * @param array $credentials 125 | * @return \Illuminate\Contracts\Auth\Authenticatable|null 126 | */ 127 | public function retrieveByCredentials(array $credentials) 128 | { 129 | // First we will add each credential element to the query as a where clause. 130 | // Then we can execute the query and, if we found a user, return it in a 131 | // Eloquent User "model" that will be utilized by the Guard instances. 132 | $query = $this->createUserModel()->newQuery(); 133 | 134 | foreach ($credentials as $key => $value) { 135 | if (!Str::contains($key, 'password')) { 136 | $query->where($key, $value); 137 | } 138 | } 139 | 140 | // return $query->first(); 141 | 142 | $user = $query->first(); 143 | 144 | // If the user was not found in the local database, and LDAP authentication 145 | // is enabled, and the option is set to automatically create new accounts 146 | // on first login, create the user and return it. Otherwise return what 147 | // we found, which could be a user or null. 148 | if ( 149 | is_null($user) && 150 | Settings::get('eloquent-ldap.enabled') && 151 | Settings::get('eloquent-ldap.create_accounts') 152 | ) { 153 | $user = $this->createUserFromLDAP($credentials['username']); 154 | } 155 | 156 | return $user; 157 | } 158 | 159 | /** 160 | * Validate a user against the given credentials. 161 | * 162 | * @param \Illuminate\Contracts\Auth\Authenticatable $user 163 | * @param array $credentials 164 | * @return bool 165 | */ 166 | public function validateCredentials(UserContract $user, array $credentials) 167 | { 168 | $credentialsValidated = false; 169 | 170 | // If the user is set AND, either of auth_type 'internal' or with 171 | // auth_type unset or null, then validate against the stored 172 | // password hash. Otherwise if the LDAP authentication 173 | // method is enabled, try it. 174 | if ( isset($user) && 175 | ( 176 | ( isset($user->auth_type) && (Settings::get('eloquent-ldap.label_internal') === $user->auth_type) ) || 177 | ( !isset($user->auth_type) ) 178 | ) 179 | ) { 180 | $plain = $credentials['password']; 181 | $credentialsValidated = $this->hasher->check($plain, $user->getAuthPassword()); 182 | } else if ( (Settings::get('eloquent-ldap.enabled')) && (Settings::get('eloquent-ldap.label_ldap') === $user->auth_type) ) { 183 | // Validate credentials against LDAP/AD server. 184 | $credentialsValidated = $this->validateLDAPCredentials($credentials); 185 | // If validated and config set to resync group membership on login. 186 | if ( $credentialsValidated ) { 187 | // Sync user enable/disable state 188 | $this->syncEnable($user); 189 | if ( (Settings::get('eloquent-ldap.resync_on_login')) && (Settings::get('eloquent-ldap.replicate_group_membership'))) { 190 | // First, revoke membership to all groups marked to 'resync_on_login'. 191 | $this->revokeMembership($user); 192 | // Then replicate group membership. 193 | $this->replicateMembershipFromLDAP($user); 194 | } 195 | } 196 | } 197 | 198 | return $credentialsValidated; 199 | } 200 | 201 | /** 202 | * Returns class name of the user model. 203 | * 204 | * @return string 205 | */ 206 | public function userModelClassName() 207 | { 208 | $class = '\\'.ltrim($this->user_model, '\\'); 209 | 210 | return $class; 211 | } 212 | 213 | /** 214 | * Create a new instance of the user model. 215 | * 216 | * @return \Illuminate\Database\Eloquent\Model 217 | */ 218 | public function createUserModel() 219 | { 220 | $class = $this->userModelClassName(); 221 | 222 | return new $class; 223 | } 224 | 225 | /** 226 | * Create a new instance of the group model. 227 | * 228 | * @return \Illuminate\Database\Eloquent\Model 229 | */ 230 | public function createGroupModel() 231 | { 232 | $class = '\\'.ltrim($this->group_model, '\\'); 233 | 234 | return new $class; 235 | } 236 | 237 | 238 | private function syncEnable($user) 239 | { 240 | $ldapUser = $this->getLDAPUser($user->username); 241 | // If we found the user in LDAP 242 | if (true == $ldapUser ) { 243 | $enabled = (($ldapUser->getFirstAttribute('useraccountcontrol') & 2) == 0); 244 | 245 | if ($enabled) { 246 | $user->enabled = true; 247 | } 248 | else { 249 | $user->enabled = false; 250 | } 251 | $user->save(); 252 | } 253 | } 254 | 255 | 256 | /** 257 | * Creates a local user from the information gained from the LDAP/AD 258 | * server. 259 | * 260 | * @param $userName The name of the user to create. 261 | */ 262 | private function createUserFromLDAP($userName) 263 | { 264 | $user = null; 265 | 266 | $ldapUser = $this->getLDAPUser($userName); 267 | // If we found the user in LDAP 268 | if (true == $ldapUser ) { 269 | $firstName = $ldapUser->getFirstAttribute(Settings::get('eloquent-ldap.first_name_field')); 270 | $lastName = $ldapUser->getFirstAttribute(Settings::get('eloquent-ldap.last_name_field')); 271 | $email = $ldapUser->getFirstAttribute(Settings::get('eloquent-ldap.email_field')); 272 | $enabled = (($ldapUser->getFirstAttribute('useraccountcontrol') & 2) == 0); 273 | 274 | $userModel = $this->createUserModel(); 275 | 276 | $ldapFields = [ 'username' => $userName, 277 | 'first_name' => $firstName, 278 | 'last_name' => $lastName, 279 | 'email' => $email, 280 | 'enabled' => $enabled, 281 | ]; 282 | 283 | $validator = Validator::make($ldapFields, $userModel::getCreateValidationRules($this->app)); 284 | 285 | if ($validator->fails()) { 286 | Log::error('Validation failed for user ['.$userName.'], in [EloquentLDAPUserProvider::createUserFromLDAP].'); 287 | $messages = $validator->errors(); 288 | foreach ($messages->all() as $message) { 289 | Log::error('Validation message: ' . $message); 290 | } 291 | 292 | } 293 | else { 294 | $user = $userModel->create(array( 295 | 'username' => $userName, 296 | 'first_name' => $firstName, 297 | 'last_name' => $lastName, 298 | 'email' => $email, 299 | 'password' => 'Password handled by AD/LDAP.', 300 | 'auth_type' => Settings::get('eloquent-ldap.label_ldap'), 301 | )); 302 | 303 | if ($enabled) { 304 | $user->enabled = true; 305 | } else { 306 | $user->enabled = false; 307 | } 308 | $user->save(); 309 | 310 | if (Settings::get('eloquent-ldap.replicate_group_membership')) { 311 | $this->replicateMembershipFromLDAP($user); 312 | } 313 | } 314 | 315 | } 316 | 317 | return $user; 318 | } 319 | 320 | /** 321 | * Builds the LDAP connection options from the configuration files. 322 | * 323 | * @return array 324 | */ 325 | private function GetLDAPConnectionOptions() 326 | { 327 | 328 | if (!isset($this->ldapConOp) || is_null($this->ldapConOp)) { 329 | // Build basic LDAP connection configuration. 330 | $this->ldapConOp = [ 331 | "account_suffix" => Settings::get('eloquent-ldap.account_suffix'), 332 | "base_dn" => Settings::get('eloquent-ldap.base_dn'), 333 | "domain_controllers" => [ Settings::get('eloquent-ldap.server') ], // config item must be an array. 334 | "admin_username" => Settings::get('eloquent-ldap.user_name'), 335 | "admin_password" => Settings::get('eloquent-ldap.password'), 336 | // "real_primarygroup" => Settings::get('eloquent-ldap.return_real_primary_group'), 337 | // "recursive_groups" => Settings::get('eloquent-ldap.recursive_groups'), 338 | // "sso" => false, // Settings::get('eloquent-ldap.sso'), // NOT SUPPORTED HARD CODED TO FALSE. 339 | "follow_referrals" => false, // Settings::get('eloquent-ldap.follow_referrals'), // NOT SUPPORTED HARD CODED TO FALSE. 340 | ]; 341 | // Create the communication option part, add the encryption and port info. 342 | if ('tls' === Settings::get('eloquent-ldap.secured')) { 343 | $comOpt = [ 344 | "use_ssl" => false, 345 | "use_tls" => true, 346 | "port" => Settings::get('eloquent-ldap.secured_port'), 347 | ]; 348 | } else if ('ssl' === Settings::get('eloquent-ldap.secured')) { 349 | $comOpt = [ 350 | "use_ssl" => true, 351 | "use_tls" => false, 352 | "port" => Settings::get('eloquent-ldap.secured_port'), 353 | ]; 354 | } else { 355 | $comOpt = [ 356 | "use_ssl" => false, 357 | "use_tls" => false, 358 | "port" => Settings::get('eloquent-ldap.port'), 359 | ]; 360 | } 361 | // Merge all options together. 362 | $this->ldapConOp = array_merge($this->ldapConOp, $comOpt); 363 | } 364 | 365 | return $this->ldapConOp; 366 | 367 | } 368 | 369 | /** 370 | * Returns the value of a key in an array, or if not found, returns the 371 | * default provided. 372 | * 373 | * @param $array The array to return the value from. 374 | * @param $key The key to lookup. 375 | * @param null $default The default value to return if the key does not exist. 376 | * @return The value requested or the default provided. 377 | */ 378 | private function GetArrayValueOrDefault($array, $key, $default = null) { 379 | $value = $default; 380 | 381 | try { 382 | $value = $array[$key]; 383 | if (null === $value) { 384 | $value = $default; 385 | } 386 | } 387 | catch( Exception $ex) { 388 | $value = $default; 389 | } 390 | 391 | return $value; 392 | } 393 | 394 | /** 395 | * Returns the value of a key at an index in a multi-dimensional array, or 396 | * if not found, returns the default provided. 397 | * 398 | * @param $array The array to return the value from. 399 | * @param $key The key to lookup. 400 | * @param $index The index of the value to return. 401 | * @param null $default The default value to return if the key does not exist. 402 | * @return The value requested or the default provided. 403 | */ 404 | private function GetArrayIndexedValueOrDefault($array, $key, $index, $default = null) { 405 | $value = $default; 406 | 407 | try { 408 | $value = $this->GetArrayValueOrDefault($array, $key, $default); 409 | if ( (isset($value)) && ($value !== $default) ) { 410 | $value = $value[$index]; 411 | } 412 | } 413 | catch( Exception $ex) { 414 | $value = $default; 415 | } 416 | 417 | return $value; 418 | } 419 | 420 | /** 421 | * Queries the LDAP/AD server for a user. 422 | * 423 | * @param $userName The name of the user to get information for. 424 | * @return Adldap User The user. 425 | */ 426 | private function getLDAPUser($username) 427 | { 428 | $adldap = false; 429 | $adUser = false; 430 | 431 | try { 432 | $ldapQuery = Settings::get('eloquent-ldap.user_filter'); 433 | if (strpos($ldapQuery, self::USER_TOKEN)) { 434 | $ldapQuery = str_replace(self::USER_TOKEN, $username, $ldapQuery); 435 | } 436 | else { 437 | throw new \Exception("Invalid AD/LDAP query filter, check the configuration of 'LDAP_USER_FILTER'."); 438 | } 439 | 440 | $ldapFields = [ 441 | Settings::get('eloquent-ldap.username_field'), 442 | Settings::get('eloquent-ldap.first_name_field'), 443 | Settings::get('eloquent-ldap.last_name_field'), 444 | Settings::get('eloquent-ldap.email_field'), 445 | 'useraccountcontrol', 446 | 'dn', 447 | ]; 448 | 449 | // Build connection info. 450 | $ldapConOp = $this->GetLDAPConnectionOptions(); 451 | 452 | if (Settings::get('eloquent-ldap.debug')) { 453 | // Set LDAP debug log level - useful in DEV, dangerous in PROD!! 454 | ldap_set_option(NULL, LDAP_OPT_DEBUG_LEVEL, 7); 455 | } 456 | 457 | // Connect to AD/LDAP 458 | $adldap = new Adldap(); 459 | $adldap->addProvider($ldapConOp); 460 | $provider = $adldap->connect(); 461 | 462 | // Search... 463 | $adUser = $provider->search()->select($ldapFields)->rawFilter($ldapQuery)->first(); 464 | // $adResults = $provider->search()->select($ldapFields)->rawFilter($ldapQuery)->get(); 465 | // 466 | // if (isset($adResults) && is_array($adResults) && isset($adResults[0])) { 467 | // $adResults = $adResults[0]; 468 | // } 469 | 470 | if (!$adUser) { 471 | $this->handleLDAPError($adldap); 472 | } 473 | } catch (\Exception $ex) { 474 | Log::error('Exception retrieving user information: ' . $ex->getMessage()); 475 | Log::error($ex->getTraceAsString()); 476 | } 477 | 478 | // Close connection. 479 | if (isset($provider)) { 480 | unset($provider); 481 | } 482 | // Close connection. 483 | if (isset($adldap)) { 484 | unset($adldap); 485 | } 486 | 487 | return $adUser; 488 | } 489 | 490 | /** 491 | * Revoke membership to all local group that are marked with 492 | * 'resync_on_login' as 1 or true. 493 | * 494 | * @param $user The user to revoke group membership from. 495 | */ 496 | private function revokeMembership($user) 497 | { 498 | try { 499 | 500 | foreach($user->membershipList as $group) { 501 | if ($group->resync_on_login) { 502 | $user->membershipList()->detach($group); 503 | } 504 | } 505 | 506 | } catch (\Exception $ex) { 507 | Log::error('Exception revoking local group membership for user: ' . $user->username . ', Exception message: ' . $ex->getMessage()); 508 | Log::error($ex->getTraceAsString()); 509 | } 510 | 511 | } 512 | 513 | /** 514 | * Grants membership to local groups for each LDAP/AD group that the user 515 | * is a member of. See the option "LDAP_RECURSIVE_GROUPS" to enable 516 | * deep LDAP/AD group probe. 517 | * NOTE: This will not maintain the hierarchical structure of the groups, 518 | * instead the structure will be 'flattened'. If you want to maintain 519 | * the hierarchical structure, set the option "LDAP_RECURSIVE_GROUPS" 520 | * to false, and build a group structure that mirrors the LDAP/AD 521 | * structure. 522 | * 523 | * @param $user The user to replicate group membership for. 524 | * @throws Exception 525 | */ 526 | private function replicateMembershipFromLDAP($user) 527 | { 528 | $adldap = false; 529 | 530 | try { 531 | $username = $user->username; 532 | $groupModel = $this->createGroupModel(); 533 | $ldapConOp = $this->GetLDAPConnectionOptions(); 534 | $ldapRecursive = Settings::get('eloquent-ldap.recursive_groups'); 535 | 536 | if (Settings::get('eloquent-ldap.debug')) { 537 | // Set LDAP debug log level - useful in DEV, dangerous in PROD!! 538 | ldap_set_option(NULL, LDAP_OPT_DEBUG_LEVEL, 7); 539 | } 540 | 541 | // Connect to AD/LDAP 542 | $adldap = new Adldap(); 543 | $adldap->addProvider($ldapConOp); 544 | $provider = $adldap->connect(); 545 | 546 | // Locate the user 547 | $adldapUser = $provider->search()->users()->find($username); 548 | // Request the user's group membership. 549 | $adldapGroups = $adldapUser->getGroups([], true); 550 | 551 | foreach($adldapGroups as $adldapGroup) { 552 | try { 553 | $adldapGroupName = $adldapGroup->getName(); 554 | $localGroup = null; 555 | $localGroup = $groupModel->where('name', $adldapGroupName)->firstOrFail(); 556 | if ( !$user->isMemberOf($adldapGroupName) ) { 557 | $user->membershipList()->attach($localGroup->id); 558 | } 559 | } catch (ModelNotFoundException $e) { 560 | // Mute the exception as we expect not to find all groups. 561 | } 562 | } 563 | 564 | } catch (\Exception $ex) { 565 | Log::error('Exception replicating group membership for user: ' . $user->username . ', Exception message: ' . $ex->getMessage()); 566 | Log::error($ex->getTraceAsString()); 567 | $this->handleLDAPError($adldap); 568 | } 569 | 570 | // Close connection. 571 | if (isset($provider)) { 572 | unset($provider); 573 | } 574 | // Close connection. 575 | if (isset($adldap)) { 576 | unset($adldap); 577 | } 578 | 579 | } 580 | 581 | /** 582 | * Validates the credentials against the configured LDAP/AD server. 583 | * The credentials are passed in an array with the keys 'username' 584 | * and 'password'. 585 | * 586 | * @param array $credentials The credentials to validate. 587 | * @return boolean 588 | */ 589 | private function validateLDAPCredentials(array $credentials) 590 | { 591 | $credentialsValidated = false; 592 | $adldap = false; 593 | 594 | try { 595 | 596 | $userPassword = $credentials['password']; 597 | $userName = $credentials['username']; 598 | $ldapConOp = $this->GetLDAPConnectionOptions(); 599 | 600 | if (Settings::get('eloquent-ldap.debug')) { 601 | // Set LDAP debug log level - useful in DEV, dangerous in PROD!! 602 | ldap_set_option(NULL, LDAP_OPT_DEBUG_LEVEL, 7); 603 | } 604 | 605 | // Try to authenticate using AD/LDAP 606 | // Connect to AD/LDAP 607 | $adldap = new Adldap(); 608 | $adldap->addProvider($ldapConOp); 609 | $provider = $adldap->connect(); 610 | 611 | // For LDAP servers, the authentication is done with the full DN, 612 | // Not the username with the suffix as is done for MSAD servers. 613 | if ('LDAP' === Settings::get('eloquent-ldap.server_type')) { 614 | $ldapUser = $this->getLDAPUser($userName); 615 | $userName = $this->GetArrayValueOrDefault($ldapUser, 'dn', ''); 616 | } 617 | 618 | $authUser = $provider->auth()->attempt($userName, $userPassword); 619 | // If the user got authenticated 620 | if ($authUser == true) { 621 | $credentialsValidated = true; 622 | } else { 623 | $this->handleLDAPError($adldap); 624 | $credentialsValidated = false; 625 | } 626 | } catch (\Exception $ex) { 627 | Log::error('Exception validating LDAP credential for user: ' . $userName . ', Exception message: ' . $ex->getMessage()); 628 | Log::error($ex->getTraceAsString()); 629 | $this->handleLDAPError($adldap); 630 | $credentialsValidated = false; 631 | } 632 | 633 | // Close connection. 634 | if (isset($provider)) { 635 | unset($provider); 636 | } 637 | // Close connection. 638 | if (isset($adldap)) { 639 | unset($adldap); 640 | } 641 | 642 | return $credentialsValidated; 643 | } 644 | 645 | /** 646 | * Logs the last LDAP error if it is not "Success". 647 | * 648 | * @param array $adldap The instance of the adLDAP object to check for 649 | * error. 650 | */ 651 | private function handleLDAPError(\Adldap\Adldap $adldap) 652 | { 653 | if (false != $adldap) { 654 | // May be helpful for finding out what and why went wrong. 655 | $adLDAPError = $adldap->getConnection()->getLastError(); 656 | if ("Success" != $adLDAPError) { 657 | Log::error('Problem with LDAP:' . $adLDAPError); 658 | } 659 | } 660 | } 661 | } 662 | -------------------------------------------------------------------------------- /src/config/config.php: -------------------------------------------------------------------------------- 1 | env('eloquent-ldap.enabled', false), 15 | 16 | /* 17 | |-------------------------------------------------------------------------- 18 | | Debug 19 | |-------------------------------------------------------------------------- 20 | | 21 | | Enables a higher debug level for the underlying LDAP library. Useful when 22 | | combined with a packet sniffer to debug connectivity issues. 23 | | 24 | */ 25 | 26 | 'debug' => env('eloquent-ldap.debug', false), 27 | 28 | /* 29 | |-------------------------------------------------------------------------- 30 | | Server type 31 | |-------------------------------------------------------------------------- 32 | | 33 | | The server type either 'LDAP' for Lightweight Directory Access Protocol 34 | | servers, or MSAD for Microsoft Active Directory servers. 35 | | 36 | */ 37 | 38 | 'server_type' => env('eloquent-ldap.server_type', 'MSAD'), 39 | 40 | /* 41 | |-------------------------------------------------------------------------- 42 | | Automatically create new accounts on first login 43 | |-------------------------------------------------------------------------- 44 | | 45 | | Should user accounts be automatically created, if they do not already 46 | | exists, after successful authentication against the configured 47 | | LDAP/AD server. This behaviour is set to true by default. 48 | | 49 | */ 50 | 51 | 'create_accounts' => env('eloquent-ldap.create_accounts', true), 52 | 53 | /* 54 | |-------------------------------------------------------------------------- 55 | | Automatically replicate group membership 56 | |-------------------------------------------------------------------------- 57 | | 58 | | Should a user's LDAP group membership be replicated in local group/roles? 59 | | If enabled the package will iterate through all LDAP groups that the 60 | | user is a member of and assigned membership of the local group with 61 | | the same name. This behaviour is set to true by default. 62 | | NOTE: New groups will not be created, membership will only be granted to 63 | | existing groups with the same name. 64 | | 65 | */ 66 | 67 | 'replicate_group_membership' => env('eloquent-ldap.replicate_group_membership', true), 68 | 69 | /* 70 | |-------------------------------------------------------------------------- 71 | | Automatically resync group membership on login 72 | |-------------------------------------------------------------------------- 73 | | 74 | | Should a user's LDAP group membership be resynchronized on every login? 75 | | If enabled the package will resynchronized group membership on 76 | | every login. 77 | | NOTE: New groups will not be created, membership will only be granted to 78 | | existing groups with the same name. 79 | | 80 | */ 81 | 82 | 'resync_on_login' => env('eloquent-ldap.resync_on_login', true), 83 | 84 | /* 85 | |-------------------------------------------------------------------------- 86 | | Group model 87 | |-------------------------------------------------------------------------- 88 | | 89 | | Name of model that represents a group or role. This is the model that 90 | | will automatically be granted membership to based on the user's LDAP 91 | | membership if the option 'assign_group' is enabled. 92 | | NOTE: The user model is picked up from the 'model' variable in the 93 | | '\config\auth.php' configuration file. 94 | | 95 | */ 96 | 97 | 'group_model' => env('eloquent-ldap.group_model', App\Models\Group::class), 98 | 99 | /* 100 | |-------------------------------------------------------------------------- 101 | | Internal label 102 | |-------------------------------------------------------------------------- 103 | | 104 | | Value to use in the auth_type column for each user to mark them as 105 | | internal. 106 | | NOTE: To avoid errors, the package will consider both user with 107 | | an aut_type of this value and null or unset to be internal. 108 | | 109 | */ 110 | 111 | 'label_internal' => env('eloquent-ldap.label_internal', 'internal'), 112 | 113 | /* 114 | |-------------------------------------------------------------------------- 115 | | LDAP label 116 | |-------------------------------------------------------------------------- 117 | | 118 | | Value to use in the auth_type column for each user to mark them as 119 | | originating from the LDAP server. 120 | | 121 | */ 122 | 123 | 'label_ldap' => env('eloquent-ldap.label_ldap', 'ldap'), 124 | 125 | /* 126 | |-------------------------------------------------------------------------- 127 | | Account suffix 128 | |-------------------------------------------------------------------------- 129 | | 130 | | Enter the right part of the email address, after and including the "@" 131 | | sign, configured in your domain. For Microsoft Active Directory this 132 | | can be your domain name, preceded by the "@" sign. 133 | | 134 | */ 135 | 136 | 'account_suffix' => env('eloquent-ldap.account_suffix', "@company.com"), 137 | 138 | /* 139 | |-------------------------------------------------------------------------- 140 | | Base DN 141 | |-------------------------------------------------------------------------- 142 | | 143 | | Enter the LDAP/AD "Base DN" to bind to. 144 | | 145 | */ 146 | 147 | 'base_dn' => env('eloquent-ldap.base_dn', "DC=department,DC=company,DC=com"), 148 | 149 | /* 150 | |-------------------------------------------------------------------------- 151 | | Server 152 | |-------------------------------------------------------------------------- 153 | | 154 | | Enter the fully qualified hostname for your LDAP server or AD domain 155 | | controller. 156 | | 157 | */ 158 | 159 | 'server' => [ env('eloquent-ldap.server', "ldapsrv01.company.com") ], 160 | 161 | /* 162 | |-------------------------------------------------------------------------- 163 | | Port 164 | |-------------------------------------------------------------------------- 165 | | 166 | | Enter the TCP port number to connect to your AD/LDAP server. 167 | | 168 | */ 169 | 170 | 'port' => env('eloquent-ldap.port', 389), 171 | 172 | /* 173 | |-------------------------------------------------------------------------- 174 | | User name 175 | |-------------------------------------------------------------------------- 176 | | 177 | | Enter the name of the user that will query the AD/LDAP server. 178 | | 179 | */ 180 | 181 | 'user_name' => env('eloquent-ldap.user_name', "ldap_reader"), 182 | 183 | /* 184 | |-------------------------------------------------------------------------- 185 | | Password 186 | |-------------------------------------------------------------------------- 187 | | 188 | | Enter the password of the user that will query the AD/LDAP server. 189 | | 190 | */ 191 | 192 | 'password' => env('eloquent-ldap.password', "PaSsWoRd"), 193 | 194 | /* 195 | |-------------------------------------------------------------------------- 196 | | Return real primary group 197 | |-------------------------------------------------------------------------- 198 | | 199 | | Fix Microsoft AD not following standards by not returning the real 200 | | primary group, may incur extra processing. 201 | | 202 | */ 203 | 204 | 'return_real_primary_group' => env('eloquent-ldap.return_real_primary_group', true), 205 | 206 | /* 207 | |-------------------------------------------------------------------------- 208 | | Enable encryption? 209 | |-------------------------------------------------------------------------- 210 | | 211 | | Enables the use of encryption to communicate with LDAP/AD using either 212 | | SSL or TLS. 213 | | 214 | | Supported values: false, "ssl", "tls" 215 | | 216 | */ 217 | 218 | 'secured' => env('eloquent-ldap.secured', false), 219 | 220 | /* 221 | |-------------------------------------------------------------------------- 222 | | Secured port 223 | |-------------------------------------------------------------------------- 224 | | 225 | | Enter the port number to use when using secured communications. 226 | | 227 | */ 228 | 229 | 'secured_port' => env('eloquent-ldap.secured_port', 636), 230 | 231 | /* 232 | |-------------------------------------------------------------------------- 233 | | Resolve all group membership? 234 | |-------------------------------------------------------------------------- 235 | | 236 | | Resolve group membership recursively. When disabled only groups that a 237 | | given user is a direct member of will be returned. May incur extra 238 | | processing. 239 | | 240 | */ 241 | 242 | 'recursive_groups' => env('eloquent-ldap.recursive_groups', false), 243 | 244 | /* 245 | |-------------------------------------------------------------------------- 246 | | Single sign-on 247 | |-------------------------------------------------------------------------- 248 | | 249 | | Enable single sign-on. 250 | | NOTE: This feature is currently not supported 251 | | 252 | | TODO: Implement SSO! 253 | | 254 | */ 255 | 256 | 'sso' => env('eloquent-ldap.sso', false), 257 | 258 | /* 259 | |-------------------------------------------------------------------------- 260 | | User name field 261 | |-------------------------------------------------------------------------- 262 | | 263 | | Enter the name of the field that will contain the user name. 264 | | 265 | */ 266 | 267 | 'username_field' => env('eloquent-ldap.username_field', "samaccountname"), 268 | 269 | /* 270 | |-------------------------------------------------------------------------- 271 | | Email field 272 | |-------------------------------------------------------------------------- 273 | | 274 | | Enter the name of the field that will contain the user's email address. 275 | | 276 | */ 277 | 278 | 'email_field' => env('eloquent-ldap.email_field', "userprincipalname"), 279 | 280 | /* 281 | |-------------------------------------------------------------------------- 282 | | First name field 283 | |-------------------------------------------------------------------------- 284 | | 285 | | Enter the name of the field that will contain the user's first name. 286 | | 287 | */ 288 | 289 | 'first_name_field' => env('eloquent-ldap.first_name_field', "givenname"), 290 | 291 | /* 292 | |-------------------------------------------------------------------------- 293 | | Title 294 | |-------------------------------------------------------------------------- 295 | | 296 | | Enter the name of the field that will contain the user's last name. 297 | | 298 | */ 299 | 300 | 'last_name_field' => env('eloquent-ldap.last_name_field', "sn"), 301 | 302 | 303 | /* 304 | |-------------------------------------------------------------------------- 305 | | User query filter 306 | |-------------------------------------------------------------------------- 307 | | 308 | | Enter the LDAP filter or query string to search for users. 309 | | 310 | | TIP: Use the command line `ldapsearch` to help you build and test your 311 | | query string. 312 | | 313 | | NOTE: The variable `%username` must be used and will be replaced by the 314 | | correct value when executed. 315 | | 316 | */ 317 | 318 | 'user_filter' => env('eloquent-ldap.user_filter', "(&(objectcategory=person)(samaccountname=%username))"), 319 | 320 | 321 | ]; 322 | 323 | -------------------------------------------------------------------------------- /src/migrations/2015_08_02_013709_eloquent_ldap_setup_tables.php: -------------------------------------------------------------------------------- 1 | increments('id'); 24 | // $table->string('first_name'); 25 | // $table->string('last_name'); 26 | // $table->string('username')->unique(); 27 | // $table->string('email')->unique(); 28 | // $table->string('password', 60); 29 | // $table->rememberToken(); 30 | // $table->timestamps(); 31 | // }); 32 | 33 | // USERS: Add the auth_type column. 34 | Schema::table('users', function (Blueprint $table) { 35 | $table->string('auth_type')->nullable(); 36 | }); 37 | 38 | //======= 39 | // GROUPS 40 | //======= 41 | // Either uncomment the section below to create the groups table if it 42 | // was not already done before, or use it as an example for your own 43 | // migration. 44 | // // Create table for storing groups 45 | // Schema::create('groups', function (Blueprint $table) { 46 | // $table->increments('id'); 47 | // $table->string('name')->unique(); 48 | // $table->string('display_name')->nullable(); 49 | // $table->string('description')->nullable(); 50 | // $table->timestamps(); 51 | // }); 52 | // 53 | // // Create table for associating groups to users (Many-to-Many) 54 | // Schema::create('group_user', function (Blueprint $table) { 55 | // $table->integer('user_id')->unsigned(); 56 | // $table->integer('group_id')->unsigned(); 57 | // 58 | // $table->foreign('user_id')->references('id')->on('users') 59 | // ->onUpdate('cascade')->onDelete('cascade'); 60 | // $table->foreign('group_id')->references('id')->on('groups') 61 | // ->onUpdate('cascade')->onDelete('cascade'); 62 | // 63 | // $table->primary(['user_id', 'group_id']); 64 | // }); 65 | 66 | // GROUPS: Add the resync_on_login column. 67 | Schema::table('groups', function (Blueprint $table) { 68 | $table->boolean('resync_on_login')->default(false); 69 | }); 70 | 71 | 72 | } 73 | 74 | /** 75 | * Reverse the migrations. 76 | * 77 | * @return void 78 | */ 79 | public function down() 80 | { 81 | Schema::table('users', function (Blueprint $table) { 82 | $table->dropColumn('auth_type'); 83 | }); 84 | 85 | // Uncomment the section below if the users table was created above. 86 | // // Drop the users table. 87 | // Schema::drop('users'); 88 | 89 | Schema::table('groups', function (Blueprint $table) { 90 | $table->dropColumn('resync_on_login'); 91 | }); 92 | 93 | // Uncomment the section below if the groups table was created above. 94 | // // Drop the groups table. 95 | // Schema::drop('groups'); 96 | // // Drop the group user link table. 97 | // Schema::drop('group_user'); 98 | } 99 | } 100 | --------------------------------------------------------------------------------