0
0
mirror of https://github.com/postfixadmin/postfixadmin.git synced 2024-09-19 19:22:14 +02:00

Automatic code style fixes

This commit is contained in:
Adrien Crivelli 2022-07-15 11:29:55 +02:00
parent 315ac19963
commit a97771adfd
No known key found for this signature in database
GPG Key ID: 16D79B903B4B5874
10 changed files with 158 additions and 159 deletions

View File

@ -20,11 +20,10 @@ require_once(dirname(__FILE__) . '/vendor/autoload.php');
// See: https://github.com/postfixadmin/postfixadmin/pull/541 - try and check if the user has a turkish locale and warn?
$old = setlocale(LC_ALL, 'C');
if(preg_match('/_TR/i', $old)) {
if (preg_match('/_TR/i', $old)) {
error_log("WARNING: You may have a Turkish locale set; this breaks the loading of some libraries (Smarty) we depend upon.");
// don't revert back to $old?
}
else {
// don't revert back to $old?
} else {
setlocale(LC_ALL, $old); // revert back.
}

View File

@ -59,12 +59,12 @@ class AdminHandler extends PFAHandler
),
'superadmin' => pacol(1, 1, 0, 'bool', 'super_admin' , 'super_admin_desc' , 0
# TODO: (finally) replace the ALL domain with a column in the admin table
# TODO: current status: 'superadmin' column exists and is written when storing an admin with AdminHandler,
# TODO: but the superadmin status is still (additionally) stored in the domain_admins table ("ALL" dummy domain)
# TODO: to keep the database backwards-compatible with 2.3.x.
# TODO: Note: superadmins created with 2.3.x after running upgrade_1284() will not work until you re-run upgrade_1284()
# TODO: Create them with the trunk version to avoid this problem.
# TODO: (finally) replace the ALL domain with a column in the admin table
# TODO: current status: 'superadmin' column exists and is written when storing an admin with AdminHandler,
# TODO: but the superadmin status is still (additionally) stored in the domain_admins table ("ALL" dummy domain)
# TODO: to keep the database backwards-compatible with 2.3.x.
# TODO: Note: superadmins created with 2.3.x after running upgrade_1284() will not work until you re-run upgrade_1284()
# TODO: Create them with the trunk version to avoid this problem.
),
'domains' => pacol(1, 1, 0, 'list', 'domain' , '' , array(), list_domains(),

View File

@ -73,7 +73,7 @@ class CliDelete extends Shell
$module = strtolower($module);
$this->out(
"Usage:
"Usage:
postfixadmin-cli $module delete

View File

@ -25,7 +25,7 @@ class CliHelp extends Shell
$module = strtolower($module);
$this->out(
"Usage:
"Usage:
postfixadmin-cli $module <task> [<address>] [--option value]
"

View File

@ -90,7 +90,7 @@ class CliScheme extends Shell
$module = strtolower($module);
$this->out(
"Usage:
"Usage:
postfixadmin-cli $module scheme

View File

@ -97,7 +97,7 @@ class CliView extends Shell
$module = strtolower($module);
$this->out(
"Usage:
"Usage:
postfixadmin-cli $module view

View File

@ -119,16 +119,16 @@ $tick = ' ✅ ';
} else {
echo $todo . " You need to have a setup_pasword hash configured in a <code>config.local.php</code> file";
}
?>
?>
</li>
<li>
<?php
if ($authenticated) {
if ($authenticated) {
echo $tick . " You are logged in with the setup_password, some environment and hosting checks are displayed below.";
} else {
} else {
echo $todo . " You need to authenticate using the setup_password before you can perform some environment and hosting checks.";
}
?>
}
?>
</li>
</ul>
@ -289,7 +289,7 @@ EOF;
<?php
$check = do_software_environment_check();
if ($authenticated) {
if ($authenticated) {
if (!empty($check['info'])) {
echo "<h3>Information</h3><ul>";
foreach ($check['info'] as $msg) {
@ -314,7 +314,7 @@ EOF;
}
$php_error_log = ini_get('error_log');
} else {
} else {
if (!empty($check['error'])) {
echo '<h3 class="text-danger">Hosting Environment errors found. Login to see details.</h3>';
}
@ -322,9 +322,9 @@ EOF;
if (!empty($check['warn'])) {
echo '<h3 class="text-warning">Hosting Environment warnings found. Login to see details.</h3>';
}
}
}
?>
?>
</div>
</div>
@ -335,14 +335,14 @@ EOF;
<?php
$db = false;
try {
try {
$db = db_connect();
} catch (\Exception $e) {
} catch (\Exception $e) {
echo "<p class='h3 text-danger'>Something went wrong while trying to connect to the database. A message should be logged - check PHP's error_log (" . ini_get('error_log') . ')</p>\n';
error_log("Couldn't perform PostfixAdmin database update - failed to connect to db? " . $e->getMessage() . " Trace: " . $e->getTraceAsString());
}
}
if ($db) {
if ($db) {
echo "<p>Everything seems fine... attempting to create/update database structure</p>\n";
try {
require_once(dirname(__FILE__) . '/upgrade.php');
@ -353,10 +353,10 @@ EOF;
echo "<p class='h3 text-danger'>Something went wrong while trying to apply database updates, a message should be logged - check PHP's error_log (" . ini_get('error_log') . ')</p>\n';
error_log("Couldn't perform PostfixAdmin database update via upgrade.php - " . $e->getMessage() . " Trace: " . $e->getTraceAsString());
}
} else {
} else {
echo "<h3 class='h3 text-danger'>Could not connect to database to perform updates; check PHP error log.</h3>";
}
?>
}
?>
</div>
</div>
@ -500,7 +500,7 @@ EOF;
<?php
}
?>
?>
</div>