Skip to content

Commit e657869

Browse files
committed
Fixed: Listener sample for overriding of default config.inc.php configuration file.
Fixed: Location regexp in Nginx configuration file. Fixed: Useless import of the `iMSCP::Rights` package (package handler). CS fixes
1 parent a4c3048 commit e657869

File tree

4 files changed

+38
-13
lines changed

4 files changed

+38
-13
lines changed

CHANGELOG.md

Lines changed: 28 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,31 @@
22

33
All notable changes to this project will be documented in this file, in reverse chronological order by release.
44

5+
## 1.0.3 - TBD
6+
7+
### Added
8+
9+
- Nothing.
10+
11+
### Changed
12+
13+
- Nothing.
14+
15+
### Deprecated
16+
17+
- Nothing.
18+
19+
### Removed
20+
21+
- Nothing.
22+
23+
### Fixed
24+
25+
- Listener sample for overriding of default `config.inc.php` configuration file.
26+
- Location regexp in Nginx configuration file.
27+
- Useless import of the `iMSCP::Rights` package (package handler).
28+
- CS fixes
29+
530
## 1.0.2 - 20190401
631

732
### Added
@@ -22,9 +47,9 @@ All notable changes to this project will be documented in this file, in reverse
2247

2348
### Fixed
2449

25-
- DBI instance must be Lazy loaded
26-
- Nginx configuration file not removed on uninstallation
27-
- Uncaught exception in `Package::SqlAdminTools::PhpMyAdmin::Handler::_setupDatabase()`
50+
- DBI instance must be Lazy loaded.
51+
- Nginx configuration file not removed on uninstallation.
52+
- Uncaught exception in `_setupDatabase` routine (package handler).
2853

2954
## 1.0.1 - 20190331
3055

src/Handler.pm

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,6 @@ use iMSCP::Debug qw/ debug error /;
3535
use iMSCP::EventManager;
3636
use iMSCP::Execute 'execute';
3737
use iMSCP::File;
38-
use iMSCP::Rights 'setRights';
3938
use iMSCP::TemplateParser qw/ getBloc replaceBloc process /;
4039
use Scalar::Defer 'lazy';
4140
use Servers::sqld;
@@ -111,7 +110,7 @@ sub postinstall
111110
"$CWD/public/tools/phpmyadmin"
112111
) ) {
113112
error( sprintf(
114-
"Couldn't create symlink for PhpMyAdmin SQL administration tool"
113+
"Couldn't create symlink for the PhpMyAdmin SQL administration tool"
115114
));
116115
return 1;
117116
}
@@ -285,6 +284,7 @@ sub _buildConfigFiles
285284
$config{'PMA_CONTROL_USER'}, $config{'PMA_CONTROL_USER_PASSWD'}
286285
);
287286

287+
# Save generated values in database (encrypted)
288288
$self->{'dbh'}->do(
289289
'
290290
INSERT INTO `config` (`name`,`value`)
@@ -340,10 +340,6 @@ sub _buildConfigFiles
340340
);
341341
$file->set( $cfgTpl );
342342
$rs = $file->save();
343-
$rs ||= $file->owner(
344-
$::imscpConfig{'SYSTEM_USER_PREFIX'} . $::imscpConfig{'SYSTEM_USER_MIN_UID'},
345-
$::imscpConfig{'SYSTEM_USER_PREFIX'} . $::imscpConfig{'SYSTEM_USER_MIN_UID'}
346-
);
347343
return $rs if $rs;
348344

349345
# Vendor configuration file
@@ -364,7 +360,7 @@ sub _buildConfigFiles
364360
};
365361
if ( $@ ) {
366362
error( $@ );
367-
return 1;
363+
$rs = 1;
368364
}
369365

370366
$rs;

src/config.inc.php

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,10 @@
88
*
99
* Perl code:
1010
*
11+
* Package Listener::PhpMyAdmin::CustomConfigIncFile;
12+
*
13+
* use strict;
14+
* use warnings;
1115
* use iMSCP::EventManager;
1216
* use iMSCP::File;
1317
*
@@ -20,9 +24,9 @@
2024
*
2125
* # Load custom PhpMyAdmin configuration file into the $cfgTplContent
2226
* # variable.
23-
* return 1 unless defined ${ $cfgTplContent } = iMSCP::File->new(
27+
* return 1 unless defined( ${ $cfgTplContent } = iMSCP::File->new(
2428
* filename => 'path/to/your/phpmyadmin/conf/file'
25-
* )->get();
29+
* )->get() );
2630
*
2731
* 0;
2832
* });

src/nginx.conf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ location = /phpmyadmin {
55
location ^~ /phpmyadmin/ {
66
root {GUI_ROOT_DIR}/public/tools;
77

8-
location ~ /(setup|sql)/ {
8+
location ~ ^/phpmyadmin/(setup|sql)/ {
99
deny all;
1010
}
1111

0 commit comments

Comments
 (0)