diff --git a/CHANGELOG.md b/CHANGELOG.md
index 6f0744d..ba7bcc3 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,79 +1,85 @@
-httpPassword 1.4 - 2023.08.12
-===========================================================
-* Require Dotclear 2.27
-* Require PHP 7.4+
-* Upgrade to Dotclear 2.27
-* Remove custom permission, only admin can handle httpPassword
-* Move third party repository
-* Use Dotclear style for CHANGELOG
-
-httpPassword 1.3 - 2023.05.13
-===========================================================
-* require dotclear 2.26
-* fix type hint and nullsafe warnings
-
-httpPassword 1.2 - 2023.04.22
-===========================================================
-* require dotclear 2.26
-* add plugin Uninstaller features
-* use latest dotclear namespace
-* fix static init
-* fix permission
-* code doc and review
-
-httpPassword 1.1 - 2023.03.25
-===========================================================
-* require dotclear 2.26
-* use namespace
-
-httpPassword 1.0 - 2022.12.30
-===========================================================
-* update to dotclear 2.24
-* change settings names
-* remove debug mode
-* use dcLog table for last logins
-
-httpPassword 0.5.10
-===========================================================
-* fix typo
-* fix for PHP 5.3 compliance
-
-httpPassword 0.5.9
-===========================================================
-* fix bug in history page (PHP errors when history was empty)
-* add page "debug" in plugin page in order to get infos about hosting setup (when plugins fails to authenticate users)
-
-httpPassword 0.5
-===========================================================
-* deep rewrite : HTTP auth is not directly handled by apache anymore but by a dotclear behavior
-* add support of multiblog installation (thanks to Stephanie "piloue" and Gabriel for being so patient and their helpfull tests)
-* add support PHP running as CGI (tested with OVH hosting services)
-* auto-detect crypt functions available and let user choose it
-* HTTP auth is not required in order to access to blog admin
-* plugin admin page with tabs
-* plugin imported to dotclear lab
-
-Known issues : This plugin does not protect non-php files (images, css, js)
-
-httpPassword 0.4
-===========================================================
-* check filepermission when running
-* add free.fr support
-
-httpPassword 0.3
-===========================================================
-* add last connection tracker
-
-httpPassword 0.2 - 2008.11.22
-===========================================================
-* _install.php added
-* password crypt function setting added
-* password crypt function can be choose within trim, crypt, md5, sha1
-* remonte crypt function added as rcrypt rmd5 and rsha1 : crypt function
- is called over http://frederic.ple.name/....
- This feature can ensure plugin running on php restricted environment
- (ex: OVH.COM)
-
-httpPassword 0.1 : 2008-11-17
-===========================================================
-* INITIAL public release
+httpPassword 1.5 - 2023.10.17
+===========================================================
+* Require Dotclear 2.28
+* Require PHP 8.1
+* Upgrade to Dotclear 2.28
+
+httpPassword 1.4 - 2023.08.12
+===========================================================
+* Require Dotclear 2.27
+* Require PHP 7.4+
+* Upgrade to Dotclear 2.27
+* Remove custom permission, only admin can handle httpPassword
+* Move third party repository
+* Use Dotclear style for CHANGELOG
+
+httpPassword 1.3 - 2023.05.13
+===========================================================
+* require dotclear 2.26
+* fix type hint and nullsafe warnings
+
+httpPassword 1.2 - 2023.04.22
+===========================================================
+* require dotclear 2.26
+* add plugin Uninstaller features
+* use latest dotclear namespace
+* fix static init
+* fix permission
+* code doc and review
+
+httpPassword 1.1 - 2023.03.25
+===========================================================
+* require dotclear 2.26
+* use namespace
+
+httpPassword 1.0 - 2022.12.30
+===========================================================
+* update to dotclear 2.24
+* change settings names
+* remove debug mode
+* use dcLog table for last logins
+
+httpPassword 0.5.10
+===========================================================
+* fix typo
+* fix for PHP 5.3 compliance
+
+httpPassword 0.5.9
+===========================================================
+* fix bug in history page (PHP errors when history was empty)
+* add page "debug" in plugin page in order to get infos about hosting setup (when plugins fails to authenticate users)
+
+httpPassword 0.5
+===========================================================
+* deep rewrite : HTTP auth is not directly handled by apache anymore but by a dotclear behavior
+* add support of multiblog installation (thanks to Stephanie "piloue" and Gabriel for being so patient and their helpfull tests)
+* add support PHP running as CGI (tested with OVH hosting services)
+* auto-detect crypt functions available and let user choose it
+* HTTP auth is not required in order to access to blog admin
+* plugin admin page with tabs
+* plugin imported to dotclear lab
+
+Known issues : This plugin does not protect non-php files (images, css, js)
+
+httpPassword 0.4
+===========================================================
+* check filepermission when running
+* add free.fr support
+
+httpPassword 0.3
+===========================================================
+* add last connection tracker
+
+httpPassword 0.2 - 2008.11.22
+===========================================================
+* _install.php added
+* password crypt function setting added
+* password crypt function can be choose within trim, crypt, md5, sha1
+* remonte crypt function added as rcrypt rmd5 and rsha1 : crypt function
+ is called over http://frederic.ple.name/....
+ This feature can ensure plugin running on php restricted environment
+ (ex: OVH.COM)
+
+httpPassword 0.1 : 2008-11-17
+===========================================================
+* INITIAL public release
diff --git a/README.md b/README.md
index ce93924..ff00b20 100644
--- a/README.md
+++ b/README.md
@@ -1,24 +1,21 @@
# README
[![Release](https://img.shields.io/badge/release-1.4-a2cbe9.svg)](https://git.dotclear.watch/JcDenis/httpPassword/releases)
-[![Date](https://img.shields.io/badge/date-2023.08.12-c44d58.svg)](https://git.dotclear.watch/JcDenis/httpPassword/releases)
+![Date](https://img.shields.io/badge/date-2023.08.12-c44d58.svg)
[![Dotclear](https://img.shields.io/badge/dotclear-v2.27-137bbb.svg)](https://fr.dotclear.org/download)
[![Dotaddict](https://img.shields.io/badge/dotaddict-official-9ac123.svg)](https://plugins.dotaddict.org/dc2/details/httpPassword)
-[![License](https://img.shields.io/github/license/JcDenis/httpPassword)](https://git.dotclear.watch/JcDenis/httpPassword/blob/master/LICENSE)
+[![License](https://img.shields.io/badge/license-GPL--2.0-ececec.svg)](https://git.dotclear.watch/JcDenis/httpPassword/src/branch/master/LICENSE)
-## WHAT IS HTTPPASSWORD ?
+## ABOUT
-_httpPassword_ is a plugin for the open-source
-web publishing software called Dotclear.
+_httpPassword_ is a plugin for the open-source web publishing software called [Dotclear](https://www.dotclear.org).
-Its helps to manage .httppassword files to make a blog private.
+> Help to manage .httppassword files to make a blog private.
## REQUIREMENTS
-_httpPassword_ requires:
-
-* Dotclear 2.27
-* PHP 7.4+
+* Dotclear 2.28
+* PHP 8.1+
* Write permissions on blogs directories
## USAGE
@@ -30,14 +27,15 @@ Manage settings, last logins, authorized users from sidebar menu _Http password_
## LINKS
-* License : [GNU GPL v2](https://www.gnu.org/licenses/old-licenses/lgpl-2.0.html)
-* Source & contribution : [Gitea Page](https://git.dotclear.watch/JcDenis/httpPassword) or [GitHub Page](https://github.com/JcDenis/httpPassword)
-* Packages & details: [Gitea Page](https://git.dotclear.watch/JcDenis/httpPassword/releases) or [Dotaddict Page](https://plugins.dotaddict.org/dc2/details/httpPassword)
-* Discussion & Help: [Dotclear Forum](http://forum.dotclear.org/viewtopic.php?pid=331158)
+* [License](https://git.dotclear.watch/JcDenis/httpPassword/src/branch/master/LICENSE)
+* [Packages & details](https://git.dotclear.watch/JcDenis/httpPassword/releases) (or on [Dotaddict](https://plugins.dotaddict.org/dc2/details/httpPassword))
+* [Sources & contributions](https://git.dotclear.watch/JcDenis/httpPassword) (or on [GitHub](https://github.com/JcDenis/httpPassword))
+* [Issues & security](https://git.dotclear.watch/JcDenis/httpPassword/issues) (or on [GitHub](https://github.com/JcDenis/httpPassword/issues))
+* [Discuss & Help](http://forum.dotclear.org/viewtopic.php?pid=331158)
## CONTRIBUTORS
* Frederic PLE (author)
-* Jean-Christian Denis
+* Jean-Christian Denis (latest)
You are welcome to contribute to this code.
diff --git a/_define.php b/_define.php
index 03d324b..9cedfed 100644
--- a/_define.php
+++ b/_define.php
@@ -1,29 +1,27 @@
registerModule(
'Http password',
'Manage .htpasswd file to make the blog private',
'Frederic PLE and contributors',
- '1.4',
+ '1.5',
[
- 'requires' => [['core', '2.27']],
- 'permissions' => dcCore::app()->auth->makePermissions([
- dcCore::app()->auth::PERMISSION_ADMIN,
- ]),
+ 'requires' => [['core', '2.28']],
+ 'permissions' => 'My',
'type' => 'plugin',
'support' => 'https://git.dotclear.watch/JcDenis/' . basename(__DIR__) . '/issues',
'details' => 'https://git.dotclear.watch/JcDenis/' . basename(__DIR__) . '/src/branch/master/README.md',
diff --git a/_init.php b/_init.php
deleted file mode 100644
index 6728c42..0000000
--- a/_init.php
+++ /dev/null
@@ -1,21 +0,0 @@
-
' . __('Logins history is empty.') . '
'; diff --git a/src/My.php b/src/My.php index b3be4d4..6280bab 100644 --- a/src/My.php +++ b/src/My.php @@ -1,15 +1,5 @@ plugins->moduleExists('Uninstaller')) { + if (!self::status()) { return false; } diff --git a/src/Utils.php b/src/Utils.php index 320e66b..54d6eab 100644 --- a/src/Utils.php +++ b/src/Utils.php @@ -1,21 +1,19 @@ 0) { $salt .= substr( - sha1(dcCore::app()->getNonce() . date('U')), + sha1(App::nonce()->getNonce() . date('U')), 2, $saltlen - strlen($salt) ); @@ -118,7 +116,7 @@ class Utils */ public static function passwordFile(): string { - return is_null(dcCore::app()->blog) ? '' : dcCore::app()->blog->public_path . DIRECTORY_SEPARATOR . My::FILE_PASSWORD; + return App::blog()->isDefined() ? App::blog()->publicPath() . DIRECTORY_SEPARATOR . My::FILE_PASSWORD : ''; } /**