// We need to see whether there is already an alias record for the user, or not.
// We need to see whether there is already an alias record for the user, or not.
// If not, we create one, else update the existing one.
// If not, we create one, else update the existing one.
@ -146,7 +140,14 @@ if ($_SERVER['REQUEST_METHOD'] == "POST")
$tGoto = $row['goto'];
$tGoto = $row['goto'];
}
}
$Active = db_get_boolean(True);
$Active = db_get_boolean(True);
$result = db_query("SELECT * FROM $table_vacation WHERE email = '$USERID_USERNAME'");
if($result['rows'] == 1) {
$result = db_query("UPDATE $table_vacation SET active = $Active, body = '$fBody', subject = '$fSubject', created = NOW() WHERE email = '$USERID_USERNAME'");
}
else {
$result = db_query ("INSERT INTO $table_vacation (email,subject,body,domain,created,active) VALUES ('$USERID_USERNAME','$fSubject','$fBody','$USERID_DOMAIN',NOW(),$Active)");
$result = db_query ("INSERT INTO $table_vacation (email,subject,body,domain,created,active) VALUES ('$USERID_USERNAME','$fSubject','$fBody','$USERID_DOMAIN',NOW(),$Active)");