summaryrefslogtreecommitdiff
path: root/classes/User.php
diff options
context:
space:
mode:
authorGeorge Halkiadakis <gchalkiadakis@sklavenitis.co.gr>2023-03-12 07:01:30 +0200
committerGeorge Halkiadakis <gchalkiadakis@sklavenitis.co.gr>2023-03-12 07:01:30 +0200
commit47cbb529f5723b246125ae083a193e11481b89ef (patch)
tree31ab20b2fbf12bee1cd994c3d6fb822fa52622e3 /classes/User.php
downloadclassroom-47cbb529f5723b246125ae083a193e11481b89ef.tar.gz
classroom-47cbb529f5723b246125ae083a193e11481b89ef.tar.bz2
classroom-47cbb529f5723b246125ae083a193e11481b89ef.zip
initializing classroom structure using anom framework
Diffstat (limited to 'classes/User.php')
-rw-r--r--classes/User.php111
1 files changed, 111 insertions, 0 deletions
diff --git a/classes/User.php b/classes/User.php
new file mode 100644
index 0000000..65b5018
--- /dev/null
+++ b/classes/User.php
@@ -0,0 +1,111 @@
+<?php
+
+class User_depricated
+{
+
+ /** PROPERTIES
+ * -------------------------------------------------------------------------
+ */
+
+ private $isLogged = false;
+
+ private $who = Array(
+ 'title' => '',
+ 'name' => '',
+ 'middle'=> '',
+ 'surname' =>'',
+ 'email' => ''
+ );
+
+ private $addresses = Array();
+
+
+
+ /** METHODS
+ * -------------------------------------------------------------------------
+ */
+
+
+ public function create()
+ {
+
+ }
+
+
+ public function setDefaultAddress($id)
+ {
+
+ }
+
+
+ public function addAddress()
+ {
+ // update session data
+ // update user record
+ }
+
+
+ public function changePassword()
+ {
+
+ }
+
+
+ public function confirmEmail()
+ {
+
+ }
+
+
+ public function sendEmail()
+ {
+
+ }
+
+ /** sendOTP()
+ * sent One-Time-Password
+ *
+ */
+ public function sendOTP($ttl)
+ {
+ $to = $this->who;
+ $otp = rand(10000,99999);
+ $expire = time() + $ttl;
+
+ $mail = new PHPMailer(true);
+ try {
+ //Server settings
+ // ...
+
+ //Recipients
+ $mail->setFrom('from@example.com', 'Mailer');
+ $mail->addAddress($to['email'], $to['surname'] .' '. $to['name']); //Add a recipient
+ $mail->addReplyTo('info@example.com', 'Information');
+
+ //Attachments
+ $mail->addAttachment('/var/tmp/file.tar.gz'); //Add attachments
+ $mail->addAttachment('/tmp/image.jpg', 'new.jpg'); //Optional name
+
+ //Content
+ $mail->isHTML(true); //Set email format to HTML
+ $mail->Subject = 'Your OTP';
+ $mail->Body = 'This is the HTML message body <b>in bold!</b>';
+ $mail->AltBody = 'This is the body in plain text for non-HTML mail clients';
+
+ $mail->send();
+ echo 'Message has been sent';
+ } catch (Exception $e) {
+ echo "Message could not be sent. Mailer Error: {$mail->ErrorInfo}";
+ }
+
+ }
+
+ /** updateSession()
+ * regenerates session
+ */
+ public function updateSession()
+ {
+
+ }
+
+}