From 688b0c10c8a76ad4da1c0f3935813d0425e82739 Mon Sep 17 00:00:00 2001 From: xdrm-brackets Date: Thu, 15 Mar 2018 13:13:35 +0100 Subject: [PATCH] [bowdel] + [AuthSystemDefault] + [module.cas] DELETE (now logout works + login + session departE?E?E?E?E?ment data) --- build/api/core/AuthSystemDefault.php | 9 +++++---- build/api/module/casController.php | 8 ++------ build/router/controller/js.php | 6 ++++-- webpack/component/ue/manage.vue | 6 +++--- webpack/scss/container/list.scss | 2 +- 5 files changed, 15 insertions(+), 16 deletions(-) diff --git a/build/api/core/AuthSystemDefault.php b/build/api/core/AuthSystemDefault.php index 1a2ceac..59d73a1 100644 --- a/build/api/core/AuthSystemDefault.php +++ b/build/api/core/AuthSystemDefault.php @@ -23,8 +23,9 @@ /* (1) Init session variables ---------------------------------------------------------*/ - if( !isset($_SESSION['CAS']) || !is_array($_SESSION['CAS']) ) $_SESSION['CAS'] = []; - if( !isset($_SESSION['AUTH']) || !is_array($_SESSION['AUTH']) ) $_SESSION['AUTH'] = []; + if( !isset($_SESSION['CAS']) || !is_array($_SESSION['CAS']) ) $_SESSION['CAS'] = []; + if( !isset($_SESSION['AUTH']) || !is_array($_SESSION['AUTH']) ) $_SESSION['AUTH'] = []; + if( !isset($_SESSION['AvailableDepartment']) || !is_array($_SESSION['AvailableDepartment']) ) $_SESSION['AvailableDepartment'] = []; /* (2) Check CAS @@ -38,8 +39,8 @@ /* (2) Get professor with this login */ $deps = $prof_repo->getLinkedDepartment($_SESSION['CAS']['login']); if(is_array($deps)){ - $_SESSION["AvailableDepartment"] = $deps; - $_SESSION['CurrentDatabase'] = $deps[0]["dbName"]; + $_SESSION["AvailableDepartment"] = $deps; + $_SESSION['CurrentDatabase'] = $deps[0]["dbName"]; $_SESSION['CurrentDepartementId'] = $deps[0]["idDep"]; Repo::switchDatabase($_SESSION['CurrentDatabase']); diff --git a/build/api/module/casController.php b/build/api/module/casController.php index e38038e..9b1b281 100644 --- a/build/api/module/casController.php +++ b/build/api/module/casController.php @@ -122,14 +122,10 @@ class casController{ public function delete(){ - /* (1) Remove CAS credentials */ - $_SESSION['CAS'] = []; - - /* (2) Re-process AuthSystemDefault */ - new \api\core\AuthSystemDefault(); + \session_destroy(); /* (3) Return if logged out */ - return ['logged_out' => !in_array('cas_user', $_SESSION['AUTH'])]; + return ['logged_out' => true]; } diff --git a/build/router/controller/js.php b/build/router/controller/js.php index 68f7678..71c3c4e 100644 --- a/build/router/controller/js.php +++ b/build/router/controller/js.php @@ -28,8 +28,10 @@ echo "window._SERVER = ".json_encode([ 'session' => [ - 'name' => $_SESSION['NAME'], - 'connected' => isset($_SESSION['AUTH']) ? count($_SESSION['AUTH']) > 0 : false + 'name' => $_SESSION['CAS']['login'], + 'connected' => isset($_SESSION['AUTH']) ? count($_SESSION['AUTH']) > 0 : false, + 'departments' => array_map(function($d){ return [ 'id' => $d['idDep'], 'label' => $d['labelDep']]; }, $_SESSION['AvailableDepartment']), + 'department_id' => $_SESSION['CurrentDepartementId'] ] ])."\n"; diff --git a/webpack/component/ue/manage.vue b/webpack/component/ue/manage.vue index b9914bb..4d0f2a9 100644 --- a/webpack/component/ue/manage.vue +++ b/webpack/component/ue/manage.vue @@ -7,14 +7,14 @@ - -
+
section.filter{ - padding-bottom: 0; + // padding-bottom: 0; background-color: transparent;