'--quota -1' gets parsed as two options ("quota" and "1"), but it's
meant to be "quota => -1".
Make sure '-1' is considered as a value, not as an option.
Also get rid of unset()'ing $params[$i] and (now?) superfluous recursive
calls to __parseParams() to make the code less confusing.
This warning was for example
PHP Notice: Undefined variable: CONF in .../languages/en.lang on line 184
and is caused by some texts that include $CONF['admin_name']
(if you installed PostfixAdmin as RPM or DEB package, you can obviously skip this step.)
Assuming we are installing Postfixadmin into /srv/postfixadmin, then something like this should work :
Assuming we are installing Postfixadmin into /srv/postfixadmin, then something like this should work.Please check https://github.com/postfixadmin/postfixadmin/releases to get the latest stable release first (the 3.2.4 version/url below is probably stale)
if (($m_pdo == 0) and ($m_pdo_mysql == 0) and ($m_pdo_sqlite == 0) and ($m_pdo_psql == 0) ) {
print "<li><b>Error: There is no database (PDO) support in your PHP setup</b><br/>\n";
print "<spanstyle='color: red'>
You MUST install a suitable PHP PDO extension (e.g. pdo_pgsql, pdo_mysql or pdo_sqlite).
</span>\n</li>";
$error += 1;
}
if ($f_mysqli_connect == 1) {
print "<li>Database - MySQL (mysqli_ functions) - Found\n";
if (Config::read_string('database_type') != 'mysqli') {
print "<br>(change the database_type to 'mysqli' in config.local.php if you want to use MySQL)\n";
}
print "</li>";
if ($m_pdo_mysql == 1) {
print "<li>Database - PDO MySQL - Found</li>";
} else {
print "<li>Database - MySQL (mysqli_ functions) - Not found</li>";
}
if (Config::read_string('database_type') == 'mysql') {
print "<li><strong><spanstyle='color: red'>Warning:</span> your configured database_type 'mysql' is deprecated; you must move to use 'mysqli'</strong> in your config.local.php.</li>\n";
$error++;
print "<li>Database - MySQL (pdo_mysql) extension not found</li>";
}
//
// PostgreSQL functions
//
if ($f_pg_connect == 1) {
print "<li>Database : PostgreSQL support (pg_ functions) - Found\n";
if ($m_pdo_pgsql == 1) {
print "<li>Database : PDO PostgreSQL - Found \n";
if (Config::read_string('database_type') != 'pgsql') {
print "<br>(change the database_type to 'pgsql' in config.local.php if you want to use PostgreSQL)\n";
}
print "</li>";
} else {
print "<li>Database - PostgreSQL (pg_ functions) - Not found</li>";
print "<li>Database - PostgreSQL (pdo_pgsql) extension not found</li>";
}
if ($f_sqlite_open == 1) {
print "<li>Database : SQLite support (SQLite3) - Found \n";
if ($m_pdo_sqlite == 1) {
print "<li>Database : PDO SQLite - Found \n";
if (Config::read_string('database_type') != 'sqlite') {
print "<br>(change the database_type to 'sqlite' in config.local.php if you want to use SQLite)\n";
}
print "</li>";
} else {
print "<li>Database - SQLite (SQLite3) - Not found</li>";
print "<li>Database - SQLite (pdo_sqlite) extension not found</li>";
if ($params[$i] != '' && $params[$i]{0} === '-') {
$key = substr($params[$i], 1);
$this->params[$key] = true;
unset($params[$i]);
if (isset($params[++$i])) {
# TODO: ideally we should know if a parameter can / must have a value instead of whitelisting known valid values starting with '-' (probably only bool doesn't need a value)
if ($params[$i]{0} !== '-' or $params[$i] != '-1') {
# TODO: ideally we should know if a parameter can / must have a value instead of whitelisting known valid values starting with '-' (probably only bool doesn't need a value)
if ($params[$i+1]{0} === '-' && $params[$i+1] != '-1') {