Conversie codeigniter 4
This commit is contained in:
@@ -0,0 +1,72 @@
|
||||
<?php
|
||||
/**
|
||||
* Created by Pensare Software.
|
||||
* User: Theo Weijmer
|
||||
* Date: 27/12/2017
|
||||
* Time: 14:10
|
||||
*/
|
||||
|
||||
class UserCreation {
|
||||
|
||||
private $user;
|
||||
private $passWordRecipe;
|
||||
private $password;
|
||||
private $saltedPassword;
|
||||
private $salt;
|
||||
|
||||
public function __construct( $user )
|
||||
{
|
||||
$this->setUser( $user );
|
||||
|
||||
$this->handle();
|
||||
}
|
||||
|
||||
public function getUser()
|
||||
{
|
||||
return $this->user;
|
||||
}
|
||||
|
||||
public function getPassword()
|
||||
{
|
||||
return $this->password;
|
||||
}
|
||||
|
||||
private function setUser( $user )
|
||||
{
|
||||
$this->user = $user;
|
||||
}
|
||||
|
||||
private function handle()
|
||||
{
|
||||
$this->passWordRecipe = new PasswordRecipe();
|
||||
|
||||
$this->setPassword();
|
||||
|
||||
$this->setSalt();
|
||||
|
||||
$this->setSaltedPassword();
|
||||
|
||||
$this->enrichUser();
|
||||
}
|
||||
|
||||
private function setPassword()
|
||||
{
|
||||
$this->password = $this->passWordRecipe->getPassword();
|
||||
}
|
||||
|
||||
private function setSalt()
|
||||
{
|
||||
$this->salt = $this->passWordRecipe->getSalt();
|
||||
}
|
||||
|
||||
private function setSaltedPassword()
|
||||
{
|
||||
$this->saltedPassword = $this->passWordRecipe->getSaltedPassword();
|
||||
}
|
||||
|
||||
private function enrichUser()
|
||||
{
|
||||
$this->user['password'] = $this->saltedPassword;
|
||||
$this->user['salt'] = $this->salt;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user