Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot clear email address from provisioning API or occ command #37424

Closed
phil-davis opened this issue May 21, 2020 · 3 comments
Closed

Cannot clear email address from provisioning API or occ command #37424

phil-davis opened this issue May 21, 2020 · 3 comments

Comments

@phil-davis
Copy link
Contributor

Steps to reproduce

  1. create a user account, e.g. phil
  2. set an email address, e.g. with the provisioning API:
$ curl -X PUT http://phil:[email protected]:8080/ocs/v2.php/cloud/users/phil -d key="email" -d value="[email protected]"
<?xml version="1.0"?>
<ocs>
 <meta>
  <status>ok</status>
  <statuscode>200</statuscode>
  <message/>
 </meta>
 <data/>
</ocs>
$ php occ user:list -a email
  - admin: 
  - phil: [email protected]

  1. try to remove the email address:
curl -X PUT http://phil:[email protected]:8080/ocs/v2.php/cloud/users/phil -d key="email" -d value=""
<?xml version="1.0"?>
<ocs>
 <meta>
  <status>failure</status>
  <statuscode>400</statuscode>
  <message/>
 </meta>
 <data/>
</ocs>

Similarly with occ commands:

$ php occ user:modify phil email "[email protected]"
The email address of phil updated to [email protected]
$ php occ user:list -a email
  - admin: 
  - phil: [email protected]
$ php occ user:modify phil email ""
The value cannot be empty

Expected behaviour

There should be some way to clear the email address using the Provisioning API and an occ command.

Actual behaviour

Errors as above when trying to specify the empty string as the email address.

Server configuration

Current git core master on Ubuntu 18.04

Note:

  1. In the webUI settings, personal, general you can clear and save an empty email address. That calls some other private endpoint.
  2. For displayname it works - I can set displayname with e Provisioning API or the occ command, and I can reset it to the empty string.
@phil-davis
Copy link
Contributor Author

Note: old PR #27671 was related to similar stuff and got closed.
Maybe there is a way to allow clearing email addresses through the Provisioning API and occ command - because the webUI certainly does it successfully.

@phil-davis
Copy link
Contributor Author

PR #37425 has a solution for the occ user:modify command. That seems to work fine setting email or display name to the empty string.

@phil-davis
Copy link
Contributor Author

Fixed in #37425 (occ user:modify command) and #37427 (Provisioning API)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant