(REF) CMSUser::create - Rename misleading parameter
authorTim Otten <totten@civicrm.org>
Sun, 16 Jul 2023 04:36:16 +0000 (21:36 -0700)
committerTim Otten <totten@civicrm.org>
Sun, 16 Jul 2023 04:54:22 +0000 (21:54 -0700)
commit86b79fe8146489ee7be7ff61d7aae0db3566571b
treea74143e169a8da31333c9d5d24ff1eb76cc1d6bf
parentd5ac84d5e216a2bf37e9fc490be2ec428b843400
(REF) CMSUser::create - Rename misleading parameter

The second parameter is very confusing:

* The name `$mail` suggests that the parameter is an email address.
* The parameter `$mail` actually contains the name of the *field* which has the email address.

This is a weird contract. It invites misinterpretation -- and now, e.g., some of the `Standalone`
code has misused it.

To confirm that `$mail` is actually the parameter-name, note that:

1. `create()` actually looks for `$params[$mail]`
2. Callers like `CRM/Contact/Form/Task/Useradd.php` actually give a parameter name
CRM/Core/BAO/CMSUser.php
CRM/Utils/System/Backdrop.php
CRM/Utils/System/Base.php
CRM/Utils/System/Drupal.php
CRM/Utils/System/Drupal8.php
CRM/Utils/System/Joomla.php
CRM/Utils/System/Standalone.php
CRM/Utils/System/WordPress.php