Compare commits
7 Commits
dbf23badf9
...
main
| Author | SHA1 | Date | |
|---|---|---|---|
| ed95c3cabb | |||
| 8c6180de73 | |||
| bc7acb7a65 | |||
| 5ac67deb13 | |||
| 92db930d5c | |||
| 02e9263542 | |||
| c21b869641 |
@@ -37,7 +37,3 @@ LISTMONK_BASE_URL=https://listmonk.powerpme.com
|
||||
LISTMONK_API_USER=
|
||||
LISTMONK_TOKEN=
|
||||
###> LISTMONK/API ###
|
||||
|
||||
###> monolog/mattermost ###
|
||||
MATTERMOST_WEBHOOK_URL=https://mattermost.powerpme.com/hooks/
|
||||
###< monolog/mattermost ###
|
||||
+2
-1
@@ -5,6 +5,7 @@
|
||||
/.env.*.local
|
||||
/config/secrets/prod/prod.decrypt.private.php
|
||||
/public/bundles/
|
||||
/public/downloader/
|
||||
/var/
|
||||
/vendor/
|
||||
###< symfony/framework-bundle ###
|
||||
###< symfony/framework-bundle ###
|
||||
@@ -12,6 +12,8 @@ use Symfony\Component\Routing\Attribute\Route;
|
||||
|
||||
use Psr\Log\LoggerInterface;
|
||||
|
||||
use Symfony\Component\Process\Process;
|
||||
|
||||
#[Route('/admin/test')]
|
||||
final class TestController extends AbstractController
|
||||
{
|
||||
@@ -63,4 +65,26 @@ final class TestController extends AbstractController
|
||||
|
||||
return $this->render('/frontend/test.html.twig', []);
|
||||
}
|
||||
|
||||
#[Route('/url', name: 'app_test_url')]
|
||||
public function url()
|
||||
{
|
||||
$process = new Process([
|
||||
'yt-dlp',
|
||||
'--print',
|
||||
'%(title)s|%(filesize,filesize_approx)s',
|
||||
'--', // 🛡️ Protection cruciale contre l'injection d'arguments
|
||||
'https://www.youtube.com/watch?v=Z8hhP38-4Eg'
|
||||
]);
|
||||
|
||||
$process->run();
|
||||
|
||||
//dd($process->getOutput());
|
||||
if (!$process->isSuccessful()) {
|
||||
echo $process->getCommandLine() . "<br>" . $process->getErrorOutput();
|
||||
die;
|
||||
return new Response("error1", Response::HTTP_INTERNAL_SERVER_ERROR);
|
||||
}
|
||||
}
|
||||
//
|
||||
}
|
||||
|
||||
@@ -30,6 +30,7 @@ use App\Entity\UserDownloader;
|
||||
use App\Entity\AnonymeDownloader;
|
||||
|
||||
use App\Service\Frontend\DownloadService;
|
||||
use App\Service\Frontend\ListmonkMailerService;
|
||||
|
||||
use Symfony\Component\HttpFoundation\BinaryFileResponse;
|
||||
|
||||
@@ -46,6 +47,7 @@ final class HomeController extends AbstractController
|
||||
private readonly TranslatorInterface $translator,
|
||||
private ParameterBagInterface $params,
|
||||
private DownloadService $downloadService,
|
||||
private readonly ListmonkMailerService $mailer,
|
||||
) {
|
||||
$this->projectDir = $params->get('kernel.project_dir');
|
||||
}
|
||||
@@ -344,4 +346,22 @@ final class HomeController extends AbstractController
|
||||
return $this->redirectToRoute('app_frontend_history');
|
||||
}
|
||||
|
||||
|
||||
|
||||
#[Route('/test', name: 'app_test')]
|
||||
public function test()
|
||||
{
|
||||
die;
|
||||
$this->mailer->send(
|
||||
['maher.tili@gmail.com'],
|
||||
7,
|
||||
['name'=> 'Monjie', 'video'=> 'mon happy movie test', 'date'=> '19/06/2026 15:45', 'url'=> 'https://video.powerpme.com/downloder/user/4/'],
|
||||
'external',
|
||||
['Content-Type' => 'application/json; charset=utf-8']
|
||||
);
|
||||
|
||||
dd($result);
|
||||
die;
|
||||
return $this->render('/frontend/test.html.twig', []);
|
||||
}
|
||||
}
|
||||
|
||||
+5
-1
@@ -9,9 +9,12 @@ use Doctrine\DBAL\Types\Types;
|
||||
use Doctrine\ORM\Mapping as ORM;
|
||||
use Symfony\Component\Security\Core\User\PasswordAuthenticatedUserInterface;
|
||||
use Symfony\Component\Security\Core\User\UserInterface;
|
||||
use Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntity;
|
||||
use Symfony\Component\Validator\Constraints as Assert;
|
||||
|
||||
#[ORM\Entity(repositoryClass: UserRepository::class)]
|
||||
#[ORM\Table(name: '`user`')]
|
||||
#[ORM\Entity(repositoryClass: UserRepository::class)]
|
||||
#[UniqueEntity(fields: ['email'], message: 'There is already an account with this email.')]
|
||||
class User implements UserInterface, PasswordAuthenticatedUserInterface
|
||||
{
|
||||
#[ORM\Id]
|
||||
@@ -20,6 +23,7 @@ class User implements UserInterface, PasswordAuthenticatedUserInterface
|
||||
private ?int $id = null;
|
||||
|
||||
#[ORM\Column(length: 180, unique: true)]
|
||||
#[Assert\Email]
|
||||
private ?string $email = null;
|
||||
|
||||
#[ORM\Column]
|
||||
|
||||
@@ -64,7 +64,7 @@ class LoginAuthenticator extends AbstractLoginFormAuthenticator
|
||||
$this->em->clear();
|
||||
|
||||
if ($user->hasRole('ROLE_ADMIN')) {
|
||||
return new RedirectResponse($this->urlGenerator->generate('app_test_test1'));
|
||||
return new RedirectResponse($this->urlGenerator->generate('admin_home_index'));
|
||||
} else {
|
||||
return new RedirectResponse($this->urlGenerator->generate('app_frontend_home'));
|
||||
}
|
||||
|
||||
@@ -143,6 +143,6 @@
|
||||
}
|
||||
|
||||
</script>
|
||||
<script src="{{ asset('assets/js/frontend.js?v=1') }}"></script>
|
||||
<script src="{{ asset('assets/js/frontend.js?v=2') }}"></script>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
Reference in New Issue
Block a user