fix(continuous-integration): correction php-cs-fixer
All checks were successful
Cadoles/nineskeletor/pipeline/pr-master This commit looks good
All checks were successful
Cadoles/nineskeletor/pipeline/pr-master This commit looks good
This commit is contained in:
@@ -2,12 +2,10 @@
|
||||
|
||||
namespace App\Entity;
|
||||
|
||||
use App\Repository\AuditRepository;
|
||||
use Doctrine\DBAL\Types\Types;
|
||||
use Doctrine\ORM\Mapping as ORM;
|
||||
|
||||
/**
|
||||
* Cron
|
||||
* Cron.
|
||||
*
|
||||
* @ORM\Table(name="audit",indexes={@ORM\Index(name="search_idx", columns={"entityname", "entityid", "datesubmit"})})
|
||||
* @ORM\Entity(repositoryClass="App\Repository\AuditRepository")
|
||||
@@ -33,8 +31,7 @@ class Audit
|
||||
/**
|
||||
* @ORM\Column(type="datetime")
|
||||
*/
|
||||
private $datesubmit;
|
||||
|
||||
private $datesubmit;
|
||||
|
||||
/**
|
||||
* @ORM\Column(type="string", length=250, nullable=false)
|
||||
@@ -49,7 +46,7 @@ class Audit
|
||||
/**
|
||||
* @ORM\Column(type="array", nullable=true)
|
||||
*/
|
||||
private $detail = array();
|
||||
private $detail = [];
|
||||
|
||||
public function getId(): ?int
|
||||
{
|
||||
@@ -127,6 +124,4 @@ class Audit
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
@@ -2,12 +2,10 @@
|
||||
|
||||
namespace App\Entity;
|
||||
|
||||
use App\Repository\ConfigRepository;
|
||||
use Doctrine\DBAL\Types\Types;
|
||||
use Doctrine\ORM\Mapping as ORM;
|
||||
|
||||
/**
|
||||
* Cron
|
||||
* Cron.
|
||||
*
|
||||
* @ORM\Table(name="config")
|
||||
* @ORM\HasLifecycleCallbacks()
|
||||
@@ -75,8 +73,8 @@ class Config
|
||||
*/
|
||||
private $help;
|
||||
|
||||
//== CODE A NE PAS REGENERER
|
||||
|
||||
// == CODE A NE PAS REGENERER
|
||||
|
||||
public function setId(string $id): self
|
||||
{
|
||||
$this->id = $id;
|
||||
@@ -86,18 +84,20 @@ class Config
|
||||
|
||||
public function getValue(): ?string
|
||||
{
|
||||
if($this->value=="") return $this->default;
|
||||
else return $this->value;
|
||||
if ('' == $this->value) {
|
||||
return $this->default;
|
||||
} else {
|
||||
return $this->value;
|
||||
}
|
||||
}
|
||||
|
||||
//== FIN DU CODE A NE PAS REGENERER
|
||||
// == FIN DU CODE A NE PAS REGENERER
|
||||
|
||||
public function getId(): ?string
|
||||
{
|
||||
return $this->id;
|
||||
}
|
||||
|
||||
|
||||
public function getTitle(): ?string
|
||||
{
|
||||
return $this->title;
|
||||
|
@@ -2,12 +2,11 @@
|
||||
|
||||
namespace App\Entity;
|
||||
|
||||
use Doctrine\DBAL\Types\Types;
|
||||
use Doctrine\ORM\Mapping as ORM;
|
||||
use Symfony\Component\Validator\Constraints as Assert;
|
||||
|
||||
/**
|
||||
* Cron
|
||||
* Cron.
|
||||
*
|
||||
* @ORM\Table(name="cron")
|
||||
* @ORM\Entity(repositoryClass="App\Repository\CronRepository")
|
||||
@@ -15,7 +14,7 @@ use Symfony\Component\Validator\Constraints as Assert;
|
||||
class Cron
|
||||
{
|
||||
/**
|
||||
* @var integer
|
||||
* @var int
|
||||
*
|
||||
* @ORM\Column(name="id", type="integer")
|
||||
* @ORM\Id
|
||||
@@ -28,70 +27,72 @@ class Cron
|
||||
*
|
||||
* @ORM\Column(name="command", type="string", nullable=false)
|
||||
* @Assert\NotBlank()
|
||||
*
|
||||
*/
|
||||
private $command;
|
||||
|
||||
/**
|
||||
* @ORM\Column(type="text", nullable=true)
|
||||
*/
|
||||
private $description;
|
||||
private $description;
|
||||
|
||||
/**
|
||||
* @ORM\Column(type="integer", nullable=true)
|
||||
*/
|
||||
private $statut;
|
||||
private $statut;
|
||||
|
||||
/**
|
||||
* @ORM\Column(type="datetime", nullable=false)
|
||||
*/
|
||||
private $submitdate;
|
||||
private $submitdate;
|
||||
|
||||
/**
|
||||
* @ORM\Column(type="datetime", nullable=true)
|
||||
*/
|
||||
private $startexecdate;
|
||||
private $startexecdate;
|
||||
|
||||
/**
|
||||
* @ORM\Column(type="datetime", nullable=true)
|
||||
*/
|
||||
private $endexecdate;
|
||||
private $endexecdate;
|
||||
|
||||
/**
|
||||
* @ORM\Column(type="datetime", nullable=true)
|
||||
*/
|
||||
private $nextexecdate;
|
||||
private $nextexecdate;
|
||||
|
||||
/**
|
||||
* @ORM\Column(type="integer", nullable=true)
|
||||
*/
|
||||
private $repeatinterval;
|
||||
private $repeatinterval;
|
||||
|
||||
/**
|
||||
* @ORM\Column(type="text", nullable=true)
|
||||
*/
|
||||
private $jsonargument;
|
||||
|
||||
private $jsonargument;
|
||||
|
||||
// A garder pour forcer l'id en init
|
||||
public function setId($id)
|
||||
{
|
||||
$this->id = $id;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
$this->submitdate = new \DateTime();
|
||||
}
|
||||
$this->submitdate = new \DateTime();
|
||||
}
|
||||
|
||||
// A garder pour récupérer le label du statut
|
||||
public function getStatutLabel()
|
||||
{
|
||||
switch($this->statut) {
|
||||
case -1: return "Désactivé"; break;
|
||||
case 0: return "KO"; break;
|
||||
case 1: return "OK"; break;
|
||||
switch ($this->statut) {
|
||||
case -1: return 'Désactivé';
|
||||
break;
|
||||
case 0: return 'KO';
|
||||
break;
|
||||
case 1: return 'OK';
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -1,11 +1,10 @@
|
||||
<?php
|
||||
|
||||
namespace App\Entity;
|
||||
|
||||
use Doctrine\Common\Collections\Collection;
|
||||
use Doctrine\DBAL\Types\Types;
|
||||
use Doctrine\ORM\Mapping as ORM;
|
||||
use Doctrine\Common\Collections\ArrayCollection;
|
||||
|
||||
use Doctrine\Common\Collections\Collection;
|
||||
use Doctrine\ORM\Mapping as ORM;
|
||||
use Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntity;
|
||||
|
||||
/**
|
||||
@@ -13,7 +12,7 @@ use Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntity;
|
||||
* @ORM\Table(name="groupe")
|
||||
* @ORM\HasLifecycleCallbacks()
|
||||
* @ORM\Entity(repositoryClass="App\Repository\GroupRepository")
|
||||
*
|
||||
*
|
||||
* @UniqueEntity(fields="label", message="Un group existe déjà avec ce label")
|
||||
*/
|
||||
class Group
|
||||
@@ -31,10 +30,10 @@ class Group
|
||||
private $label;
|
||||
|
||||
/**
|
||||
* @var string
|
||||
*
|
||||
* @ORM\Column(name="description", type="text", nullable=true)
|
||||
*/
|
||||
* @var string
|
||||
*
|
||||
* @ORM\Column(name="description", type="text", nullable=true)
|
||||
*/
|
||||
private $description;
|
||||
|
||||
/**
|
||||
@@ -46,12 +45,12 @@ class Group
|
||||
* @ORM\Column(type="boolean", options={"default" : false})
|
||||
*/
|
||||
private $isopen;
|
||||
|
||||
|
||||
/**
|
||||
* @ORM\Column(type="boolean", options={"default" : false})
|
||||
*/
|
||||
private $isworkgroup;
|
||||
|
||||
private $isworkgroup;
|
||||
|
||||
/**
|
||||
* @ORM\Column(type="string")
|
||||
*/
|
||||
@@ -66,7 +65,7 @@ class Group
|
||||
* @ORM\Column(type="text", nullable=true)
|
||||
*/
|
||||
private $attributes;
|
||||
|
||||
|
||||
/**
|
||||
* @ORM\Column(type="text", nullable=true)
|
||||
*/
|
||||
@@ -79,7 +78,7 @@ class Group
|
||||
private $owner;
|
||||
|
||||
/**
|
||||
* @var ArrayCollection $users
|
||||
* @var ArrayCollection
|
||||
* @var UserGroup
|
||||
*
|
||||
* @ORM\OneToMany(targetEntity="UserGroup", mappedBy="group", cascade={"persist"}, orphanRemoval=true)
|
||||
@@ -91,13 +90,14 @@ class Group
|
||||
$this->users = new ArrayCollection();
|
||||
}
|
||||
|
||||
//== CODE A NE PAS REGENERER
|
||||
// == CODE A NE PAS REGENERER
|
||||
public function setId(int $id): self
|
||||
{
|
||||
$this->id = $id;
|
||||
|
||||
return $this;
|
||||
}
|
||||
//== FIN DU CODE A NE PAS REGENERER
|
||||
// == FIN DU CODE A NE PAS REGENERER
|
||||
|
||||
public function getId(): ?int
|
||||
{
|
||||
|
@@ -1,20 +1,19 @@
|
||||
<?php
|
||||
|
||||
namespace App\Entity;
|
||||
|
||||
use Doctrine\Common\Collections\Collection;
|
||||
use Doctrine\DBAL\Types\Types;
|
||||
use Doctrine\ORM\Mapping as ORM;
|
||||
use App\Validator;
|
||||
use Doctrine\Common\Collections\ArrayCollection;
|
||||
|
||||
use Doctrine\Common\Collections\Collection;
|
||||
use Doctrine\ORM\Mapping as ORM;
|
||||
use Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntity;
|
||||
use App\Validator as Validator;
|
||||
|
||||
/**
|
||||
* @ORM\Entity
|
||||
* @ORM\Table(name="niveau01")
|
||||
* @ORM\HasLifecycleCallbacks()
|
||||
* @ORM\Entity(repositoryClass="App\Repository\Niveau01Repository")
|
||||
*
|
||||
*
|
||||
* @UniqueEntity(fields="label", message="Un Niveau de rang 01 existe déjà avec ce label")
|
||||
*/
|
||||
class Niveau01
|
||||
@@ -30,9 +29,9 @@ class Niveau01
|
||||
* @ORM\Column(type="string", length=250, unique=true)
|
||||
* @Validator\Grouplabel()
|
||||
* @Validator\Niveau01unique()
|
||||
*/
|
||||
*/
|
||||
private $label;
|
||||
|
||||
|
||||
/**
|
||||
* @ORM\Column(type="string")
|
||||
*/
|
||||
@@ -54,7 +53,7 @@ class Niveau01
|
||||
private $idexternal;
|
||||
|
||||
/**
|
||||
* @var ArrayCollection $niveau02s
|
||||
* @var ArrayCollection
|
||||
* @var Registration
|
||||
*
|
||||
* @ORM\OneToMany(targetEntity="Niveau02", mappedBy="niveau01", cascade={"persist"}, orphanRemoval=false)
|
||||
@@ -62,7 +61,7 @@ class Niveau01
|
||||
private $niveau02s;
|
||||
|
||||
/**
|
||||
* @var ArrayCollection $registrations
|
||||
* @var ArrayCollection
|
||||
* @var Registration
|
||||
*
|
||||
* @ORM\OneToMany(targetEntity="Registration", mappedBy="niveau01", cascade={"persist"}, orphanRemoval=false)
|
||||
@@ -70,16 +69,15 @@ class Niveau01
|
||||
private $registrations;
|
||||
|
||||
/**
|
||||
* @var ArrayCollection $users
|
||||
* @var ArrayCollection
|
||||
* @var User
|
||||
*
|
||||
* @ORM\OneToMany(targetEntity="User", mappedBy="niveau01", cascade={"persist"}, orphanRemoval=false)
|
||||
*/
|
||||
private $users;
|
||||
|
||||
|
||||
/**
|
||||
* @var ArrayCollection $modos
|
||||
* @var ArrayCollection
|
||||
* @var User
|
||||
*
|
||||
* @ORM\OneToMany(targetEntity="UserModo", mappedBy="niveau01", cascade={"persist"}, orphanRemoval=false)
|
||||
@@ -94,14 +92,14 @@ class Niveau01
|
||||
$this->modos = new ArrayCollection();
|
||||
}
|
||||
|
||||
|
||||
//== CODE A NE PAS REGENERER
|
||||
// == CODE A NE PAS REGENERER
|
||||
public function setId(int $id): self
|
||||
{
|
||||
$this->id = $id;
|
||||
|
||||
return $this;
|
||||
}
|
||||
//== FIN DU CODE A NE PAS REGENERER
|
||||
// == FIN DU CODE A NE PAS REGENERER
|
||||
|
||||
public function getId(): ?int
|
||||
{
|
||||
@@ -287,6 +285,4 @@ class Niveau01
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
@@ -1,12 +1,12 @@
|
||||
<?php
|
||||
|
||||
namespace App\Entity;
|
||||
|
||||
use App\Validator;
|
||||
use Doctrine\Common\Collections\ArrayCollection;
|
||||
use Doctrine\Common\Collections\Collection;
|
||||
use Doctrine\ORM\Mapping as ORM;
|
||||
use Doctrine\Common\Collections\ArrayCollection;
|
||||
|
||||
use Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntity;
|
||||
use App\Validator as Validator;
|
||||
|
||||
/**
|
||||
* @ORM\Entity
|
||||
@@ -31,7 +31,7 @@ class Niveau02
|
||||
* @Validator\Niveau02unique()
|
||||
*/
|
||||
private $label;
|
||||
|
||||
|
||||
/**
|
||||
* @ORM\Column(type="string")
|
||||
*/
|
||||
@@ -42,17 +42,17 @@ class Niveau02
|
||||
* @ORM\JoinColumn(nullable=false)
|
||||
*/
|
||||
private $niveau01;
|
||||
|
||||
|
||||
/**
|
||||
* @var ArrayCollection $registrations
|
||||
* @var ArrayCollection
|
||||
* @var Registration
|
||||
*
|
||||
* @ORM\OneToMany(targetEntity="Registration", mappedBy="niveau02", cascade={"persist"}, orphanRemoval=false)
|
||||
*/
|
||||
private $registrations;
|
||||
|
||||
/**
|
||||
* @var ArrayCollection $users
|
||||
/**
|
||||
* @var ArrayCollection
|
||||
* @var User
|
||||
*
|
||||
* @ORM\OneToMany(targetEntity="User", mappedBy="niveau02", cascade={"persist"}, orphanRemoval=false)
|
||||
@@ -165,5 +165,4 @@ class Niveau02
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
}
|
||||
|
@@ -1,22 +1,18 @@
|
||||
<?php
|
||||
|
||||
namespace App\Entity;
|
||||
|
||||
use Doctrine\Common\Collections\Collection;
|
||||
use Doctrine\DBAL\Types\Types;
|
||||
use App\Validator;
|
||||
use Doctrine\ORM\Mapping as ORM;
|
||||
use Doctrine\Common\Collections\ArrayCollection;
|
||||
|
||||
use Symfony\Component\Security\Core\User\UserInterface;
|
||||
use Symfony\Component\Security\Core\User\LegacyPasswordAuthenticatedUserInterface;
|
||||
use Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntity;
|
||||
|
||||
use App\Validator as Validator;
|
||||
use Symfony\Component\Security\Core\User\LegacyPasswordAuthenticatedUserInterface;
|
||||
use Symfony\Component\Security\Core\User\UserInterface;
|
||||
|
||||
/**
|
||||
* @ORM\Entity
|
||||
* @ORM\HasLifecycleCallbacks()
|
||||
* @ORM\Entity(repositoryClass="App\Repository\RegistrationRepository")
|
||||
*
|
||||
*
|
||||
* @UniqueEntity(fields="username", message="Un utilisateur existe déjà avec ce login.")
|
||||
* @UniqueEntity(fields="email", message="Un utilisateur existe déjà avec ce mail.")
|
||||
*/
|
||||
@@ -49,7 +45,7 @@ class Registration implements UserInterface, LegacyPasswordAuthenticatedUserInte
|
||||
* @ORM\Column(type="string", length=250)
|
||||
*/
|
||||
private $password;
|
||||
|
||||
|
||||
/**
|
||||
* @Validator\Password()
|
||||
*/
|
||||
@@ -74,7 +70,7 @@ class Registration implements UserInterface, LegacyPasswordAuthenticatedUserInte
|
||||
* @ORM\Column(type="string", length=250, nullable=true)
|
||||
*/
|
||||
private $postaladress;
|
||||
|
||||
|
||||
/**
|
||||
* @ORM\Column(type="string", length=60, nullable=true)
|
||||
*/
|
||||
@@ -84,11 +80,11 @@ class Registration implements UserInterface, LegacyPasswordAuthenticatedUserInte
|
||||
* @ORM\Column(type="string", length=250, nullable=true)
|
||||
*/
|
||||
private $job;
|
||||
|
||||
|
||||
/**
|
||||
* @ORM\Column(type="string", length=250, nullable=true)
|
||||
*/
|
||||
private $position;
|
||||
private $position;
|
||||
|
||||
/**
|
||||
* @ORM\Column(name="motivation", type="text", nullable=true)
|
||||
@@ -103,18 +99,18 @@ class Registration implements UserInterface, LegacyPasswordAuthenticatedUserInte
|
||||
/**
|
||||
* @ORM\Column(type="datetime", nullable=true)
|
||||
*/
|
||||
private $keyexpire;
|
||||
private $keyexpire;
|
||||
|
||||
/**
|
||||
* @ORM\Column(type="string", length=60, nullable=true)
|
||||
*/
|
||||
private $keyvalue;
|
||||
private $keyvalue;
|
||||
|
||||
/**
|
||||
* @ORM\Column(type="integer", length=60, nullable=false)
|
||||
*/
|
||||
private $statut;
|
||||
|
||||
|
||||
/**
|
||||
* @ORM\ManyToOne(targetEntity="Niveau01", inversedBy="registrations")
|
||||
* @ORM\JoinColumn(nullable=false)
|
||||
@@ -124,47 +120,45 @@ class Registration implements UserInterface, LegacyPasswordAuthenticatedUserInte
|
||||
/**
|
||||
* @ORM\ManyToOne(targetEntity="Niveau02", inversedBy="registrations")
|
||||
*/
|
||||
private $niveau02;
|
||||
private $niveau02;
|
||||
|
||||
|
||||
//== CODE A NE PAS REGENERER
|
||||
// == CODE A NE PAS REGENERER
|
||||
private $roles;
|
||||
|
||||
|
||||
public function getUserIdentifier(): string
|
||||
{
|
||||
return $this->username;
|
||||
}
|
||||
|
||||
|
||||
public function setPasswordDirect($password)
|
||||
{
|
||||
// Permet de setter le password généré lors de l'inscription
|
||||
$this->password = $password;
|
||||
|
||||
|
||||
return $this;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @see PasswordAuthenticatedUserInterface
|
||||
*/
|
||||
public function getPassword(): string
|
||||
{
|
||||
return $this->password;
|
||||
return $this->password;
|
||||
}
|
||||
|
||||
public function setPassword($password): self
|
||||
{
|
||||
if($password!=$this->password&&$password!=""){
|
||||
if ($password != $this->password && '' != $password) {
|
||||
// Placer le password non encodé dans une variable tempo sur laquel on va appliquer la contraite de form
|
||||
$this->passwordplain = $password;
|
||||
|
||||
// Password encrypté format openldap
|
||||
// Password encrypté format openldap
|
||||
$this->salt = uniqid(mt_rand(), true);
|
||||
$hash = "{SSHA}" . base64_encode(pack("H*", sha1($password . $this->salt)) . $this->salt);
|
||||
$hash = '{SSHA}'.base64_encode(pack('H*', sha1($password.$this->salt)).$this->salt);
|
||||
|
||||
$this->password = $hash;
|
||||
$this->password = $hash;
|
||||
}
|
||||
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
@@ -194,22 +188,24 @@ class Registration implements UserInterface, LegacyPasswordAuthenticatedUserInte
|
||||
|
||||
public function hasRole(string $role): ?bool
|
||||
{
|
||||
return in_array($role,$this->getRoles());
|
||||
return in_array($role, $this->getRoles());
|
||||
}
|
||||
|
||||
public function setRole(string $role): self
|
||||
{
|
||||
if(!$this->hasRole($role))
|
||||
array_push($this->roles,$role);
|
||||
if (!$this->hasRole($role)) {
|
||||
array_push($this->roles, $role);
|
||||
}
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getDisplayname() {
|
||||
return $this->firstname." ".$this->lastname;
|
||||
public function getDisplayname()
|
||||
{
|
||||
return $this->firstname.' '.$this->lastname;
|
||||
}
|
||||
|
||||
//== FIN DU CODE A NE PAS REGENERER
|
||||
// == FIN DU CODE A NE PAS REGENERER
|
||||
|
||||
public function getId(): ?int
|
||||
{
|
||||
@@ -414,5 +410,4 @@ class Registration implements UserInterface, LegacyPasswordAuthenticatedUserInte
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
}
|
||||
|
@@ -1,23 +1,21 @@
|
||||
<?php
|
||||
|
||||
namespace App\Entity;
|
||||
|
||||
use Doctrine\Common\Collections\Collection;
|
||||
use Doctrine\DBAL\Types\Types;
|
||||
use Doctrine\ORM\Mapping as ORM;
|
||||
use App\Validator;
|
||||
use Doctrine\Common\Collections\ArrayCollection;
|
||||
|
||||
use Symfony\Component\Security\Core\User\UserInterface;
|
||||
use Symfony\Component\Security\Core\User\LegacyPasswordAuthenticatedUserInterface;
|
||||
use Doctrine\Common\Collections\Collection;
|
||||
use Doctrine\ORM\Mapping as ORM;
|
||||
use Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntity;
|
||||
|
||||
use App\Validator as Validator;
|
||||
use Symfony\Component\Security\Core\User\LegacyPasswordAuthenticatedUserInterface;
|
||||
use Symfony\Component\Security\Core\User\UserInterface;
|
||||
|
||||
/**
|
||||
* @ORM\Entity
|
||||
* @ORM\Table(name="useraccount")
|
||||
* @ORM\HasLifecycleCallbacks()
|
||||
* @ORM\Entity(repositoryClass="App\Repository\UserRepository")
|
||||
*
|
||||
*
|
||||
* @UniqueEntity(fields="username", message="Un utilisateur existe déjà avec ce login.")
|
||||
* @UniqueEntity(fields="email", message="Un utilisateur existe déjà avec ce mail.")
|
||||
*/
|
||||
@@ -56,8 +54,8 @@ class User implements UserInterface, LegacyPasswordAuthenticatedUserInterface
|
||||
*
|
||||
* @ORM\Column(type="array", length=255)
|
||||
*/
|
||||
private $roles = array();
|
||||
|
||||
private $roles = [];
|
||||
|
||||
/**
|
||||
* @ORM\Column(type="string", length=250)
|
||||
*/
|
||||
@@ -79,7 +77,7 @@ class User implements UserInterface, LegacyPasswordAuthenticatedUserInterface
|
||||
private $email;
|
||||
|
||||
/**
|
||||
* @ORM\Column(type="string", length=250, nullable=true, options={"default" : 0})
|
||||
* @ORM\Column(type="string", length=250, nullable=true, options={"default" : 0})
|
||||
*/
|
||||
private $avatar;
|
||||
|
||||
@@ -87,12 +85,12 @@ class User implements UserInterface, LegacyPasswordAuthenticatedUserInterface
|
||||
* @ORM\Column(type="boolean")
|
||||
*/
|
||||
protected $isvisible;
|
||||
|
||||
|
||||
/**
|
||||
* @ORM\Column(type="text", nullable=true)
|
||||
*/
|
||||
private $postaladress;
|
||||
|
||||
|
||||
/**
|
||||
* @ORM\Column(type="string", length=60, nullable=true)
|
||||
*/
|
||||
@@ -102,11 +100,11 @@ class User implements UserInterface, LegacyPasswordAuthenticatedUserInterface
|
||||
* @ORM\Column(type="string", length=250, nullable=true)
|
||||
*/
|
||||
private $job;
|
||||
|
||||
|
||||
/**
|
||||
* @ORM\Column(type="string", length=250, nullable=true)
|
||||
*/
|
||||
private $position;
|
||||
private $position;
|
||||
|
||||
/**
|
||||
* @ORM\Column(type="text", nullable=true)
|
||||
@@ -126,13 +124,13 @@ class User implements UserInterface, LegacyPasswordAuthenticatedUserInterface
|
||||
/**
|
||||
* @ORM\Column(type="datetime", nullable=true)
|
||||
*/
|
||||
private $keyexpire;
|
||||
private $keyexpire;
|
||||
|
||||
/**
|
||||
* @ORM\Column(type="string", length=60, nullable=true)
|
||||
*/
|
||||
private $keyvalue;
|
||||
|
||||
private $keyvalue;
|
||||
|
||||
/**
|
||||
* @ORM\Column(type="datetime", nullable=true)
|
||||
*/
|
||||
@@ -152,10 +150,10 @@ class User implements UserInterface, LegacyPasswordAuthenticatedUserInterface
|
||||
/**
|
||||
* @ORM\ManyToOne(targetEntity="Niveau02", inversedBy="users")
|
||||
*/
|
||||
private $niveau02;
|
||||
private $niveau02;
|
||||
|
||||
/**
|
||||
* @var ArrayCollection $groups
|
||||
* @var ArrayCollection
|
||||
* @var UserGroup
|
||||
*
|
||||
* @ORM\OneToMany(targetEntity="UserGroup", mappedBy="user", cascade={"persist"}, orphanRemoval=true)
|
||||
@@ -163,7 +161,7 @@ class User implements UserInterface, LegacyPasswordAuthenticatedUserInterface
|
||||
private $groups;
|
||||
|
||||
/**
|
||||
* @var ArrayCollection $ownergroups
|
||||
* @var ArrayCollection
|
||||
* @var Group
|
||||
*
|
||||
* @ORM\OneToMany(targetEntity="Group", mappedBy="owner", cascade={"persist"}, orphanRemoval=false)
|
||||
@@ -171,7 +169,7 @@ class User implements UserInterface, LegacyPasswordAuthenticatedUserInterface
|
||||
private $ownergroups;
|
||||
|
||||
/**
|
||||
* @var ArrayCollection $groups
|
||||
* @var ArrayCollection
|
||||
* @var UserGroup
|
||||
*
|
||||
* @ORM\OneToMany(targetEntity="UserModo", mappedBy="user", cascade={"persist"}, orphanRemoval=true)
|
||||
@@ -185,49 +183,48 @@ class User implements UserInterface, LegacyPasswordAuthenticatedUserInterface
|
||||
$this->modos = new ArrayCollection();
|
||||
}
|
||||
|
||||
//== CODE A NE PAS REGENERER
|
||||
// == CODE A NE PAS REGENERER
|
||||
public function setId(int $id): self
|
||||
{
|
||||
$this->id = $id;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
|
||||
public function getUserIdentifier(): string
|
||||
{
|
||||
return $this->username;
|
||||
}
|
||||
|
||||
|
||||
public function setPasswordDirect($password)
|
||||
{
|
||||
// Permet de setter le password généré lors de l'inscription
|
||||
$this->password = $password;
|
||||
|
||||
|
||||
return $this;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @see PasswordAuthenticatedUserInterface
|
||||
*/
|
||||
public function getPassword(): string
|
||||
{
|
||||
return $this->password;
|
||||
return $this->password;
|
||||
}
|
||||
|
||||
public function setPassword($password): self
|
||||
{
|
||||
if($password!=$this->password&&$password!=""){
|
||||
if ($password != $this->password && '' != $password) {
|
||||
// Placer le password non encodé dans une variable tempo sur laquel on va appliquer la contraite de form
|
||||
$this->passwordplain = $password;
|
||||
|
||||
// Password encrypté format openldap
|
||||
// Password encrypté format openldap
|
||||
$this->salt = uniqid(mt_rand(), true);
|
||||
$hash = "{SSHA}" . base64_encode(pack("H*", sha1($password . $this->salt)) . $this->salt);
|
||||
$hash = '{SSHA}'.base64_encode(pack('H*', sha1($password.$this->salt)).$this->salt);
|
||||
|
||||
$this->password = $hash;
|
||||
$this->password = $hash;
|
||||
}
|
||||
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
@@ -257,22 +254,24 @@ class User implements UserInterface, LegacyPasswordAuthenticatedUserInterface
|
||||
|
||||
public function hasRole(string $role): ?bool
|
||||
{
|
||||
return in_array($role,$this->getRoles());
|
||||
return in_array($role, $this->getRoles());
|
||||
}
|
||||
|
||||
public function setRole(string $role): self
|
||||
{
|
||||
if(!$this->hasRole($role))
|
||||
array_push($this->roles,$role);
|
||||
if (!$this->hasRole($role)) {
|
||||
array_push($this->roles, $role);
|
||||
}
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getDisplayname() {
|
||||
return $this->firstname." ".$this->lastname;
|
||||
public function getDisplayname()
|
||||
{
|
||||
return $this->firstname.' '.$this->lastname;
|
||||
}
|
||||
|
||||
//== FIN DU CODE A NE PAS REGENERER
|
||||
// == FIN DU CODE A NE PAS REGENERER
|
||||
|
||||
public function getId(): ?int
|
||||
{
|
||||
@@ -622,5 +621,4 @@ class User implements UserInterface, LegacyPasswordAuthenticatedUserInterface
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
}
|
||||
|
@@ -1,7 +1,7 @@
|
||||
<?php
|
||||
|
||||
namespace App\Entity;
|
||||
|
||||
use Doctrine\DBAL\Types\Types;
|
||||
use Doctrine\ORM\Mapping as ORM;
|
||||
use Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntity;
|
||||
|
||||
@@ -10,7 +10,7 @@ use Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntity;
|
||||
* @ORM\Table(name="usergroupe",uniqueConstraints={@ORM\UniqueConstraint(columns={"user_id", "group_id"})})
|
||||
* @ORM\HasLifecycleCallbacks()
|
||||
* @ORM\Entity(repositoryClass="App\Repository\UserGroupRepository")
|
||||
*
|
||||
*
|
||||
* @UniqueEntity(fields={"user", "group"}, message="Cette liaison existe déjà !")
|
||||
*/
|
||||
class UserGroup
|
||||
@@ -25,12 +25,12 @@ class UserGroup
|
||||
/**
|
||||
* @ORM\Column(type="integer", length=60)
|
||||
*/
|
||||
private $rolegroup;
|
||||
private $rolegroup;
|
||||
|
||||
/**
|
||||
* @ORM\Column(type="string", length=60)
|
||||
*/
|
||||
private $apikey;
|
||||
private $apikey;
|
||||
|
||||
/**
|
||||
* @ORM\Column(type="datetime", nullable=true)
|
||||
@@ -41,7 +41,7 @@ class UserGroup
|
||||
* @ORM\Column(type="integer", nullable=true)
|
||||
*/
|
||||
private $visitecpt;
|
||||
|
||||
|
||||
/**
|
||||
* @ORM\ManyToOne(targetEntity="User", inversedBy="groups")
|
||||
*/
|
||||
@@ -128,5 +128,4 @@ class UserGroup
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
}
|
||||
|
@@ -1,4 +1,5 @@
|
||||
<?php
|
||||
|
||||
namespace App\Entity;
|
||||
|
||||
use Doctrine\ORM\Mapping as ORM;
|
||||
@@ -59,4 +60,4 @@ class UserModo
|
||||
|
||||
return $this;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -1,8 +1,8 @@
|
||||
<?php
|
||||
|
||||
namespace App\Entity;
|
||||
|
||||
use Doctrine\ORM\Mapping as ORM;
|
||||
|
||||
use Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntity;
|
||||
|
||||
/**
|
||||
|
Reference in New Issue
Block a user