admin_news privilege for writing news too

This commit is contained in:
Philip Häusler 2011-09-14 22:23:29 +02:00
parent fc90174dd8
commit 3c33e23c3c
1 changed files with 43 additions and 41 deletions

View File

@ -108,7 +108,7 @@ function user_news() {
$html = "";
if (isset ($_POST["text"]) && isset ($_POST["betreff"])) {
if (isset ($_POST["text"]) && isset ($_POST["betreff"]) && in_array("admin_news", $privileges)) {
if (!isset ($_POST["treffen"]) || !in_array("admin_news", $privileges))
$_POST["treffen"] = 0;
sql_query("INSERT INTO `News` (`Datum`, `Betreff`, `Text`, `UID`, `Treffen`) " .
@ -137,8 +137,9 @@ function user_news() {
else
$html .= '<a href="' . page_link_to("news") . '&page=' . $i . '">' . ($i +1) . '</a>&nbsp; ';
}
$html .= '</div>
<br /><hr />
$html .= '</div>';
if (in_array("admin_news", $privileges)) {
$html .= '<br /><hr />
<h2>' . Get_Text(6) . '</h2>
<a name="Neu">&nbsp;</a>
@ -163,6 +164,7 @@ function user_news() {
<br />
<input type="submit" value="' . Get_Text("save") . '">
</form>';
}
return $html;
}
?>