This commit is contained in:
ragueneaul 2024-11-28 17:08:46 +01:00
commit ad7f61275c
19 changed files with 381 additions and 64 deletions

View File

@ -1,12 +1,38 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="DataSourceManagerImpl" format="xml" multifile-model="true">
<<<<<<< HEAD
<data-source source="LOCAL" name="chauffageproj@172.20.96.1" uuid="633df7e7-7b9a-4298-8a3c-3075313a1153">
=======
<<<<<<< HEAD
<data-source source="LOCAL" name="@172.20.96.1" uuid="76621fd2-6622-4f8e-a632-d7b7602e0afe">
<driver-ref>postgresql</driver-ref>
<synchronize>true</synchronize>
<jdbc-driver>org.postgresql.Driver</jdbc-driver>
<jdbc-url>jdbc:postgresql://172.20.96.1:5432/</jdbc-url>
<working-dir>$ProjectFileDir$</working-dir>
</data-source>
<data-source source="LOCAL" name="hegreconfort@127.0.0.1" uuid="a0219ca4-02a7-456a-bf02-9b3234ed346b">
<driver-ref>mariadb</driver-ref>
<synchronize>true</synchronize>
<jdbc-driver>org.mariadb.jdbc.Driver</jdbc-driver>
<jdbc-url>jdbc:mariadb://127.0.0.1:3306/hegreconfort</jdbc-url>
=======
<data-source source="LOCAL" name="chauffageproj@172.20.96.1" uuid="6554e332-842b-41d7-a021-08782c7b72bb">
<driver-ref>postgresql</driver-ref>
<synchronize>true</synchronize>
<jdbc-driver>org.postgresql.Driver</jdbc-driver>
<jdbc-url>jdbc:postgresql://172.20.96.1:5432/chauffageproj</jdbc-url>
<working-dir>$ProjectFileDir$</working-dir>
</data-source>
<data-source source="LOCAL" name="chauffageproj@172.20.96.1 [2]" uuid="a446f2ca-1dfc-459a-97f5-eda71fd74aa2">
>>>>>>> 6532d4d88b86c321a212cdc0ca43b2e4770db117
<driver-ref>postgresql</driver-ref>
<synchronize>true</synchronize>
<jdbc-driver>org.postgresql.Driver</jdbc-driver>
<jdbc-url>jdbc:postgresql://172.20.96.1:5432/chauffageproj</jdbc-url>
>>>>>>> ee236ff74aaac1882a825817d5ce8f692d3bdd0f
<working-dir>$ProjectFileDir$</working-dir>
</data-source>
</component>
</project>

View File

@ -4,7 +4,16 @@
<option name="autoReloadType" value="SELECTIVE" />
</component>
<component name="ChangeListManager">
<<<<<<< HEAD
<list default="true" id="cf8b8ad0-a5ca-449a-93b5-e4441856adec" name="Changes" comment="" />
=======
<list default="true" id="cf8b8ad0-a5ca-449a-93b5-e4441856adec" name="Changes" comment="">
<change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/config/packages/security.yaml" beforeDir="false" afterPath="$PROJECT_DIR$/config/packages/security.yaml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/Entity/User.php" beforeDir="false" />
<change beforePath="$PROJECT_DIR$/src/Repository/UserRepository.php" beforeDir="false" />
</list>
>>>>>>> 6532d4d88b86c321a212cdc0ca43b2e4770db117
<option name="SHOW_DIALOG" value="false" />
<option name="HIGHLIGHT_CONFLICTS" value="true" />
<option name="HIGHLIGHT_NON_ACTIVE_CHANGELIST" value="false" />
@ -165,19 +174,34 @@
<component name="PropertiesComponent">{
&quot;keyToString&quot;: {
&quot;RunOnceActivity.ShowReadmeOnStart&quot;: &quot;true&quot;,
<<<<<<< HEAD
&quot;git-widget-placeholder&quot;: &quot;develop&quot;,
&quot;last_opened_file_path&quot;: &quot;E:/BTS/PhpStorm/centre_fitness&quot;,
=======
&quot;RunOnceActivity.git.unshallow&quot;: &quot;true&quot;,
&quot;git-widget-placeholder&quot;: &quot;develop&quot;,
&quot;last_opened_file_path&quot;: &quot;/home/ragueneaul@stsio.lan/Documents/DecoMaison_Lucas_Ragueneau&quot;,
>>>>>>> ee236ff74aaac1882a825817d5ce8f692d3bdd0f
&quot;node.js.detected.package.eslint&quot;: &quot;true&quot;,
&quot;node.js.detected.package.tslint&quot;: &quot;true&quot;,
&quot;node.js.selected.package.eslint&quot;: &quot;(autodetect)&quot;,
&quot;node.js.selected.package.tslint&quot;: &quot;(autodetect)&quot;,
&quot;nodejs_package_manager_path&quot;: &quot;npm&quot;,
<<<<<<< HEAD
&quot;php.add.doc.comment.for.fields.panel.add.php.doc.for.all.properties&quot;: &quot;true&quot;,
&quot;settings.editor.selected.configurable&quot;: &quot;inlay.hints&quot;,
=======
>>>>>>> ee236ff74aaac1882a825817d5ce8f692d3bdd0f
&quot;vue.rearranger.settings.migration&quot;: &quot;true&quot;
},
&quot;keyToStringList&quot;: {
&quot;DatabaseDriversLRU&quot;: [
<<<<<<< HEAD
&quot;postgresql&quot;,
&quot;mysql&quot;
=======
&quot;postgresql&quot;
>>>>>>> ee236ff74aaac1882a825817d5ce8f692d3bdd0f
]
}
}</component>
@ -195,8 +219,13 @@
<component name="SharedIndexes">
<attachedChunks>
<set>
<<<<<<< HEAD
<option value="bundled-js-predefined-d6986cc7102b-5c90d61e3bab-JavaScript-PS-242.23726.107" />
<option value="bundled-php-predefined-a98d8de5180a-90914f2295cb-com.jetbrains.php.sharedIndexes-PS-242.23726.107" />
=======
<option value="bundled-js-predefined-d6986cc7102b-e768b9ed790e-JavaScript-PS-243.21565.202" />
<option value="bundled-php-predefined-a98d8de5180a-5fbe0c30323e-com.jetbrains.php.sharedIndexes-PS-243.21565.202" />
>>>>>>> ee236ff74aaac1882a825817d5ce8f692d3bdd0f
</set>
</attachedChunks>
</component>
@ -211,11 +240,18 @@
<workItem from="1728656379062" duration="1875000" />
<workItem from="1728671983731" duration="846000" />
<workItem from="1729167245881" duration="2915000" />
<<<<<<< HEAD
<workItem from="1731589942576" duration="10448000" />
=======
<workItem from="1729175702600" duration="1829000" />
<workItem from="1731589591731" duration="13398000" />
<workItem from="1732193975936" duration="8317000" />
<<<<<<< HEAD
<workItem from="1732797917791" duration="5571000" />
<workItem from="1732804930233" duration="4645000" />
=======
>>>>>>> ee236ff74aaac1882a825817d5ce8f692d3bdd0f
>>>>>>> 6532d4d88b86c321a212cdc0ca43b2e4770db117
</task>
<servers />
</component>

View File

@ -5,6 +5,6 @@ import './bootstrap.js';
* This file will be included onto the page via the importmap() Twig function,
* which should already be in your base.html.twig.
*/
import './styles/app.css';
import './styles/css/app.css';
console.log('This log comes from assets/app.js - welcome to AssetMapper! 🎉');

View File

View File

@ -0,0 +1,67 @@
body {
width: 1500px;
height: 1000px;
background: linear-gradient(#A0C2C8, #A6CD9E);
}
.logo {
position: absolute;
margin: -3% 0 0 1%;
height: 30%;
}
.titre { /*pas fini*/
margin: 4% 10% 0 25%;
font-weight: 50;
font-size: 450%;
}
.background {
position: absolute;
width: 50%;
height: 50%;
left: 25%;
top: 25%;
background: rgba(36, 60, 64, 0.7);
}
.logoEmail {
position: absolute;
margin: 6.5% 0 0 31%;
height: 12%;
background: #243C40;
}
.email {
position: absolute;
margin: 7% 0 0 37.5%;
width: 30%;
height: 9.5%;
background-color: #f0f0f0;
}
.logoPassword {
position: absolute;
margin: 16.5% 0 0 31%;
height: 12%;
background: #243C40;
}
.password {
position: absolute;
margin: 17% 0 0 37.5%;
width: 30%;
height: 9.5%;
background-color: #f0f0f0;
}
/*forgot password*/
.forgot {
position: absolute;
margin: 23.5% 0 0 42.5%;
font-size: 130%;
color: #f0f0f0;
}

BIN
assets/styles/image/1.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 42 KiB

BIN
assets/styles/image/2.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 25 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 52 KiB

View File

@ -4,14 +4,18 @@ security:
Symfony\Component\Security\Core\User\PasswordAuthenticatedUserInterface: 'auto'
# https://symfony.com/doc/current/security.html#loading-the-user-the-user-provider
providers:
users_in_memory: { memory: null }
# used to reload user from session & other features (e.g. switch_user)
app_user_provider:
entity:
class: App\Entity\User
property: email
firewalls:
dev:
pattern: ^/(_(profiler|wdt)|css|images|js)/
security: false
main:
lazy: true
provider: users_in_memory
provider: app_user_provider
# activate different ways to authenticate
# https://symfony.com/doc/current/security.html#the-firewall

View File

@ -0,0 +1,43 @@
<?php
declare(strict_types=1);
namespace DoctrineMigrations;
use Doctrine\DBAL\Schema\Schema;
use Doctrine\Migrations\AbstractMigration;
/**
* Auto-generated Migration: Please modify to your needs!
*/
final class Version20241114151456 extends AbstractMigration
{
public function getDescription(): string
{
return '';
}
public function up(Schema $schema): void
{
// this up() migration is auto-generated, please modify it to your needs
$this->addSql('CREATE TABLE fault (id INT AUTO_INCREMENT NOT NULL, wording VARCHAR(255) NOT NULL, PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
$this->addSql('CREATE TABLE intervention (id INT AUTO_INCREMENT NOT NULL, wording VARCHAR(255) NOT NULL, timestamp DATETIME NOT NULL, description VARCHAR(255) NOT NULL, address VARCHAR(255) NOT NULL, status VARCHAR(255) NOT NULL, PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
$this->addSql('CREATE TABLE skill (id INT AUTO_INCREMENT NOT NULL, wording VARCHAR(255) NOT NULL, description VARCHAR(255) NOT NULL, PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
$this->addSql('CREATE TABLE stock (id INT AUTO_INCREMENT NOT NULL, wording VARCHAR(255) NOT NULL, description VARCHAR(255) NOT NULL, quantity VARCHAR(255) NOT NULL, PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
$this->addSql('CREATE TABLE `user` (id INT AUTO_INCREMENT NOT NULL, first_name VARCHAR(255) NOT NULL, last_name VARCHAR(255) NOT NULL, birth_date DATE NOT NULL, email VARCHAR(255) NOT NULL, phone VARCHAR(255) NOT NULL, type VARCHAR(255) NOT NULL, PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
$this->addSql('CREATE TABLE vehicle (id INT AUTO_INCREMENT NOT NULL, license_plate VARCHAR(255) NOT NULL, brand VARCHAR(255) NOT NULL, PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
$this->addSql('CREATE TABLE messenger_messages (id BIGINT AUTO_INCREMENT NOT NULL, body LONGTEXT NOT NULL, headers LONGTEXT NOT NULL, queue_name VARCHAR(190) NOT NULL, created_at DATETIME NOT NULL COMMENT \'(DC2Type:datetime_immutable)\', available_at DATETIME NOT NULL COMMENT \'(DC2Type:datetime_immutable)\', delivered_at DATETIME DEFAULT NULL COMMENT \'(DC2Type:datetime_immutable)\', INDEX IDX_75EA56E0FB7336F0 (queue_name), INDEX IDX_75EA56E0E3BD61CE (available_at), INDEX IDX_75EA56E016BA31DB (delivered_at), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
}
public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('DROP TABLE fault');
$this->addSql('DROP TABLE intervention');
$this->addSql('DROP TABLE skill');
$this->addSql('DROP TABLE stock');
$this->addSql('DROP TABLE `user`');
$this->addSql('DROP TABLE vehicle');
$this->addSql('DROP TABLE messenger_messages');
}
}

View File

@ -0,0 +1,18 @@
<?php
namespace App\Controller;
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\Routing\Attribute\Route;
class CalendrierController extends AbstractController
{
#[Route('/calendrier', name: 'app_calendrier')]
public function index(): Response
{
return $this->render('calendrier/index.html.twig', [
'controller_name' => 'CalendrierController',
]);
}
}

View File

@ -5,16 +5,21 @@ namespace App\Entity;
use App\Repository\UserRepository;
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;
#[ORM\Entity(repositoryClass: UserRepository::class)]
#[ORM\Table(name: '`user`')]
class User
#[ORM\UniqueConstraint(name: 'UNIQ_IDENTIFIER_EMAIL', fields: ['email'])]
class User implements UserInterface, PasswordAuthenticatedUserInterface
{
#[ORM\Id]
#[ORM\GeneratedValue]
#[ORM\Column]
private ?int $id = null;
#[ORM\Column(length: 180)]
private ?string $email = null;
#[ORM\Column(length: 255)]
private ?string $FirstName = null;
@ -29,84 +34,154 @@ class User
#[ORM\Column(length: 255)]
private ?string $Phone = null;
/**
* @var list<string> The user roles
*/
#[ORM\Column]
private array $roles = [];
#[ORM\Column(length: 255)]
private ?string $Type = null;
/**
* @var string The hashed password
*/
#[ORM\Column]
private ?string $password = null;
public function getId(): ?int
{
return $this->id;
}
public function getFirstName(): ?string
{
return $this->FirstName;
}
public function setFirstName(string $FirstName): static
{
$this->FirstName = $FirstName;
return $this;
}
public function getLastName(): ?string
{
return $this->LastName;
}
public function setLastName(string $LastName): static
{
$this->LastName = $LastName;
return $this;
}
/**
* @return \DateTimeInterface|null
*/
public function getBirthDate(): ?\DateTimeInterface
{
return $this->BirthDate;
}
public function setBirthDate(\DateTimeInterface $BirthDate): static
/**
* @param \DateTimeInterface|null $BirthDate
*/
public function setBirthDate(?\DateTimeInterface $BirthDate): void
{
$this->BirthDate = $BirthDate;
return $this;
}
public function getEmail(): ?string
/**
* @return string|null
*/
public function getLastName(): ?string
{
return $this->Email;
return $this->LastName;
}
public function setEmail(string $Email): static
/**
* @param string|null $LastName
*/
public function setLastName(?string $LastName): void
{
$this->Email = $Email;
return $this;
$this->LastName = $LastName;
}
/**
* @return string|null
*/
public function getFirstName(): ?string
{
return $this->FirstName;
}
/**
* @param string|null $FirstName
*/
public function setFirstName(?string $FirstName): void
{
$this->FirstName = $FirstName;
}
/**
* @return string|null
*/
public function getPhone(): ?string
{
return $this->Phone;
}
public function setPhone(string $Phone): static
/**
* @param string|null $Phone
*/
public function setPhone(?string $Phone): void
{
$this->Phone = $Phone;
}
public function getEmail(): ?string
{
return $this->email;
}
public function setEmail(string $email): static
{
$this->email = $email;
return $this;
}
public function getType(): ?string
/**
* A visual identifier that represents this user.
*
* @see UserInterface
*/
public function getUserIdentifier(): string
{
return $this->Type;
return (string) $this->email;
}
public function setType(string $Type): static
/**
* @see UserInterface
*
* @return list<string>
*/
public function getRoles(): array
{
$this->Type = $Type;
$roles = $this->roles;
// guarantee every user at least has ROLE_USER
$roles[] = 'ROLE_USER';
return array_unique($roles);
}
/**
* @param list<string> $roles
*/
public function setRoles(array $roles): static
{
$this->roles = $roles;
return $this;
}
/**
* @see PasswordAuthenticatedUserInterface
*/
public function getPassword(): ?string
{
return $this->password;
}
public function setPassword(string $password): static
{
$this->password = $password;
return $this;
}
/**
* @see UserInterface
*/
public function eraseCredentials(): void
{
// If you store any temporary, sensitive data on the user, clear it here
// $this->plainPassword = null;
}
}

View File

@ -5,17 +5,34 @@ namespace App\Repository;
use App\Entity\User;
use Doctrine\Bundle\DoctrineBundle\Repository\ServiceEntityRepository;
use Doctrine\Persistence\ManagerRegistry;
use Symfony\Component\Security\Core\Exception\UnsupportedUserException;
use Symfony\Component\Security\Core\User\PasswordAuthenticatedUserInterface;
use Symfony\Component\Security\Core\User\PasswordUpgraderInterface;
/**
* @extends ServiceEntityRepository<User>
*/
class UserRepository extends ServiceEntityRepository
class UserRepository extends ServiceEntityRepository implements PasswordUpgraderInterface
{
public function __construct(ManagerRegistry $registry)
{
parent::__construct($registry, User::class);
}
/**
* Used to upgrade (rehash) the user's password automatically over time.
*/
public function upgradePassword(PasswordAuthenticatedUserInterface $user, string $newHashedPassword): void
{
if (!$user instanceof User) {
throw new UnsupportedUserException(sprintf('Instances of "%s" are not supported.', $user::class));
}
$user->setPassword($newHashedPassword);
$this->getEntityManager()->persist($user);
$this->getEntityManager()->flush();
}
// /**
// * @return User[] Returns an array of User objects
// */

View File

@ -0,0 +1,20 @@
{% extends 'base.html.twig' %}
{% block title %}Hello CalendrierController!{% endblock %}
{% block body %}
<style>
.example-wrapper { margin: 1em auto; max-width: 800px; width: 95%; font: 18px/1.5 sans-serif; }
.example-wrapper code { background: #F5F5F5; padding: 2px 6px; }
</style>
<div class="example-wrapper">
<h1>Hello {{ controller_name }}! ✅</h1>
This friendly message is coming from:
<ul>
<li>Your controller at <code>/home/allarda@stsio.lan/Test/HegreEtConfort/src/Controller/CalendrierController.php</code></li>
<li>Your template at <code>/home/allarda@stsio.lan/Test/HegreEtConfort/templates/calendrier/index.html.twig</code></li>
</ul>
</div>
{% endblock %}

View File

@ -1,20 +1,31 @@
{% extends 'base.html.twig' %}
<!DOCTYPE html>
<html lang="fr, en">
<head>
<meta charset="UTF-8">
<title>{% block title %}Authentification{% endblock %}</title>
<link href="{{ asset('styles/css/authentification.css') }}" rel='stylesheet'>
<link rel="icon" href="data:image/svg+xml,<svg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 128 128%22><text y=%221.2em%22 font-size=%2296%22>⚫️</text><text y=%221.3em%22 x=%220.2em%22 font-size=%2276%22 fill=%22%23fff%22>sf</text></svg>">
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-QWTKZyjpPEjISv5WaRU9OFeRpok6YctnYmDr5pNlyT2bRjXh0JMhjY6hW+ALEwIH" crossorigin="anonymous">
{% block stylesheets %}
{% endblock %}
</head>
<body>
{% block title %}Hello LoginController!{% endblock %}
{% block body %}
<style>
.example-wrapper { margin: 1em auto; max-width: 800px; width: 95%; font: 18px/1.5 sans-serif; }
.example-wrapper code { background: #F5F5F5; padding: 2px 6px; }
</style>
<div class="example-wrapper">
<h1>Hello {{ controller_name }}! ✅</h1>
This friendly message is coming from:
<ul>
<li>Your controller at <code>E:/BTS/PhpStorm/HegreEtConfort/src/Controller/LoginController.php</code></li>
<li>Your template at <code>E:/BTS/PhpStorm/HegreEtConfort/templates/login/index.html.twig</code></li>
</ul>
<div class="row" id="xxx">
<div class="col-2"><img class="logo" src="{{ asset('styles/image/LogoHegreConfort_SansFond.png') }}" alt="Logo Hegre et Confort"></div>
<div class="col-10"><h1 class="titre">D'HEGRE ET CONFORT</h1></div>
</div>
{% endblock %}
<section>
<div class="background"></div>
<img class="logoEmail" src="{{ asset('styles/image/1.png') }}">
<input class="email" type="email" placeholder="Adresse mail">
<img class="logoPassword" src="{{ asset('styles/image/2.png') }}">
<input class="password" type="password" placeholder="Mot de passe">
</section>
<p class="forgot"> Mot de passe oublié ?</p>
</body>
</html>