@ -125,35 +128,20 @@ if ($_SERVER['REQUEST_METHOD'] == "POST")
if ($fActive == "on")
{
$sqlActive = db_get_boolean(True);
$fActive = 1;
}
else
{
$sqlActive = db_get_boolean(False);
$fActive = 0;
}
$sqlActive=$fActive;
if ('pgsql'==$CONF['database_type']) {
$sqlActive=($fActive) ? 'true':'false';
}
if (empty ($fPassword) and empty ($fPassword2))
{
$result = db_query ("UPDATE $table_mailbox SET name='$fName',quota=$quota,modified=NOW(),active=$sqlActive WHERE username='$fUsername' AND domain='$fDomain'");
if ($result['rows'] == 1) $result = db_query ("UPDATE $table_alias SET modified=NOW(),active='$sqlActive' WHERE address='$fUsername' AND domain='$fDomain'");
}
else
{
$password = pacrypt ($fPassword);
$result = db_query ("UPDATE $table_mailbox SET password='$password',name='$fName',quota=$quota,modified=NOW(),active=$sqlActive WHERE username='$fUsername' AND domain='$fDomain'");
if ($result['rows'] == 1) $result = db_query ("UPDATE $table_alias SET modified=NOW(),active='$sqlActive' WHERE address='$fUsername' AND domain='$fDomain'");
}
if ($result['rows'] != 1)
{
$result = db_query ("UPDATE $table_mailbox SET name='$fName',password='$fPassword',quota=$quota,modified=NOW(),active=$sqlActive WHERE username='$fUsername' AND domain='$fDomain'");