예제 #1
0
 public function __construct()
 {
     $service = new ServicesHelper();
     $container = $service->container;
     global $config;
     $config = $container["config"];
     $this->objConfig = $config;
     global $translator;
     $translator = $container["translator"];
     if (!$this->objConfig["requiredSSL"]) {
         $this->redirectToSSL();
     }
     /* @var $twig \Twig_Environment */
     global $twig;
     $twig = $container["twig"];
     $this->objTwig = $twig;
     /* @var $session \Symfony\Component\HttpFoundation\Session\Session */
     global $session;
     $session = $container["session"];
     $this->objSession = $session;
     global $request;
     $request = $container["request"];
     $this->objRequest = $request;
     $this->response = new Response();
     $this->ipAdresse = $request->server->get("REMOTE_ADDR");
     if ($session->get("ID") !== null) {
         $this->isConnected = true;
         $objAccount = Account\AccountHelper::getAccountRepository()->find($session->get("ID"));
         $this->objAccount = $objAccount;
         $this->ReloadSessionValues();
         $this->LoadAdminSessionValues();
         if ($this->objAccount->getStatus() == StatusHelper::BANNI) {
             $this->isBanned = true;
         }
         if ($this->isAdminProtected) {
             if (!$this->isAdmin) {
                 include '../../pages/_LegacyPages/News.php';
                 exit;
             }
         }
     } else {
         $this->isConnected = false;
     }
     if ($this->isProtected) {
         $this->ControleConnexion();
     }
 }
예제 #2
0
 public function run()
 {
     global $request;
     $em = \Shared\DoctrineHelper::getEntityManager();
     $idAccount = \Encryption::decrypt($request->query->get("id"));
     if ($idAccount !== null) {
         $objAccount = Account\AccountHelper::getAccountRepository()->find($idAccount);
         if ($objAccount !== null) {
             if ($objAccount->getStatus() != StatusHelper::BANNI) {
                 $objAccount->setStatus(StatusHelper::ACTIF);
                 $em->persist($objAccount);
                 $em->flush();
                 header("LOCATION: index.php?ok");
             } else {
                 echo "Ahah ! Niqué gros !";
             }
         } else {
             echo "Nous n'avons pas trouvé votre compte sur nos serveurs.";
         }
     }
 }