You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Evidently I misunderstood the force_api_session part. Not setting anything and having the default 0 (false) being used actually avoids the password confirmation.
Similar to the web UI a
user:invite
command would be useful to trigger the regular user invitation workflow from the console.This way no password must be set for a new user in advance, this should be left to the user in case he accepts the invitation.
Technically
Piwik\Plugins\UsersManager\API::inviteUser()
exists for this very purpose. Unfortunately there are 1-2 caveats with this API:force_api_session
:https://github.com/matomo-org/matomo/blob/5.1.2/plugins/UsersManager/API.php#L789
https://github.com/matomo-org/matomo/blob/5.1.2/plugins/UsersManager/API.php#L790
This among others calls
Piwik::doesUserRequirePasswordConfirmation()
:https://github.com/matomo-org/matomo/blob/5.1.2/core/Piwik.php#L297
Slightly hack-ish but probably the easiest workaround for now would be setting
$_GET['force_api_session'] = 1;
before calling::inviteUser()
:https://github.com/matomo-org/matomo/blob/5.1.2/plugins/UsersManager/tests/Integration/APITest.php#L1128
The text was updated successfully, but these errors were encountered: