You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
49 lines
1.0 KiB
49 lines
1.0 KiB
<?php
|
|
class User{
|
|
public string $username;
|
|
public string $passwd;
|
|
public string $img;
|
|
public string $email;
|
|
|
|
function __construct(string $pseudo, string $password, string $image, string $mail) {
|
|
$this->username = $pseudo;
|
|
$this->passwd = $password;
|
|
$this->img = $image;
|
|
$this->email = $mail;
|
|
}
|
|
}
|
|
|
|
$u = new User('Testeur', 'e', '../images/imageProfil.png', 'testeur.compte@wikifantasy.com'); /*Test*/
|
|
|
|
function hidenPassWd(User $u){
|
|
return str_repeat('*', strlen($u->passwd));
|
|
}
|
|
|
|
function modifyName(string $name){
|
|
if(!empty($name)){
|
|
$u->username = $name;
|
|
}
|
|
}
|
|
|
|
function modifyEmail(string $mail){
|
|
if(!empty($mail)){
|
|
$u->email = $mail;
|
|
}
|
|
}
|
|
|
|
function modifyPassWd(string $password1, string $password2){
|
|
if(!empty($password2) && !empty($password2)){
|
|
if($password1 == $password2){
|
|
$u->passwd = $password;
|
|
}
|
|
}
|
|
}
|
|
|
|
function modifyImage(string $image){
|
|
if(!empty($image)){
|
|
$u->img = $image;
|
|
}
|
|
}
|
|
|
|
|
|
?>
|