From 1b7413e25654f25a7f4d3e4c18d6fa05c3352501 Mon Sep 17 00:00:00 2001 From: dleffler Date: Fri, 25 Jul 2014 12:20:42 -0400 Subject: [PATCH] Fixes regression bug where traditional file manager would display wrong 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. --- .../modules/file/controllers/fileController.php | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/framework/modules/file/controllers/fileController.php b/framework/modules/file/controllers/fileController.php index 9e3cc59170..c1e298191b 100755 --- a/framework/modules/file/controllers/fileController.php +++ b/framework/modules/file/controllers/fileController.php @@ -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 "; @@ -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') { @@ -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 { @@ -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); @@ -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); @@ -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); @@ -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);