* Thu Sep 04 2025 Brian Read <brianr@koozali.org> 11.1-6.sme
- Add favicon to mailstats table, summary and detailed pages [SME: 13121] - Bring DB config reading for mailstats itself inline with php summary and detailed logs - using /etc/mailstats/db.php [SME: 13121] - Remove DB config fields from the SM2 config panel {sme: 13121] - Arrange for password to be generated and mailstats user to be set with limited permissions [SME: 13121]
This commit is contained in:
16
root/etc/e-smith/db/configuration/migrate/80DBPass
Normal file
16
root/etc/e-smith/db/configuration/migrate/80DBPass
Normal file
@@ -0,0 +1,16 @@
|
||||
{
|
||||
use MIME::Base64 qw(encode_base64);
|
||||
|
||||
my $rec = $DB->get('mailstats') || $DB->new_record('mailstats', {type => 'report'});
|
||||
|
||||
my $pw = $rec->prop('DBPass');
|
||||
return "" if $pw;
|
||||
|
||||
my $length = shift || 16;
|
||||
|
||||
my @chars = ('A'..'Z', 'a'..'z', 0..9, qw(! @ $ % ^ & * ? _ - + =));
|
||||
$pw = '';
|
||||
$pw .= $chars[rand @chars] for 1..$length;
|
||||
$rec->set_prop('DBPass', $pw);
|
||||
return ""
|
||||
}
|
Reference in New Issue
Block a user