Esempio n. 1
0
// If user is not logged in then create an error.
// Do not bother validating the other fields if not logged in.
if ($user->getIsLoggedIn()) {
    if (!$logRecordId) {
        $status = "fail";
        $errors[logRecordId] = "No logRecordId specefied.";
    }
} else {
    $status = "fail";
    $errors[user] = "You are not logged in.";
}
$logRec = new LogRecord();
if ($status == "success") {
    // Everything is OK. Do the DELETE:
    $logRec->setId($logRecordId);
    if (!$logRec->deleteRecord()) {
        $status = "fail";
        $errors[deleteRecordFailed] = "Failed to delete record.";
    }
}
header("content-type: text/xml");
?>


<DeleteLogRecord>
	<logId><?php 
echo $logRec->getId();
?>
</logId>
	<status><?php 
echo $status;