+ * @param bool $twoFactorAuthentication
+ */
+ public function setTwoFactorAuthentication($twoFactorAuthentication)
+ {
+ $this->twoFactorAuthentication = $twoFactorAuthentication;
+ }
+
+ public function isEmailAuthEnabled()
+ {
+ return $this->twoFactorAuthentication;
+ }
+
+ public function getEmailAuthCode()
+ {
+ return $this->authCode;
+ }
+
+ public function setEmailAuthCode($authCode)
+ {
+ $this->authCode = $authCode;
+ }
+
+ public function addTrustedComputer($token, \DateTime $validUntil)
+ {
+ $this->trusted[$token] = $validUntil->format('r');
+ }
+
+ public function isTrustedComputer($token)
+ {
+ if (isset($this->trusted[$token])) {
+ $now = new \DateTime();
+ $validUntil = new \DateTime($this->trusted[$token]);
+
+ return $now < $validUntil;
+ }
+
+ return false;
+ }
+
+ /**
+ * @param Client $client