Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- use Nette\Security,
- Nette\Utils\Strings;
- class UsersRepository extends Repository {
- /**
- * Vráti celý riadok o userovi
- * @return user object
- */
- public function findByName($username) {
- return $this->findAll()->where('username', $username)->fetch();
- }
- /**
- * Registrácia nového používateľa
- * @return insert new user into db
- */
- public function register($data) {
- unset($data['password2']);
- $data['role'] = "guest";
- $data['password'] = Authenticator::calculateHash($data['password']);
- return $this->getTable()->insert($data);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement