Added login and posting functionality

Signed-off-by: Gergely Polonkai (W00d5t0ck) <polesz@w00d5t0ck.info>
This commit is contained in:
Gergely Polonkai (W00d5t0ck)
2012-09-04 17:21:04 +02:00
parent 5bcd9f079b
commit 04d408aee0
12 changed files with 277 additions and 18 deletions

View File

@@ -2,6 +2,7 @@
namespace GergelyPolonkai\FrontBundle\Entity;
use Doctrine\ORM\Mapping as ORM;
use Symfony\Component\Security\Core\User\UserInterface;
/**
* Description of User
@@ -11,7 +12,7 @@ use Doctrine\ORM\Mapping as ORM;
* @ORM\Entity
* @ORM\Table(name="users")
*/
class User
class User implements UserInterface
{
/**
* @ORM\Id
@@ -30,6 +31,29 @@ class User
*/
private $name;
/**
* @var string $password
*
* @ORM\Column(type="string", length=50, nullable=false)
*/
private $password;
public function __toString()
{
return $this->name . '(' . $this->username . ')';
}
public function getSalt() {
return $this->password;
}
public function eraseCredentials() {
}
public function getRoles() {
return array('ROLE_ADMIN');
}
/**
* Get id
*
@@ -85,4 +109,26 @@ class User
{
return $this->name;
}
}
/**
* Set password
*
* @param string $password
* @return User
*/
public function setPassword($password)
{
$this->password = $password;
return $this;
}
/**
* Get password
*
* @return string
*/
public function getPassword()
{
return $this->password;
}
}