<?php
+// This permits to have the LdapUserInterface even when fr3d/ldap-bundle is not
+// in the packages
+namespace FR3D\LdapBundle\Model;
+
+interface LdapUserInterface
+{
+ public function setDn($dn);
+ public function getDn();
+}
+
namespace Wallabag\UserBundle\Entity;
use Doctrine\Common\Collections\ArrayCollection;
use Wallabag\CoreBundle\Entity\Config;
use Wallabag\CoreBundle\Entity\Entry;
use Wallabag\CoreBundle\Helper\EntityTimestampsTrait;
+use FR3D\LdapBundle\Model\LdapUserInterface;
/**
* User.
* @UniqueEntity("email")
* @UniqueEntity("username")
*/
-class User extends BaseUser implements TwoFactorInterface, TrustedComputerInterface
+class User extends BaseUser implements TwoFactorInterface, TrustedComputerInterface, LdapUserInterface
{
use EntityTimestampsTrait;
*/
protected $email;
+ /**
+ * @var string
+ *
+ * @ORM\Column(name="dn", type="text", nullable=true)
+ */
+ protected $dn;
+
/**
* @var \DateTime
*
return $this->clients->first();
}
}
+
+ /**
+ * Set dn.
+ *
+ * @param string $dn
+ *
+ * @return User
+ */
+ public function setDn($dn)
+ {
+ $this->dn = $dn;
+
+ return $this;
+ }
+
+ /**
+ * Get dn.
+ *
+ * @return string
+ */
+ public function getDn()
+ {
+ return $this->dn;
+ }
+
+ public function isLdapUser()
+ {
+ return $this->dn !== null;
+ }
}