Skip to content

Commit

Permalink
more password-suggestion fields modernized as the others; little beau…
Browse files Browse the repository at this point in the history
…tifications here and there

Signed-off-by: Michael Kaufmann <[email protected]>
  • Loading branch information
d00p committed Oct 31, 2023
1 parent f18c14e commit d3e6063
Show file tree
Hide file tree
Showing 8 changed files with 54 additions and 55 deletions.
19 changes: 3 additions & 16 deletions lib/Froxlor/Cron/Http/Apache.php
Original file line number Diff line number Diff line change
Expand Up @@ -515,13 +515,7 @@ public function createIpPort()
*/
private function createStandardDirectoryEntry()
{
$vhosts_folder = '';
if (is_dir(Settings::Get('system.apacheconf_vhost'))) {
$vhosts_folder = FileDir::makeCorrectDir(Settings::Get('system.apacheconf_vhost'));
} else {
$vhosts_folder = FileDir::makeCorrectDir(dirname(Settings::Get('system.apacheconf_vhost')));
}
$vhosts_filename = FileDir::makeCorrectFile($vhosts_folder . '/05_froxlor_dirfix_nofcgid.conf');
$vhosts_filename = $this->getCustomVhostFilename('05_froxlor_dirfix_nofcgid.conf');

if (!isset($this->virtualhosts_data[$vhosts_filename])) {
$this->virtualhosts_data[$vhosts_filename] = '';
Expand All @@ -545,7 +539,7 @@ private function createStandardDirectoryEntry()
}
$this->virtualhosts_data[$vhosts_filename] .= ' </Directory>' . "\n";

$ocsp_cache_filename = FileDir::makeCorrectFile($vhosts_folder . '/03_froxlor_ocsp_cache.conf');
$ocsp_cache_filename = $this->getCustomVhostFilename('03_froxlor_ocsp_cache.conf');
if (Settings::Get('system.use_ssl') == '1' && Settings::Get('system.apache24') == 1) {
$this->virtualhosts_data[$ocsp_cache_filename] = 'SSLStaplingCache ' . Settings::Get('system.apache24_ocsp_cache_path') . "\n";
} else {
Expand All @@ -562,14 +556,7 @@ private function createStandardDirectoryEntry()
private function createStandardErrorHandler()
{
if (Settings::Get('defaultwebsrverrhandler.enabled') == '1' && (Settings::Get('defaultwebsrverrhandler.err401') != '' || Settings::Get('defaultwebsrverrhandler.err403') != '' || Settings::Get('defaultwebsrverrhandler.err404') != '' || Settings::Get('defaultwebsrverrhandler.err500') != '')) {
$vhosts_folder = '';
if (is_dir(Settings::Get('system.apacheconf_vhost'))) {
$vhosts_folder = FileDir::makeCorrectDir(Settings::Get('system.apacheconf_vhost'));
} else {
$vhosts_folder = FileDir::makeCorrectDir(dirname(Settings::Get('system.apacheconf_vhost')));
}

$vhosts_filename = FileDir::makeCorrectFile($vhosts_folder . '/05_froxlor_default_errorhandler.conf');
$vhosts_filename = $this->getCustomVhostFilename('05_froxlor_default_errorhandler.conf');

if (!isset($this->virtualhosts_data[$vhosts_filename])) {
$this->virtualhosts_data[$vhosts_filename] = '';
Expand Down
9 changes: 9 additions & 0 deletions lib/Froxlor/Cron/Http/HttpConfigBase.php
Original file line number Diff line number Diff line change
Expand Up @@ -202,4 +202,13 @@ protected function getVhostFilename(array $domain, bool $ssl_vhost = false, bool
}
return FileDir::makeCorrectFile(Settings::Get('system.apacheconf_vhost') . '/' . $filename);
}

protected function getCustomVhostFilename(string $name)
{
$vhosts_folder = FileDir::makeCorrectDir(dirname(Settings::Get('system.apacheconf_vhost')));
if (is_dir(Settings::Get('system.apacheconf_vhost'))) {
$vhosts_folder = FileDir::makeCorrectDir(Settings::Get('system.apacheconf_vhost'));
}
return FileDir::makeCorrectFile($vhosts_folder . '/' . $name);
}
}
9 changes: 1 addition & 8 deletions lib/Froxlor/Cron/Http/Nginx.php
Original file line number Diff line number Diff line change
Expand Up @@ -1161,14 +1161,7 @@ protected function composePhpOptions(&$domain, $ssl_vhost = false)
private function createStandardErrorHandler()
{
if (Settings::Get('defaultwebsrverrhandler.enabled') == '1' && (Settings::Get('defaultwebsrverrhandler.err401') != '' || Settings::Get('defaultwebsrverrhandler.err403') != '' || Settings::Get('defaultwebsrverrhandler.err404') != '' || Settings::Get('defaultwebsrverrhandler.err500') != '')) {
$vhosts_folder = '';
if (is_dir(Settings::Get('system.apacheconf_vhost'))) {
$vhosts_folder = FileDir::makeCorrectDir(Settings::Get('system.apacheconf_vhost'));
} else {
$vhosts_folder = FileDir::makeCorrectDir(dirname(Settings::Get('system.apacheconf_vhost')));
}

$vhosts_filename = FileDir::makeCorrectFile($vhosts_folder . '/05_froxlor_default_errorhandler.conf');
$vhosts_filename = $this->getCustomVhostFilename('05_froxlor_default_errorhandler.conf');

if (!isset($this->nginx_data[$vhosts_filename])) {
$this->nginx_data[$vhosts_filename] = '';
Expand Down
17 changes: 10 additions & 7 deletions lib/formfields/customer/extras/formfield.htpasswd_add.php
Original file line number Diff line number Diff line change
Expand Up @@ -55,13 +55,16 @@
'label' => lng('login.password'),
'type' => 'password',
'autocomplete' => 'off',
'mandatory' => true
],
'directory_password_suggestion' => [
'label' => lng('customer.generated_pwd'),
'type' => 'text',
'visible' => (Settings::Get('panel.password_regex') == ''),
'value' => Crypt::generatePassword()
'mandatory' => true,
'next_to' => [
'directory_password_suggestion' => [
'next_to_prefix' => lng('customer.generated_pwd') . ':',
'type' => 'text',
'visible' => (Settings::Get('panel.password_regex') == ''),
'value' => Crypt::generatePassword(),
'readonly' => true
]
]
],
'directory_authname' => [
'label' => lng('extras.htpasswdauthname'),
Expand Down
17 changes: 10 additions & 7 deletions lib/formfields/customer/extras/formfield.htpasswd_edit.php
Original file line number Diff line number Diff line change
Expand Up @@ -49,13 +49,16 @@
'directory_password' => [
'label' => lng('login.password'),
'type' => 'password',
'autocomplete' => 'off'
],
'directory_password_suggestion' => [
'label' => lng('customer.generated_pwd'),
'type' => 'text',
'visible' => (Settings::Get('panel.password_regex') == ''),
'value' => Crypt::generatePassword()
'autocomplete' => 'off',
'next_to' => [
'directory_password_suggestion' => [
'next_to_prefix' => lng('customer.generated_pwd') . ':',
'type' => 'text',
'visible' => (Settings::Get('panel.password_regex') == ''),
'value' => Crypt::generatePassword(),
'readonly' => true
]
]
],
'directory_authname' => [
'label' => lng('extras.htpasswdauthname'),
Expand Down
18 changes: 10 additions & 8 deletions lib/formfields/customer/mysql/formfield.mysql_add.php
Original file line number Diff line number Diff line change
Expand Up @@ -46,14 +46,16 @@
'label' => lng('login.password'),
'type' => 'password',
'autocomplete' => 'off',
'mandatory' => true
],
'mysql_password_suggestion' => [
'label' => lng('customer.generated_pwd'),
'type' => 'text',
'visible' => (Settings::Get('panel.password_regex') == ''),
'value' => Crypt::generatePassword(),
'readonly' => true
'mandatory' => true,
'next_to' => [
'mysql_password_suggestion' => [
'next_to_prefix' => lng('customer.generated_pwd') . ':',
'type' => 'text',
'visible' => (Settings::Get('panel.password_regex') == ''),
'value' => Crypt::generatePassword(),
'readonly' => true
]
]
],
'sendinfomail' => [
'label' => lng('customer.sendinfomail'),
Expand Down
18 changes: 10 additions & 8 deletions lib/formfields/customer/mysql/formfield.mysql_edit.php
Original file line number Diff line number Diff line change
Expand Up @@ -52,14 +52,16 @@
'mysql_password' => [
'label' => lng('changepassword.new_password_ifnotempty'),
'type' => 'password',
'autocomplete' => 'off'
],
'mysql_password_suggestion' => [
'label' => lng('customer.generated_pwd'),
'type' => 'text',
'visible' => (Settings::Get('panel.password_regex') == ''),
'value' => Crypt::generatePassword(),
'readonly' => true
'autocomplete' => 'off',
'next_to' => [
'mysql_password_suggestion' => [
'next_to_prefix' => lng('customer.generated_pwd') . ':',
'type' => 'text',
'visible' => (Settings::Get('panel.password_regex') == ''),
'value' => Crypt::generatePassword(),
'readonly' => true
]
]
]
]
]
Expand Down
2 changes: 1 addition & 1 deletion templates/misc/deactivated/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ <h2>Domain deactivated</h2>
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" class="icon">
<path stroke-linecap="round" stroke-linejoin="round" d="M11.25 11.25l.041-.02a.75.75 0 011.063.852l-.708 2.836a.75.75 0 001.063.853l.041-.021M21 12a9 9 0 11-18 0 9 9 0 0118 0zm-9-3.75h.008v.008H12V8.25z" />
</svg>
<span>Please ask your provider/hoster if you think this is not correct</span>
<span>Please ask your provider/hoster if you have any questions.</span>
</li>
</ul>
</main>
Expand Down

0 comments on commit d3e6063

Please sign in to comment.