Skip to content

Commit

Permalink
Fixes regression bug where traditional file manager would display wro…
Browse files Browse the repository at this point in the history
…ng set of files initially (ownly owned and shared files and NOT all files which should be visible by all admins) and a super-admin might not be able to see all files (but a non-super-admin admin would)...admins & super-admins should be able to see all files regardless of whether owned or shared.
  • Loading branch information
dleffler committed Jul 25, 2014
1 parent 9b913cd commit 1b7413e
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions framework/modules/file/controllers/fileController.php
Expand Up @@ -276,7 +276,7 @@ public function getFilesByJSON() {
}
$totalrecords = 0;

if (isset($this->params['query'])) {
if (!empty($this->params['query'])) {
$filter = '';
if (!$user->isAdmin()) {
$filter = "(poster=".$user->id." OR shared=1) AND ";
Expand Down Expand Up @@ -325,7 +325,7 @@ public function getFilesByJSON() {
'records'=>$files
);
} else {
if (!$user->isActingAdmin()) {
if (!$user->isAdmin()) {
$filter = "(poster=".$user->id." OR shared=1)";
};
// if ($this->params['update']=='ck' || $this->params['update']=='tiny') {
Expand Down Expand Up @@ -475,7 +475,7 @@ public function batchDelete() {

if (empty($error)) foreach ($files as $file) {
$delfile = new expFile($file->id);
if ($user->id==$delfile->poster || $user->isActingAdmin()) {
if ($user->id==$delfile->poster || $user->isAdmin()) {
$delfile->delete();
unlink($delfile->directory.$delfile->filename);
} else {
Expand Down Expand Up @@ -630,7 +630,7 @@ public function quickUpload(){
public function editCat() {
global $user;
$file = new expFile($this->params['id']);
if ($user->id==$file->poster || $user->isActingAdmin()) {
if ($user->id==$file->poster || $user->isAdmin()) {
$expcat = new expCat($this->params['newValue']);
$params['expCat'][0] = $expcat->id;
$file->update($params);
Expand All @@ -646,7 +646,7 @@ public function editCat() {
public function editTitle() {
global $user;
$file = new expFile($this->params['id']);
if ($user->id==$file->poster || $user->isActingAdmin()) {
if ($user->id==$file->poster || $user->isAdmin()) {
$file->title = $this->params['newValue'];
$file->save();
$ar = new expAjaxReply(200, gt('Your title was updated successfully'), $file);
Expand All @@ -659,7 +659,7 @@ public function editTitle() {
public function editAlt() {
global $user;
$file = new expFile($this->params['id']);
if ($user->id==$file->poster || $user->isActingAdmin()) {
if ($user->id==$file->poster || $user->isAdmin()) {
$file->alt = $this->params['newValue'];
$file->save();
$ar = new expAjaxReply(200, gt('Your alt was updated successfully'), $file);
Expand All @@ -676,7 +676,7 @@ public function editShare() {
if(!isset($this->params['newValue'])) {
$this->params['newValue'] = 0;
}
if ($user->id==$file->poster || $user->isActingAdmin()) {
if ($user->id==$file->poster || $user->isAdmin()) {
$file->shared = $this->params['newValue'];
$file->save();
$ar = new expAjaxReply(200, gt('This file is now shared.'), $file);
Expand Down

0 comments on commit 1b7413e

Please sign in to comment.