forked from Cavemanon/cavepaintings
Permissions to constants
This commit is contained in:
@@ -155,7 +155,7 @@ class Upload extends Extension
|
||||
{
|
||||
global $database, $page, $user;
|
||||
|
||||
if ($user->can("create_image")) {
|
||||
if ($user->can(Permissions::CREATE_IMAGE)) {
|
||||
if ($this->is_full) {
|
||||
$this->theme->display_full($page);
|
||||
} else {
|
||||
@@ -165,7 +165,7 @@ class Upload extends Extension
|
||||
|
||||
if ($event->page_matches("upload/replace")) {
|
||||
// check if the user is an administrator and can upload files.
|
||||
if (!$user->can("replace_image")) {
|
||||
if (!$user->can(Permissions::REPLACE_IMAGE)) {
|
||||
$this->theme->display_permission_denied();
|
||||
} else {
|
||||
if ($this->is_full) {
|
||||
@@ -221,7 +221,7 @@ class Upload extends Extension
|
||||
}
|
||||
}
|
||||
} elseif ($event->page_matches("upload")) {
|
||||
if (!$user->can("create_image")) {
|
||||
if (!$user->can(Permissions::CREATE_IMAGE)) {
|
||||
$this->theme->display_permission_denied();
|
||||
} else {
|
||||
/* Regular Upload Image */
|
||||
@@ -371,7 +371,7 @@ class Upload extends Extension
|
||||
$ok = true;
|
||||
|
||||
// Checks if user is admin > check if you want locked.
|
||||
if ($user->can("edit_image_lock") && !empty($_GET['locked'])) {
|
||||
if ($user->can(Permissions::EDIT_IMAGE_LOCK) && !empty($_GET['locked'])) {
|
||||
$locked = bool_escape($_GET['locked']);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user