public function adminLogin($username, $password)
{
$row = $this->database->table('loginadmin')->where('name', $username)->fetch();
if (!$row) {
throw new Nette\Security\AuthenticationException('Nesprávné přihlašovací jméno.');
}
if (!($password == $row['password'])) {
throw new Nette\Security\AuthenticationException('Nesprávné heslo.');
}
$this->user->getStorage()->setNamespace('App\\AdminModule');
$this->user->login(new Nette\Security\Identity($row['id'], $row['name']));
}