contao/test — Issue #2850: importUser hook doesn't work
Author: importer
Created: 2011-11-29 10:26:04+00:00
State: closed
Labels: Defect, framework, Invalid

While using importUser hook, I've got a function which always returns true. The member doesn't exist in Contao database, but it shouldn't be a problem - that's why this hook is for, isn't it?

I think there is a mistake in the code, because even if $blnLoaded will be set to true (e.g. user is found in external database), then $this->findBy(...)==false will always return true (user is not found in Contao database). So in summary, it will be (false || true), which results in true overall...

/system/libraries/User.php line 184

```
// Return if the user still cannot be loaded
if (!$blnLoaded || $this->findBy('username', $this->Input->post('username')) == false)
{
$_SESSION['TL_ERROR'][] = $GLOBALS['TL_LANG']['ERR']['invalidLogin'];
$this->log('Could not find user "' . $this->Input->post('username') . '"', get_class($this) . ' login()', TL_ACCESS);

return false;
}
```

Am I missing something?

--- _Originally created by qzminski on February 6th, 2011, at 04:57pm (ID 2850)_