'--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.)
(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)
print "<li>Database - MySQL (mysqli_ functions) - Found\n";
print "<li>Database - PDO MySQL - Found</li>";
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>";
} else {
} else {
print "<li>Database - MySQL (mysqli_ functions) - Not found</li>";
print "<li>Database - MySQL (pdo_mysql) extension 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++;
}
}
//
//
// PostgreSQL functions
// PostgreSQL functions
//
//
if ($f_pg_connect == 1) {
if ($m_pdo_pgsql == 1) {
print "<li>Database : PostgreSQL support (pg_ functions) - Found\n";
print "<li>Database : PDO PostgreSQL - Found \n";
if (Config::read_string('database_type') != 'pgsql') {
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 "<br>(change the database_type to 'pgsql' in config.local.php if you want to use PostgreSQL)\n";
}
}
print "</li>";
print "</li>";
} else {
} 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) {
if ($m_pdo_sqlite == 1) {
print "<li>Database : SQLite support (SQLite3) - Found \n";
print "<li>Database : PDO SQLite - Found \n";
if (Config::read_string('database_type') != 'sqlite') {
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 "<br>(change the database_type to 'sqlite' in config.local.php if you want to use SQLite)\n";
}
}
print "</li>";
print "</li>";
} else {
} 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);
$key = substr($params[$i], 1);
if (isset($params[$i+1])) {
$this->params[$key] = true;
# 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)
unset($params[$i]);
if ($params[$i+1]{0} === '-' && $params[$i+1] != '-1') {
if (isset($params[++$i])) {
$this->params[$key] = true;
# 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)
} else {
if ($params[$i]{0} !== '-' or $params[$i] != '-1') {