Compare commits

...

7 Commits

Author SHA1 Message Date
baya ed95c3cabb update file .gitignore 2026-06-25 17:08:10 +02:00
baya 8c6180de73 fix bug 25 juin 2026 17:06 2026-06-25 17:06:23 +02:00
baya bc7acb7a65 Merge branch 'main' into HEAD 2026-06-25 16:54:29 +02:00
baya 5ac67deb13 fix bug user 2026-06-25 16:52:29 +02:00
baya 92db930d5c correction rollback 2026-06-25 16:39:37 +02:00
baya 02e9263542 Add Symfony Validation to entity User 2026-06-25 16:09:35 +02:00
baya c21b869641 Add Symfony Validation to entity User 2026-06-25 16:08:56 +02:00
7 changed files with 53 additions and 8 deletions
-4
View File
@@ -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
View File
@@ -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 ###
+24
View File
@@ -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
View File
@@ -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]
+1 -1
View File
@@ -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'));
}
+1 -1
View File
@@ -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>