$goto"); } } } //Set the vacation data for $fUsername if (!empty ($fChange)) { $goto = ''; $result = db_query ("SELECT * FROM $table_alias WHERE address='$fUsername'"); if ($result['rows'] == 1) { $row = db_array ($result['result']); $goto = $row['goto']; } $Active = db_get_boolean(True); $notActive = db_get_boolean(False); // I don't think we need to care if the vacation entry is inactive or active.. as long as we don't try and // insert a duplicate $result = db_query("SELECT * FROM $table_vacation WHERE email = '$fUsername'"); if($result['rows'] == 1) { $result = db_query("UPDATE $table_vacation SET active = '$Active', subject = '$fSubject', body = '$fBody', created = NOW() WHERE email = '$fUsername'"); } else { $result = db_query ("INSERT INTO $table_vacation (email,subject,body,domain,created,active) VALUES ('$fUsername','$fSubject','$fBody','$fDomain',NOW(),'$Active')"); } if ($result['rows'] != 1) { $error = 1; } if($goto == '') { $goto = $vacation_goto; $sql = "INSERT INTO $table_alias (goto, address, domain, modified) VALUES ('$goto', '$fUsername', '$fDomain', NOW())"; } else { $goto = $goto . "," . $vacation_goto; $sql = "UPDATE $table_alias SET goto='$goto',modified=NOW() WHERE address='$fUsername'"; } $result = db_query ($sql); if ($result['rows'] != 1) { $error = 1; } db_log($SESSID_USERNAME, $domain, 'edit_alias', "$fUsername -> $goto"); } } if($error == 0) { if(!empty ($fBack)) { $tMessage = $PALANG['pVacation_result_removed']; } if(!empty($fChange)) { $tMessage= $PALANG['pVacation_result_added']; } } else { $tMessage = $PALANG['pVacation_result_error']; } include ("templates/header.php"); include ("templates/menu.php"); include ("templates/edit-vacation.php"); include ("templates/footer.php"); /* vim: set expandtab softtabstop=3 tabstop=3 shiftwidth=3: */ ?>