move filterDocumentLinks() from inc.Util.php to Core/inc.ClassDMS.php

This commit is contained in:
Uwe Steinmann 2013-04-10 15:39:05 +02:00
parent 0c89264f79
commit 21437e5a90
2 changed files with 18 additions and 8 deletions

View File

@ -205,6 +205,24 @@ class SeedDMS_Core_DMS {
return $newArr;
} /* }}} */
/**
* Filter document links
*
* Returns a filtered list of links which are accessible by the
* given user.
*
* @param array $links list of objects of type SeedDMS_Core_DocumentLink
* @param object $user user for which access is being checked
* @return filtered list of links
*/
static function filterDocumentLinks($user, $links) { /* {{{ */
$tmp = array();
foreach ($links as $link)
if ($link->isPublic() || ($link->getUser()->getID() == $user->getID()) || $user->isAdmin())
array_push($tmp, $link);
return $tmp;
} /* }}} */
/**
* Create a new instance of the dms
*

View File

@ -323,14 +323,6 @@ function _add_log_line($msg="") { /* {{{ */
return $txtpath;
} /* }}} */
function filterDocumentLinks($user, $links) { /* {{{ */
$tmp = array();
foreach ($links as $link)
if ($link->isPublic() || ($link->getUser()->getID() == $user->getID()) || $user->isAdmin())
array_push($tmp, $link);
return $tmp;
} /* }}} */
function showtree() { /* {{{ */
global $settings;