Permissions to constants
This commit is contained in:
@ -45,7 +45,7 @@ class NumericScore extends Extension
|
||||
public function onUserPageBuilding(UserPageBuildingEvent $event)
|
||||
{
|
||||
global $user;
|
||||
if ($user->can("edit_other_vote")) {
|
||||
if ($user->can(Permissions::EDIT_OTHER_VOTE)) {
|
||||
$this->theme->get_nuller($event->display_user);
|
||||
}
|
||||
|
||||
@ -98,7 +98,7 @@ class NumericScore extends Extension
|
||||
$page->set_redirect(make_link("post/view/$image_id"));
|
||||
}
|
||||
} elseif ($event->page_matches("numeric_score/remove_votes_on") && $user->check_auth_token()) {
|
||||
if ($user->can("edit_other_vote")) {
|
||||
if ($user->can(Permissions::EDIT_OTHER_VOTE)) {
|
||||
$image_id = int_escape($_POST['image_id']);
|
||||
$database->execute(
|
||||
"DELETE FROM numeric_score_votes WHERE image_id=?",
|
||||
@ -112,7 +112,7 @@ class NumericScore extends Extension
|
||||
$page->set_redirect(make_link("post/view/$image_id"));
|
||||
}
|
||||
} elseif ($event->page_matches("numeric_score/remove_votes_by") && $user->check_auth_token()) {
|
||||
if ($user->can("edit_other_vote")) {
|
||||
if ($user->can(Permissions::EDIT_OTHER_VOTE)) {
|
||||
$this->delete_votes_by(int_escape($_POST['user_id']));
|
||||
$page->set_mode(PageMode::REDIRECT);
|
||||
$page->set_redirect(make_link());
|
||||
|
Reference in New Issue
Block a user