Skip to content

Commit

Permalink
Merge branch 'dev'
Browse files Browse the repository at this point in the history
  • Loading branch information
guilhermednt committed Aug 30, 2016
2 parents 1d4e696 + b31c358 commit 702617e
Show file tree
Hide file tree
Showing 6 changed files with 32 additions and 21 deletions.
25 changes: 13 additions & 12 deletions src/LoginCidadao/CoreBundle/Entity/Person.php
Original file line number Diff line number Diff line change
Expand Up @@ -618,6 +618,18 @@ public function getFullName()
}
}

/**
* Get the full name of the user (first + last name)
* @JMS\Groups({"full_name", "name"})
* @JMS\VirtualProperty
* @JMS\SerializedName("name")
* @return string
*/
public function getOIDCName()
{
return $this->getFullName();
}

/**
* @JMS\Groups({"badges", "public_profile"})
* @JMS\VirtualProperty
Expand Down Expand Up @@ -776,17 +788,6 @@ public function getEmailExpiration()
return $this->emailExpiration;
}

public function setConfirmationToken($confirmationToken)
{
parent::setConfirmationToken($confirmationToken);

// fixes issue PROCERGS#428
// TODO: a setter shouldn't change another attribute!
if ($this->getConfirmationToken() !== null) {
$this->setEmailConfirmedAt(null);
}
}

public function setFacebookUsername($facebookUsername)
{
$this->facebookUsername = $facebookUsername;
Expand Down Expand Up @@ -1268,7 +1269,7 @@ public function getGivenName()
}

/**
* @JMS\Groups({"full_name"})
* @JMS\Groups({"full_name","name"})
* @JMS\VirtualProperty
* @JMS\SerializedName("family_name")
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

namespace LoginCidadao\CoreBundle\EventListener;

use Doctrine\Common\Cache\MemcacheCache;
use Doctrine\Common\Cache\CacheProvider;
use Doctrine\ORM\EntityManager;
use LoginCidadao\CoreBundle\Entity\CityRepository;
use LoginCidadao\OAuthBundle\Entity\Client;
Expand All @@ -15,7 +15,7 @@ class CheckDeployEventSubscriber implements EventSubscriberInterface
{
const CHECK_DEPLOY_KEY = 'check_deploy';

/** @var MemcacheCache */
/** @var CacheProvider */
private $cache;

/** @var CityRepository */
Expand All @@ -28,16 +28,22 @@ class CheckDeployEventSubscriber implements EventSubscriberInterface
private $defaultClientUid;

public function __construct(
MemcacheCache $cache,
EntityManager $em,
$defaultClientUid
) {


$this->cache = $cache;
$this->cityRepository = $em->getRepository('LoginCidadaoCoreBundle:City');
$this->clientRepository = $em->getRepository('LoginCidadaoOAuthBundle:Client');
$this->defaultClientUid = $defaultClientUid;

$this->cache = null;
}

/**
* @param CacheProvider $cache
*/
public function setCacheProvider(CacheProvider $cache = null)
{
$this->cache = $cache;
}

/**
Expand All @@ -52,7 +58,7 @@ public static function getSubscribedEvents()

public function checkDeploy(GetResponseEvent $event)
{
if ($this->cache->contains(self::CHECK_DEPLOY_KEY)) {
if (null === $this->cache || $this->cache->contains(self::CHECK_DEPLOY_KEY)) {
return;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,7 @@ private function checkEmailChanged(Person & $user)
// send confirmation token to new email
$user->setConfirmationToken($this->tokenGenerator->generateToken());
$user->setEmailExpiration(new \DateTime("+$this->emailUnconfirmedTime"));
$user->setEmailConfirmedAt(null);
$this->fosMailer->sendConfirmationEmailMessage($user);

$this->mailer->sendEmailChangedMessage($user, $this->email);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@ public function buildForm(FormBuilderInterface $builder, array $options)
public function configureOptions(OptionsResolver $resolver)
{
$resolver->setDefaults(array(
'data_class' => 'LoginCidadao\CoreBundle\Entity\Person'
'data_class' => 'LoginCidadao\CoreBundle\Entity\Person',
'validation_groups' => ['Profile'],
));
}

Expand Down
3 changes: 2 additions & 1 deletion src/LoginCidadao/CoreBundle/Resources/config/services.yml
Original file line number Diff line number Diff line change
Expand Up @@ -382,9 +382,10 @@ services:
lc.check_deploy_subscriber:
class: LoginCidadao\CoreBundle\EventListener\CheckDeployEventSubscriber
arguments:
- "@cache"
- "@doctrine.orm.entity_manager"
- '%oauth_default_client.uid%'
calls:
- ["setCacheProvider", ["@?cache"]]
tags:
- { name: kernel.event_subscriber }

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
*/

html, body {
font-family: "Open Sans", Arial, sans-serif;
background-color: #f9f9f9;
}

Expand Down

0 comments on commit 702617e

Please sign in to comment.