|
|
|
@ -15,40 +15,42 @@ class User{
|
|
|
|
|
$this->img = $image;
|
|
|
|
|
$this->email = $mail;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
$u = new User('Testeur', 'motDepasse', '../images/imageProfil.png', 'testeur.compte@wikifantasy.com'); /*Test*/
|
|
|
|
|
|
|
|
|
|
function hidenPassWd(string $passwd){
|
|
|
|
|
if(strlen($passwd) >= 16) return str_repeat('*', 16);
|
|
|
|
|
return str_repeat('*', strlen($passwd));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function modifyName(string $name){
|
|
|
|
|
if(!empty($name)){
|
|
|
|
|
$u->username = $name;
|
|
|
|
|
public function updateUsername(string $newUsername){
|
|
|
|
|
if(!empty($newUsername)){
|
|
|
|
|
$this->username = $newUsername;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function modifyEmail(string $mail){
|
|
|
|
|
if(!empty($mail)){
|
|
|
|
|
$u->email = $mail;
|
|
|
|
|
public function updateEmail(string $newEmail) {
|
|
|
|
|
if(!empty($newEmail)){
|
|
|
|
|
$this->email = $newEmail;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function modifyPassWd(string $password1, string $password2){
|
|
|
|
|
if(!empty($password2) && !empty($password2)){
|
|
|
|
|
if($password1 == $password2){
|
|
|
|
|
$u->passwd = $password;
|
|
|
|
|
public function updatePassWd(string $newPassword1, string $newPassword2){
|
|
|
|
|
if(!empty($newPassword2) && !empty($newPassword1)){
|
|
|
|
|
if($newPassword1 == $newPassword2){
|
|
|
|
|
$u->passwd = $newPassword1;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function modifyImage(string $image){
|
|
|
|
|
public function modifyImage(string $image){
|
|
|
|
|
if(!empty($image)){
|
|
|
|
|
$u->img = $image;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
$u = new User('Testeur', 'motDepasse', '../images/imageProfil.png', 'testeur.compte@wikifantasy.com'); /*Test*/
|
|
|
|
|
|
|
|
|
|
function hidenPassWd(string $passwd){
|
|
|
|
|
if(strlen($passwd) >= 16) return str_repeat('*', 16);
|
|
|
|
|
return str_repeat('*', strlen($passwd));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
?>
|