[not_a_tag] fix link
This commit is contained in:
parent
ac14d1e4c6
commit
255e797ea0
1 changed files with 26 additions and 28 deletions
|
@ -109,7 +109,7 @@ class NotATag extends Extension
|
|||
global $user;
|
||||
if ($event->parent === "tags") {
|
||||
if ($user->can(Permissions::BAN_IMAGE)) {
|
||||
$event->add_nav_link("untags", new Link('untag/list/1'), "UnTags");
|
||||
$event->add_nav_link("untags", new Link('untag/list'), "UnTags");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -118,7 +118,7 @@ class NotATag extends Extension
|
|||
{
|
||||
global $user;
|
||||
if ($user->can(Permissions::BAN_IMAGE)) {
|
||||
$event->add_link("UnTags", make_link("untag/list/1"));
|
||||
$event->add_link("UnTags", make_link("untag/list"));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -126,8 +126,7 @@ class NotATag extends Extension
|
|||
{
|
||||
global $database, $page, $user;
|
||||
|
||||
if ($event->page_matches("untag", permission: Permissions::BAN_IMAGE)) {
|
||||
if ($event->page_matches("untag/add", method: "POST")) {
|
||||
if ($event->page_matches("untag/add", method: "POST", permission: Permissions::BAN_IMAGE)) {
|
||||
$input = validate_input(["c_tag" => "string", "c_redirect" => "string"]);
|
||||
$database->execute(
|
||||
"INSERT INTO untags(tag, redirect) VALUES (:tag, :redirect)",
|
||||
|
@ -136,7 +135,7 @@ class NotATag extends Extension
|
|||
$page->set_mode(PageMode::REDIRECT);
|
||||
$page->set_redirect(referer_or(make_link()));
|
||||
}
|
||||
if ($event->page_matches("untag/remove", method: "POST")) {
|
||||
if ($event->page_matches("untag/remove", method: "POST", permission: Permissions::BAN_IMAGE)) {
|
||||
$input = validate_input(["d_tag" => "string"]);
|
||||
$database->execute(
|
||||
"DELETE FROM untags WHERE LOWER(tag) = LOWER(:tag)",
|
||||
|
@ -154,4 +153,3 @@ class NotATag extends Extension
|
|||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Reference in a new issue