ヤミRoot VoidGate
User / IP
:
216.73.216.81
Host / Server
:
146.88.233.70 / dev.loger.cm
System
:
Linux hybrid1120.fr.ns.planethoster.net 3.10.0-957.21.2.el7.x86_64 #1 SMP Wed Jun 5 14:26:44 UTC 2019 x86_64
Command
|
Upload
|
Create
Mass Deface
|
Jumping
|
Symlink
|
Reverse Shell
Ping
|
Port Scan
|
DNS Lookup
|
Whois
|
Header
|
cURL
:
/
home
/
logercm
/
dev.loger.cm
/
src
/
Controller
/
Viewing: BuildingNavigationController.php
<?php namespace App\Controller; use App\Entity\BookingRoom; use App\Entity\Building; use App\Entity\BuildingType; use App\Entity\Company; use App\Entity\Payment; use App\Entity\PaymentOption; use App\Entity\Room; use App\Entity\Town; use App\Entity\User; use App\Event\Token; use App\Event\TransactionRef; use App\Security\EmailVerifier; use DateTime; use Doctrine\ORM\EntityManagerInterface; use Lexik\Bundle\JWTAuthenticationBundle\Services\JWTManager; use Lexik\Bundle\JWTAuthenticationBundle\Services\JWTManagerInterface; use Symfony\Bundle\FrameworkBundle\Controller\AbstractController; use Symfony\Component\HttpFoundation\JsonResponse; use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpFoundation\Response; use Symfony\Component\Routing\Annotation\Route; use Symfony\Component\Routing\Generator\UrlGeneratorInterface; class BuildingNavigationController extends AbstractController { private $emailVerifier; private $entityManager; private $jwtManager; public function __construct( EmailVerifier $emailVerifier,UrlGeneratorInterface $urlGenerator, EntityManagerInterface $entityManager) { $this->urlGenerator = $urlGenerator; $this->emailVerifier = $emailVerifier; $this->entityManager = $entityManager; } function decodeJWTPayloadOnly($token){ $tks = explode('.', $token); if (count($tks) != 3) { return null; } list($headb64, $bodyb64, $cryptob64) = $tks; $input=$bodyb64; $remainder = strlen($input) % 4; if ($remainder) { $padlen = 4 - $remainder; $input .= str_repeat('=', $padlen); } $input = (base64_decode(strtr($input, '-_', '+/'))); if (version_compare(PHP_VERSION, '5.4.0', '>=') && !(defined('JSON_C_VERSION') && PHP_INT_SIZE > 4)) { $obj = json_decode($input, false, 512, JSON_BIGINT_AS_STRING); } else { $max_int_length = strlen((string) PHP_INT_MAX) - 1; $json_without_bigints = preg_replace('/:\s*(-?\d{'.$max_int_length.',})/', ': "$1"', $input); $obj = json_decode($json_without_bigints); } return $obj; } /** * @Route("/building/room/booking", name="app_room_booking") */ public function bookRoom(Request $request){ $data = json_decode($request->getContent(), true); try{ $userToken= $data['_user_token']; $buildingId= $data['buildingId']; $roomId= $data['roomId']; $startDate= $data['startDate']; $endDate= $data['endDate']; $townId= $data['townId']; }catch (\Exception $exception){ $this->addFlash('error',"invalid inputs"); $this->redirectToRoute('app_home'); } $adult= $data['adult']; $child= $data['child']; $building= $this->entityManager->getRepository(Building::class)->find($buildingId); if(!is_null($building)){ $company=$this->entityManager->getRepository(Company::class)->find($building->getCompany()->getId()); $company->setVues($company->getVues()+1); $this->entityManager->persist($company); $this->entityManager->flush(); } $room= $this->entityManager->getRepository(Room::class)->find($roomId); $user= $this->entityManager->getRepository(User::class)->findOneBySomeField($this->decodeJWTPayloadOnly($userToken)->username); $town= $this->entityManager->getRepository(Town::class)->find($townId); if(is_null($room)){ return new JsonResponse(json_encode( array( "bookingId"=>null, "paymentLink"=>null, "notificationLink"=>null, "resultCode"=>404, "message"=>"room not found", "result"=>null, ) ), Response::HTTP_NOT_FOUND); } if(empty($endDate) || empty($startDate)){ return new JsonResponse(json_encode( array( "bookingId"=>null, "paymentLink"=>null, "notificationLink"=>null, "payBefore"=>false, "resultCode"=>400, "message"=>"Empty Start Date or End Date", "result"=>null, ) ), Response::HTTP_BAD_REQUEST); } $date1 = new DateTime($startDate); $date2 = new DateTime($endDate); $interval = $date1->diff($date2); if($date2<$date1){ return new JsonResponse(json_encode( array( "bookingId"=>null, "paymentLink"=>null, "notificationLink"=>null, "resultCode"=>400, "message"=>"Date Range Not Valid", "result"=>null, "payBefore"=>false, "interval"=>$interval, ) ), Response::HTTP_BAD_REQUEST); } if(is_null($user)){ return new JsonResponse(json_encode( array( "bookingId"=>null, "paymentLink"=>null, "notificationLink"=>null, "resultCode"=>404, "message"=>"user not found", "result"=>null, "payBefore"=>false, "interval"=>$interval, ) ), Response::HTTP_NOT_FOUND); } str_replace("T"," ",$startDate); str_replace("T"," ",$endDate); $result= $this->entityManager->getRepository(BookingRoom::class)->findByRoomBook($startDate,$endDate,$roomId); if(empty($result)){ $bookingRoomTemp=new BookingRoom(); $bookingRoomTemp->setRoom($room); $bookingRoomTemp->setAdult($adult); $bookingRoomTemp->setChild($child); $bookingRoomTemp->setArrivalDate( new DateTime($startDate)); $bookingRoomTemp->setDepartureDate(new \DateTime($endDate)); $bookingRoomTemp->setComingFrom($town); $bookingRoomTemp->setPaymentAsBeenConfirmed(false); $bookingRoomTemp->setUser($user); $payment= new Payment(); $payment->setAmount($room->getCost()*intval($interval->format('%d'))); $payment->setDiscount(0); $payment->setFees(0); $payment->setUser($user); $room->setIsFree(false); $this->entityManager->persist($room); $this->entityManager->persist($bookingRoomTemp); $this->entityManager->flush(); $transactionRef= new TransactionRef(); $transactionRef->amount=$room->getCost()*intval($interval->format('%d')); $transactionRef->userId=$user->getId(); $transactionRef->roomId=$roomId; $transactionRef->createdDate=$payment->getCreatedAt()->format("Y-m-d H:i:s"); $payment->setTransactionRef( sha1(json_encode($transactionRef)) ); $bookingRoomTemp->setPayment($payment); $token= new Token(); $token->amount=$room->getCost()*(intval($interval->format('%d'))); $token->booking=$bookingRoomTemp->getId(); $token->ref= $bookingRoomTemp->getPayment()->getTransactionRef(); $bookingRoomTemp->getPayment()->setPaymentToken( base64_encode(json_encode( $token)) ); $bookingRoomTemp->setPaymentLink($this->getGeneratePaymentUrl($bookingRoomTemp)); $bookingRoomTemp->setPaymentNotificationLink($this->getNotifyPaymentLink()); $bookingRoomTemp->getPayment()->setPaymentOption( $this->entityManager->getRepository(PaymentOption::class)->findOneBy(array('isCash'=>true))); $this->entityManager->persist($bookingRoomTemp); $this->entityManager->flush(); return new JsonResponse(json_encode( array( "bookingId"=>$bookingRoomTemp->getId(), "paymentLink"=>$this->getGeneratePaymentUrl($bookingRoomTemp), "result"=>$result, "payBefore"=>$bookingRoomTemp->getRoom()->isPayBefore(), "resultCode"=>200, "message"=>"success", "notificationLink"=>$this->getGeneratePaymentUrl( $bookingRoomTemp), ) ), Response::HTTP_ACCEPTED); }else{ return new JsonResponse(json_encode( array( "bookingId"=>null, "paymentLink"=>null, "notificationLink"=>null, "resultCode"=>406, "payBefore"=>false, "message"=>"Room Not Available From", "result"=>$result, ) ), Response::HTTP_NOT_ACCEPTABLE); } } const NOTIFY_PAYMENT = "app_payment_notify"; public function getNotifyPaymentLink(): string { return $this->urlGenerator->generate(self::NOTIFY_PAYMENT); } /** * @Route("/building/navigation", name="app_building_navigation") */ public function index(Request $request): Response { $town=$request->get("destination"); $building=$request->get("building"); $startDate=$request->get("startDate"); if(sizeof($startDate)==10){ $startDate=$startDate." 12:00"; } $endDate=$request->get("endDate"); if(sizeof($endDate)==10){ $endDate=$endDate." 12:01"; } $adult=$request->get("adult"); $child=$request->get("child"); if(empty($adult)|| !isset($adult)){ $adult=1; } $local=$request->getLocale(); $language=""; $onlinePath=$request->getBasePath(); if(strcmp($local,"fr")==0) { $language=" <a href=\"#!\" class=\"dropdown-button grey-text text-darken-1\" data-activates='choose_language' style=\"font-size: 18px\"><img src=\"".$onlinePath."/img/french_flag.png\" style=\"height: 24px; width: 24px;margin-right: 10px; margin-bottom: -6px\" alt=\"\"> Français</a>"; $body=' <li> <a href="'.$onlinePath.'/change_locale/en" class="grey-text text-darken-1" style="font-size: 18px"><img src="'.$onlinePath.'/img/flag_england.png" style="height: 27px; width: 24px;margin-right: 10px; margin-bottom: -6px" alt=""> Anglais</a></li> <li> <a href="'.$onlinePath.'/change_locale/es" class="grey-text text-darken-1" style="font-size: 18px"><img src="'.$onlinePath.'/img/flag_spanish.png" style="height: 24px; width: 24px;margin-right: 10px; margin-bottom: -6px" alt=""> Espagnol</a></li> <li> <a href="'.$onlinePath.'/change_locale/it" class="grey-text text-darken-1" style="font-size: 18px"><img src="'.$onlinePath.'/img/italiano_flag.png" style="height: 24px; width: 24px;margin-right: 10px; margin-bottom: -6px" alt=""> Italien</a></li> <li> <a href="'.$onlinePath.'/change_locale/zh_CN" class="grey-text text-darken-1" style="font-size: 18px"><img src="'.$onlinePath.'/img/china_flag.png" style="height: 24px; width: 24px;margin-right: 10px; margin-bottom: -6px" alt=""> Chinois</a></li> '; }else if(strcmp($local,"es")==0) { $language=" <a href=\"#!\" class=\"dropdown-button grey-text text-darken-1\" data-activates='choose_language' style=\"font-size: 18px\"><img src=\"".$onlinePath."/img/flag_spanish.png\" style=\"height: 24px; width: 24px;margin-right: 10px; margin-bottom: -6px\" alt=\"\"> Español</a>"; $body=' <li> <a href="'.$onlinePath.'/change_locale/fr" class="grey-text text-darken-1" style="font-size: 18px"><img src="'.$onlinePath.'/img/french_flag.png" style="height: 24px; width: 24px;margin-right: 10px; margin-bottom: -6px" alt=""> Francés</a></li> <li> <a href="'.$onlinePath.'/change_locale/en" class="grey-text text-darken-1" style="font-size: 18px"><img src="'.$onlinePath.'/img/flag_england.png" style="height: 27px; width: 24px;margin-right: 10px; margin-bottom: -6px" alt=""> Inglés</a></li> <li> <a href="'.$onlinePath.'/change_locale/it" class="grey-text text-darken-1" style="font-size: 18px"><img src="'.$onlinePath.'/img/italiano_flag.png" style="height: 24px; width: 24px;margin-right: 10px; margin-bottom: -6px" alt=""> Italiano</a></li> <li> <a href="'.$onlinePath.'/change_locale/zh_CN" class="grey-text text-darken-1" style="font-size: 18px"><img src="'.$onlinePath.'/img/china_flag.png" style="height: 24px; width: 24px;margin-right: 10px; margin-bottom: -6px" alt=""> Chinise</a></li> '; }else if (strcmp($local,"en")==0) { $language=" <a href=\"#!\" class=\"dropdown-button grey-text text-darken-1\" data-activates='choose_language'style=\"font-size: 18px\"><img src=\"".$onlinePath."/img/flag_england.png\" style=\"height: 27px; width: 24px;margin-right: 10px; margin-bottom: -6px\" alt=\"\"> English</a>"; $body=' <li> <a href="'.$onlinePath.'/change_locale/fr" class="grey-text text-darken-1" style="font-size: 18px"><img src="'.$onlinePath.'/img/french_flag.png" style="height: 24px; width: 24px;margin-right: 10px; margin-bottom: -6px" alt=""> French</a></li> <li> <a href="'.$onlinePath.'/change_locale/it" class="grey-text text-darken-1" style="font-size: 18px"><img src="'.$onlinePath.'/img/italiano_flag.png" style="height: 24px; width: 24px;margin-right: 10px; margin-bottom: -6px" alt=""> Italiano</a></li> <li> <a href="'.$onlinePath.'/change_locale/zh_CN" class="grey-text text-darken-1" style="font-size: 18px"><img src="'.$onlinePath.'/img/china_flag.png" style="height: 24px; width: 24px;margin-right: 10px; margin-bottom: -6px" alt=""> Chinise</a></li> <li> <a href="'.$onlinePath.'/change_locale/es" class="grey-text text-darken-1" style="font-size: 18px"><img src="'.$onlinePath.'/img/flag_spanish.png" style="height: 27px; width: 24px;margin-right: 10px; margin-bottom: -6px" alt=""> Spanish</a></li>'; }else if (strcmp($local,"it")==0) { $language=" <a href=\"#\" class=\"dropdown-button grey-text text-darken-1\" data-activates='choose_language'style=\"font-size: 18px\"><img src=\"".$onlinePath."/img/italiano_flag.png\" style=\"height: 27px; width: 24px;margin-right: 10px; margin-bottom: -6px\" alt=\"\"> Italiano</a>"; $body=' <li> <a href="'.$onlinePath.'/change_locale/fr" class="grey-text text-darken-1" style="font-size: 18px"><img src="'.$onlinePath.'/img/french_flag.png" style="height: 24px; width: 24px;margin-right: 10px; margin-bottom: -6px" alt=""> Francese</a></li> <li> <a href="'.$onlinePath.'/change_locale/en" class="grey-text text-darken-1" style="font-size: 18px"><img src="'.$onlinePath.'/img/flag_england.png" style="height: 24px; width: 24px;margin-right: 10px; margin-bottom: -6px" alt=""> inglese</a></li> <li> <a href="'.$onlinePath.'/change_locale/zh_CN" class="grey-text text-darken-1" style="font-size: 18px"><img src="'.$onlinePath.'/img/china_flag.png" style="height: 24px; width: 24px;margin-right: 10px; margin-bottom: -6px" alt=""> Cinese</a></li> <li> <a href="'.$onlinePath.'/change_locale/es" class="grey-text text-darken-1" style="font-size: 18px"><img src="'.$onlinePath.'/img/flag_spanish.png" style="height: 27px; width: 24px;margin-right: 10px; margin-bottom: -6px" alt=""> Spagnolo</a></li>'; }else if (strcmp($local,"zh_CN")==0) { $language=" <a href=\"#!\" class=\"dropdown-button grey-text text-darken-1\" data-activates='choose_language'style=\"font-size: 18px\"><img src=\"".$onlinePath."/img/china_flag.png\" style=\"height: 27px; width: 24px;margin-right: 10px; margin-bottom: -6px\" alt=\"\"> 中國人</a>"; $body=' <li> <a href="'.$onlinePath.'/change_locale/fr" class="grey-text text-darken-1" style="font-size: 18px"><img src="'.$onlinePath.'/img/french_flag.png" style="height: 24px; width: 24px;margin-right: 10px; margin-bottom: -6px" alt=""> 法語</a></li> <li> <a href="'.$onlinePath.'/change_locale/it" class="grey-text text-darken-1" style="font-size: 18px"><img src="'.$onlinePath.'/img/italiano_flag.png" style="height: 24px; width: 24px;margin-right: 10px; margin-bottom: -6px" alt=""> 意大利語</a></li> <li> <a href="'.$onlinePath.'/change_locale/en" class="grey-text text-darken-1" style="font-size: 18px"><img src="'.$onlinePath.'/img/flag_england.png" style="height: 24px; width: 24px;margin-right: 10px; margin-bottom: -6px" alt=""> 中國人</a></li> <li> <a href="'.$onlinePath.'/change_locale/es" class="grey-text text-darken-1" style="font-size: 18px"><img src="'.$onlinePath.'/img/flag_spanish.png" style="height: 27px; width: 24px;margin-right: 10px; margin-bottom: -6px" alt=""> 西班牙語</a></li>'; } $date1 = new DateTime($startDate); $date2 = new DateTime($endDate); $interval = $date1->diff($date2); $sign="+"; $result= $this->entityManager->getRepository(Room::class)->findRoomsByBuilding($building); return $this->render('building_navigation/building_navigation.html.twig', [ 'controller_name' => 'BuildingNavigationController', 'companyName' => $this->getParameter("app_client"), 'languageChoose' => $body, 'onlinePath' => $onlinePath, 'language' => $language, 'building' => $building, 'buildingObjet' => $this->entityManager->getRepository(Building::class)->find($building), 'town' => $town, 'startDate' => $startDate, 'endDate' => $endDate, 'adult' => $adult, 'child' => $child, 'interval' => $sign.$interval->format('%d'), 'showItem' => 2, 'result' => $result, 'appUser' =>$this->getParameter('appUser'), 'host'=>$this->siteURL(), ]); } function siteURL() { $protocol = (!empty($_SERVER['HTTPS']) && $_SERVER['HTTPS'] !== 'off' || $_SERVER['SERVER_PORT'] == 443) ? "https://" : "http://"; $domainName = $_SERVER['HTTP_HOST'].'/'; if ($_SERVER['HTTP_HOST'] == "localhost") { return $protocol.$domainName.$this->getParameter('localRepository')."/".$this->getParameter('apiLink'); }else{ return $protocol.$domainName.$this->getParameter('apiLink'); } } const GENERATE_PAYMENT = "app_payment"; private $urlGenerator; public function getGeneratePaymentUrl(BookingRoom $bookingRoom): string { return $this->urlGenerator->generate(self::GENERATE_PAYMENT,["token"=>$bookingRoom->getPayment()->getPaymentToken()]); } }
Coded With 💗 by
0x6ick