From 1cfe7e0defdda0fe4e4999f2e66bdbb60b7e0344 Mon Sep 17 00:00:00 2001 From: Brian Canini <canini.16@osu.edu> Date: Tue, 15 Jun 2021 09:59:44 -0400 Subject: [PATCH] Removing drupal/realname (1.0.0-rc2) --- composer.json | 1 - composer.lock | 80 +---- vendor/composer/InstalledVersions.php | 13 +- vendor/composer/installed.json | 80 ----- vendor/composer/installed.php | 13 +- web/modules/realname/LICENSE.txt | 339 ------------------ web/modules/realname/README.txt | 55 --- web/modules/realname/composer.json | 24 -- .../config/install/realname.settings.yml | 1 - ...action.realname_update_realname_action.yml | 10 - .../config/schema/realname.schema.yml | 13 - .../migrations/d6_realname_settings.yml | 18 - .../migrations/d7_realname_settings.yml | 18 - web/modules/realname/realname.api.php | 58 --- web/modules/realname/realname.info.yml | 13 - web/modules/realname/realname.install | 50 --- web/modules/realname/realname.links.menu.yml | 5 - web/modules/realname/realname.links.task.yml | 4 - web/modules/realname/realname.module | 289 --------------- web/modules/realname/realname.permissions.yml | 3 - web/modules/realname/realname.routing.yml | 7 - web/modules/realname/realname.services.yml | 11 - web/modules/realname/realname.views.inc | 41 --- .../RealnameAutocompleteController.php | 107 ------ .../src/EventSubscriber/ConfigCacheTag.php | 58 --- .../src/Form/RealnameAdminSettingsForm.php | 95 ----- .../Plugin/Action/RealnameUpdateRealname.php | 37 -- .../migrate/process/RealnameReplaceToken.php | 33 -- .../src/Routing/RealnameRouteSubscriber.php | 20 -- .../realname/src/Tests/RealnameBasicTest.php | 150 -------- 30 files changed, 5 insertions(+), 1641 deletions(-) delete mode 100644 web/modules/realname/LICENSE.txt delete mode 100644 web/modules/realname/README.txt delete mode 100644 web/modules/realname/composer.json delete mode 100644 web/modules/realname/config/install/realname.settings.yml delete mode 100644 web/modules/realname/config/install/system.action.realname_update_realname_action.yml delete mode 100644 web/modules/realname/config/schema/realname.schema.yml delete mode 100644 web/modules/realname/migrations/d6_realname_settings.yml delete mode 100644 web/modules/realname/migrations/d7_realname_settings.yml delete mode 100644 web/modules/realname/realname.api.php delete mode 100644 web/modules/realname/realname.info.yml delete mode 100644 web/modules/realname/realname.install delete mode 100644 web/modules/realname/realname.links.menu.yml delete mode 100644 web/modules/realname/realname.links.task.yml delete mode 100644 web/modules/realname/realname.module delete mode 100644 web/modules/realname/realname.permissions.yml delete mode 100644 web/modules/realname/realname.routing.yml delete mode 100644 web/modules/realname/realname.services.yml delete mode 100644 web/modules/realname/realname.views.inc delete mode 100644 web/modules/realname/src/Controller/RealnameAutocompleteController.php delete mode 100644 web/modules/realname/src/EventSubscriber/ConfigCacheTag.php delete mode 100644 web/modules/realname/src/Form/RealnameAdminSettingsForm.php delete mode 100644 web/modules/realname/src/Plugin/Action/RealnameUpdateRealname.php delete mode 100644 web/modules/realname/src/Plugin/migrate/process/RealnameReplaceToken.php delete mode 100644 web/modules/realname/src/Routing/RealnameRouteSubscriber.php delete mode 100644 web/modules/realname/src/Tests/RealnameBasicTest.php diff --git a/composer.json b/composer.json index bbc3fc9e4f..6929e4f5b2 100644 --- a/composer.json +++ b/composer.json @@ -145,7 +145,6 @@ "drupal/pantheon_advanced_page_cache": "1.2", "drupal/paragraphs": "1.12", "drupal/pathauto": "1.8", - "drupal/realname": "1.0.0-rc2", "drupal/rebuild_cache_access": "1.7", "drupal/recaptcha": "3.0", "drupal/recaptcha_v3": "^1.4", diff --git a/composer.lock b/composer.lock index 180450240e..e86bfd5680 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "d3cd96c3df9f39031d74be176705f95b", + "content-hash": "b768ebbdfd1c5263f38e2a30b4867485", "packages": [ { "name": "alchemy/zippy", @@ -6484,84 +6484,6 @@ "documentation": "https://www.drupal.org/docs/8/modules/pathauto" } }, - { - "name": "drupal/realname", - "version": "1.0.0-rc2", - "source": { - "type": "git", - "url": "https://git.drupalcode.org/project/realname.git", - "reference": "8.x-1.0-rc2" - }, - "dist": { - "type": "zip", - "url": "https://ftp.drupal.org/files/projects/realname-8.x-1.0-rc2.zip", - "reference": "8.x-1.0-rc2", - "shasum": "f5bd7f98fdf17ef3b7d8eb3c1f9a5c043f121354" - }, - "require": { - "drupal/core": "~8.0", - "drupal/token": "^1.0.0-alpha2" - }, - "type": "drupal-module", - "extra": { - "drupal": { - "version": "8.x-1.0-rc2", - "datestamp": "1548970380", - "security-coverage": { - "status": "not-covered", - "message": "RC releases are not covered by Drupal security advisories." - } - } - }, - "notification-url": "https://packages.drupal.org/8/downloads", - "license": [ - "GPL-2.0+" - ], - "authors": [ - { - "name": "hass", - "homepage": "https://www.drupal.org/u/hass" - }, - { - "name": "See other contributors", - "homepage": "https://www.drupal.org/node/266280/committers" - }, - { - "name": "coderintherye", - "homepage": "https://www.drupal.org/user/297478" - }, - { - "name": "hass", - "homepage": "https://www.drupal.org/user/85918" - }, - { - "name": "philltran", - "homepage": "https://www.drupal.org/user/295397" - }, - { - "name": "rmiddle", - "homepage": "https://www.drupal.org/user/192183" - }, - { - "name": "theamoeba", - "homepage": "https://www.drupal.org/user/251700" - }, - { - "name": "tkuldeep17", - "homepage": "https://www.drupal.org/user/2498278" - }, - { - "name": "voxpelli", - "homepage": "https://www.drupal.org/user/341713" - } - ], - "description": "Provides token-based name displays for users.", - "homepage": "https://www.drupal.org/project/realname", - "support": { - "source": "https://git.drupal.org/project/realname.git", - "issues": "https://www.drupal.org/project/issues/realname" - } - }, { "name": "drupal/rebuild_cache_access", "version": "1.7.0", diff --git a/vendor/composer/InstalledVersions.php b/vendor/composer/InstalledVersions.php index da081d9c7b..f280691f21 100644 --- a/vendor/composer/InstalledVersions.php +++ b/vendor/composer/InstalledVersions.php @@ -30,7 +30,7 @@ class InstalledVersions 'aliases' => array ( ), - 'reference' => 'ababbcc1bdd8b12bbd8d8bbc4ad5d6316607af68', + 'reference' => '2bf3b254e0ab09b0c9d5eb273e7597cfe10739d3', 'name' => 'osu-asc-webservices/d8-upstream', ), 'versions' => @@ -1567,15 +1567,6 @@ class InstalledVersions 0 => '8.9.16', ), ), - 'drupal/realname' => - array ( - 'pretty_version' => '1.0.0-rc2', - 'version' => '1.0.0.0-RC2', - 'aliases' => - array ( - ), - 'reference' => '8.x-1.0-rc2', - ), 'drupal/rebuild_cache_access' => array ( 'pretty_version' => '1.7.0', @@ -2287,7 +2278,7 @@ class InstalledVersions 'aliases' => array ( ), - 'reference' => 'ababbcc1bdd8b12bbd8d8bbc4ad5d6316607af68', + 'reference' => '2bf3b254e0ab09b0c9d5eb273e7597cfe10739d3', ), 'pantheon-systems/quicksilver-pushback' => array ( diff --git a/vendor/composer/installed.json b/vendor/composer/installed.json index 9e7fff9f39..8aac8b9ee4 100644 --- a/vendor/composer/installed.json +++ b/vendor/composer/installed.json @@ -6689,86 +6689,6 @@ }, "install-path": "../../web/modules/pathauto" }, - { - "name": "drupal/realname", - "version": "1.0.0-rc2", - "version_normalized": "1.0.0.0-RC2", - "source": { - "type": "git", - "url": "https://git.drupalcode.org/project/realname.git", - "reference": "8.x-1.0-rc2" - }, - "dist": { - "type": "zip", - "url": "https://ftp.drupal.org/files/projects/realname-8.x-1.0-rc2.zip", - "reference": "8.x-1.0-rc2", - "shasum": "f5bd7f98fdf17ef3b7d8eb3c1f9a5c043f121354" - }, - "require": { - "drupal/core": "~8.0", - "drupal/token": "^1.0.0-alpha2" - }, - "type": "drupal-module", - "extra": { - "branch-alias": { - "dev-1.x": "1.x-dev" - }, - "drupal": { - "version": "8.x-1.0-rc2", - "datestamp": "1548970380", - "security-coverage": { - "status": "not-covered", - "message": "RC releases are not covered by Drupal security advisories." - } - } - }, - "installation-source": "dist", - "notification-url": "https://packages.drupal.org/8/downloads", - "license": [ - "GPL-2.0+" - ], - "authors": [ - { - "name": "hass", - "homepage": "https://www.drupal.org/u/hass" - }, - { - "name": "See other contributors", - "homepage": "https://www.drupal.org/node/266280/committers" - }, - { - "name": "coderintherye", - "homepage": "https://www.drupal.org/user/297478" - }, - { - "name": "hass", - "homepage": "https://www.drupal.org/user/85918" - }, - { - "name": "rmiddle", - "homepage": "https://www.drupal.org/user/192183" - }, - { - "name": "theamoeba", - "homepage": "https://www.drupal.org/user/251700" - }, - { - "name": "tkuldeep17", - "homepage": "https://www.drupal.org/user/2498278" - }, - { - "name": "voxpelli", - "homepage": "https://www.drupal.org/user/341713" - } - ], - "description": "Provides token-based name displays for users.", - "homepage": "https://www.drupal.org/project/realname", - "support": { - "source": "https://git.drupal.org/project/realname.git", - "issues": "https://www.drupal.org/project/issues/realname" - }, - "install-path": "../../web/modules/realname" - }, { "name": "drupal/rebuild_cache_access", "version": "1.7.0", diff --git a/vendor/composer/installed.php b/vendor/composer/installed.php index fa4f421335..6611728696 100644 --- a/vendor/composer/installed.php +++ b/vendor/composer/installed.php @@ -6,7 +6,7 @@ 'aliases' => array ( ), - 'reference' => 'ababbcc1bdd8b12bbd8d8bbc4ad5d6316607af68', + 'reference' => '2bf3b254e0ab09b0c9d5eb273e7597cfe10739d3', 'name' => 'osu-asc-webservices/d8-upstream', ), 'versions' => @@ -1543,15 +1543,6 @@ 0 => '8.9.16', ), ), - 'drupal/realname' => - array ( - 'pretty_version' => '1.0.0-rc2', - 'version' => '1.0.0.0-RC2', - 'aliases' => - array ( - ), - 'reference' => '8.x-1.0-rc2', - ), 'drupal/rebuild_cache_access' => array ( 'pretty_version' => '1.7.0', @@ -2263,7 +2254,7 @@ 'aliases' => array ( ), - 'reference' => 'ababbcc1bdd8b12bbd8d8bbc4ad5d6316607af68', + 'reference' => '2bf3b254e0ab09b0c9d5eb273e7597cfe10739d3', ), 'pantheon-systems/quicksilver-pushback' => array ( diff --git a/web/modules/realname/LICENSE.txt b/web/modules/realname/LICENSE.txt deleted file mode 100644 index d159169d10..0000000000 --- a/web/modules/realname/LICENSE.txt +++ /dev/null @@ -1,339 +0,0 @@ - GNU GENERAL PUBLIC LICENSE - Version 2, June 1991 - - Copyright (C) 1989, 1991 Free Software Foundation, Inc., - 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - Everyone is permitted to copy and distribute verbatim copies - of this license document, but changing it is not allowed. - - Preamble - - The licenses for most software are designed to take away your -freedom to share and change it. By contrast, the GNU General Public -License is intended to guarantee your freedom to share and change free -software--to make sure the software is free for all its users. This -General Public License applies to most of the Free Software -Foundation's software and to any other program whose authors commit to -using it. (Some other Free Software Foundation software is covered by -the GNU Lesser General Public License instead.) You can apply it to -your programs, too. - - 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 -this service 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. - - To protect your rights, we need to make restrictions that forbid -anyone to deny you these rights or to ask you to surrender the rights. -These restrictions translate to certain responsibilities for you if you -distribute copies of the software, or if you modify it. - - For example, if you distribute copies of such a program, whether -gratis or for a fee, you must give the recipients all the rights that -you have. 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. - - We protect your rights with two steps: (1) copyright the software, and -(2) offer you this license which gives you legal permission to copy, -distribute and/or modify the software. - - Also, for each author's protection and ours, we want to make certain -that everyone understands that there is no warranty for this free -software. If the software is modified by someone else and passed on, we -want its recipients to know that what they have is not the original, so -that any problems introduced by others will not reflect on the original -authors' reputations. - - Finally, any free program is threatened constantly by software -patents. We wish to avoid the danger that redistributors of a free -program will individually obtain patent licenses, in effect making the -program proprietary. To prevent this, we have made it clear that any -patent must be licensed for everyone's free use or not licensed at all. - - The precise terms and conditions for copying, distribution and -modification follow. - - GNU GENERAL PUBLIC LICENSE - TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION - - 0. This License applies to any program or other work which contains -a notice placed by the copyright holder saying it may be distributed -under the terms of this General Public License. The "Program", below, -refers to any such program or work, and a "work based on the Program" -means either the Program or any derivative work under copyright law: -that is to say, a work containing the Program or a portion of it, -either verbatim or with modifications and/or translated into another -language. (Hereinafter, translation is included without limitation in -the term "modification".) Each licensee is addressed as "you". - -Activities other than copying, distribution and modification are not -covered by this License; they are outside its scope. The act of -running the Program is not restricted, and the output from the Program -is covered only if its contents constitute a work based on the -Program (independent of having been made by running the Program). -Whether that is true depends on what the Program does. - - 1. You may copy and distribute 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 and disclaimer of warranty; keep intact all the -notices that refer to this License and to the absence of any warranty; -and give any other recipients of the Program a copy of this License -along with the Program. - -You may charge a fee for the physical act of transferring a copy, and -you may at your option offer warranty protection in exchange for a fee. - - 2. You may modify your copy or copies of the Program or any portion -of it, thus forming a work based on the Program, and copy and -distribute such modifications or work under the terms of Section 1 -above, provided that you also meet all of these conditions: - - a) You must cause the modified files to carry prominent notices - stating that you changed the files and the date of any change. - - b) You must cause any work that you distribute or publish, that in - whole or in part contains or is derived from the Program or any - part thereof, to be licensed as a whole at no charge to all third - parties under the terms of this License. - - c) If the modified program normally reads commands interactively - when run, you must cause it, when started running for such - interactive use in the most ordinary way, to print or display an - announcement including an appropriate copyright notice and a - notice that there is no warranty (or else, saying that you provide - a warranty) and that users may redistribute the program under - these conditions, and telling the user how to view a copy of this - License. (Exception: if the Program itself is interactive but - does not normally print such an announcement, your work based on - the Program is not required to print an announcement.) - -These requirements apply to the modified work as a whole. If -identifiable sections of that work are not derived from the Program, -and can be reasonably considered independent and separate works in -themselves, then this License, and its terms, do not apply to those -sections when you distribute them as separate works. But when you -distribute the same sections as part of a whole which is a work based -on the Program, the distribution of the whole must be on the terms of -this License, whose permissions for other licensees extend to the -entire whole, and thus to each and every part regardless of who wrote it. - -Thus, it is not the intent of this section to claim rights or contest -your rights to work written entirely by you; rather, the intent is to -exercise the right to control the distribution of derivative or -collective works based on the Program. - -In addition, mere aggregation of another work not based on the Program -with the Program (or with a work based on the Program) on a volume of -a storage or distribution medium does not bring the other work under -the scope of this License. - - 3. You may copy and distribute the Program (or a work based on it, -under Section 2) in object code or executable form under the terms of -Sections 1 and 2 above provided that you also do one of the following: - - a) Accompany it with the complete corresponding machine-readable - source code, which must be distributed under the terms of Sections - 1 and 2 above on a medium customarily used for software interchange; or, - - b) Accompany it with a written offer, valid for at least three - years, to give any third party, for a charge no more than your - cost of physically performing source distribution, a complete - machine-readable copy of the corresponding source code, to be - distributed under the terms of Sections 1 and 2 above on a medium - customarily used for software interchange; or, - - c) Accompany it with the information you received as to the offer - to distribute corresponding source code. (This alternative is - allowed only for noncommercial distribution and only if you - received the program in object code or executable form with such - an offer, in accord with Subsection b above.) - -The source code for a work means the preferred form of the work for -making modifications to it. For an executable work, complete source -code means all the source code for all modules it contains, plus any -associated interface definition files, plus the scripts used to -control compilation and installation of the executable. However, as a -special exception, the source code distributed need not include -anything that is normally distributed (in either source or binary -form) with the major components (compiler, kernel, and so on) of the -operating system on which the executable runs, unless that component -itself accompanies the executable. - -If distribution of executable or object code is made by offering -access to copy from a designated place, then offering equivalent -access to copy the source code from the same place counts as -distribution of the source code, even though third parties are not -compelled to copy the source along with the object code. - - 4. You may not copy, modify, sublicense, or distribute the Program -except as expressly provided under this License. Any attempt -otherwise to copy, modify, sublicense or distribute the Program is -void, and will automatically terminate your rights under this License. -However, parties who have received copies, or rights, from you under -this License will not have their licenses terminated so long as such -parties remain in full compliance. - - 5. You are not required to accept this License, since you have not -signed it. However, nothing else grants you permission to modify or -distribute the Program or its derivative works. These actions are -prohibited by law if you do not accept this License. Therefore, by -modifying or distributing the Program (or any work based on the -Program), you indicate your acceptance of this License to do so, and -all its terms and conditions for copying, distributing or modifying -the Program or works based on it. - - 6. Each time you redistribute the Program (or any work based on the -Program), the recipient automatically receives a license from the -original licensor to copy, distribute or modify the Program subject to -these terms and conditions. You may not impose any further -restrictions on the recipients' exercise of the rights granted herein. -You are not responsible for enforcing compliance by third parties to -this License. - - 7. If, as a consequence of a court judgment or allegation of patent -infringement or for any other reason (not limited to patent issues), -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 -distribute so as to satisfy simultaneously your obligations under this -License and any other pertinent obligations, then as a consequence you -may not distribute the Program at all. For example, if a patent -license would not permit royalty-free redistribution of the Program by -all those who receive copies directly or indirectly through you, then -the only way you could satisfy both it and this License would be to -refrain entirely from distribution of the Program. - -If any portion of this section is held invalid or unenforceable under -any particular circumstance, the balance of the section is intended to -apply and the section as a whole is intended to apply in other -circumstances. - -It is not the purpose of this section to induce you to infringe any -patents or other property right claims or to contest validity of any -such claims; this section has the sole purpose of protecting the -integrity of the free software distribution system, which is -implemented by public license practices. Many people have made -generous contributions to the wide range of software distributed -through that system in reliance on consistent application of that -system; it is up to the author/donor to decide if he or she is willing -to distribute software through any other system and a licensee cannot -impose that choice. - -This section is intended to make thoroughly clear what is believed to -be a consequence of the rest of this License. - - 8. If the distribution and/or use of the Program is restricted in -certain countries either by patents or by copyrighted interfaces, the -original copyright holder who places the Program under this License -may add an explicit geographical distribution limitation excluding -those countries, so that distribution is permitted only in or among -countries not thus excluded. In such case, this License incorporates -the limitation as if written in the body of this License. - - 9. The Free Software Foundation may publish revised and/or new versions -of the 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. - -Each version is given a distinguishing version number. If the Program -specifies a version number of this License which applies to it and "any -later version", you have the option of following the terms and conditions -either of that version or of any later version published by the Free -Software Foundation. If the Program does not specify a version number of -this License, you may choose any version ever published by the Free Software -Foundation. - - 10. If you wish to incorporate parts of the Program into other free -programs whose distribution conditions are different, write to the author -to ask for permission. For software which is copyrighted by the Free -Software Foundation, write to the Free Software Foundation; we sometimes -make exceptions for this. Our decision will be guided by the two goals -of preserving the free status of all derivatives of our free software and -of promoting the sharing and reuse of software generally. - - NO WARRANTY - - 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, 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. - - 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING -WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR -REDISTRIBUTE 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. - - END OF TERMS AND CONDITIONS - - How to Apply These Terms to Your New Programs - - If you develop a new program, and you want it to be of the greatest -possible use to the public, the best way to achieve this is to make it -free software which everyone can redistribute and change under these terms. - - To do so, attach the following notices to the program. It is safest -to attach them to the start of each source file to most effectively -convey the exclusion of warranty; and each file should have at least -the "copyright" line and a pointer to where the full notice is found. - - <one line to give the program's name and a brief idea of what it does.> - Copyright (C) <year> <name of author> - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License along - with this program; if not, write to the Free Software Foundation, Inc., - 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - -Also add information on how to contact you by electronic and paper mail. - -If the program is interactive, make it output a short notice like this -when it starts in an interactive mode: - - Gnomovision version 69, Copyright (C) year name of author - Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. - This is free software, and you are welcome to redistribute it - under certain conditions; type `show c' for details. - -The hypothetical commands `show w' and `show c' should show the appropriate -parts of the General Public License. Of course, the commands you use may -be called something other than `show w' and `show c'; they could even be -mouse-clicks or menu items--whatever suits your program. - -You should also get your employer (if you work as a programmer) or your -school, if any, to sign a "copyright disclaimer" for the program, if -necessary. Here is a sample; alter the names: - - Yoyodyne, Inc., hereby disclaims all copyright interest in the program - `Gnomovision' (which makes passes at compilers) written by James Hacker. - - <signature of Ty Coon>, 1 April 1989 - Ty Coon, President of Vice - -This General Public License does not permit incorporating your program into -proprietary programs. If your program is a subroutine library, you may -consider it more useful to permit linking proprietary applications with the -library. If this is what you want to do, use the GNU Lesser General -Public License instead of this License. diff --git a/web/modules/realname/README.txt b/web/modules/realname/README.txt deleted file mode 100644 index f23719d116..0000000000 --- a/web/modules/realname/README.txt +++ /dev/null @@ -1,55 +0,0 @@ -CONTENTS OF THIS FILE ---------------------- - -* Introduction -* Requirements -* Installation -* Configuration -* Maintainers - - -INTRODUCTION ------------- - -The Real name module allows the admin to choose fields from the user profile -that will be used to add a "realname" element (method) to a user object. -Hook_user is used to automatically add this to any user object that is loaded. - - -* For a full description of the module visit - https://www.drupal.org/project/realname. - -* To submit bug reports and feature suggestions, or to track changes visit - https://www.drupal.org/project/issues/realname. - - -REQUIREMENTS ------------- - -This module requires the following module: - - * Token - https://www.drupal.org/project/token - - -INSTALLATION ------------- - -Install the Real name module as you would normally install a contributed -Drupal module. Visit https://www.drupal.org/node/1897420 for further -information. - - -CONFIGURATION -------------- - -The settings page is at Administration >> Configuration >> People >> Real name. - -This pattern will be used to construct Realnames for all users. -Note that if the pattern is changed: all current Realnames will be deleted and -the list in the database will be rebuilt as needed. - - -MAINTAINERS ------------ - -* Alexander Hass (hass) - https://www.drupal.org/u/hass diff --git a/web/modules/realname/composer.json b/web/modules/realname/composer.json deleted file mode 100644 index 027764245d..0000000000 --- a/web/modules/realname/composer.json +++ /dev/null @@ -1,24 +0,0 @@ -{ - "name": "drupal/realname", - "description": "Provides token-based name displays for users.", - "type": "drupal-module", - "homepage": "https://www.drupal.org/project/realname", - "authors": [ - { - "name": "hass", - "homepage": "https://www.drupal.org/u/hass" - }, - { - "name": "See other contributors", - "homepage":"https://www.drupal.org/node/266280/committers" - } - ], - "support": { - "issues": "https://www.drupal.org/project/issues/realname", - "source": "https://git.drupal.org/project/realname.git" - }, - "license": "GPL-2.0+", - "require": { - "drupal/token": "^1.0.0-alpha2" - } -} diff --git a/web/modules/realname/config/install/realname.settings.yml b/web/modules/realname/config/install/realname.settings.yml deleted file mode 100644 index 9546e78dfa..0000000000 --- a/web/modules/realname/config/install/realname.settings.yml +++ /dev/null @@ -1 +0,0 @@ -pattern: '[user:account-name]' diff --git a/web/modules/realname/config/install/system.action.realname_update_realname_action.yml b/web/modules/realname/config/install/system.action.realname_update_realname_action.yml deleted file mode 100644 index d46fa3c1c3..0000000000 --- a/web/modules/realname/config/install/system.action.realname_update_realname_action.yml +++ /dev/null @@ -1,10 +0,0 @@ -langcode: en -status: true -dependencies: - module: - - user -id: realname_update_realname_action -label: 'Update real names of the selected user(s)' -type: user -plugin: realname_update_realname_action -configuration: { } diff --git a/web/modules/realname/config/schema/realname.schema.yml b/web/modules/realname/config/schema/realname.schema.yml deleted file mode 100644 index f28a9ad837..0000000000 --- a/web/modules/realname/config/schema/realname.schema.yml +++ /dev/null @@ -1,13 +0,0 @@ -# Schema for the configuration files of the realname module. - -realname.settings: - type: config_object - label: 'Realname settings' - mapping: - pattern: - type: string - label: 'Realname pattern' - -action.configuration.realname_update_realname_action: - type: action_configuration_default - label: 'Update real name' diff --git a/web/modules/realname/migrations/d6_realname_settings.yml b/web/modules/realname/migrations/d6_realname_settings.yml deleted file mode 100644 index a3326fbc3d..0000000000 --- a/web/modules/realname/migrations/d6_realname_settings.yml +++ /dev/null @@ -1,18 +0,0 @@ -id: d6_realname_settings -label: Realname 6 configuration -migration_tags: - - Drupal 6 - - Configuration -source: - plugin: variable - variables: - - realname_pattern - source_module: realname -process: - pattern: - plugin: realname_replace_token - source: - - realname_pattern -destination: - plugin: config - config_name: realname.settings diff --git a/web/modules/realname/migrations/d7_realname_settings.yml b/web/modules/realname/migrations/d7_realname_settings.yml deleted file mode 100644 index 6b11af74df..0000000000 --- a/web/modules/realname/migrations/d7_realname_settings.yml +++ /dev/null @@ -1,18 +0,0 @@ -id: d7_realname_settings -label: Realname 7 configuration -migration_tags: - - Drupal 7 - - Configuration -source: - plugin: variable - variables: - - realname_pattern - source_module: realname -process: - pattern: - plugin: realname_replace_token - source: - - realname_pattern -destination: - plugin: config - config_name: realname.settings diff --git a/web/modules/realname/realname.api.php b/web/modules/realname/realname.api.php deleted file mode 100644 index 09e813e57c..0000000000 --- a/web/modules/realname/realname.api.php +++ /dev/null @@ -1,58 +0,0 @@ -<?php - -/** - * @file - * Hooks provided by the Real name module. - */ - -/** - * @addtogroup hooks - * @{ - */ - -/** - * Alter the pattern for a user's real name prior to generation. - * - * @param string $pattern - * The real name pattern string prior to token replacement. - * @param object $account - * A user account object. - * - * @see realname_update() - * - * @ingroup realname - */ -function hook_realname_pattern_alter(&$pattern, $account) { - -} - -/** - * Alter a user's real name before it is saved to the database. - * - * @param string $realname - * The user's generated real name. - * @param object $account - * A user account object. - * - * @see realname_update() - * - * @ingroup realname - */ -function hook_realname_alter(&$realname, $account) { - -} - -/** - * Respond to updates to an account's real name. - * - * @see realname_update() - * - * @ingroup realname - */ -function hook_realname_update($realname, $account) { - -} - -/** - * @} End of "addtogroup hooks". - */ diff --git a/web/modules/realname/realname.info.yml b/web/modules/realname/realname.info.yml deleted file mode 100644 index e854609673..0000000000 --- a/web/modules/realname/realname.info.yml +++ /dev/null @@ -1,13 +0,0 @@ -name: 'Real name' -type: module -description: 'Provides token-based name displays for users.' -configure: realname.admin_settings_form -# core: 8.x -dependencies: - - token:token - -# Information added by Drupal.org packaging script on 2019-01-31 -version: '8.x-1.0-rc2' -core: '8.x' -project: 'realname' -datestamp: 1548970384 diff --git a/web/modules/realname/realname.install b/web/modules/realname/realname.install deleted file mode 100644 index 0fa66a5a66..0000000000 --- a/web/modules/realname/realname.install +++ /dev/null @@ -1,50 +0,0 @@ -<?php - -/** - * @file - * Installation file for Realname module. - */ - -/** - * Implements hook_schema(). - */ -function realname_schema() { - $schema['realname'] = [ - 'description' => 'Computed Real Names to reduce overhead.', - 'fields' => [ - 'uid' => [ - 'description' => 'User ID, links to User table.', - 'type' => 'int', - 'unsigned' => TRUE, - 'not null' => TRUE, - 'default' => 0, - ], - 'realname' => [ - 'description' => 'The generated real name of the user.', - 'type' => 'varchar', - 'length' => 255, - 'not null' => TRUE, - 'default' => '', - ], - 'created' => [ - 'description' => 'The UNIX timestamp of when the real name was created.', - 'type' => 'int', - 'unsigned' => TRUE, - 'not null' => TRUE, - 'default' => 0, - ], - ], - 'primary key' => ['uid'], - 'indexes' => [ - 'realname' => ['realname'], - ], - 'foreign keys' => [ - 'users' => [ - 'table' => 'users', - 'columns' => ['uid' => 'uid'], - ], - ], - ]; - - return $schema; -} diff --git a/web/modules/realname/realname.links.menu.yml b/web/modules/realname/realname.links.menu.yml deleted file mode 100644 index 6430d3793e..0000000000 --- a/web/modules/realname/realname.links.menu.yml +++ /dev/null @@ -1,5 +0,0 @@ -realname.admin_settings_form: - title: 'Real name' - parent: user.admin_index - description: 'Use tokens to configure how user names are displayed.' - route_name: realname.admin_settings_form diff --git a/web/modules/realname/realname.links.task.yml b/web/modules/realname/realname.links.task.yml deleted file mode 100644 index 8e0d6cb649..0000000000 --- a/web/modules/realname/realname.links.task.yml +++ /dev/null @@ -1,4 +0,0 @@ -realname.admin_settings_form_tab: - route_name: realname.admin_settings_form - title: 'Real name' - base_route: entity.user.admin_form diff --git a/web/modules/realname/realname.module b/web/modules/realname/realname.module deleted file mode 100644 index e4982f84cd..0000000000 --- a/web/modules/realname/realname.module +++ /dev/null @@ -1,289 +0,0 @@ -<?php - -/** - * @file - * Provides token-based name displays for users. - * - * @todo Add a 'view realname' permission enabled by default - * @todo Allow users to login with their real name - * @todo Disable the username field - */ - -use Drupal\Component\Utility\Html; -use Drupal\Component\Utility\Unicode; -use Drupal\Core\Entity\Display\EntityViewDisplayInterface; -use Drupal\Core\Entity\EntityInterface; -use Drupal\Core\Link; -use Drupal\Core\Routing\RouteMatchInterface; -use Drupal\Core\Url; -use Drupal\user\Entity\User; - -/** - * @defgroup realname Real name API - */ - -/** - * Implements hook_help(). - */ -function realname_help($route_name, RouteMatchInterface $route_match) { - switch ($route_name) { - // Main module help for the Realname module. - case 'realname.admin_settings_form': - case 'help.page.realname': - return '<p>' . t("A Real Name is what the site developer decides that users' names should look like. It is constructed from various tokens that are available within the site.") . '</p>'; - } -} - -/** - * Implements hook_entity_extra_field_info(). - */ -function realname_entity_extra_field_info() { - $fields['user']['user']['display']['realname'] = [ - 'label' => t('Real name'), - 'description' => t('Real name'), - 'weight' => -1, - 'visible' => FALSE, - ]; - - return $fields; -} - -/** - * Implements hook_user_format_name_alter(). - */ -function realname_user_format_name_alter(&$name, $account) { - static $in_username_alter = FALSE; - $uid = $account->id(); - - // Don't alter anonymous users or objects that do not have any user ID. - if (empty($uid)) { - return; - } - - // Real name was loaded/generated via hook_user_load(), so re-use it. - if (isset($account->realname)) { - if (Unicode::strlen($account->realname)) { - // Only if the real name is a non-empty string is $name actually altered. - $name = $account->realname; - } - return; - } - - // Real name was not yet available for the account so we need to generate it. - // Because tokens may call format_username() we need to prevent recursion. - if (!$in_username_alter) { - $in_username_alter = TRUE; - - // If $account->realname was undefined, then the user account object was - // not properly loaded. We must enforce calling user_load(). - if ($realname_account = User::load($uid)) { - realname_user_format_name_alter($name, $realname_account); - } - - $in_username_alter = FALSE; - } -} - -/** - * Implements hook_ENTITY_TYPE_load(). - */ -function realname_user_load(array $accounts) { - $realnames = realname_load_multiple($accounts); - foreach ($realnames as $uid => $realname) { - $accounts[$uid]->realname = $realname; - } -} - -/** - * Implements hook_ENTITY_TYPE_update(). - */ -function realname_user_update(EntityInterface $account) { - // Since user data may have changed, update the realname and its cache. - $realnames = &drupal_static('realname_load_multiple', []); - $realnames[$account->id()] = realname_update($account); -} - -/** - * Implements hook_ENTITY_TYPE_delete(). - */ -function realname_user_delete(EntityInterface $account) { - realname_delete($account->id()); -} - -/** - * Implements hook_ENTITY_TYPE_view() for user entities. - */ -function realname_user_view(array &$build, EntityInterface $account, EntityViewDisplayInterface $display, $view_mode) { - if ($display->getComponent('realname')) { - if ($account->access('view')) { - $url = Url::fromRoute('entity.user.canonical', ['user' => $account->id()]); - $markup = Link::fromTextAndUrl($account->realname, $url)->toString(); - } - else { - $markup = Html::escape($account->realname); - } - - $build['realname'] = [ - '#theme' => 'field', - '#title' => t('Real name'), - '#label_display' => 'inline', - '#view_mode' => '_custom', - '#field_name' => 'realname', - '#field_type' => 'text', - '#field_translatable' => FALSE, - '#entity_type' => 'custom', - '#bundle' => 'custom', - '#object' => $account, - '#items' => [TRUE], - '#is_multiple' => FALSE, - 0 => [ - '#markup' => $markup, - ], - ]; - } -} - -/** - * @addtogroup realname - * @{ - */ - -/** - * Loads a real name. - * - * @param Drupal\user\Entity\User $account - * A user account object. - * - * @return mixed - * The user's generated real name. - */ -function realname_load(User $account) { - $realnames = realname_load_multiple([$account->id() => $account]); - return reset($realnames); -} - -/** - * Loads multiple real names. - * - * @param array $accounts - * An array of user account objects keyed by user ID. - * - * @return array - * An array of real names keyed by user ID. - */ -function realname_load_multiple(array $accounts) { - $realnames = &drupal_static(__FUNCTION__, []); - - if ($new_accounts = array_diff_key($accounts, $realnames)) { - // Attempt to fetch realnames from the database first. - $realnames += \Drupal::database()->query("SELECT uid, realname FROM {realname} WHERE uid IN (:uids[])", [':uids[]' => array_keys($new_accounts)])->fetchAllKeyed(); - - // For each account that was not present in the database, generate its - // real name. - foreach ($new_accounts as $uid => $account) { - if (!isset($realnames[$uid])) { - $realnames[$uid] = realname_update($account); - } - } - } - - return array_intersect_key($realnames, $accounts); -} - -/** - * Update the realname for a user account. - * - * @param Drupal\user\Entity\User $account - * A user account object. - * - * @return string - * A string with the real name. - * - * @see hook_realname_pattern_alter() - * @see hook_realname_alter() - * @see hook_realname_update() - */ -function realname_update(User $account) { - $realname = ''; - - if (!$account->isAnonymous()) { - // Get the default pattern and allow other modules to alter it. - $config = \Drupal::config('realname.settings'); - $pattern = $config->get('pattern'); - \Drupal::moduleHandler()->alter('realname_pattern', $pattern, $account); - - // Perform token replacement on the real name pattern. - $realname = \Drupal::token()->replace($pattern, ['user' => $account], ['clear' => TRUE, 'sanitize' => FALSE]); - - // Remove any HTML tags. - $realname = strip_tags(Html::decodeEntities($realname)); - - // Remove double spaces (if a token had no value). - $realname = preg_replace('/ {2,}/', ' ', $realname); - - // Allow other modules to alter the generated realname. - \Drupal::moduleHandler()->alter('realname', $realname, $account); - - // The name must be trimmed to 255 characters before inserting into the - // database. - $realname = Unicode::truncate(trim($realname), 255); - } - else { - // DisplayName cannot generated with tokens for anonymous users. - $realname = $account->label(); - } - - // Save to the database and the static cache. - \Drupal::database()->merge('realname') - ->key(['uid' => $account->id()]) - ->fields([ - 'realname' => $realname, - 'created' => \Drupal::time()->getRequestTime(), - ]) - ->execute(); - - // Allow modules to react to the realname being updated. - \Drupal::moduleHandler()->invokeAll('realname_update', [$realname, $account]); - - // Clear the entity cache. - /** @var \Drupal\user\UserStorageInterface $user_storage */ - $user_storage = \Drupal::getContainer()->get('entity.manager')->getStorage('user'); - $user_storage->resetCache([$account->id()]); - - return $realname; -} - -/** - * Delete a real name. - * - * @param int $uid - * A user ID. - */ -function realname_delete($uid) { - return realname_delete_multiple([$uid]); -} - -/** - * Delete multiple real names. - * - * @param array $uids - * An array of user IDs. - */ -function realname_delete_multiple(array $uids) { - \Drupal::database()->delete('realname')->condition('uid', $uids, 'IN')->execute(); - drupal_static_reset('realname_load_multiple'); - \Drupal::entityTypeManager()->getStorage('user')->resetCache($uids); -} - -/** - * Delete all real names. - */ -function realname_delete_all() { - \Drupal::database()->truncate('realname')->execute(); - drupal_static_reset('realname_load_multiple'); - \Drupal::entityTypeManager()->getStorage('user')->resetCache(); -} - -/** - * @} End of "addtogroup realname". - */ diff --git a/web/modules/realname/realname.permissions.yml b/web/modules/realname/realname.permissions.yml deleted file mode 100644 index 6d93be6c8e..0000000000 --- a/web/modules/realname/realname.permissions.yml +++ /dev/null @@ -1,3 +0,0 @@ -administer realname: - title: 'Administer Real Name' - description: 'Allows users to administer realname settings.' diff --git a/web/modules/realname/realname.routing.yml b/web/modules/realname/realname.routing.yml deleted file mode 100644 index c65b1e6468..0000000000 --- a/web/modules/realname/realname.routing.yml +++ /dev/null @@ -1,7 +0,0 @@ -realname.admin_settings_form: - path: '/admin/config/people/realname' - defaults: - _form: 'Drupal\realname\Form\RealnameAdminSettingsForm' - _title: 'Real name' - requirements: - _permission: 'administer realname' diff --git a/web/modules/realname/realname.services.yml b/web/modules/realname/realname.services.yml deleted file mode 100644 index cf4fe9bb13..0000000000 --- a/web/modules/realname/realname.services.yml +++ /dev/null @@ -1,11 +0,0 @@ -services: - realname.config_cache_tag: - class: Drupal\realname\EventSubscriber\ConfigCacheTag - arguments: ['@cache_tags.invalidator'] - tags: - - { name: event_subscriber } - - realname.route.subscriber: - class: Drupal\realname\Routing\RealnameRouteSubscriber - tags: - - { name: event_subscriber } diff --git a/web/modules/realname/realname.views.inc b/web/modules/realname/realname.views.inc deleted file mode 100644 index a4af06a930..0000000000 --- a/web/modules/realname/realname.views.inc +++ /dev/null @@ -1,41 +0,0 @@ -<?php - -/** - * @file - * Views integration for the realname module. - */ - -/** - * Implements hook_views_data(). - */ -function realname_views_data() { - $data['realname']['table']['group'] = t('Realname'); - $data['realname']['table']['join'] = [ - 'users' => [ - 'left_field' => 'uid', - 'field' => 'uid', - ], - ]; - - $data['realname']['realname'] = [ - 'title' => t('Real name'), - 'help' => t("The user's real name."), - 'field' => [ - 'handler' => 'views_handler_field_user', - 'click sortable' => TRUE, - ], - 'sort' => [ - 'handler' => 'views_handler_sort', - ], - 'argument' => [ - 'handler' => 'views_handler_argument_string', - ], - 'filter' => [ - 'handler' => 'views_handler_filter_string', - 'title' => t('Name'), - 'help' => t("The user's real name. This filter does not check if the user exists and allows partial matching. Does not utilize autocomplete."), - ], - ]; - - return $data; -} diff --git a/web/modules/realname/src/Controller/RealnameAutocompleteController.php b/web/modules/realname/src/Controller/RealnameAutocompleteController.php deleted file mode 100644 index fd536d53d5..0000000000 --- a/web/modules/realname/src/Controller/RealnameAutocompleteController.php +++ /dev/null @@ -1,107 +0,0 @@ -<?php - -namespace Drupal\realname\Controller; - -use Drupal\system\Controller\EntityAutocompleteController; -use Drupal\Component\Utility\Crypt; -use Drupal\Component\Utility\Tags; -use Drupal\Component\Utility\Unicode; -use Drupal\Core\Database\Query\Condition; -use Drupal\Core\Site\Settings; -use Drupal\user\Entity\User; -use Symfony\Component\HttpFoundation\JsonResponse; -use Symfony\Component\HttpFoundation\Request; -use Symfony\Component\HttpKernel\Exception\AccessDeniedHttpException; - -/** - * Defines a route controller for entity autocomplete form elements. - */ -class RealnameAutocompleteController extends EntityAutocompleteController { - - /** - * {@inheritdoc} - */ - public function handleAutocomplete(Request $request, $target_type, $selection_handler, $selection_settings_key) { - if ($target_type != 'user') { - return parent::handleAutocomplete($request, $target_type, $selection_handler, $selection_settings_key); - } - - $matches = []; - if ($input = $request->query->get('q')) { - $typed_string = Tags::explode($input); - $typed_string = Unicode::strtolower(array_pop($typed_string)); - $selection_settings = $this->keyValue->get($selection_settings_key, FALSE); - if ($selection_settings !== FALSE) { - $selection_settings_hash = Crypt::hmacBase64(serialize($selection_settings) . $target_type . $selection_handler, Settings::getHashSalt()); - if ($selection_settings_hash !== $selection_settings_key) { - throw new AccessDeniedHttpException('Invalid selection settings key.'); - } - } - else { - throw new AccessDeniedHttpException(); - } - - $matches = $this->getMatches($selection_settings, $typed_string); - } - - return new JsonResponse($matches); - } - - /** - * Gets matched labels based on a given search string. - * - * @param array $selection_settings - * An array of settings that will be passed to the selection handler. - * @param string $string - * (optional) The label of the entity to query by. - * - * @return array - * An array of matched entity labels, in the format required by the AJAX - * autocomplete API (e.g. array('value' => $value, 'label' => $label)). - * - * @throws \Symfony\Component\HttpKernel\Exception\AccessDeniedHttpException - * Thrown when the current user doesn't have access to the specified entity. - */ - protected function getMatches($selection_settings, $string = '') { - $matches = []; - - if (isset($string)) { - // Get an array of matching entities. - $match_operator = !empty($selection_settings['match_operator']) ? $selection_settings['match_operator'] : 'CONTAINS'; - $include_anonymous = isset($selection_settings['include_anonymous']) ? $selection_settings['include_anonymous'] : TRUE; - - $connection = \Drupal::database(); - $query = $connection->select('users_field_data', 'u'); - $query->fields('u', ['uid']); - $query->leftJoin('realname', 'rn', 'u.uid = rn.uid'); - if ($match_operator == 'CONTAINS') { - $query->condition((new Condition('OR')) - ->condition('rn.realname', '%' . $connection->escapeLike($string) . '%', 'LIKE') - ->condition('u.name', '%' . $connection->escapeLike($string) . '%', 'LIKE') - ); - } - else { - $query->condition((new Condition('OR')) - ->condition('rn.realname', $connection->escapeLike($string) . '%', 'LIKE') - ->condition('u.name', $connection->escapeLike($string) . '%', 'LIKE') - ); - } - if ($include_anonymous == FALSE) { - $query->condition('u.uid', 0, '>'); - } - $query->range(0, 10); - $uids = $query->execute()->fetchCol(); - $accounts = User::loadMultiple($uids); - - /* @var $account User */ - foreach ($accounts as $account) { - $matches[] = [ - 'value' => t('@realname (@id)', ['@realname' => $account->getDisplayName(), '@id' => $account->id()]), - 'label' => t('@realname (@username)', ['@realname' => $account->getDisplayName(), '@username' => $account->getAccountName()]), - ]; - } - } - return $matches; - } - -} diff --git a/web/modules/realname/src/EventSubscriber/ConfigCacheTag.php b/web/modules/realname/src/EventSubscriber/ConfigCacheTag.php deleted file mode 100644 index a3144fcdb9..0000000000 --- a/web/modules/realname/src/EventSubscriber/ConfigCacheTag.php +++ /dev/null @@ -1,58 +0,0 @@ -<?php - -namespace Drupal\realname\EventSubscriber; - -use Drupal\Core\Cache\CacheTagsInvalidatorInterface; -use Drupal\Core\Config\ConfigCrudEvent; -use Drupal\Core\Config\ConfigEvents; -use Symfony\Component\EventDispatcher\EventSubscriberInterface; - -/** - * A subscriber invalidating cache tags when realname config objects are saved. - */ -class ConfigCacheTag implements EventSubscriberInterface { - - /** - * The cache tags invalidator. - * - * @var \Drupal\Core\Cache\CacheTagsInvalidatorInterface - */ - protected $cacheTagsInvalidator; - - /** - * Constructs a RealnameCacheTag object. - * - * @param \Drupal\Core\Cache\CacheTagsInvalidatorInterface $cache_tags_invalidator - * The cache tags invalidator. - */ - public function __construct(CacheTagsInvalidatorInterface $cache_tags_invalidator) { - $this->cacheTagsInvalidator = $cache_tags_invalidator; - } - - /** - * Invalidate cache tags when particular realname config objects are saved. - * - * @param \Drupal\Core\Config\ConfigCrudEvent $event - * The Event to process. - */ - public function onSave(ConfigCrudEvent $event) { - // Check if realname settings object has been changed. - if ($event->getConfig()->getName() === 'realname.settings') { - // Clear the realname cache if the pattern was changed. - realname_delete_all(); - - // A change to the display-name pattern must invalidate the render cache - // since the display-name could be used anywhere. - $this->cacheTagsInvalidator->invalidateTags(['rendered']); - } - } - - /** - * {@inheritdoc} - */ - public static function getSubscribedEvents() { - $events[ConfigEvents::SAVE][] = ['onSave']; - return $events; - } - -} diff --git a/web/modules/realname/src/Form/RealnameAdminSettingsForm.php b/web/modules/realname/src/Form/RealnameAdminSettingsForm.php deleted file mode 100644 index d8c9a7e9d9..0000000000 --- a/web/modules/realname/src/Form/RealnameAdminSettingsForm.php +++ /dev/null @@ -1,95 +0,0 @@ -<?php - -namespace Drupal\realname\Form; - -use Drupal\Core\Form\ConfigFormBase; -use Drupal\Core\Form\FormStateInterface; - -/** - * Configure Realname settings for this site. - */ -class RealnameAdminSettingsForm extends ConfigFormBase { - - /** - * {@inheritdoc} - */ - public function getFormId() { - return 'realname_admin_settings'; - } - - /** - * {@inheritdoc} - */ - protected function getEditableConfigNames() { - return ['realname.settings']; - } - - /** - * {@inheritdoc} - */ - public function buildForm(array $form, FormStateInterface $form_state) { - $config = $this->config('realname.settings'); - - $form['general'] = [ - '#type' => 'fieldset', - '#title' => $this->t('General settings'), - ]; - - $note = '<div>'; - $note .= $this->t('Note that if it is changed, all current Realnames will be deleted and the list in the database will be rebuilt as needed.'); - $note .= '</div>'; - - $form['general']['realname_pattern'] = [ - '#type' => 'textfield', - '#title' => $this->t('Realname pattern'), - '#default_value' => $config->get('pattern'), - '#element_validate' => ['token_element_validate'], - '#token_types' => ['user'], - '#min_tokens' => 1, - '#required' => TRUE, - '#maxlength' => 256, - '#description' => $this->t('This pattern will be used to construct Realnames for all users.') . $note, - ]; - // Add the token tree UI. - $form['general']['token_help'] = [ - '#theme' => 'token_tree_link', - '#token_types' => ['user'], - '#global_types' => FALSE, - ]; - - return parent::buildForm($form, $form_state); - } - - /** - * {@inheritdoc} - */ - public function validateForm(array &$form, FormStateInterface $form_state) { - parent::validateForm($form, $form_state); - - $pattern = $form_state->getValue('realname_pattern'); - - // Tokens that will cause recursion. - $tokens = [ - '[user:name]', - ]; - foreach ($tokens as $token) { - if (strpos($pattern, $token) !== FALSE) { - $form_state->setErrorByName('realname_pattern', $this->t('The %token token cannot be used as it will cause recursion.', ['%token' => $token])); - } - } - } - - /** - * {@inheritdoc} - */ - public function submitForm(array &$form, FormStateInterface $form_state) { - $config = $this->config('realname.settings'); - - if ($form['general']['realname_pattern']['#default_value'] != $form_state->getValue('realname_pattern')) { - $config->set('pattern', $form_state->getValue('realname_pattern'))->save(); - } - - parent::submitForm($form, $form_state); - } - -} diff --git a/web/modules/realname/src/Plugin/Action/RealnameUpdateRealname.php b/web/modules/realname/src/Plugin/Action/RealnameUpdateRealname.php deleted file mode 100644 index ec0d7e2716..0000000000 --- a/web/modules/realname/src/Plugin/Action/RealnameUpdateRealname.php +++ /dev/null @@ -1,37 +0,0 @@ -<?php - -namespace Drupal\realname\Plugin\Action; - -use Drupal\Core\Action\ActionBase; -use Drupal\Core\Session\AccountInterface; - -/** - * Update user real name. - * - * @Action( - * id = "realname_update_realname_action", - * label = @Translation("Update real name"), - * type = "user" - * ) - */ -class RealnameUpdateRealname extends ActionBase { - - /** - * {@inheritdoc} - */ - public function execute($account = NULL) { - realname_update($account); - } - - /** - * {@inheritdoc} - */ - public function access($object, AccountInterface $account = NULL, $return_as_object = FALSE) { - /** @var \Drupal\user\UserInterface $object */ - $access = $object->status->access('edit', $account, TRUE) - ->andIf($object->access('update', $account, TRUE)); - - return $return_as_object ? $access : $access->isAllowed(); - } - -} diff --git a/web/modules/realname/src/Plugin/migrate/process/RealnameReplaceToken.php b/web/modules/realname/src/Plugin/migrate/process/RealnameReplaceToken.php deleted file mode 100644 index f800f1dab0..0000000000 --- a/web/modules/realname/src/Plugin/migrate/process/RealnameReplaceToken.php +++ /dev/null @@ -1,33 +0,0 @@ -<?php - -namespace Drupal\realname\Plugin\migrate\process; - -use Drupal\migrate\ProcessPluginBase; -use Drupal\migrate\MigrateExecutableInterface; -use Drupal\migrate\Row; - -/** - * If the source evaluates to empty, we skip the current row. - * - * @MigrateProcessPlugin( - * id = "realname_replace_token", - * handle_multiples = TRUE - * ) - */ -class RealnameReplaceToken extends ProcessPluginBase { - - /** - * {@inheritdoc} - */ - public function transform($value, MigrateExecutableInterface $migrate_executable, Row $row, $destination_property) { - list($realname_pattern) = $value; - - // Previous D7 realname token need to be replaced by D8 core token. - // - // At least two tokens may exists: - // - [user:name-raw] - // - [current-user:name-raw] - return str_ireplace(':name-raw]', ':account-name]', $realname_pattern); - } - -} diff --git a/web/modules/realname/src/Routing/RealnameRouteSubscriber.php b/web/modules/realname/src/Routing/RealnameRouteSubscriber.php deleted file mode 100644 index fe927de956..0000000000 --- a/web/modules/realname/src/Routing/RealnameRouteSubscriber.php +++ /dev/null @@ -1,20 +0,0 @@ -<?php - -namespace Drupal\realname\Routing; - -use Drupal\Core\Routing\RouteSubscriberBase; -use Symfony\Component\Routing\RouteCollection; - -/** - * Subscriber for routes. - */ -class RealnameRouteSubscriber extends RouteSubscriberBase { - /** - * {@inheritdoc} - */ - protected function alterRoutes(RouteCollection $collection) { - if ($route = $collection->get('system.entity_autocomplete')) { - $route->setDefault('_controller', '\Drupal\realname\Controller\RealnameAutocompleteController::handleAutocomplete'); - } - } -} diff --git a/web/modules/realname/src/Tests/RealnameBasicTest.php b/web/modules/realname/src/Tests/RealnameBasicTest.php deleted file mode 100644 index 7a0400c4af..0000000000 --- a/web/modules/realname/src/Tests/RealnameBasicTest.php +++ /dev/null @@ -1,150 +0,0 @@ -<?php - -namespace Drupal\realname\Tests; - -use Drupal\simpletest\WebTestBase; -use Drupal\user\Entity\User; - -/** - * Test basic functionality of Realname module. - * - * @group Realname - */ -class RealnameBasicTest extends WebTestBase { - - /** - * {@inheritdoc} - */ - public static $modules = [ - 'realname', - 'field_ui', - ]; - - /** - * {@inheritdoc} - */ - protected function setUp() { - parent::setUp(); - - $permissions = [ - 'access administration pages', - 'administer modules', - 'administer realname', - 'administer site configuration', - 'administer user fields', - 'administer user form display', - 'administer user display', - 'administer users', - ]; - - // User to set up realname. - $this->admin_user = $this->drupalCreateUser($permissions); - $this->drupalLogin($this->admin_user); - } - - /** - * Test realname configuration. - */ - public function testRealnameConfiguration() { - // Check if Configure link is available on 'Modules' page. - // Requires 'administer modules' permission. - $this->drupalGet('admin/modules'); - $this->assertRaw('admin/config/people/realname', '[testRealnameConfiguration]: Configure link from Modules page to Realname settings page exists.'); - - // Check for setting page's presence. - $this->drupalGet('admin/config/people/realname'); - $this->assertRaw(t('Realname pattern'), '[testRealnameConfiguration]: Settings page displayed.'); - - // Save form with allowed token. - $edit['realname_pattern'] = '[user:account-name]'; - $this->drupalPostForm('admin/config/people/realname', $edit, t('Save configuration')); - $this->assertRaw(t('The configuration options have been saved.'), '[testRealnameConfiguration]: Settings form has been saved.'); - - // Check token recursion protection. - $edit['realname_pattern'] = '[user:name]'; - $this->drupalPostForm('admin/config/people/realname', $edit, t('Save configuration')); - $this->assertRaw(t('The %token token cannot be used as it will cause recursion.', ['%token' => '[user:name]']), '[testRealnameConfiguration]: Invalid token found.'); - } - - /** - * Test realname alter functions. - */ - public function testRealnameUsernameAlter() { - // Add a test string and see if core username has been replaced by realname. - $edit['realname_pattern'] = '[user:account-name] (UID: [user:uid])'; - $this->drupalPostForm('admin/config/people/realname', $edit, t('Save configuration')); - - $this->drupalGet('user/' . $this->admin_user->id()); - // @ @FIXME: Needs patch https://www.drupal.org/node/2629286 - // $this->assertRaw($this->admin_user->getDisplayName(), '[testRealnameUsernameAlter]: Real name shown on user page.'); - - $this->drupalGet('user/' . $this->admin_user->id() . '/edit'); - // @FIXME: Needs patch https://www.drupal.org/node/2629286 - // $this->assertRaw($this->admin_user->getDisplayName(), '[testRealnameUsernameAlter]: Real name shown on user edit page.'); - - /** @var \Drupal\user\entity\User $user_account */ - $user_account = $this->admin_user; - $username_before = $user_account->getAccountName(); - $user_account->save(); - $username_after = $user_account->getAccountName(); - $this->assertEqual($username_before, $username_after, 'Username did not change after save'); - } - - /** - * Test realname display configuration. - */ - public function testRealnameManageDisplay() { - $edit['realname_pattern'] = '[user:account-name]'; - $this->drupalPostForm('admin/config/people/realname', $edit, t('Save configuration')); - - $this->drupalGet('admin/config/people/accounts/fields'); - $this->assertTitle('Manage fields | Drupal'); - $this->assertNoRaw('Real name', '[testRealnameManageDisplay]: Real name field not shown in manage fields list.'); - - $this->drupalGet('admin/config/people/accounts/form-display'); - $this->assertTitle('Manage form display | Drupal'); - $this->assertNoRaw('Real name', '[testRealnameManageDisplay]: Real name field not shown in manage form display list.'); - - $this->drupalGet('admin/config/people/accounts/display'); - $this->assertTitle('Manage display | Drupal'); - $this->assertRaw('Real name', '[testRealnameManageDisplay]: Real name field shown in manage display.'); - - // By default the realname field is not visible. - $this->drupalGet('user/' . $this->admin_user->id()); - $this->assertNoText('Real name', '[testRealnameManageDisplay]: Real name field not visible on user page.'); - - // Make realname field visible on user page. - $this->drupalGet('admin/config/people/accounts/display'); - $edit = ['fields[realname][region]' => 'content']; - $this->drupalPostForm(NULL, $edit, t('Save')); - $this->assertResponse(200); - - $this->drupalGet('user/' . $this->admin_user->id()); - $this->assertText('Real name', '[testRealnameManageDisplay]: Real name field visible on user page.'); - } - - /** - * Test realname user update. - */ - public function testRealnameUserUpdate() { - $edit['realname_pattern'] = '[user:account-name]'; - $this->drupalPostForm('admin/config/people/realname', $edit, t('Save configuration')); - - $user1 = User::load($this->admin_user->id()); - $realname1 = $user1->realname; - - // Update user name. - $user1->name = $this->randomMachineName(); - $user1->save(); - - // Reload the user. - $user2 = User::load($this->admin_user->id()); - $realname2 = $user2->realname; - - // Check if realname changed. - $this->assertTrue($realname1); - $this->assertTrue($realname2); - $this->assertNotEqual($realname1, $realname2, '[testRealnameUserUpdate]: Real name changed.'); - } - -} -- GitLab