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