rackspace/php-opencloud — pull request #341 by benja-M-1 (2014-04-16 20:18:22+00:00)
Title: Proposal to fix the user creation issue with OpenStack

This is the same [PR](rackspace/php-opencloud/pull/340) I opened 2 days ago on the wrong branch.

-----------------------------------------------------------------

Hi,

the opencloud library does not send the right parameters to the OpenStack API according to the [API reference](http://api.openstack.org/api-ref-identity-v2.html#os-ksadm-admin-ext).

Here is what the library sends
```json
{
"user": {
"username": "foo",
"enabled": true,
"email": "foo@bar.fr"
}
}
```
but it should be

```json
{
"user": {
"name": "foo",
"enabled": true,
"email": "foo@bar.fr",
"OS-KSADM:password": "secrete"
}
}
```

This fix tries to solve two things:
* it replaces the keys of the payload by their aliases if they exist
* it change the key "username" to "name" by the aliasing system

I can provide test if you want but before I would like to know if I did it the right way or want to have some feedback before going further.

Thanks :)