Account Management

---

**Dokku:** https://accountmanagement.dokku.hypothes.is

- [x] No tests for accountManagement directive
- [ ] No tests for backend changes
- [x] accountManagement directive needs to be moved to a controller
- [ ] Password updating doesn't seem to work.
- [x] Account sheet needs to close on logout.
- [x] Nothing happens after a user account is disabled other than a success message.
- [ ] Remove email update form (pending emails)
- [ ] disable_user endpoint needs to return a 401 when the password is invalid
- [ ] clear out password fields on successful submission

---

I'm taking the opportunity here to open this pull request for the account management branch so that both the code and the interface can be reviewed.

It's okay for this branch to still be considered a work in progress, and this PR will remain open as a place for discussion until it it's ready to be merged.

So this branch adds three new panels to the sidebar.

Settings:

![settings](https://cloud.githubusercontent.com/assets/47144/3386301/0f5f4056-fc73-11e3-87df-e6495c1e147b.png)

Profile:

![profile](https://cloud.githubusercontent.com/assets/47144/3386302/0f631910-fc73-11e3-9eac-a26a48f640ad.png)

Account:

![account](https://cloud.githubusercontent.com/assets/47144/3386300/0f5d2aa0-fc73-11e3-8d29-dae3f5a7f523.png)

@RawKStar77 if you've any thing to add, please do :)
Both methods need to return an `"errors"` key too to work with the form validation. eg.

```
{
  "status": "failure",
  "reason": "Blah",
  "flash": {},
  "model": {
    "csrf_token": "d5c22132a563ae79a7a51834bb9a7b48310acb02",
    "userid": "acct:bill@localhost"
  },
  "errors": {
    "pwd": "Invalid password"
  }
}}
```