diff --git a/public/setup.php b/public/setup.php index 036e556a..f50b56d6 100644 --- a/public/setup.php +++ b/public/setup.php @@ -160,7 +160,6 @@ if ($configSetupDone) { For a new installation, you must generate a 'setup_password' to go into your config.local.php file.

You can use the form below, or run something like the following in a shell - php -r 'echo password_hash("password", PASSWORD_DEFAULT);'

@@ -247,7 +246,7 @@ EOF; - +

@@ -380,16 +379,17 @@ EOF;
- 'ALL', 'description' => '', 'transport' => '')); } @@ -407,11 +407,10 @@ EOF; if ($error == 1) { $tUsername = htmlentities($values['username']); } else { -// all good!. + // all good!. $setupMessage .= "

You are done with your basic setup. "; $setupMessage .= "

You can now login to PostfixAdmin using the account you just created."; } - } ?> @@ -431,16 +430,14 @@ EOF; {$errors[$key]}"; } -function create_admin($values) -{ +function create_admin($values) { define('POSTFIXADMIN_SETUP', 1); # avoids instant redirect to login.php after creating the admin $handler = new AdminHandler(1, 'setup.php'); @@ -468,8 +465,7 @@ function create_admin($values) /** * @return array['info' => string[], 'warn' => string[], 'error' => string[] ] */ -function do_software_environment_check() -{ +function do_software_environment_check() { $CONF = Config::getInstance()->getAll(); $warn = []; @@ -478,7 +474,7 @@ function do_software_environment_check() // -// Check for availability functions + // Check for availability functions // $f_phpversion = function_exists("phpversion"); $f_apache_get_version = function_exists("apache_get_version"); @@ -495,13 +491,13 @@ function do_software_environment_check() $file_local_config = file_exists(realpath("./../config.local.php")); -// Fall back to looking in /etc/postfixadmin for config.local.php (Debian etc) + // Fall back to looking in /etc/postfixadmin for config.local.php (Debian etc) if (!$file_local_config && is_dir('/etc/postfixadmin')) { $file_local_config = file_exists('/etc/postfixadmin/config.local.php'); } // -// Check for PHP version + // Check for PHP version // $phpversion = 'unknown-version'; @@ -519,14 +515,14 @@ function do_software_environment_check() } // -// Check for Apache version + // Check for Apache version // if ($f_apache_get_version == 1) { $info[] = apache_get_version(); } // -// Check for config.local.php + // Check for config.local.php // if ($file_local_config == 1) { $info[] = "Depends on: presence config.local.php - Found"; @@ -534,7 +530,7 @@ function do_software_environment_check() $warn[] = "Warning: config.local.php - NOT FOUND - It's Recommended to store your own settings in config.local.php instead of editing config.inc.php"; } -// Check if there is support for at least 1 database + // Check if there is support for at least 1 database if (($m_pdo == 0) and ($m_pdo_mysql == 0) and ($m_pdo_sqlite == 0) and ($m_pdo_pgsql == 0)) { $error[] = "There is no database (PDO) support in your PHP setup, you MUST install a suitable PHP PDO extension (e.g. pdo_pgsql, pdo_mysql or pdo_sqlite)."; } @@ -546,7 +542,7 @@ function do_software_environment_check() } // -// PostgreSQL functions + // PostgreSQL functions // if ($m_pdo_pgsql == 1) { $info[] = "Database support : PDO PostgreSQL - Found "; @@ -583,7 +579,7 @@ function do_software_environment_check() } // -// Session functions + // Session functions // if ($f_session_start == 1) { $info[] = "Depends on: session - OK"; @@ -592,7 +588,7 @@ function do_software_environment_check() } // -// PCRE functions + // PCRE functions // if ($f_preg_match == 1) { $info[] = "Depends on: pcre - Found"; @@ -601,7 +597,7 @@ function do_software_environment_check() } // -// Multibyte functions + // Multibyte functions // if ($f_mb_encode_mimeheader == 1) { $info[] = "Depends on: multibyte string - Found"; @@ -611,7 +607,7 @@ function do_software_environment_check() // -// Imap functions + // Imap functions // if ($f_imap_open == 1) { $info[] = "IMAP functions - Found"; @@ -620,7 +616,7 @@ function do_software_environment_check() } // -// If PHP <7.0, require random_compat works. Currently we bundle it via the Phar extension. + // If PHP <7.0, require random_compat works. Currently we bundle it via the Phar extension. // if (version_compare(phpversion(), "7.0", '<') && !extension_loaded('Phar') diff --git a/tests/PasswordValidationCallableTest.php b/tests/PasswordValidationCallableTest.php index d165a3b0..447d5ad6 100644 --- a/tests/PasswordValidationCallableTest.php +++ b/tests/PasswordValidationCallableTest.php @@ -1,10 +1,7 @@ getAll(); @@ -22,8 +19,7 @@ class PasswordValidationCallableTEst extends \PHPUnit\Framework\TestCase parent::setUp(); } - public function testBasic() - { + public function testBasic() { // anything except 'fail' should work. $this->assertEmpty(validate_password('str')); $this->assertEquals([], validate_password('1234asdf'));