Issues (733)

Security Analysis    not enabled

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

  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.
  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.
  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.
  Code Injection
Code Injection enables an attacker to execute arbitrary code on the server.
  Response Splitting
Response Splitting can be used to send arbitrary responses.
  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.
  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.
  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.
  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.
  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.
  Header Injection
  Other Vulnerability
This category comprises other attack vectors such as manipulating the PHP runtime, loading custom extensions, freezing the runtime, or similar.
  Regex Injection
Regex Injection enables an attacker to execute arbitrary code in your PHP process.
  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.
  Variable Injection
Variable Injection enables an attacker to overwrite program variables with custom data, and can lead to further vulnerabilities.
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.

admin/offer.php (4 issues)

Upgrade to new PHP Analysis Engine

These results are based on our legacy PHP analysis, consider migrating to our new PHP analysis engine instead. Learn more

1
<?php
2
/**
3
 *
4
 * Module: SmartCourse
5
 * Author: The SmartFactory <www.smartfactory.ca>
6
 * Licence: GNU
7
 * @param bool   $showmenu
8
 * @param int    $offerid
9
 * @param string $fct
10
 */
11
12
function editoffer($showmenu = false, $offerid = 0, $fct = '')
13
{
14
    global $smartPartnerOfferHandler, $smartPartnerCategoryHandler, $smartPartnerPartnerHandler;
15
16
    $offerObj = $smartPartnerOfferHandler->get($offerid);
17
18
    if ($offerObj->isNew()) {
19
        $breadcrumb            = _AM_SPARTNER_OFFERS . ' > ' . _AM_SPARTNER_CREATINGNEW;
20
        $title                 = _AM_SPARTNER_OFFER_CREATE;
21
        $info                  = _AM_SPARTNER_OFFER_CREATE_INFO;
22
        $collaps_name          = 'offercreate';
23
        $form_name             = _AM_SPARTNER_OFFER_CREATE;
24
        $submit_button_caption = null;
25
        $offerObj->setVar('date_sub', time());
26
    } else {
27
        $breadcrumb            = _AM_SPARTNER_OFFERS . ' > ' . _AM_SPARTNER_EDITING;
28
        $title                 = _AM_SPARTNER_OFFER_EDIT;
29
        $info                  = _AM_SPARTNER_OFFER_EDIT_INFO;
30
        $collaps_name          = 'offeredit';
31
        $form_name             = _AM_SPARTNER_OFFER_EDIT;
32
        $submit_button_caption = null;
33
    }
34
    $partnerObj = $smartPartnerPartnerHandler->get($offerObj->getVar('partnerid', 'e'));
35
    $offerObj->hideFieldFromForm('date_sub');
36
    $menuTab = 3;
37
38
    if ($showmenu) {
39
        //smart_adminMenu($menuTab, $breadcrumb);
0 ignored issues
show
Unused Code Comprehensibility introduced by
75% of this comment could be valid code. Did you maybe forget this after debugging?

Sometimes obsolete code just ends up commented out instead of removed. In this case it is better to remove the code once you have checked you do not need it.

The code might also have been commented out for debugging purposes. In this case it is vital that someone uncomments it again or your project may behave in very unexpected ways in production.

This check looks for comments that seem to be mostly valid code and reports them.

Loading history...
40
    }
41
    echo "<br>\n";
42
    smart_collapsableBar($collaps_name, $title, $info);
43
44
    $sform = $offerObj->getForm($form_name, 'addoffer', false, $submit_button_caption);
45
    if ($fct === 'app') {
46
        $sform->addElement(new XoopsFormHidden('fct', 'app'));
47
    }
48
    $sform->display();
49
    smart_close_collapsable($collaps_name);
50
}
51
52
include_once __DIR__ . '/admin_header.php';
53
54
$op = '';
55
if (isset($_GET['op'])) {
56
    $op = $_GET['op'];
57
}
58
if (isset($_POST['op'])) {
59
    $op = $_POST['op'];
60
}
61
62
switch ($op) {
63
    case 'mod':
64
        $offerid = isset($_GET['offerid']) ? (int)$_GET['offerid'] : 0;
65
        $fct     = isset($_GET['fct']) ? $_GET['fct'] : '';
66
        smart_xoops_cp_header();
67
68
        editoffer(true, $offerid, $fct);
69
        break;
70
71
    case 'addoffer':
72
        include_once XOOPS_ROOT_PATH . '/modules/smartobject/class/smartobjectcontroller.php';
73
74
        $controller = new SmartObjectController($smartPartnerOfferHandler);
75
        $offerObj   = $controller->storeSmartObject();
76
        $fct        = isset($_POST['fct']) ? $_POST['fct'] : '';
77
78
        if ($offerObj->hasError()) {
79
            redirect_header($smart_previous_page, 3, _CO_SOBJECT_SAVE_ERROR . $offerObj->getHtmlErrors());
80
        } else {
81
            $partnerObj = $smartPartnerPartnerHandler->get($offerObj->getVar('partnerid', 'e'));
82
            $partnerObj->setUpdated();
83
            if ($_POST['offerid'] == '') {
84
                $offerObj->sendNotifications(array(_SPARTNER_NOT_OFFER_NEW));
85
            }
86
87
            redirect_header(smart_get_page_before_form(), 3, _CO_SOBJECT_SAVE_SUCCESS);
88
        }
89
        exit;
90
        break;
91
92
    case 'del':
93
        include_once XOOPS_ROOT_PATH . '/modules/smartobject/class/smartobjectcontroller.php';
94
        $controller = new SmartObjectController($smartPartnerOfferHandler);
95
        $controller->handleObjectDeletion();
96
        break;
97
98
    case 'default':
99
    default:
100
        include_once(XOOPS_ROOT_PATH . '/modules/smartobject/include/functions.php');
101
        smart_xoops_cp_header();
102
103
        //add navigation icon
104
        $indexAdmin = new ModuleAdmin();
105
        echo $indexAdmin->addNavigation(basename(__FILE__));
106
107
        //add button for creating a new offer
108
        $indexAdmin->addItemButton(_AM_SPARTNER_OFFER_CREATE, 'offer.php?op=mod', 'add', '');
109
        echo $indexAdmin->renderButton('left', '');
110
111
        //smart_adminMenu(3, _AM_SPARTNER_OFFERS);
0 ignored issues
show
Unused Code Comprehensibility introduced by
63% of this comment could be valid code. Did you maybe forget this after debugging?

Sometimes obsolete code just ends up commented out instead of removed. In this case it is better to remove the code once you have checked you do not need it.

The code might also have been commented out for debugging purposes. In this case it is vital that someone uncomments it again or your project may behave in very unexpected ways in production.

This check looks for comments that seem to be mostly valid code and reports them.

Loading history...
112
113
        //        echo "<br>\n";
114
        //        echo "<form><div style=\"margin-bottom: 12px;\">";
0 ignored issues
show
Unused Code Comprehensibility introduced by
43% of this comment could be valid code. Did you maybe forget this after debugging?

Sometimes obsolete code just ends up commented out instead of removed. In this case it is better to remove the code once you have checked you do not need it.

The code might also have been commented out for debugging purposes. In this case it is vital that someone uncomments it again or your project may behave in very unexpected ways in production.

This check looks for comments that seem to be mostly valid code and reports them.

Loading history...
115
        //        echo "<input type='button' name='button' onclick=\"location='offer.php?op=mod'\" value='" . _AM_SPARTNER_OFFER_CREATE . "'>&nbsp;&nbsp;";
116
        //        echo "</div></form>";
117
118
        smart_collapsableBar('createdoffers', _AM_SPARTNER_OFFERS, _AM_SPARTNER_OFFERS_DSC);
119
120
        include_once XOOPS_ROOT_PATH . '/modules/smartobject/class/smartobjecttable.php';
121
        $objectTable = new SmartObjectTable($smartPartnerOfferHandler);
122
        $objectTable->addFilter('partnerid', 'getPartnerList');
123
        $objectTable->addFilter('status', 'getStatusList');
124
        $objectTable->addColumn(new SmartObjectColumn('title', 'left'));
125
        $objectTable->addColumn(new SmartObjectColumn('partnerid', 'center', 100));
126
        $objectTable->addColumn(new SmartObjectColumn('status', 'center', 100));
127
        $objectTable->render();
128
129
        echo '<br>';
130
        smart_close_collapsable('createdoffers');
131
        echo '<br>';
132
133
        break;
134
}
135
136
//smart_modFooter();
0 ignored issues
show
Unused Code Comprehensibility introduced by
67% of this comment could be valid code. Did you maybe forget this after debugging?

Sometimes obsolete code just ends up commented out instead of removed. In this case it is better to remove the code once you have checked you do not need it.

The code might also have been commented out for debugging purposes. In this case it is vital that someone uncomments it again or your project may behave in very unexpected ways in production.

This check looks for comments that seem to be mostly valid code and reports them.

Loading history...
137
//xoops_cp_footer();
138
include_once __DIR__ . '/admin_footer.php';
139