From 0201f90b2fad7813dc73f427e771df75377c64d9 Mon Sep 17 00:00:00 2001 From: Awilum Date: Mon, 7 Dec 2020 11:49:41 +0300 Subject: [PATCH] Accounts Admin 1.5.0 --- .gitignore | 11 +++++++++++ CHANGELOG.md | 7 +++++++ LICENSE.txt | 2 +- app/Controllers/AccountsAdminController.php | 14 ++++++++------ composer.json | 4 +++- plugin.yaml | 4 ++-- 6 files changed, 32 insertions(+), 10 deletions(-) diff --git a/.gitignore b/.gitignore index 5ce2fa3..c00a8d8 100755 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,14 @@ +# Global +.composer +composer.lock +package-lock.json +vendor/ +node_modules/ +dist/ + +# Flextype Site Specific +var/ + # OS Generated .DS_Store* ehthumbs.db diff --git a/CHANGELOG.md b/CHANGELOG.md index 50565ef..83d26e5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,10 @@ + +# [1.5.0](https://github.com/flextype-plugins/accounts-admin) (2020-12-07) + +### Features + +* **core** update code base for new Flextype 0.9.12 + # [1.4.0](https://github.com/flextype-plugins/accounts-admin) (2020-08-25) diff --git a/LICENSE.txt b/LICENSE.txt index cacc3f0..6b05ac2 100755 --- a/LICENSE.txt +++ b/LICENSE.txt @@ -1,6 +1,6 @@ The MIT License (MIT) -Copyright (c) 2020 Sergey Romanenko +Copyright (c) 2021 Sergey Romanenko Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/app/Controllers/AccountsAdminController.php b/app/Controllers/AccountsAdminController.php index eba7945..e26d8a8 100644 --- a/app/Controllers/AccountsAdminController.php +++ b/app/Controllers/AccountsAdminController.php @@ -13,7 +13,7 @@ use Flextype\Component\Arrays\Arrays; use Flextype\Component\Filesystem\Filesystem; -use Flextype\Component\Session\Session; + use Psr\Http\Message\ResponseInterface as Response; use Psr\Http\Message\ServerRequestInterface as Request; use PHPMailer\PHPMailer\PHPMailer; @@ -43,14 +43,14 @@ class AccountsAdminController /** * Flextype Application */ - + /** * __construct */ public function __construct() { - + } /** @@ -314,6 +314,7 @@ public function deleteProcess(Request $request, Response $response, array $args) */ public function login(Request $request, Response $response, array $args) : Response { + if (flextype('acl')->isUserLoggedIn()) { return $response->withRedirect(flextype('router')->pathFor('admin.dashboard.index')); } @@ -351,6 +352,7 @@ public function loginProcess(Request $request, Response $response, array $args) flextype('acl')->setUserLoggedInUuid($user_file['uuid']); flextype('acl')->setUserLoggedIn(true); + // Run event onAccountsAdminUserLoggedIn flextype('emitter')->emit('onAccountsAdminUserLoggedIn'); @@ -608,7 +610,7 @@ public function registrationProcess(Request $request, Response $response, array } // Clear cache before proccess - flextype('cache')->purgeAll(); + Filesystem::deleteDir(PATH['tmp']); // Get Data from POST $post_data = $request->getParsedBody(); @@ -778,7 +780,7 @@ public function registrationProcess(Request $request, Response $response, array Filesystem::write(PATH['project'] . '/config/plugins/accounts-admin/settings.yaml', flextype('yaml')->encode($accounts_admin_config)); // Clear cache after proccess - flextype('cache')->purgeAll(); + Filesystem::deleteDir(PATH['tmp']); return $response->withRedirect(flextype('router')->pathFor('admin.accounts.login')); } @@ -797,7 +799,7 @@ public function registrationProcess(Request $request, Response $response, array */ public function logoutProcess(Request $request, Response $response) : Response { - Session::destroy(); + flextype('session')->destroy(); // Run event onAccountsAdminLogout flextype('emitter')->emit('onAccountsAdminLogout'); diff --git a/composer.json b/composer.json index 19759c3..d164e8c 100755 --- a/composer.json +++ b/composer.json @@ -16,7 +16,9 @@ "issues": "https://github.com/flextype-plugins/accounts-admin/issues" }, "require": { - "php": ">=7.3.0" + "php": ">=7.3.0", + "flextype-components/arrays" : "3.0.1", + "flextype-components/filesystem": "2.0.8" }, "config": { "apcu-autoloader": true, diff --git a/plugin.yaml b/plugin.yaml index 04a3079..fca0643 100755 --- a/plugin.yaml +++ b/plugin.yaml @@ -1,5 +1,5 @@ name: Accounts Admin -version: 1.4.0 +version: 1.5.0 description: Accounts Admin Plugin to manage users accounts in Flextype Admin Panel. icon: fas fa-users author: @@ -11,7 +11,7 @@ bugs: https://github.com/flextype-plugins/accounts-admin/issues license: MIT dependencies: - flextype: 0.9.11 + flextype: 0.9.12 twig: '>=1.0.0' admin: '>=1.0.0' form: '>=1.0.0'