Automatické přihlášení - NETTE
$this->user->login(new Nette\Security\Identity($row["id"], array(), $row));
$this->redirectUrl($this->link('@homepage'));
<?php
public function regenerateIdentity()
{
$row = $this->database->table("user")->where("id", $this->user->identity->id)->fetch();
if (!$row)
{
throw new Nette\Security\AuthenticationException('Cannot regenerate identity - user not logged', self::NOT_APPROVED);
}
$arr = $row->toArray();
unset($arr["password"]);
$this->getUser()->storage->setIdentity(
new Nette\Security\Identity($row["id"], $row["role"], $arr)
);
}