You've already forked postfixadmin
mirror of
https://github.com/postfixadmin/postfixadmin.git
synced 2025-08-06 06:42:37 +03:00
Automatic code style fixes
This commit is contained in:
@@ -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?
|
// 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');
|
$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.");
|
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?
|
// don't revert back to $old?
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
setlocale(LC_ALL, $old); // revert back.
|
setlocale(LC_ALL, $old); // revert back.
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -59,12 +59,12 @@ class AdminHandler extends PFAHandler
|
|||||||
),
|
),
|
||||||
|
|
||||||
'superadmin' => pacol(1, 1, 0, 'bool', 'super_admin' , 'super_admin_desc' , 0
|
'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: (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: 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: 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: 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: 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: Create them with the trunk version to avoid this problem.
|
||||||
),
|
),
|
||||||
|
|
||||||
'domains' => pacol(1, 1, 0, 'list', 'domain' , '' , array(), list_domains(),
|
'domains' => pacol(1, 1, 0, 'list', 'domain' , '' , array(), list_domains(),
|
||||||
|
@@ -73,7 +73,7 @@ class CliDelete extends Shell
|
|||||||
$module = strtolower($module);
|
$module = strtolower($module);
|
||||||
|
|
||||||
$this->out(
|
$this->out(
|
||||||
"Usage:
|
"Usage:
|
||||||
|
|
||||||
postfixadmin-cli $module delete
|
postfixadmin-cli $module delete
|
||||||
|
|
||||||
|
@@ -25,7 +25,7 @@ class CliHelp extends Shell
|
|||||||
$module = strtolower($module);
|
$module = strtolower($module);
|
||||||
|
|
||||||
$this->out(
|
$this->out(
|
||||||
"Usage:
|
"Usage:
|
||||||
|
|
||||||
postfixadmin-cli $module <task> [<address>] [--option value]
|
postfixadmin-cli $module <task> [<address>] [--option value]
|
||||||
"
|
"
|
||||||
|
@@ -90,7 +90,7 @@ class CliScheme extends Shell
|
|||||||
$module = strtolower($module);
|
$module = strtolower($module);
|
||||||
|
|
||||||
$this->out(
|
$this->out(
|
||||||
"Usage:
|
"Usage:
|
||||||
|
|
||||||
postfixadmin-cli $module scheme
|
postfixadmin-cli $module scheme
|
||||||
|
|
||||||
|
@@ -97,7 +97,7 @@ class CliView extends Shell
|
|||||||
$module = strtolower($module);
|
$module = strtolower($module);
|
||||||
|
|
||||||
$this->out(
|
$this->out(
|
||||||
"Usage:
|
"Usage:
|
||||||
|
|
||||||
postfixadmin-cli $module view
|
postfixadmin-cli $module view
|
||||||
|
|
||||||
|
@@ -119,16 +119,16 @@ $tick = ' ✅ ';
|
|||||||
} else {
|
} else {
|
||||||
echo $todo . " You need to have a setup_pasword hash configured in a <code>config.local.php</code> file";
|
echo $todo . " You need to have a setup_pasword hash configured in a <code>config.local.php</code> file";
|
||||||
}
|
}
|
||||||
?>
|
?>
|
||||||
</li>
|
</li>
|
||||||
<li>
|
<li>
|
||||||
<?php
|
<?php
|
||||||
if ($authenticated) {
|
if ($authenticated) {
|
||||||
echo $tick . " You are logged in with the setup_password, some environment and hosting checks are displayed below.";
|
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.";
|
echo $todo . " You need to authenticate using the setup_password before you can perform some environment and hosting checks.";
|
||||||
}
|
}
|
||||||
?>
|
?>
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
|
|
||||||
@@ -289,7 +289,7 @@ EOF;
|
|||||||
<?php
|
<?php
|
||||||
$check = do_software_environment_check();
|
$check = do_software_environment_check();
|
||||||
|
|
||||||
if ($authenticated) {
|
if ($authenticated) {
|
||||||
if (!empty($check['info'])) {
|
if (!empty($check['info'])) {
|
||||||
echo "<h3>Information</h3><ul>";
|
echo "<h3>Information</h3><ul>";
|
||||||
foreach ($check['info'] as $msg) {
|
foreach ($check['info'] as $msg) {
|
||||||
@@ -314,7 +314,7 @@ EOF;
|
|||||||
}
|
}
|
||||||
|
|
||||||
$php_error_log = ini_get('error_log');
|
$php_error_log = ini_get('error_log');
|
||||||
} else {
|
} else {
|
||||||
if (!empty($check['error'])) {
|
if (!empty($check['error'])) {
|
||||||
echo '<h3 class="text-danger">Hosting Environment errors found. Login to see details.</h3>';
|
echo '<h3 class="text-danger">Hosting Environment errors found. Login to see details.</h3>';
|
||||||
}
|
}
|
||||||
@@ -322,9 +322,9 @@ EOF;
|
|||||||
if (!empty($check['warn'])) {
|
if (!empty($check['warn'])) {
|
||||||
echo '<h3 class="text-warning">Hosting Environment warnings found. Login to see details.</h3>';
|
echo '<h3 class="text-warning">Hosting Environment warnings found. Login to see details.</h3>';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
?>
|
?>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -335,14 +335,14 @@ EOF;
|
|||||||
|
|
||||||
<?php
|
<?php
|
||||||
$db = false;
|
$db = false;
|
||||||
try {
|
try {
|
||||||
$db = db_connect();
|
$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';
|
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());
|
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";
|
echo "<p>Everything seems fine... attempting to create/update database structure</p>\n";
|
||||||
try {
|
try {
|
||||||
require_once(dirname(__FILE__) . '/upgrade.php');
|
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';
|
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());
|
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>";
|
echo "<h3 class='h3 text-danger'>Could not connect to database to perform updates; check PHP error log.</h3>";
|
||||||
}
|
}
|
||||||
?>
|
?>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -500,7 +500,7 @@ EOF;
|
|||||||
<?php
|
<?php
|
||||||
}
|
}
|
||||||
|
|
||||||
?>
|
?>
|
||||||
|
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
Reference in New Issue
Block a user