Browse Source

Added registration

Jordi Boggiano 13 years ago
parent
commit
d63f9adaa9

+ 31 - 29
src/Packagist/WebBundle/Entity/User.php

@@ -22,38 +22,40 @@ class User extends BaseUser
      * @ORM\ManyToMany(targetEntity="Package", mappedBy="maintainers")
      */
     private $packages;
-    public function __construct()
-    {
-        $this->packages = new \Doctrine\Common\Collections\ArrayCollection();
-    }
-    
-    /**
-     * Get id
-     *
-     * @return integer $id
-     */
-    public function getId()
-    {
-        return $this->id;
+
+    public function __construct()
+    {
+        $this->packages = new \Doctrine\Common\Collections\ArrayCollection();
+        parent::__construct();
     }
 
-    /**
-     * Add packages
-     *
-     * @param Packagist\WebBundle\Entity\Package $packages
-     */
-    public function addPackages(\Packagist\WebBundle\Entity\Package $packages)
-    {
-        $this->packages[] = $packages;
+    /**
+     * Get id
+     *
+     * @return integer $id
+     */
+    public function getId()
+    {
+        return $this->id;
     }
 
-    /**
-     * Get packages
-     *
-     * @return Doctrine\Common\Collections\Collection $packages
-     */
-    public function getPackages()
-    {
-        return $this->packages;
+    /**
+     * Add packages
+     *
+     * @param Packagist\WebBundle\Entity\Package $packages
+     */
+    public function addPackages(\Packagist\WebBundle\Entity\Package $packages)
+    {
+        $this->packages[] = $packages;
+    }
+
+    /**
+     * Get packages
+     *
+     * @return Doctrine\Common\Collections\Collection $packages
+     */
+    public function getPackages()
+    {
+        return $this->packages;
     }
 }

+ 2 - 2
src/Packagist/WebBundle/Resources/views/layout.html.twig

@@ -38,9 +38,9 @@
         <div class="container">
             <div>
                 {% if user.username is defined %}
-                    {{ user.username }} | <a href="{{ url('fos_user_security_logout') }}">logout</a>
+                    {{ user.username }} | <a href="{{ path('fos_user_security_logout') }}">logout</a>
                 {% else %}
-                    <a href="{{ url('fos_user_security_login') }}">login</a>
+                    <a href="{{ path('fos_user_security_login') }}">login</a> | <a href="{{ path('fos_user_registration_register') }}">register</a>
                 {% endif %}
             </div>
             <div class="betawarn">WARNING - This is an experimental site, packages may come and go, this is not ready yet.</div>