mirror of
https://github.com/WhatCD/Gazelle.git
synced 2024-12-13 19:06:27 +00:00
20 lines
675 B
PHP
20 lines
675 B
PHP
<?
|
|
authorize();
|
|
|
|
//Todo, check that loggeduser > edit
|
|
if(!is_number($_POST['article']) || $_POST['article'] == ''){ error(0); }
|
|
|
|
$ArticleID = $_POST['article'];
|
|
$NewAlias = $Alias->convert($_POST['alias']);
|
|
$Dupe = $Alias->to_id($_POST['alias']);
|
|
|
|
if($NewAlias!='' && $NewAlias!='addalias' && !$Dupe){ //Not null, and not dupe
|
|
$DB->query("INSERT INTO wiki_aliases (Alias, UserID, ArticleID) VALUES ('$NewAlias', '$LoggedUser[ID]', '$ArticleID')");
|
|
$Alias->flush();
|
|
} else {
|
|
error('The alias you attempted to add was either null or already in the database.');
|
|
}
|
|
|
|
$Cache->delete_value('wiki_article_'.$ArticleID);
|
|
header('Location: wiki.php?action=article&id='.$ArticleID);
|