summaryrefslogtreecommitdiff
path: root/includes/pages/admin_news.php
diff options
context:
space:
mode:
Diffstat (limited to 'includes/pages/admin_news.php')
-rw-r--r--includes/pages/admin_news.php12
1 files changed, 6 insertions, 6 deletions
diff --git a/includes/pages/admin_news.php b/includes/pages/admin_news.php
index 192f3cce..af7046c9 100644
--- a/includes/pages/admin_news.php
+++ b/includes/pages/admin_news.php
@@ -8,12 +8,12 @@ function admin_news() {
} else {
$html = '<div class="col-md-12"><h1>' . _("Edit news entry") . '</h1>' . msg();
if (isset($_REQUEST['id']) && preg_match("/^[0-9]{1,11}$/", $_REQUEST['id'])) {
- $id = $_REQUEST['id'];
+ $news_id = $_REQUEST['id'];
} else {
return error("Incomplete call, missing News ID.", true);
}
- $news = sql_select("SELECT * FROM `News` WHERE `ID`='" . sql_escape($id) . "' LIMIT 1");
+ $news = sql_select("SELECT * FROM `News` WHERE `ID`='" . sql_escape($news_id) . "' LIMIT 1");
if (count($news) > 0) {
switch ($_REQUEST["action"]) {
default:
@@ -33,9 +33,9 @@ function admin_news() {
form_textarea('eText', _("Message"), $news['Text']),
form_checkbox('eTreffen', _("Meeting"), $news['Treffen'] == 1, 1),
form_submit('submit', _("Save"))
- ], page_link_to('admin_news&action=save&id=' . $id));
+ ], page_link_to('admin_news&action=save&id=' . $news_id));
- $html .= '<a class="btn btn-danger" href="' . page_link_to('admin_news&action=delete&id=' . $id) . '"><span class="glyphicon glyphicon-trash"></span> ' . _("Delete") . '</a>';
+ $html .= '<a class="btn btn-danger" href="' . page_link_to('admin_news&action=delete&id=' . $news_id) . '"><span class="glyphicon glyphicon-trash"></span> ' . _("Delete") . '</a>';
break;
case 'save':
@@ -47,7 +47,7 @@ function admin_news() {
`Text`='" . sql_escape($_POST["eText"]) . "',
`UID`='" . sql_escape($user['UID']) . "',
`Treffen`='" . sql_escape($_POST["eTreffen"]) . "'
- WHERE `ID`='" . sql_escape($id) . "'");
+ WHERE `ID`='" . sql_escape($news_id) . "'");
engelsystem_log("News updated: " . $_POST["eBetreff"]);
success(_("News entry updated."));
redirect(page_link_to("news"));
@@ -56,7 +56,7 @@ function admin_news() {
case 'delete':
list($news) = $news;
- sql_query("DELETE FROM `News` WHERE `ID`='" . sql_escape($id) . "' LIMIT 1");
+ sql_query("DELETE FROM `News` WHERE `ID`='" . sql_escape($news_id) . "' LIMIT 1");
engelsystem_log("News deleted: " . $news['Betreff']);
success(_("News entry deleted."));
redirect(page_link_to("news"));