mirror of
https://github.com/itflow-org/itflow
synced 2026-12-04 01:59:00 +00:00
36 lines
1.0 KiB
PHP
36 lines
1.0 KiB
PHP
<?php
|
|
|
|
/*
|
|
* API - Knowledge Base articles - Delete
|
|
* POST /api/v1/kb_articles/delete.php
|
|
*
|
|
* Delete an article for good, as Delete on its page does - with its versions, tags, files,
|
|
* pictures and readers' feedback. Needs Full on Support.
|
|
*
|
|
* Parameters (POST, JSON body):
|
|
* api_key required - Your API key
|
|
* kb_article_id required - The article
|
|
*/
|
|
|
|
require_once '../validate_api_key.php';
|
|
|
|
require_once '../require_post_method.php';
|
|
|
|
require_once 'kb_article_model.php';
|
|
|
|
$delete_count = false;
|
|
|
|
$row = kbApiArticle($_POST['kb_article_id'] ?? 0);
|
|
$kb_article_id = intval($row['kb_article_id']);
|
|
|
|
$title = kbArticleDelete($kb_article_id);
|
|
if ($title !== null) {
|
|
$delete_count = 1;
|
|
$title = escapeSql($title);
|
|
logAudit("Knowledge Base", "Delete", "$session_name deleted article $title and its versions via API ($api_key_name)", 0, $kb_article_id);
|
|
logAudit("API", "Success", "Deleted Knowledge Base article $title via API ($api_key_name)", 0);
|
|
}
|
|
|
|
// Output
|
|
require_once '../delete_output.php';
|