Issues (608)

Security Analysis    not enabled

This project does not seem to handle request data directly as such no vulnerable execution paths were found.

  File Inclusion
File Inclusion enables an attacker to inject custom files into PHP's file loading mechanism, either explicitly passed to include, or for example via PHP's auto-loading mechanism.
  Regex Injection
Regex Injection enables an attacker to execute arbitrary code in your PHP process.
  SQL Injection
SQL Injection enables an attacker to execute arbitrary SQL code on your database server gaining access to user data, or manipulating user data.
  Response Splitting
Response Splitting can be used to send arbitrary responses.
  File Manipulation
File Manipulation enables an attacker to write custom data to files. This potentially leads to injection of arbitrary code on the server.
  Object Injection
Object Injection enables an attacker to inject an object into PHP code, and can lead to arbitrary code execution, file exposure, or file manipulation attacks.
  File Exposure
File Exposure allows an attacker to gain access to local files that he should not be able to access. These files can for example include database credentials, or other configuration files.
  XML Injection
XML Injection enables an attacker to read files on your local filesystem including configuration files, or can be abused to freeze your web-server process.
  Code Injection
Code Injection enables an attacker to execute arbitrary code on the server.
  Variable Injection
Variable Injection enables an attacker to overwrite program variables with custom data, and can lead to further vulnerabilities.
  XPath Injection
XPath Injection enables an attacker to modify the parts of XML document that are read. If that XML document is for example used for authentication, this can lead to further vulnerabilities similar to SQL Injection.
  Other Vulnerability
This category comprises other attack vectors such as manipulating the PHP runtime, loading custom extensions, freezing the runtime, or similar.
  Command Injection
Command Injection enables an attacker to inject a shell command that is execute with the privileges of the web-server. This can be used to expose sensitive data, or gain access of your server.
  LDAP Injection
LDAP Injection enables an attacker to inject LDAP statements potentially granting permission to run unauthorized queries, or modify content inside the LDAP tree.
  Cross-Site Scripting
Cross-Site Scripting enables an attacker to inject code into the response of a web-request that is viewed by other users. It can for example be used to bypass access controls, or even to take over other users' accounts.
  Header Injection
Unfortunately, the security analysis is currently not available for your project. If you are a non-commercial open-source project, please contact support to gain access.

makepdf.php (17 issues)

Labels
Severity
1
<?php
2
/*
3
 You may not change or alter any portion of this comment or credits
4
 of supporting developers from this source code or any supporting source code
5
 which is considered copyrighted (c) material of the original comment or credit authors.
6
7
 This program is distributed in the hope that it will be useful,
8
 but WITHOUT ANY WARRANTY; without even the implied warranty of
9
 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
10
*/
11
12
/**
13
 * oledrion
14
 *
15
 * @copyright   {@link https://xoops.org/ XOOPS Project}
16
 * @license     {@link http://www.fsf.org/copyleft/gpl.html GNU public license}
17
 * @author      Hervé Thouzard (http://www.herve-thouzard.com/)
18
 *
19
 * /**
20
 * Impression du catalogue au format PDF
21
 */
22
23
use XoopsModules\Oledrion;
24
25
//use tecnickcom\TCPDF;
26
require_once dirname(dirname(__DIR__)) . '/mainfile.php';
27
require_once XOOPS_ROOT_PATH . '/modules/oledrion/include/common.php';
28
29
if (!is_file(XOOPS_ROOT_PATH . '/class/libraries/vendor/tecnickcom/tcpdf/tcpdf.php')) {
30
    redirect_header(XOOPS_URL . '/modules/' . $xoopsModule->getVar('dirname') . '/viewtopic.php?topic_id=' . $topic_id, 3, 'TCPDF for Xoops not installed');
31
}
32
33
error_reporting(0);
34
@$xoopsLogger->activated = false;
35
36
if (1 != Oledrion\Utility::getModuleOption('pdf_catalog')) {
37
    die();
38
}
39
40
require_once XOOPS_ROOT_PATH . '/class/template.php';
41
$details        = \Xmf\Request::getInt('catalogFormat', 0, 'POST');
42
$Tpl            = new \XoopsTpl();
43
$vatArray       = $tbl_categories = [];
44
$vatArray       = $vatHandler->getAllVats(new Oledrion\Parameters());
45
$tbl_categories = $categoryHandler->getAllCategories(new Oledrion\Parameters());
46
$Tpl->assign('mod_pref', $mod_pref);    // module preferences
47
48
$cat_cid  = 0;
49
$tbl_tmp  = [];
50
$products = [];
51
$products = $productsHandler->getRecentProducts(new Oledrion\Parameters(['start' => 0, 'limit' => 0, 'category' => $cat_cid]));
52
53
if (count($products) > 0) {
54
    $helper->loadLanguage('modinfo');
55
    $Tpl->assign('details', $details);
56
    $tblAuthors = $tbl_tmp = $tblManufacturersPerProduct = [];
57
    $tblAuthors = $productsmanuHandler->getObjects(new \Criteria('pm_product_id', '(' . implode(',', array_keys($products)) . ')', 'IN'), true);
58
    foreach ($tblAuthors as $item) {
59
        $tbl_tmp[]                                                    = $item->getVar('pm_manu_id');
60
        $tblManufacturersPerProduct[$item->getVar('pm_product_id')][] = $item;
61
    }
62
    $tbl_tmp    = array_unique($tbl_tmp);
63
    $tblAuthors = $manufacturerHandler->getObjects(new \Criteria('manu_id', '(' . implode(',', $tbl_tmp) . ')', 'IN'), true);
64
    foreach ($products as $item) {
65
        $tbl_tmp                               = [];
66
        $tbl_tmp                               = $item->toArray();
67
        $tbl_tmp['product_category']           = isset($tbl_categories[$item->getVar('product_cid')]) ? $tbl_categories[$item->getVar('product_cid')]->toArray() : null;
68
        $tbl_tmp['product_price_ttc']          = Oledrion\Utility::getTTC($item->getVar('product_price'), $vatArray[$item->getVar('product_vat_id')]->getVar('vat_rate'), false, 's');
69
        $tbl_tmp['product_discount_price_ttc'] = Oledrion\Utility::getTTC($item->getVar('product_discount_price'), $vatArray[$item->getVar('product_vat_id')]->getVar('vat_rate'), false, 's');
70
        $tbl_join                              = [];
71
        foreach ($tblManufacturersPerProduct[$item->getVar('product_id')] as $author) {
72
            $auteur     = $tblAuthors[$author->getVar('pm_manu_id')];
73
            $tbl_join[] = $auteur->getVar('manu_commercialname') . ' ' . $auteur->getVar('manu_name');
74
        }
75
        if (count($tbl_join) > 0) {
76
            $tbl_tmp['product_joined_manufacturers'] = implode(', ', $tbl_join);
77
        }
78
        $Tpl->append('products', $tbl_tmp);
79
    }
80
}
81
82
$content1 = utf8_encode($Tpl->fetch('db:oledrion_pdf_catalog.tpl'));
83
$content2 = '';
84
if (Oledrion\Utility::getModuleOption('use_price')) {
85
    $content2 = utf8_encode($Tpl->fetch('db:oledrion_purchaseorder.tpl'));
86
}
87
88
// ****************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************
89
// ****************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************
90
// ****************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************
91
92
$doc_title    = _OLEDRION_CATALOG;
93
$doc_subject  = _OLEDRION_CATALOG;
94
$doc_keywords = 'Instant Zero';
95
96
//require_once OLEDRION_PATH.'pdf/config/lang/'._LANGCODE.'.php';
97
//require_once OLEDRION_PATH.'pdf/tcpdf.php';
98
require_once XOOPS_ROOT_PATH . '/class/libraries/vendor/tecnickcom/tcpdf/tcpdf.php';
99
100
//create new PDF document (document units are set by default to millimeters)
101
$pdf = new TCPDF(PDF_PAGE_ORIENTATION, PDF_UNIT, PDF_PAGE_FORMAT, true);
0 ignored issues
show
The type TCPDF was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
The constant PDF_PAGE_ORIENTATION was not found. Maybe you did not declare it correctly or list all dependencies?
Loading history...
The constant PDF_PAGE_FORMAT was not found. Maybe you did not declare it correctly or list all dependencies?
Loading history...
The constant PDF_UNIT was not found. Maybe you did not declare it correctly or list all dependencies?
Loading history...
102
103
// set document information
104
$pdf->SetCreator(PDF_CREATOR);
0 ignored issues
show
The constant PDF_CREATOR was not found. Maybe you did not declare it correctly or list all dependencies?
Loading history...
105
$pdf->SetAuthor(PDF_AUTHOR);
0 ignored issues
show
The constant PDF_AUTHOR was not found. Maybe you did not declare it correctly or list all dependencies?
Loading history...
106
$pdf->SetTitle($doc_title);
107
$pdf->SetSubject($doc_subject);
108
$pdf->SetKeywords($doc_keywords);
109
110
$firstLine  = utf8_encode(Oledrion\Utility::getModuleName() . ' - ' . $xoopsConfig['sitename']);
111
$secondLine = OLEDRION_URL . ' - ' . formatTimestamp(time(), 'm');
112
$pdf->setHeaderData('', '', $firstLine, $secondLine);
113
114
//set margins
115
$pdf->SetMargins(PDF_MARGIN_LEFT, PDF_MARGIN_TOP, PDF_MARGIN_RIGHT);
0 ignored issues
show
The constant PDF_MARGIN_RIGHT was not found. Maybe you did not declare it correctly or list all dependencies?
Loading history...
The constant PDF_MARGIN_TOP was not found. Maybe you did not declare it correctly or list all dependencies?
Loading history...
The constant PDF_MARGIN_LEFT was not found. Maybe you did not declare it correctly or list all dependencies?
Loading history...
116
//set auto page breaks
117
$pdf->SetAutoPageBreak(true, PDF_MARGIN_BOTTOM);
0 ignored issues
show
The constant PDF_MARGIN_BOTTOM was not found. Maybe you did not declare it correctly or list all dependencies?
Loading history...
118
$pdf->setHeaderMargin(PDF_MARGIN_HEADER);
0 ignored issues
show
The constant PDF_MARGIN_HEADER was not found. Maybe you did not declare it correctly or list all dependencies?
Loading history...
119
$pdf->setFooterMargin(PDF_MARGIN_FOOTER);
0 ignored issues
show
The constant PDF_MARGIN_FOOTER was not found. Maybe you did not declare it correctly or list all dependencies?
Loading history...
120
$pdf->setImageScale(PDF_IMAGE_SCALE_RATIO); //set image scale factor
0 ignored issues
show
The constant PDF_IMAGE_SCALE_RATIO was not found. Maybe you did not declare it correctly or list all dependencies?
Loading history...
121
122
$pdf->setHeaderFont([PDF_FONT_NAME_MAIN, '', PDF_FONT_SIZE_MAIN]);
0 ignored issues
show
The constant PDF_FONT_NAME_MAIN was not found. Maybe you did not declare it correctly or list all dependencies?
Loading history...
The constant PDF_FONT_SIZE_MAIN was not found. Maybe you did not declare it correctly or list all dependencies?
Loading history...
123
$pdf->setFooterFont([PDF_FONT_NAME_DATA, '', PDF_FONT_SIZE_DATA]);
0 ignored issues
show
The constant PDF_FONT_SIZE_DATA was not found. Maybe you did not declare it correctly or list all dependencies?
Loading history...
The constant PDF_FONT_NAME_DATA was not found. Maybe you did not declare it correctly or list all dependencies?
Loading history...
124
125
$pdf->setLanguageArray($l); //set language items
126
127
//initialize document
128
//$pdf->AliasNbPages();
129
$pdf->AddPage();
130
$pdf->writeHTML($content1, true, 0);
131
if (Oledrion\Utility::getModuleOption('use_price')) {
132
    $pdf->AddPage();
133
    $pdf->writeHTML($content2, true, 0);
134
}
135
$pdf->Output();
136