FileZ/FileZ — Issue #76: 2.1 login new users problem
Author: griff158
Created: 2011-11-19 20:36:03+00:00
State: open

when upgraded to the 2.1 branche version i ran into a problem where i could login with a new user but couldn't upload any files or see the header with the correct username. When i changed the username to the same value as the id it all worked. after some searching i found the solution:

in / lib / Fz / Controller.php i change:

...
self::$_user = Fz_Db::getTable('User')->findByUsername ($auth->getUserId ());
...

to

...
self::$_user = Fz_Db::getTable('User')->findById ($auth->getUserId ());
...

and added this new fucntion to FileZ / app / models / DbTable / User.php

...
ublic function findById($id) {
$sql = 'SELECT * FROM '.$this->getTableName ().' WHERE id = ?';
return $this->findOneBySQL ($sql, $id);
}
...