owncloud/apps — pull request #1681 by mirekys (2014-02-25 15:15:15+00:00)
Title: User_saml fix for OC6

Fixes broken user creation and logout on OC6.

```createUser``` needs to be called inside ```checkPassword``` function, since it never gets called in post_login hook.
Once backend's ```checkPassword``` returns user $uid, user gets cached by ```getUserObject``` call:
```
/* private/user/manager.php (checkPassword) */
$uid = $backend->checkPassword($loginname, $password);
if ($uid !== false) {
return $this->getUserObject($uid, $backend);
```
```
protected function getUserObject($uid, $backend) {
$this->cachedUsers[$uid] = new User($uid, $backend, $this, $this->config);
```
This results in ```userExists``` returning true because it finds user in cachedUsers. So the following in the post_login hook will never get called:
```
if (!OC_User::userExists($uid)) {
OC_User::createUser($uid, $random_password);
```