Last active
August 23, 2017 16:52
-
-
Save johnriberto/b907877e1bb18423bd4ed68d273f152a to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace AppBundle\Security; | |
use ..... | |
class UserData | |
{ | |
private $stack; | |
...... | |
public function __construct(.....) | |
{ | |
....... | |
} | |
public function checkUser($username) | |
{ | |
$user = $this->entityManager->getRepository('AppBundle:User')->findOneBy(['username' => $username]); | |
if ($user) { | |
$camp = $this->entityManager->getRepository('AppBundle:Campaigns')->findOneBy(['id' => $user->getTarget()]); | |
if ($camp) { | |
// redirect | |
return $this->redirectResponse('facebook.com', 301); | |
} | |
} | |
return true; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment