From a8e8ba6f167b0774b69800d59abcba4f8f919294 Mon Sep 17 00:00:00 2001 From: beaulaton Date: Tue, 8 Oct 2024 10:39:35 +0200 Subject: [PATCH] php profil --- images/modify.svg | 1 + pages/profil.php | 57 +++++++++++++++++++++++++++++++++++++++++++++++ script/user.php | 33 +++++++++++++++++++++++++++ 3 files changed, 91 insertions(+) create mode 100644 images/modify.svg create mode 100644 pages/profil.php diff --git a/images/modify.svg b/images/modify.svg new file mode 100644 index 0000000..98fbe6f --- /dev/null +++ b/images/modify.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/pages/profil.php b/pages/profil.php new file mode 100644 index 0000000..4db7069 --- /dev/null +++ b/pages/profil.php @@ -0,0 +1,57 @@ + + + + + + + Wiki Fantasy : Profil + + + + + +
+
+ + +
+
+ +
+

▶ Profil ◀

+ + + img} class='imageProfil' onmousedown='return false'/>"; + + echo "

{$u->username}

"; + echo "

{$u->email}

"; + $passwdhiden = hidenPassWd($u); + echo "

{$passwdhiden}

"; + ?> + +
+

Language :

+
+ + + + + +
+ +
+ +
+ + diff --git a/script/user.php b/script/user.php index 1a907c9..a2adc20 100644 --- a/script/user.php +++ b/script/user.php @@ -13,4 +13,37 @@ class User{ } } +$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; + } +} + + ?> \ No newline at end of file