Při přihlášení do administrace – divná chyba z laděnky
Upozornění: Tohle vlákno je hodně staré a informace nemusí být platné pro současné Nette.

- Jakub Kontra
 - Člen | 30
 
<?php
use     \Nette\Object,
        \dibi,
        \Nette\Security\Identity,
        \Nette\Security\IAuthenticator,
        \Nette\Security\AuthenticationException;
class Authenticator extends \Nette\Object implements \Nette\Security\IAuthenticator
{
    public function __construct()
    {
//        $this->passwordSalt = $salt;
    }
public function authenticate(array $credentials)
    {
        list($username, $password) = $credentials;
        $row = dibi::fetch('SELECT * FROM [developers] WHERE [username] = %s', $username);
        if (!$row) {
            throw new AuthenticationException("Uživatel '$username' neexistuje.", self::IDENTITY_NOT_FOUND);
        }
        if ($row->password !== $password) {
            throw new AuthenticationException("Špatné heslo.", self::INVALID_CREDENTIAL);
        }
        $identity = dibi::fetch('SELECT * FROM [developers] WHERE [username] = %s', $username);
        return new \Nette\Security\Identity($row->id,$row->username);
    }
}
Osekal jsem to na uplné minimum, momentálně nehashuji ani hesla.. Ale
vyhazuje mi to tuto chybu
http://imageshack.us/…xception.png
Cache smazána, údaje sedí
Prosím, pokud se s tím někdo někdy setkal – rád bych znal řešení jak to vyřešit.

- Jakub Kontra
 - Člen | 30
 
Databáze připojení mi funguje, ale v případě že se lognu do Administrace to vyhodí tuto chybu..
Další ze souborů
common:
	parameters:
		database:
			driver: mysql
			host: localhost
			database: db
			user: root
			password:
			persistent: true
			charset: utf8
			lazy: true
		facebook:
			appID: '' #Musí být string
			secret:
		core:
			salt: popokatepetl
	php:
		date.timezone: Europe/Prague
		# zlib.output_compression: yes
	nette:
		application:
			errorPresenter: Error
		session:
			expiration: 14 days
	services:
		database:
			class: DibiConnection('%database.driver%:host=%database.host%;dbname=%database.database%'
			%database.user%
			%database.password%
			)
		authenticator:
			class: \Models\Authenticator
			arguments: ['@database']
	factories:
production < common:
development < common:
				
- Jakub Kontra
 - Člen | 30
 
Chyba vyřešena.. chyba se nacházela v konfigu…
#
# SECURITY WARNING: it is CRITICAL that this file & directory are NOT accessible directly via a web browser!
#
# If you don't protect this directory from direct web access, anybody will be able to see your passwords.
# https://nette.org/en/security-warning
#
common:
	parameters:
		facebook:
			appID: '' #Musí být string
			secret:
		core:
			salt: popokatepetl
	php:
		date.timezone: Europe/Prague
		# zlib.output_compression: yes
	nette:
		application:
			errorPresenter: Error
		session:
			expiration: 14 days
	services:
		authenticator:
			class: Authenticator
	factories:
production < common:
	parameters:
		database:
			driver: mysql
			host: localhost
			database:
			user:
			password:
			persistent: true
			charset: utf8
			lazy: true
development < common:
	parameters:
		database:
			driver: mysql
			host: localhost
			database:
			user:
			password:
			persistent: true
			charset: utf8
			lazy: true