From 1c6c1a82b12f999229d1e625601eedd22e91d232 Mon Sep 17 00:00:00 2001 From: Sibidharan <sibidharan@icloud.com> Date: Sat, 2 Apr 2022 16:57:37 +0000 Subject: [PATCH] users upgrade --- __migrations.sql | 2 ++ libs/includes/User.class.php | 10 ++++++++-- 2 files changed, 10 insertions(+), 2 deletions(-) create mode 100644 __migrations.sql diff --git a/__migrations.sql b/__migrations.sql new file mode 100644 index 00000000..a3944bfa --- /dev/null +++ b/__migrations.sql @@ -0,0 +1,2 @@ +-- 2 Apr, 2022 Migrations +ALTER TABLE `auth` ADD `sec_email` varchar(256) NULL; \ No newline at end of file diff --git a/libs/includes/User.class.php b/libs/includes/User.class.php index 16a9cd12..65f7fa72 100644 --- a/libs/includes/User.class.php +++ b/libs/includes/User.class.php @@ -46,21 +46,27 @@ class User { $this->conn = Database::getConnection(); $this->conn->query(); + $this->username = $username; + + //TODO: Write the code to fetch user data from Database for the given username. If username is not present, throw Exception. + $this->id = null; //Update this from database. } public function authenticate() { } - public function setBio() + public function setBio($bio) { + //TODO: Write UPDATE command to change new bio } public function getBio() { + //TODO: Write SELECT command to get the bio. } - public function setAvatar() + public function setAvatar($link) { } -- GitLab