public function run()
 {
     global $request;
     $em = \Shared\DoctrineHelper::getEntityManager();
     $loginCompte = $request->request->get("Mot_De_Passe_Oublie_Compte");
     $emailCompte = $request->request->get("Mot_De_Passe_Oublie_Email");
     $passwordNew = \FonctionsUtiles::GenerateString(8);
     $objLogsOublieMotDePasse = new \Site\Entity\LogsOublieMotDePasse();
     $objLogsOublieMotDePasse->setCompteEssaye($loginCompte);
     $objLogsOublieMotDePasse->setEmailEssaye($emailCompte);
     $objLogsOublieMotDePasse->setIp($this->ipAdresse);
     $objLogsOublieMotDePasse->setDateEssai(new \DateTime(date("Y-m-d H:i:s")));
     $objAccount = \Account\AccountHelper::getAccountRepository()->findAccountByEmailAndLogin($emailCompte, $loginCompte);
     if ($objAccount !== null) {
         \Account\AccountHelper::getAccountRepository()->updateAccountPassword($objAccount->getId(), $passwordNew);
         $template = $this->objTwig->loadTemplate("PasswordForgottenEmail.html5.twig");
         $result = $template->render(["newMDP" => $passwordNew]);
         $subject = 'VamosMT2 - Nouveau mot de passe';
         \EmailHelper::sendEmail($emailCompte, $subject, $result);
         $objLogsOublieMotDePasse->setResultatDemande("1");
         echo "1";
     } else {
         $objLogsOublieMotDePasse->setResultatDemande("2");
         echo "2";
     }
     $em->persist($objLogsOublieMotDePasse);
     $em->flush();
 }
 public function run()
 {
     global $request;
     $em = \Shared\DoctrineHelper::getEntityManager();
     $passwordOld = $request->request->get("Ancien_Mot_De_Passe");
     $passwordNew = $request->request->get("Nouveau_Mot_De_Passe");
     $objAccount = \Account\AccountHelper::getAccountRepository()->findAccountByLoginAndPassword($this->objAccount->getLogin(), $passwordOld);
     if ($objAccount !== null) {
         //Suppression des autres demandes
         \Site\SiteHelper::getControleChangementMotDePasseRepository()->deleteByAccountId($objAccount->getId());
         $Nombre_Unique = \FonctionsUtiles::GenerateString(8, "INT");
         $objControleChangementMotDePasse = new \Site\Entity\ControleChangementMotDePasse();
         $objControleChangementMotDePasse->setIdCompte($objAccount->getId());
         $objControleChangementMotDePasse->setCompte($objAccount->getLogin());
         $objControleChangementMotDePasse->setNouveauMotDePasse($passwordNew);
         $objControleChangementMotDePasse->setNumeroVerif($Nombre_Unique);
         $objControleChangementMotDePasse->setIp($this->ipAdresse);
         $em->persist($objControleChangementMotDePasse);
         $em->flush();
         $template = $this->objTwig->loadTemplate("PasswordChangeEmail.html5.twig");
         $result = $template->render(["account" => $objAccount->getLogin(), "key" => $Nombre_Unique]);
         $subject = 'VamosMT2 - Changement de mot de passe';
         \EmailHelper::sendEmail($objAccount->getEmail(), $subject, $result);
         echo '1';
     } else {
         echo '2';
     }
 }
 public function run()
 {
     global $request;
     $em = \Shared\DoctrineHelper::getEntityManager();
     $idCompte = $this->objAccount->getId();
     $idPersonnage = $request->request->get("id_personnage");
     $objPlayer = \Player\PlayerHelper::getPlayerRepository()->find($idPersonnage);
     if ($objPlayer !== null) {
         //Suppression des autres demandes
         \Site\SiteHelper::getSuppressionPersonnageRepository()->deleteByPlayerId($idPersonnage);
         $objAccount = \Account\AccountHelper::getAccountRepository()->find($idCompte);
         if ($objAccount !== null) {
             $numeroVerif = \FonctionsUtiles::GenerateString(8, "INT");
             //Envoie de l'email de vérification
             $template = $this->objTwig->loadTemplate("PersonnageDeleteEmailVerify.html5.twig");
             $result = $template->render(["account" => $objAccount->getLogin(), "player" => $objPlayer->getName(), "key" => $numeroVerif]);
             $subject = 'VamosMt2 - Suppression du personnage ' . $objPlayer->getName() . '';
             \EmailHelper::sendEmail($objAccount->getEmail(), $subject, $result);
             //Insertion de la demande
             $objSuppressionPersonnage = new \Site\Entity\SuppressionPersonnage();
             $objSuppressionPersonnage->setIdCompte($idCompte);
             $objSuppressionPersonnage->setIdPersonnage($idPersonnage);
             $objSuppressionPersonnage->setEmail($objAccount->getEmail());
             $objSuppressionPersonnage->setNumeroVerif($numeroVerif);
             $objSuppressionPersonnage->setDate(new \DateTime(date("Y-m-d H:i:s")));
             $objSuppressionPersonnage->setIp($this->ipAdresse);
             $em->persist($objSuppressionPersonnage);
             $em->flush();
             $Tableau_Retour_Json = array('result' => true);
         } else {
             $Tableau_Retour_Json = array('result' => false, 'reasons' => "Le compte n'existe pas.");
         }
         echo json_encode($Tableau_Retour_Json);
     }
 }
 public function run()
 {
     $columnsParameters = array(array('dbField' => 'AccountEntity.login', 'dtField' => 'compte'), array('dbField' => 'PlayerIndexEntity.empire', 'filterLevel' => 'strict', 'dtField' => 'empire', 'formatter' => function ($d, $row) {
         return \FonctionsUtiles::findIconEmpire($d);
     }), array('dbField' => ['PlayerEntity1.name', 'PlayerEntity2.name', 'PlayerEntity3.name', 'PlayerEntity4.name'], 'dbSortReplaceField' => ["PlayerEntity1.name" => "PlayerEntity2.name", "PlayerEntity2.name" => "PlayerEntity3.name", "PlayerEntity3.name" => "PlayerEntity4.name", "PlayerEntity4.name" => "PlayerEntity1.name"], 'dbConcatSeparator' => "|VAMOS|", 'dtField' => 'names', 'formatter' => function ($d, $row) {
         $arrReturn = array_unique(explode("|VAMOS|", $d));
         return implode(", ", $arrReturn);
     }), array('dbField' => 'BannissementsActifsEntity.raisonBannissement', 'dtField' => 'raison', 'formatter' => function ($d, $row) {
         return \BanRaisonHelper::getLibelle($d);
     }), array('dbField' => 'BannissementsActifsEntity.duree', 'filterLevel' => 'strict', 'dtField' => 'duree', 'formatter' => function ($d, $row) {
         if ($d == 999) {
             return "Définitif";
         } else {
             return \BanDureeHelper::getLibelle($d);
         }
     }), array('dbField' => 'AccountEntity.ipCreation', 'dtField' => 'ip'), array('dbField' => 'AccountEntity.id', 'dtField' => 'actions', 'formatter' => function ($d, $row) {
         if ($this->HaveTheRight(\DroitsHelper::DEBANNISSEMENT)) {
             $varButton = '<a class="btn btn-material btn-success btn-sm" onclick="SuppressionBannissement(' . $d . ')" data-tooltip="Lever"><i class="material-icons md-icon-lock-open"></i></a>';
         } else {
             $varButton = "";
         }
         return '<div class="btn-toolbar">' . $varButton . "</div>";
     }));
     $datatable = new \DataTable();
     $datatable->setColumnsParameters($columnsParameters)->setRequest($_GET)->from("\\Account\\Entity\\Account", "AccountEntity")->leftJoin("\\Player\\Entity\\PlayerIndex", "PlayerIndexEntity", "WITH", "PlayerIndexEntity.id = AccountEntity.id")->leftJoin("\\Player\\Entity\\Player", "PlayerEntity1", "WITH", "PlayerEntity1.id = PlayerIndexEntity.pid1")->leftJoin("\\Player\\Entity\\Player", "PlayerEntity2", "WITH", "PlayerEntity2.id = PlayerIndexEntity.pid2")->leftJoin("\\Player\\Entity\\Player", "PlayerEntity3", "WITH", "PlayerEntity3.id = PlayerIndexEntity.pid3")->leftJoin("\\Player\\Entity\\Player", "PlayerEntity4", "WITH", "PlayerEntity4.id = PlayerIndexEntity.pid4")->leftJoin("\\Site\\Entity\\BannissementsActifs", "BannissementsActifsEntity", "WITH", "BannissementsActifsEntity.idCompte = AccountEntity.id")->andWhere("AccountEntity.status = '" . \StatusHelper::BANNI . "'");
     $datatable->getResult()->toJson();
 }
 public function run()
 {
     if ($_GET["sEcho"] == 1) {
         exit;
     }
     $columnsParameters = array(array('dbField' => 'AccountEntity.login', 'dtField' => 'compte'), array('dbField' => 'AccountEntity.email', 'dtField' => 'email'), array('dbField' => 'AccountEntity.cash', 'dtField' => 'cash', 'formatter' => function ($d, $row) {
         return number_format($d, 0, '.', ',') . "<span style='position:relative; top:2px;'>" . \FonctionsUtiles::findIconDevise(\DeviseHelper::CASH) . "</span>";
     }), array('dbField' => 'AccountEntity.mileage', 'dtField' => 'mileage', 'formatter' => function ($d, $row) {
         return number_format($d, 0, '.', ',') . "<span style='position:relative; top:2px;'>" . \FonctionsUtiles::findIconDevise(\DeviseHelper::MILEAGE) . "</span>";
     }), array('dbField' => 'PlayerIndexEntity.empire', 'filterLevel' => 'strict', 'dtField' => 'empire', 'formatter' => function ($d, $row) {
         return \FonctionsUtiles::findIconEmpire($d);
     }), array('dbField' => 'AccountEntity.status', 'filterLevel' => 'strict', 'dtField' => 'status', 'formatter' => function ($d, $row) {
         return \FonctionsUtiles::findIconStatus($d);
     }), array('dbField' => 'AccountEntity.ipCreation', 'dtField' => 'ip'), array('dbField' => 'AccountEntity.id', 'dtField' => 'actions', 'formatter' => function ($d, $row) {
         $varButton = "";
         if ($row["status"] == \StatusHelper::ACTIF) {
             if ($this->HaveTheRight(\DroitsHelper::BANNISSEMENT)) {
                 $varButton = '<a class="btn btn-material btn-danger btn-sm" data-featherlight="ajax" href="pages/Admin/BannissementAddForm.php?idAccount=' . $d . '" data-tooltip="Bannir"><i class="material-icons md-icon-lock"></i></a>';
             }
         }
         return '<div class="btn-toolbar">' . $varButton . "</div>";
     }));
     $datatable = new \DataTable();
     $datatable->setColumnsParameters($columnsParameters)->setRequest($_GET)->from("\\Account\\Entity\\Account", "AccountEntity")->leftJoin("\\Player\\Entity\\PlayerIndex", "PlayerIndexEntity", "WITH", "PlayerIndexEntity.id = AccountEntity.id");
     $datatable->getResult()->toJson();
 }
 public function run()
 {
     $columnsParameters = array(array('dbField' => 'ItemshopEntity.nameItem', 'dtField' => 'article'), array('dbField' => 'ItemshopEntity.nbItem', 'dtField' => 'nombre', 'formatter' => function ($d, $row) {
         if ($row["type"] == "2") {
             if ($d == 9999) {
                 return "A vie";
             } else {
                 return $d . " jours";
             }
         } else {
             return $d;
         }
     }), array('dbField' => 'ItemshopCategoriesEntity.nom', 'dtField' => 'categorie'), array('dbField' => 'ItemshopEntity.prix', 'filterLevel' => 'strict', 'dtField' => 'prix', 'formatter' => function ($d, $row) {
         if ($row["type"] == "1") {
             return number_format($d, 0, ",", " ") . " <span style='position: relative; top:3px;'>" . \FonctionsUtiles::findIconDevise(\DeviseHelper::CASH) . "</span>";
         } elseif ($row["type"] == "2") {
             return number_format($d, 0, ",", " ") . " <span style='position: relative; top:3px;'>" . \FonctionsUtiles::findIconDevise(\DeviseHelper::CASH) . "</span>";
         } elseif ($row["type"] == "3") {
             return number_format($d, 0, ",", " ") . " <span style='position: relative; top:3px;'>" . \FonctionsUtiles::findIconDevise(\DeviseHelper::MILEAGE);
         }
     }), array('dbField' => 'ItemshopEntity.type', 'dtField' => 'type'), array('dbField' => 'ItemshopEntity.estImportant', 'dtField' => 'estImportant', 'formatter' => function ($d, $row) {
         if ($d == 1) {
             return "important";
         } else {
             return "";
         }
     }), array('dbField' => 'ItemshopEntity.id', 'dtField' => 'actions', 'formatter' => function ($d, $row) {
         $varButton = '<a class="btn btn-material btn-primary btn-sm" data-featherlight="ajax" href="pages/Admin/modules/GererItemShop/GererItemShopArticlesEdit.php?mode=mod&idArticle=' . $d . '"><i class="material-icons md-icon-edit"></i></a>';
         $varButton .= '<a class="btn btn-material btn-danger btn-sm" onclick="SuppressionArticle(' . $d . ')"><i class="material-icons md-icon-delete"></i></a>';
         return '<div class="btn-toolbar">' . $varButton . "</div>";
     }));
     $datatable = new \DataTable();
     $datatable->setColumnsParameters($columnsParameters)->setRequest($_GET)->from("\\Site\\Entity\\Itemshop", "ItemshopEntity")->leftJoin("\\Site\\Entity\\ItemshopCategories", "ItemshopCategoriesEntity", "WITH", "ItemshopCategoriesEntity.id = ItemshopEntity.cat");
     $datatable->getResult()->toJson();
 }
 public function run()
 {
     $columnsParameters = array(array('dbField' => 'LogsItemshopAchatsEntity.date', 'dtField' => 'date', 'formatter' => function ($d, $row) {
         return \DateTimeHelper::dateTimeToFormatedString($d);
     }), array('dbField' => 'LogsItemshopAchatsEntity.item', 'dtField' => 'article'), array('dbField' => 'LogsItemshopAchatsEntity.quantite', 'filterLevel' => 'strict', 'dtField' => 'quantite'), array('dbField' => 'LogsItemshopAchatsEntity.devise', 'dtField' => 'devise'), array('dbField' => 'LogsItemshopAchatsEntity.prix', 'filterLevel' => 'strict', 'dtField' => 'prix', 'formatter' => function ($d, $row) {
         return number_format($d, 0, '.', ',') . "<span style='position:relative; top:2px;'>" . \FonctionsUtiles::findIconDevise($row["devise"]) . "</span>";
     }), array('dbField' => 'AccountEntity.login', 'dtField' => 'compte'), array('dbField' => 'LogsItemshopAchatsEntity.resultat', 'dtField' => 'result'));
     $datatable = new \DataTable();
     $datatable->setColumnsParameters($columnsParameters)->setRequest($_GET)->from("\\Site\\Entity\\LogsItemshopAchats", "LogsItemshopAchatsEntity")->leftJoin("\\Account\\Entity\\Account", "AccountEntity", "WITH", "AccountEntity.id = LogsItemshopAchatsEntity.idCompte");
     $datatable->getResult()->toJson();
 }
 public function run()
 {
     global $request;
     global $session;
     global $config;
     $em = \Shared\DoctrineHelper::getEntityManager();
     $login = $request->request->get("Utilisateur");
     $password = $request->request->get("Mot_De_Passe");
     $email = $request->request->get("Email");
     $objIpToCountry = \Site\SiteHelper::getIpToCountryRepository()->findCountryBetween(ip2long($this->ipAdresse));
     if ($objIpToCountry !== null) {
         $Langue = $objIpToCountry->getCntry();
     } else {
         $Langue = "Inconnu";
     }
     $passwordEncrypted = \FonctionsUtiles::myPasswordToDoubleSha1($password);
     $objAccount = new \Account\Entity\Account();
     $objAccount->setLogin(trim($login));
     $objAccount->setPassword($passwordEncrypted);
     $objAccount->setEmail($email);
     $objAccount->setCash($config["register"]["initCash"]);
     $objAccount->setMileage($config["register"]["initMileage"]);
     $objAccount->setIpCreation($this->ipAdresse);
     $objAccount->setLangue($Langue);
     $objAccount->setCreateTime(new \DateTime(date("Y-m-d H:i:s")));
     $anneeRestantMysql = 2037 - date("Y");
     $dateActuel = \Carbon\Carbon::now();
     $dateBonusNew = $dateActuel->addYear($anneeRestantMysql);
     $objAccount->setMarriageFastExpire(new \DateTime(date("Y-m-d H:i:s")));
     $objAccount->setMoneyDropRateExpire(new \DateTime(date("Y-m-d H:i:s")));
     $objAccount->setGoldExpire(new \DateTime(date("Y-m-d H:i:s")));
     $objAccount->setSilverExpire(new \DateTime(date("Y-m-d H:i:s")));
     $objAccount->setAutolootExpire($dateBonusNew);
     $objAccount->setFishMindExpire(new \DateTime(date("Y-m-d H:i:s")));
     $objAccount->setSafeboxExpire($dateBonusNew);
     if ($config["register"]["emailActivation"]) {
         $objAccount->setStatus(\StatusHelper::NON_CONFIRME);
     } else {
         $objAccount->setStatus(\StatusHelper::ACTIF);
     }
     $em->persist($objAccount);
     $em->flush();
     if ($config["register"]["emailActivation"]) {
         $template = $this->objTwig->loadTemplate("InscriptionSubmitVerif.html5.twig");
         $result = $template->render(["account" => $objAccount->getLogin(), "accountId" => $objAccount->getId()]);
         $subject = 'VamosMT2 - Activez votre compte ' . $objAccount->getLogin();
         \EmailHelper::sendEmail($objAccount->getEmail(), $subject, $result);
     }
     $session->set("NomTemporaire", trim($login));
     echo "1";
 }
Esempio n. 9
0
 public function run()
 {
     $columnsParameters = array(array('dbField' => 'ActualitesEntity.date', 'dtField' => 'date', 'formatter' => function ($d, $row) {
         return \DateTimeHelper::dateTimeToFormatedString($d);
     }), array('dbField' => 'ActualitesEntity.titre', 'dtField' => 'titre'), array('dbField' => 'ActualitesEntity.contenu', 'dtField' => 'message', 'formatter' => function ($d, $row) {
         return \FonctionsUtiles::Raccourcissement_Chaine($d, 50);
     }), array('dbField' => 'AccountEntity.login', 'dtField' => 'compte'), array('dbField' => 'ActualitesEntity.id', 'dtField' => 'actions', 'formatter' => function ($d, $row) {
         $varButton = '<a class="btn btn-material btn-primary btn-sm" data-featherlight="ajax" href="pages/Admin/GererNewsEdit.php?mode=mod&idNews=' . $d . '"><i class="material-icons md-icon-edit"></i></a>';
         $varButton .= '<a class="btn btn-material btn-danger btn-sm" onclick="SuppressionNews(' . $d . ')"><i class="material-icons md-icon-delete"></i></a>';
         return '<div class="btn-toolbar">' . $varButton . "</div>";
     }));
     $datatable = new \DataTable();
     $datatable->setColumnsParameters($columnsParameters)->setRequest($_GET)->from("\\Site\\Entity\\Actualites", "ActualitesEntity")->leftJoin("\\Account\\Entity\\Account", "AccountEntity", "WITH", "AccountEntity.id = ActualitesEntity.idCompte");
     $datatable->getResult()->toJson();
 }
Esempio n. 10
0
 public function run()
 {
     global $config;
     $urlClient = $config["linkClient"];
     $urlClientTorrent = $config["linkClientTorrent"];
     $cacheManager = \CacheHelper::getCacheManager();
     if ($cacheManager->isExisting("sizeOfClient")) {
         $size = $cacheManager->get("sizeOfClient");
     } else {
         $size = \FonctionsUtiles::sizeOfFileExt($urlClient);
         $cacheManager->set("sizeOfClient", $size, 21600);
     }
     $this->arrayTemplate["urlClient"] = $urlClient;
     $this->arrayTemplate["urlClientTorrent"] = $urlClientTorrent;
     $this->arrayTemplate["tailleClient"] = \FonctionsUtiles::Formatage_Taille($size);
     $view = $this->template->render($this->arrayTemplate);
     $this->response->setContent($view);
     $this->response->send();
 }
 public function run()
 {
     if ($_GET["sEcho"] == 1) {
         exit;
     }
     $columnsParameters = array(array('dbField' => 'GuildEntity.name', 'dtField' => 'name'), array('dbField' => 'GuildEntity.level', 'filterLevel' => 'strict', 'dtField' => 'level'), array('dbField' => ["GuildEntity.victoire", "GuildEntity.defaite", "GuildEntity.egalite"], 'dbSortReplaceField' => [], 'dbConcatSeparator' => "|VAMOS|", 'dtField' => 'scores', 'formatter' => function ($d, $row) {
         $explosion = explode("|VAMOS|", $d);
         $scores = "<span class='text-green'>" . $explosion[0] . "</span>";
         $scores .= " / <span class='text-red'>" . $explosion[1] . "</span>";
         $scores .= " / <span>" . $explosion[2] . "</span>";
         return $scores;
     }), array('dbField' => 'AccountEntity.login', 'dtField' => 'chef'), array('dbField' => 'PlayerIndexEntity.empire', 'filterLevel' => 'strict', 'dtField' => 'empire', 'formatter' => function ($d, $row) {
         return \FonctionsUtiles::findIconEmpire($d);
     }), array('dbField' => 'AccountEntity.status', 'filterLevel' => 'strict', 'dtField' => 'status', 'formatter' => function ($d, $row) {
         return \FonctionsUtiles::findIconStatus($d);
     }));
     $datatable = new \DataTable();
     $datatable->setColumnsParameters($columnsParameters)->setRequest($_GET)->from("\\Player\\Entity\\Guild", "GuildEntity")->innerJoin("\\Account\\Entity\\Account", "AccountEntity", "WITH", "AccountEntity.id = GuildEntity.master")->innerJoin("\\Player\\Entity\\PlayerIndex", "PlayerIndexEntity", "WITH", "PlayerIndexEntity.id = AccountEntity.id");
     $datatable->getResult()->toJson();
 }
Esempio n. 12
0
 public function run()
 {
     $columnsParameters = array(array('dbField' => 'PlayerEntity.name', 'dtField' => 'name', 'formatter' => function ($d, $row) {
         return \FonctionsUtiles::findIconJob($row["job"]) . " " . $d;
     }), array('dbField' => 'AccountEntity.login', 'dtField' => 'compte'), array('dbField' => 'PlayerEntity.job', 'dtField' => 'job'), array('dbField' => 'GmlistEntity.mauthority', 'dtField' => 'authority', 'formatter' => function ($d, $row) {
         return \AuthorityHelper::getLibelle($d);
     }), array('dbField' => 'PlayerEntity.playtime', 'dtField' => 'playtime', 'formatter' => function ($d, $row) {
         return \DateTimeHelper::minutesToString($d);
     }), array('dbField' => 'PlayerEntity.lastPlay', 'dtField' => 'lastPlay', 'formatter' => function ($d, $row) {
         return \DateTimeHelper::dateTimeToFormatedString($d);
     }), array('dbField' => 'AccountEntity.status', 'filterLevel' => 'strict', 'dtField' => 'status', 'formatter' => function ($d, $row) {
         return \FonctionsUtiles::findIconStatus($d);
     }), array('dbField' => 'PlayerEntity.ip', 'dtField' => 'ip'), array('dbField' => 'GmlistEntity.mid', 'dtField' => 'actions', 'formatter' => function ($d, $row) {
         $varButton = '<a class="btn btn-material btn-primary btn-sm" data-featherlight="ajax" href="pages/Admin/modules/GererEquipeJeu/GererEquipeJeuEdit.php?mode=mod&idMembre=' . $d . '"><i class="material-icons md-icon-edit"></i></a>';
         $varButton .= '<a class="btn btn-material btn-danger btn-sm " onclick="SuppressionMembreEquipe(' . $d . ')"><i class="material-icons md-icon-delete"></i></a>';
         return '<div class="btn-toolbar">' . $varButton . "</div>";
     }));
     $datatable = new \DataTable();
     $datatable->setColumnsParameters($columnsParameters)->setRequest($_GET)->from("\\Common\\Entity\\Gmlist", "GmlistEntity")->innerJoin("\\Player\\Entity\\Player", "PlayerEntity", "WITH", "PlayerEntity.name = GmlistEntity.mname")->innerJoin("\\Account\\Entity\\Account", "AccountEntity", "WITH", "AccountEntity.login = GmlistEntity.maccount");
     $datatable->getResult()->toJson();
 }
 public function run()
 {
     $em = \Shared\DoctrineHelper::getEntityManager();
     $Nombre_Unique = \FonctionsUtiles::GenerateString(8, "INT");
     //Suppression des autres entrées de vérification
     \Site\SiteHelper::getControleChangementMailRepository()->deleteByAccountId($this->objAccount->getId());
     //Insertion de la clés de vérification
     $objControleChangementMail = new \Site\Entity\ControleChangementMail();
     $objControleChangementMail->setIdCompte($this->objAccount->getId());
     $objControleChangementMail->setEmail($this->objAccount->getEmail());
     $objControleChangementMail->setNumeroVerif($Nombre_Unique);
     $objControleChangementMail->setIp($this->ipAdresse);
     $objControleChangementMail->setDate(new \DateTime(date("Y-m-d H:i:s")));
     $em->persist($objControleChangementMail);
     $em->flush();
     //Envoi de l'email avec la clés
     $templateOld = $this->objTwig->loadTemplate("EmailChangeEmailVerify.html5.twig");
     $resultOld = $templateOld->render(["compte" => $this->objAccount->getLogin(), "key" => $Nombre_Unique]);
     $subject = 'VamosMt2 - Changement de mail de ' . $this->objAccount->getLogin() . '';
     \EmailHelper::sendEmail($this->objAccount->getEmail(), $subject, $resultOld);
     echo '1';
 }
 public function run()
 {
     $columnsParameters = array(array('dbField' => 'GuildEntity1.name', 'filterLevel' => 'strict', 'dtField' => 'firstGuild', 'formatter' => function ($d, $row) {
         return \FonctionsUtiles::findIconEmpire($row["firstEmpire"]) . " " . $d;
     }), array('dbField' => 'GuildEntity2.name', 'filterLevel' => 'strict', 'dtField' => 'secondGuild', 'formatter' => function ($d, $row) {
         return \FonctionsUtiles::findIconEmpire($row["secondEmpire"]) . " " . $d;
     }), array('dbField' => 'PlayerMaster1Entity.name', 'dtField' => 'firstChef'), array('dbField' => 'GuildWarReservationEntity.time', 'dbConcatSeparator' => ", ", 'dtField' => 'date', 'formatter' => function ($d, $row) {
         return \DateTimeHelper::dateTimeToFormatedString($d);
     }), array('dbField' => 'PlayerMaster2Entity.name', 'dtField' => 'secondChef'), array('dbField' => 'GuildWarReservationEntity.result1', 'dtField' => 'result1'), array('dbField' => 'GuildWarReservationEntity.result2', 'dtField' => 'result2'), array('dbField' => 'GuildEntityWin.name', 'filterLevel' => 'strict', 'dtField' => 'winner', 'formatter' => function ($d, $row) {
         if ($row["result1"] > $row["result2"]) {
             return $d . " (<span class='text-green'>" . $row["result1"] . "</span> / <span class='text-red'>" . $row["result2"] . "</span>)";
         } else {
             if ($row["result1"] < $row["result2"]) {
                 return $d . " (<span class='text-green'>" . $row["result2"] . "</span> / <span class='text-red'>" . $row["result1"] . "</span>)";
             } else {
                 return "Match nul";
             }
         }
     }), array('dbField' => 'PlayerIndexMaster1Entity.empire', 'dtField' => 'firstEmpire'), array('dbField' => 'PlayerIndexMaster2Entity.empire', 'dtField' => 'secondEmpire'));
     $datatable = new \DataTable();
     $datatable->setColumnsParameters($columnsParameters)->setRequest($_GET)->from("\\Player\\Entity\\GuildWarReservation", "GuildWarReservationEntity")->leftJoin("\\Player\\Entity\\Guild", "GuildEntity1", "WITH", "GuildEntity1.id = GuildWarReservationEntity.guild1")->leftJoin("\\Player\\Entity\\Guild", "GuildEntity2", "WITH", "GuildEntity2.id = GuildWarReservationEntity.guild2")->leftJoin("\\Player\\Entity\\Guild", "GuildEntityWin", "WITH", "GuildEntityWin.id = GuildWarReservationEntity.winner")->innerJoin("\\Player\\Entity\\Player", "PlayerMaster1Entity", "WITH", "PlayerMaster1Entity.id = GuildEntity1.master")->innerJoin("\\Player\\Entity\\Player", "PlayerMaster2Entity", "WITH", "PlayerMaster2Entity.id = GuildEntity2.master")->leftJoin("\\Account\\Entity\\Account", "AccountMaster1Entity", "WITH", "AccountMaster1Entity.id = PlayerMaster1Entity.idAccount")->leftJoin("\\Account\\Entity\\Account", "AccountMaster2Entity", "WITH", "AccountMaster2Entity.id = PlayerMaster2Entity.idAccount")->leftJoin("\\Player\\Entity\\PlayerIndex", "PlayerIndexMaster1Entity", "WITH", "PlayerIndexMaster1Entity.id = AccountMaster1Entity.id")->leftJoin("\\Player\\Entity\\PlayerIndex", "PlayerIndexMaster2Entity", "WITH", "PlayerIndexMaster2Entity.id = AccountMaster2Entity.id");
     $datatable->getResult()->toJson();
 }
 public function countBonusOnAccount($objAccount = null)
 {
     return \FonctionsUtiles::countBonusOnAccount($objAccount);
 }
Esempio n. 16
0
 /**
  * Hydrate un objet Vehicule
  *
  * @param $aDonnees les données à assigner à l'objet
  *
  * @return Vehicule object l'objet hydraté
  */
 public function hydrate($aDonnees)
 {
     foreach ($aDonnees as $sKey => $sValue) {
         $sKey = FonctionsUtiles::toCamelCase($sKey);
         $sMethod = 'set' . $sKey;
         if (method_exists($this, $sMethod)) {
             $this->{$sMethod}($sValue);
         }
     }
 }
Esempio n. 17
0
    <span class="info-box-icon"><i class="material-icons md-icon-download md-36"></i></span>

    <div class="info-box-content">
        <span class="info-box-text">Télécharger</span>

        <?php 
$urlClient = $config["linkClient"];
if ($cacheManager->isExisting("sizeOfClient")) {
    $size = $cacheManager->get("sizeOfClient");
} else {
    $size = \FonctionsUtiles::sizeOfFileExt($urlClient);
    $cacheManager->set("sizeOfClient", $size, 21600);
}
?>

        <span class="info-box-number"><?php 
echo \FonctionsUtiles::Formatage_Taille($size);
?>
</span>
    </div>
</div>

<div class="box box-default flat">
    <div class="box-body no-padding">
        <a onclick="$.featherlight({ajax: 'pages/_Home/trailer.php', variant: 'trailerVideo'});">

            <img class="ImageVideoNouveaute" src="./images/trailer.png" />
        </a>
    </div>
</div>
 public function formatNumber($number)
 {
     return FonctionsUtiles::Formatage_Yangs($number);
 }