FOSSology  4.5.1
Open Source License Compliance by Open Source Software
ui-view-info.php
1 <?php
2 /*
3  SPDX-FileCopyrightText: © 2008-2014 Hewlett-Packard Development Company, L.P.
4  SPDX-FileCopyrightText: © 2015, 2018 Siemens AG
5 
6  SPDX-License-Identifier: GPL-2.0-only
7 */
8 
13 
14 class ui_view_info extends FO_Plugin
15 {
19  private $uploadDao;
23  private $dbManager;
28  private $userDao;
29  function __construct()
30  {
31  $this->Name = "view_info";
32  $this->Title = _("View File Information");
33  $this->Dependency = array("browse");
34  $this->DBaccess = PLUGIN_DB_READ;
35  $this->LoginFlag = 0;
36  parent::__construct();
37  $this->uploadDao = $GLOBALS['container']->get('dao.upload');
38  $this->dbManager = $GLOBALS['container']->get('db.manager');
39  $this->userDao = $GLOBALS['container']->get('dao.user');
40  }
41 
45  function RegisterMenus()
46  {
47  $tooltipText = _("View file information");
48  menu_insert("Browse-Pfile::Info", 5, $this->Name, $tooltipText);
49  // For the Browse menu, permit switching between detail and summary.
50  $Parm = Traceback_parm_keep(array("upload","item","format"));
51  $URI = $this->Name . $Parm;
52 
53  $menuPosition = 60;
54  $menuText = "Info";
55  if (GetParm("mod", PARM_STRING) == $this->Name) {
56  menu_insert("View::[BREAK]", 61);
57  menu_insert("View::[BREAK]", 50);
58  menu_insert("View::{$menuText}", $menuPosition);
59  menu_insert("View-Meta::[BREAK]", 61);
60  menu_insert("View-Meta::[BREAK]", 50);
61  menu_insert("View-Meta::{$menuText}", $menuPosition);
62 
63  menu_insert("Browse::Info", -3);
64  } else {
65  $tooltipText = _("View information about this file");
66  menu_insert("View::[BREAK]", 61);
67  menu_insert("View::[BREAK]", 50);
68  menu_insert("View::{$menuText}", $menuPosition, $URI, $tooltipText);
69  menu_insert("View-Meta::[BREAK]", 61);
70  menu_insert("View-Meta::[BREAK]", 50);
71  menu_insert("View-Meta::{$menuText}", $menuPosition, $URI, $tooltipText);
72 
73  menu_insert("Browse::Info", -3, $URI, $tooltipText);
74  }
75  } // RegisterMenus()
76 
80  function ShowView($Upload, $Item, $ShowMenu = 0)
81  {
82  $vars = [];
83  if (empty($Upload) || empty($Item)) {
84  return;
85  }
86 
87  $Page = GetParm("page", PARM_INTEGER);
88  if (empty($Page)) {
89  $Page = 0;
90  }
91  $vars['repoLocPage'] = $Page;
92 
98  if ($Page == 0) {
99  $sql = "SELECT * FROM uploadtree
100  INNER JOIN pfile ON uploadtree_pk = $1
101  AND pfile_fk = pfile_pk
102  LIMIT 1;";
103  $row = $this->dbManager->getSingleRow(
104  $sql,
105  array($Item),
106  __METHOD__ . "GetFileDescribingRow"
107  );
108  $bytes = $row['pfile_size'];
109  $bytesH = HumanSize($bytes);
110  $bytes = number_format($bytes, 0, "", ",") . ' B';
111  if ($bytesH == $bytes) {
112  $bytesH = "";
113  } else {
114  $bytesH = '(' . $bytesH . ')';
115  }
116  $vars['sizeInBytes'] = $bytes;
117  $vars['sizeInMB'] = $bytesH;
118  $vars['fileSha1'] = $row['pfile_sha1'];
119  $vars['fileMd5'] = $row['pfile_md5'];
120  $vars['fileSha256'] = $row['pfile_sha256'];
121  $vars['fileSize'] = $row['pfile_size'];
122  $vars['filePfileId'] = $row['pfile_fk'];
123  }
124  return $vars;
125  } // ShowView()
126 
130  function ShowSightings($Upload, $Item)
131  {
132  $v = "";
133  if (empty($Upload) || empty($Item)) {
134  return $vars;
135  }
136 
137  $page = GetParm("page", PARM_INTEGER);
138  if (empty($page)) {
139  $page = 0;
140  }
141  $MAX = 50;
142  $offset = $page * $MAX;
143  /**********************************
144  List the directory locations where this pfile is found
145  **********************************/
146  $sql = "SELECT * FROM pfile,uploadtree
147  WHERE pfile_pk=pfile_fk
148  AND pfile_pk IN
149  (SELECT pfile_fk FROM uploadtree WHERE uploadtree_pk = $1)
150  LIMIT $2 OFFSET $3";
151  $this->dbManager->prepare(__METHOD__ . "getListOfFiles", $sql);
152  $result = $this->dbManager->execute(__METHOD__ . "getListOfFiles", array($Item,$MAX,$offset));
153  $count = pg_num_rows($result);
154  if (($page > 0) || ($count >= $MAX)) {
155  $vMenu = "<p>\n" . MenuEndlessPage($page, ($count >= $MAX)) . "</p>\n";
156  } else {
157  $vMenu = "";
158  }
159  if ($count > 0) {
160  $v .= _("This exact file appears in the following locations:\n");
161  $v .= $vMenu;
162  $offset++;
163  $v .= Dir2FileList($result, "browse", "view", $offset);
164  $v .= $vMenu;
165  } elseif ($page > 0) {
166  $v .= _("End of listing.\n");
167  } else {
168  $v .= _("This file does not appear in any other known location.\n");
169  }
170  pg_free_result($result);
171 
172  $vars = [];
173  $vars['sightingsContent'] = $v;
174  return $vars;
175  } //ShowSightings()
176 
177 
178 
182  function ShowMetaView($Upload, $Item)
183  {
184  $groupId = Auth::getGroupId();
185  $vars = [];
186  if (empty($Item) || empty($Upload)) {
187  return $vars;
188  }
189 
190  /* display mimetype */
191  $sql = "SELECT * FROM uploadtree where uploadtree_pk = $1";
192  $this->dbManager->prepare(__METHOD__ . "DisplayMimetype", $sql);
193  $result = $this->dbManager->execute(__METHOD__ . "DisplayMimetype", array($Item));
194  if (pg_num_rows($result)) {
195  $vars['fileInfo'] = 1;
196  $row = pg_fetch_assoc($result);
197 
198  if (! empty($row['mimetype_pk'])) {
199  $vars['displayMimeTypeName'] = $row['mimetype_name'];
200  }
201  } else {
202  // bad uploadtree_pk
203  $vars['fileInfo'] = 0;
204  return $vars;
205  }
206  $this->dbManager->freeResult($result);
207 
208  /* get mimetype */
209  if (! empty($row['pfile_fk'])) {
210  $sql = "select mimetype_name from pfile, mimetype where pfile_pk = $1 and pfile_mimetypefk=mimetype_pk";
211  $this->dbManager->prepare(__METHOD__ . "GetMimetype", $sql);
212  $result = $this->dbManager->execute(
213  __METHOD__ . "GetMimetype",
214  array($row['pfile_fk'])
215  );
216  if (pg_num_rows($result)) {
217  $pmRow = pg_fetch_assoc($result);
218  $vars['getMimeTypeName'] = $pmRow['mimetype_name'];
219  }
220  $this->dbManager->freeResult($result);
221  }
222  $pmRow = [];
223  // Check if ScanOSS is enabled
224  $sql = "SELECT agent_enabled FROM agent WHERE agent_name ='scanoss' ORDER BY agent_ts LIMIT 1;";
225  $row = $this->dbManager->getSingleRow($sql, [],
226  __METHOD__ . "checkScanOss");
227  if (!empty($row) && $row["agent_enabled"] == 't') {
228  $sql = "SELECT s.purl, s.matchtype, s.lineranges, s.url, s.filepath " .
229  "FROM scanoss_fileinfo s, uploadtree u where u.uploadtree_pk = $1 and s.pfile_fk = u.pfile_fk;";
230  $pmRow = $this->dbManager->getSingleRow($sql, [$Item],
231  __METHOD__ . "GetFileMatchInfo");
232  }
233  if (!empty($pmRow)) {
234  $vars['purl'] = $pmRow['purl'];
235  $vars['matchType'] = $pmRow['matchtype'];
236  $vars['lineRange'] = $pmRow['lineranges'];
237  $vars['url'] = $pmRow['url'];
238  $vars['path'] = $pmRow['filepath'];
239  $vars['scanossInfo'] = 1;
240  } else {
241  $vars['scanossInfo'] = 0;
242  }
243  /* display upload origin */
244  $sql = "select * from upload where upload_pk=$1";
245  $row = $this->dbManager->getSingleRow(
246  $sql,
247  array($row['upload_fk']),
248  __METHOD__ . "getUploadOrigin"
249  );
250  if ($row) {
251  /* upload source */
252  if ($row['upload_mode'] & 1 << 2) {
253  $text = _("Added by URL");
254  } elseif ($row['upload_mode'] & 1 << 3) {
255  $text = _("Added by file upload");
256  } elseif ($row['upload_mode'] & 1 << 4) {
257  $text = _("Added from filesystem");
258  }
259  $vars['fileUploadOriginInfo'] = $text;
260  $vars['fileUploadOrigin'] = $row['upload_origin'];
261 
262  /* upload time */
263  $ts = $row['upload_ts'];
264  $vars['fileUploadDate'] = substr($ts, 0, strrpos($ts, '.'));
265  }
266  /* display where it was uploaded from */
267  /* display upload owner*/
268  $sql = "SELECT user_name from users, upload where user_pk = user_fk and upload_pk = $1";
269  $row = $this->dbManager->getSingleRow($sql, array($Upload), __METHOD__ . "getUploadOwner");
270 
271  $vars['fileUploadUser'] = $row['user_name'];
272  $userId = $this->uploadDao->getAssignee($Upload, $groupId);
273  $vars['fileAssigneeUser'] = ($userId == 1) ? 'Unassigned' : $this->userDao->getUserName($userId);
274  $assignedDate = $this->uploadDao->getAssigneeDate($Upload);
275  $vars['fileAssigneeUserOn'] = empty($assignedDate) ? 'NA' : substr($assignedDate, 0, strrpos($assignedDate, '.'));
276  $vars['fileClearingDuration'] = $this->uploadDao->getClearingDuration($Upload)[0];
277 
278  return $vars;
279  } // ShowMetaView()
280 
285  function ShowPackageInfo($Upload, $Item, $ShowMenu = 0)
286  {
287  $vars = [];
288  $Require = "";
289  $MIMETYPE = "";
290  $Count = 0;
291 
292  $rpm_info = array("Package" => "pkg_name",
293  "Alias" => "pkg_alias",
294  "Architecture" => "pkg_arch",
295  "Version" => "version",
296  "License" => "license",
297  "Group" => "pkg_group",
298  "Packager" => "packager",
299  "Release" => "release",
300  "BuildDate" => "build_date",
301  "Vendor" => "vendor",
302  "URL" => "url",
303  "Summary" => "summary",
304  "Description" => "description",
305  "Source" => "source_rpm");
306 
307  $deb_binary_info = array("Package" => "pkg_name",
308  "Architecture" => "pkg_arch",
309  "Version" => "version",
310  "Section" => "section",
311  "Priority" => "priority",
312  "Installed Size" => "installed_size",
313  "Maintainer" => "maintainer",
314  "Homepage" => "homepage",
315  "Source" => "source",
316  "Summary" => "summary",
317  "Description" => "description");
318 
319  $deb_source_info = array("Format" => "format",
320  "Source" => "source",
321  "Binary" => "pkg_name",
322  "Architecture" => "pkg_arch",
323  "Version" => "version",
324  "Maintainer" => "maintainer",
325  "Uploaders" => "uploaders",
326  "Standards-Version" => "standards_version");
327 
328  if (empty($Item) || empty($Upload)) {
329  return $vars;
330  }
331 
332  /**********************************
333  Check if pkgagent disabled
334  ***********************************/
335  $sql = "SELECT agent_enabled FROM agent WHERE agent_name ='pkgagent' order by agent_ts LIMIT 1;";
336  $row = $this->dbManager->getSingleRow($sql, array(), __METHOD__ . "checkPkgagentDisabled");
337  if (isset($row) && ($row['agent_enabled'] == 'f')) {
338  return $vars;
339  }
340 
341  /* If pkgagent_ars table didn't exists, don't show the result. */
342  $sql = "SELECT typlen FROM pg_type where typname='pkgagent_ars' limit 1;";
343  $this->dbManager->prepare(__METHOD__ . "displayPackageInfo", $sql);
344  $result = $this->dbManager->execute(__METHOD__ . "displayPackageInfo", array());
345  $numrows = pg_num_rows($result);
346  $this->dbManager->freeResult($result);
347  if ($numrows <= 0) {
348  $vars['packageAgentNA'] = 1;
349  return $vars;
350  }
351 
352  /* If pkgagent_ars table didn't have record for this upload, don't show the result. */
353  $agent_status = AgentARSList('pkgagent_ars', $Upload);
354  if (empty($agent_status)) {
355  $vars['packageAgentStatus'] = 1;
356  $vars['trackback_uri'] = Traceback_uri() .
357  "?mod=schedule_agent&upload=$Upload&agent=agent_pkgagent";
358  return ($vars);
359  }
360  $sql = "SELECT mimetype_name
361  FROM uploadtree
362  INNER JOIN pfile ON uploadtree_pk = $1
363  AND pfile_fk = pfile_pk
364  INNER JOIN mimetype ON pfile_mimetypefk = mimetype_pk;";
365  $this->dbManager->prepare(__METHOD__ . "getMimetypeName", $sql);
366  $result = $this->dbManager->execute(__METHOD__ . "getMimetypeName", array($Item));
367  while ($row = pg_fetch_assoc($result)) {
368  if (! empty($row['mimetype_name'])) {
369  $MIMETYPE = $row['mimetype_name'];
370  }
371  }
372  $this->dbManager->freeResult($result);
373 
377  if ($MIMETYPE == "application/x-rpm") {
378  $sql = "SELECT *
379  FROM pkg_rpm
380  INNER JOIN uploadtree ON uploadtree_pk = $1
381  AND uploadtree.pfile_fk = pkg_rpm.pfile_fk;";
382  $R = $this->dbManager->getSingleRow($sql, array($Item), __METHOD__ . "getRPMPackageInfo");
383  if ((! empty($R['source_rpm'])) and (trim($R['source_rpm']) != "(none)")) {
384  $vars['packageType'] = _("RPM Binary Package");
385  } else {
386  $vars['packageType'] = _("RPM Source Package");
387  }
388  $Count = 1;
389 
390  if (! empty($R['pkg_pk'])) {
391  $Require = $R['pkg_pk'];
392  foreach ($rpm_info as $key => $value) {
393  $entry = [];
394  $entry['count'] = $Count;
395  $entry['type'] = _($key);
396  $entry['value'] = htmlspecialchars($R["$value"], ENT_QUOTES|ENT_HTML5, 'UTF-8');
397  $Count++;
398  $vars['packageEntries'][] = $entry;
399  }
400 
401  $sql = "SELECT * FROM pkg_rpm_req WHERE pkg_fk = $1;";
402  $this->dbManager->prepare(__METHOD__ . "getPkg_rpm_req", $sql);
403  $result = $this->dbManager->execute(__METHOD__ . "getPkg_rpm_req", array($Require));
404 
405  while ($R = pg_fetch_assoc($result) and ! empty($R['req_pk'])) {
406  $entry = [];
407  $entry['count'] = $Count;
408  $entry['type'] = _("Requires");
409  $entry['value'] = htmlspecialchars($R["$value"], ENT_QUOTES|ENT_HTML5, 'UTF-8');
410  $Count++;
411  $vars['packageRequires'][] = $entry;
412  }
413  $this->dbManager->freeResult($result);
414  }
415  } elseif ($MIMETYPE == "application/x-debian-package") {
416  $vars['packageType'] = _("Debian Binary Package\n");
417 
418  $sql = "SELECT *
419  FROM pkg_deb
420  INNER JOIN uploadtree ON uploadtree_pk = $1
421  AND uploadtree.pfile_fk = pkg_deb.pfile_fk;";
422  $R = $this->dbManager->getSingleRow($sql, array($Item), __METHOD__ . "debianBinaryPackageInfo");
423  $Count = 1;
424 
425  if ($R) {
426  $Require = $R['pkg_pk'];
427  foreach ($deb_binary_info as $key => $value) {
428  $entry = [];
429  $entry['count'] = $Count;
430  $entry['type'] = _($key);
431  $entry['value'] = htmlspecialchars($R["$value"], ENT_QUOTES|ENT_HTML5, 'UTF-8');
432  $Count++;
433  $vars['packageEntries'][] = $entry;
434  }
435 
436  $sql = "SELECT * FROM pkg_deb_req WHERE pkg_fk = $1;";
437  $this->dbManager->prepare(__METHOD__ . "getPkg_rpm_req", $sql);
438  $result = $this->dbManager->execute(__METHOD__ . "getPkg_rpm_req", array($Require));
439 
440  while ($R = pg_fetch_assoc($result) and ! empty($R['req_pk'])) {
441  $entry = [];
442  $entry['count'] = $Count;
443  $entry['type'] = _("Depends");
444  $entry['value'] = htmlspecialchars($R["$value"], ENT_QUOTES|ENT_HTML5, 'UTF-8');
445  $Count++;
446  $vars['packageRequires'][] = $entry;
447  }
448  $this->dbManager->freeResult($result);
449  }
450  $V .= "</table>\n";
451  } elseif ($MIMETYPE == "application/x-debian-source") {
452  $vars['packageType'] = _("Debian Source Package\n");
453 
454  $sql = "SELECT *
455  FROM pkg_deb
456  INNER JOIN uploadtree ON uploadtree_pk = $1
457  AND uploadtree.pfile_fk = pkg_deb.pfile_fk;";
458  $R = $this->dbManager->getSingleRow($sql, array($Item), __METHOD__ . "debianSourcePakcageInfo");
459  $Count = 1;
460 
461  if ($R) {
462  $Require = $R['pkg_pk'];
463  foreach ($deb_source_info as $key => $value) {
464  $entry = [];
465  $entry['count'] = $Count;
466  $entry['type'] = _($key);
467  $entry['value'] = htmlspecialchars($R["$value"], ENT_QUOTES|ENT_HTML5, 'UTF-8');
468  $Count++;
469  $vars['packageEntries'][] = $entry;
470  }
471 
472  $sql = "SELECT * FROM pkg_deb_req WHERE pkg_fk = $1;";
473  $this->dbManager->prepare(__METHOD__ . "getPkg_rpm_req", $sql);
474  $result = $this->dbManager->execute(__METHOD__ . "getPkg_rpm_req", array($Require));
475 
476  while ($R = pg_fetch_assoc($result) and ! empty($R['req_pk'])) {
477  $entry = [];
478  $entry['count'] = $Count;
479  $entry['type'] = _("Build-Depends");
480  $entry['value'] = htmlspecialchars($R["$value"], ENT_QUOTES|ENT_HTML5, 'UTF-8');
481  $Count++;
482  $vars['packageRequires'][] = $entry;
483  }
484  $this->dbManager->freeResult($result);
485  }
486  } else {
487  /* Not a package */
488  $vars['packageType'] = "";
489  }
490  return $vars;
491  } // ShowPackageInfo()
492 
493 
497  function ShowTagInfo($Upload, $Item)
498  {
499  $vars = [];
500  $groupId = Auth::getGroupId();
501  $row = $this->uploadDao->getUploadEntry($Item);
502  if (empty($row)) {
503  $vars['tagInvalid'] = 1;
504  return $vars;
505  }
506  $lft = $row["lft"];
507  $rgt = $row["rgt"];
508  $upload_pk = $row["upload_fk"];
509 
510  if (empty($lft)) {
511  $vars['tagInvalid'] = 2;
512  return $vars;
513  }
514  $sql = "SELECT * FROM uploadtree INNER JOIN (SELECT * FROM tag_file,tag WHERE tag_pk = tag_fk) T
515  ON uploadtree.pfile_fk = T.pfile_fk WHERE uploadtree.upload_fk = $1
516  AND uploadtree.lft >= $2 AND uploadtree.rgt <= $3 UNION SELECT * FROM uploadtree INNER JOIN
517  (SELECT * FROM tag_uploadtree,tag WHERE tag_pk = tag_fk) T ON uploadtree.uploadtree_pk = T.uploadtree_fk
518  WHERE uploadtree.upload_fk = $1 AND uploadtree.lft >= $2 AND uploadtree.rgt <= $3 ORDER BY ufile_name";
519  $this->dbManager->prepare(__METHOD__, $sql);
520  $result = $this->dbManager->execute(__METHOD__, array($upload_pk, $lft,$rgt));
521  if (pg_num_rows($result) > 0) {
522  while ($row = pg_fetch_assoc($result)) {
523  $entry = [];
524  $entry['ufile_name'] = $row['ufile_name'];
525  $entry['tag'] = $row['tag'];
526  if ($this->uploadDao->isAccessible($upload_pk, $groupId)) {
527  $entry['url'] = Traceback_uri() .
528  "?mod=tag&action=edit&upload=$Upload&item=" . $row['uploadtree_pk'] .
529  "&tag_file_pk=" . $row['tag_file_pk'];
530  } else {
531  $entry['url'] = "";
532  }
533  $vars['tagsEntries'][] = $entry;
534  }
535  }
536  $this->dbManager->freeResult($result);
537 
538  return $vars;
539  }
540 
546  function showReuseInfo($uploadId)
547  {
548  $vars = [];
549  $reusedInfo = $this->uploadDao->getReusedUpload(
550  $uploadId,
551  Auth::getGroupId()
552  );
553  foreach ($reusedInfo as $row) {
554  $entry = [];
555  $reuseUploadFk = $row['reused_upload_fk'];
556  $reuseGroupFk = $row['reused_group_fk'];
557  $reusedUpload = $this->uploadDao->getUpload($reuseUploadFk);
558  $reuseMode = array();
559  if ($row['reuse_mode'] & UploadDao::REUSE_ENHANCED) {
560  $reuseMode[] = "Enhanced";
561  } else {
562  $reuseMode[] = "Normal";
563  }
564  if ($row['reuse_mode'] & UploadDao::REUSE_MAIN) {
565  $reuseMode[] = "Main license";
566  }
567  if ($row['reuse_mode'] & UploadDao::REUSE_CONF) {
568  $reuseMode[] = "Report configuration settings";
569  }
570  $entry['name'] = $reusedUpload->getFilename();
571  $entry['url'] = Traceback_uri() .
572  "?mod=license&upload=$reuseUploadFk&item=" .
573  $this->uploadDao->getUploadParent($reuseUploadFk);
574  $entry['group'] = $this->userDao->getGroupNameById($reuseGroupFk) .
575  " ($reuseGroupFk)";
576  $entry['sha1'] = $this->uploadDao->getUploadHashes($reuseUploadFk)['sha1'];
577  $entry['mode'] = implode(", ", $reuseMode) . " reuse";
578 
579  $vars['reusedPackageList'][] = $entry;
580  }
581  return $vars;
582  }
583 
584  public function Output()
585  {
586  $uploadId = GetParm("upload", PARM_INTEGER);
587  if (!$this->uploadDao->isAccessible($uploadId, Auth::getGroupId())) {
588  return;
589  }
590 
591  $itemId = GetParm("item", PARM_INTEGER);
592  $this->vars['micromenu'] = Dir2Browse("browse", $itemId, null, $showBox = 0, "View-Meta");
593 
594  $this->vars += $this->ShowTagInfo($uploadId, $itemId);
595  $this->vars += $this->ShowPackageinfo($uploadId, $itemId, 1);
596  $this->vars += $this->ShowMetaView($uploadId, $itemId);
597  $this->vars += $this->ShowSightings($uploadId, $itemId);
598  $this->vars += $this->ShowView($uploadId, $itemId);
599  $this->vars += $this->showReuseInfo($uploadId);
600  }
601 
602  public function getTemplateName()
603  {
604  return "ui-view-info.html.twig";
605  }
606 }
607 $NewPlugin = new ui_view_info();
608 $NewPlugin->Initialize();
This is the Plugin class. All plugins should:
Definition: FO_Plugin.php:57
Contains the constants and helpers for authentication of user.
Definition: Auth.php:24
ShowMetaView($Upload, $Item)
Display the meta data associated with the file.
ShowPackageInfo($Upload, $Item, $ShowMenu=0)
Display the package info associated with the rpm/debian package.
Output()
This function is called when user output is requested. This function is responsible for content....
ShowView($Upload, $Item, $ShowMenu=0)
Display the info data associated with the file.
ShowTagInfo($Upload, $Item)
Display the tag info data associated with the file.
showReuseInfo($uploadId)
Get the info regarding reused package.
ShowSightings($Upload, $Item)
Show Sightings, List the directory locations where this pfile is found.
RegisterMenus()
Customize submenus.
__construct()
base constructor. Most plugins will just use this
Dir2FileList(&$Listing, $IfDirPlugin, $IfFilePlugin, $Count=-1, $ShowPhrase=0)
Given an array of pfiles/uploadtree, sorted by pfile, list all of the breadcrumbs for each file....
Definition: common-dir.php:403
Dir2Browse($Mod, $UploadtreePk, $LinkLast=NULL, $ShowBox=1, $ShowMicro=NULL, $Enumerate=-1, $PreText='', $PostText='', $uploadtree_tablename="uploadtree")
Get an html linked string of a file browse path.
Definition: common-dir.php:263
MenuEndlessPage($Page, $Next=1, $Uri='')
Create a "First Prev 1 2 ... Next" page links for paged output.
menu_insert($Path, $LastOrder=0, $URI=NULL, $Title=NULL, $Target=NULL, $HTML=NULL)
Given a Path, order level for the last item, and optional plugin name, insert the menu item.
Traceback_uri()
Get the URI without query to this location.
Definition: common-parm.php:97
const PARM_INTEGER
Definition: common-parm.php:14
const PARM_STRING
Definition: common-parm.php:18
GetParm($parameterName, $parameterType)
This function will retrieve the variables and check data types.
Definition: common-parm.php:46
Traceback_parm_keep($List)
Create a new URI, keeping only these items.
HumanSize( $bytes)
Translate a byte number to a proper type, xxx bytes to xxx B/KB/MB/GB/TB/PB.
Definition: common-ui.php:100
char * trim(char *ptext)
Trimming whitespace.
Definition: fossconfig.c:690
#define PLUGIN_DB_READ
Plugin requires read permission on DB.
Definition: libfossology.h:37
fo_dbManager * dbManager
fo_dbManager object
Definition: process.c:16