summaryrefslogtreecommitdiff
path: root/public/app/controllers/Auth.php
diff options
context:
space:
mode:
Diffstat (limited to 'public/app/controllers/Auth.php')
-rw-r--r--public/app/controllers/Auth.php15
1 files changed, 7 insertions, 8 deletions
diff --git a/public/app/controllers/Auth.php b/public/app/controllers/Auth.php
index aeec41c..4b3dcfb 100644
--- a/public/app/controllers/Auth.php
+++ b/public/app/controllers/Auth.php
@@ -7,10 +7,9 @@ use Render;
// user classes and models
use app\extends\Classroom_user;
use app\extends\Classroom_manager;
-use app\models\User_model;
+use app\models\Access_model;
+use app\extends\SendMail_service;
-use app\extends\Send_mail;
-use app\extends\Mail_jet;
/** class Auth
@@ -31,7 +30,7 @@ class Auth {
$req = Registry::get('REQUEST');
// get the record of the target user
- $record = User_model::checkUser($req->POST['email']);
+ $record = Access_model::checkUser($req->POST['email']);
// if no user exists, return false
if ($record === false) return false;
@@ -51,7 +50,7 @@ class Auth {
if ($userManager->isPasswordValid($user, $req->POST['password'])) {
// get user's security attributes
- $attributes = User_Model::getUser($record['id']);
+ $attributes = Access_model::getUser($record['id']);
$roles = json_decode($attributes['Roles_json']);
$user
->setRoles($roles)
@@ -111,7 +110,7 @@ class Auth {
$req = Registry::get('REQUEST');
// get the record of the target user
- $check = User_model::activate($req->GET['ticket']);
+ $check = Access_model::activate($req->GET['ticket']);
if ($check == true) {
Render::view('/error/general', [
@@ -151,7 +150,7 @@ class Auth {
->setPrivileges([]); // none privilege until acount confirmation
// create user record
- $activation_code = User_model::registerUser($req->POST, $password);
+ $activation_code = Access_model::registerUser($req->POST, $password);
// TODO:
// handle error on user registration
@@ -164,7 +163,7 @@ class Auth {
// ];
// }
- $send_mail = Send_mail::send_activation_code([
+ $send_mail = SendMail_service::send_activation_code([
'email' => $req->POST['email'],
'name' => $req->POST['name'] .' '. $req->POST['surname'],
'code' => $activation_code['activation']