$licenseDao = $GLOBALS['container']->get("dao.license"); if (empty($uploadtree_pk)) { $uploadtreeRec = $dbManager->getSingleRow('SELECT uploadtree_pk FROM uploadtree WHERE parent IS NULL AND upload_fk=$1', array($upload_pk), __METHOD__ . '.find.uploadtree.to.use.in.browse.link'); $uploadtree_pk = $uploadtreeRec['uploadtree_pk']; } /* get last monk agent_pk that has data for this upload */ $AgentRec = AgentARSList("monk_ars", $upload_pk, 1); if ($AgentRec === false) { echo _("No data available \n"); return; } $agent_pk = $AgentRec[0]["agent_fk"]; $uploadtreeTablename = GetUploadtreeTableName($upload_pk); /** @var ItemTreeBounds */ $itemTreeBounds = $uploadDao->getItemTreeBounds($uploadtree_pk, $uploadtreeTablename); $licensesPerFileName = $licenseDao->getLicensesPerFileNameForAgentId($itemTreeBounds, array($agent_pk), true, array(), $excluding, $ignore); foreach ($licensesPerFileName as $fileName => $licenseNames) { if (!$ignore || $licenseNames !== false && $licenseNames !== array()) { if ($licenseNames !== false) { print $fileName . ': ' . implode($licenseNames, ', ') . "\n"; } else { if ($showContainer) { print $filename . "\n"; } } } } } /** get license information for this uploadtree */ GetLicenseList($item, $upload, $showContainer, $excluding, $ignoreFilesWithoutLicense); return 0;
print $Usage; return 1; } account_check($user, $passwd); // check username/password $return_value = read_permission($upload, $user); // check if the user has the permission to read this upload if (empty($return_value)) { $text = _("The user '{$user}' has no permission to read the information of upload {$upload}\n"); echo $text; return 1; } require_once "{$MODDIR}/lib/php/common.php"; global $PG_CONN; /** get license information for this uploadtree */ GetLicenseList($item, $upload, $container); return 0; /** * \brief get nomos license list of one specified uploadtree_id * * \param $uploadtree_pk - uploadtree id * \param $upload_pk - upload id * \param $container - include container or not, 1: yes, 0: no (default) */ function GetLicenseList($uploadtree_pk, $upload_pk, $container = 0) { global $PG_CONN; if (empty($uploadtree_pk)) { /* Find the uploadtree_pk for this upload so that it can be used in the browse link */ $uploadtreeRec = GetSingleRec("uploadtree", "where parent is NULL and upload_fk='{$upload_pk}'"); $uploadtree_pk = $uploadtreeRec['uploadtree_pk'];