Issues (381)

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.

include/oninstall.php (9 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
 *  - A Project by Developers TEAM For Xoops - ( https://xoops.org )
5
 * ****************************************************************************
6
 *  XNEWSLETTER - MODULE FOR XOOPS
7
 *  Copyright (c) 2007 - 2012
8
 *  Goffy ( wedega.com )
9
 *
10
 *  You may not change or alter any portion of this comment or credits
11
 *  of supporting developers from this source code or any supporting
12
 *  source code which is considered copyrighted (c) material of the
13
 *  original comment or credit authors.
14
 *
15
 *  This program is distributed in the hope that it will be useful,
16
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
17
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18
 *  GNU General Public License for more details.
19
 *  ---------------------------------------------------------------------------
20
 * @copyright  Goffy ( wedega.com )
21
 * @license    GPL 2.0
22
 * @package    xnewsletter
23
 * @author     Goffy ( [email protected] )
24
 *
25
 *  Version : 1 Mon 2012/11/05 14:31:32 :  Exp $
26
 * ****************************************************************************
27
 */
28
29
use XoopsModules\Xnewsletter;
30
use XoopsModules\Xnewsletter\Common;
31
32
defined('XOOPS_ROOT_PATH') || die('XOOPS root path not defined');
33
require_once XOOPS_ROOT_PATH . '/modules/xnewsletter/include/common.php';
34
//@require XOOPS_ROOT_PATH . '/modules/xnewsletter/language/' . $xoopsConfig['language'] . '/admin.php';
35
xoops_loadLanguage('admin', 'xnewsletter');
36
37
define('INDEX_FILE_PATH', XOOPS_UPLOAD_PATH . '/index.html');
38
define('BLANK_FILE_PATH', XOOPS_UPLOAD_PATH . '/blank.gif');
39
40
/**
41
 * @param \XoopsModule $module
42
 *
43
 * @return bool
44
 */
45
function xoops_module_pre_install_xnewsletter(\XoopsModule $module)
0 ignored issues
show
The parameter $module is not used and could be removed.

This check looks from parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
46
{
47
    // NOP
48
    return true;
49
}
50
51
/**
52
 * @param \XoopsModule $module
53
 *
54
 * @return bool
55
 */
56
function xoops_module_install_xnewsletter(\XoopsModule $module)
57
{
58
    require_once dirname(__DIR__) . '/preloads/autoloader.php';
59
60
    // get module config values
61
    $hModConfig  = xoops_getHandler('config');
62
    $configArray = $hModConfig->getConfigsByCat(0, $module->getVar('mid'));
63
64
    //Creation of folder "uploads" for the module to the site root
65
    $path = XOOPS_ROOT_PATH . '/uploads/xnewsletter';
66 View Code Duplication
    if (!is_dir($path)) {
0 ignored issues
show
This code seems to be duplicated across your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
67
        if (!mkdir($path, 0777, true) && !is_dir($path)) {
68
            throw new \RuntimeException(sprintf('Directory "%s" was not created', $path));
69
        }
70
    }
71
    chmod($path, 0777);
72
    copy(INDEX_FILE_PATH, $path . '/index.html');
73
74
    //Creation of the file accounts in uploads directory
75
    $path = XOOPS_ROOT_PATH . '/uploads/xnewsletter/accounts';
76 View Code Duplication
    if (!is_dir($path)) {
0 ignored issues
show
This code seems to be duplicated across your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
77
        if (!mkdir($path, 0777, true) && !is_dir($path)) {
78
            throw new \RuntimeException(sprintf('Directory "%s" was not created', $path));
79
        }
80
    }
81
    chmod($path, 0777);
82
    copy(INDEX_FILE_PATH, $path . '/index.html');
83
84
    //Creation of the file cat in uploads directory
85
    $path = XOOPS_ROOT_PATH . '/uploads/xnewsletter/cat';
86 View Code Duplication
    if (!is_dir($path)) {
0 ignored issues
show
This code seems to be duplicated across your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
87
        if (!mkdir($path, 0777, true) && !is_dir($path)) {
88
            throw new \RuntimeException(sprintf('Directory "%s" was not created', $path));
89
        }
90
    }
91
    chmod($path, 0777);
92
    copy(INDEX_FILE_PATH, $path . '/index.html');
93
94
    //Creation of the file subscr in uploads directory
95
    $path = XOOPS_ROOT_PATH . '/uploads/xnewsletter/subscr';
96 View Code Duplication
    if (!is_dir($path)) {
0 ignored issues
show
This code seems to be duplicated across your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
97
        if (!mkdir($path, 0777, true) && !is_dir($path)) {
98
            throw new \RuntimeException(sprintf('Directory "%s" was not created', $path));
99
        }
100
    }
101
    chmod($path, 0777);
102
    copy(INDEX_FILE_PATH, $path . '/index.html');
103
104
    //Creation of the file catsubscr in uploads directory
105
    $path = XOOPS_ROOT_PATH . '/uploads/xnewsletter/catsubscr';
106 View Code Duplication
    if (!is_dir($path)) {
0 ignored issues
show
This code seems to be duplicated across your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
107
        if (!mkdir($path, 0777, true) && !is_dir($path)) {
108
            throw new \RuntimeException(sprintf('Directory "%s" was not created', $path));
109
        }
110
    }
111
    chmod($path, 0777);
112
    copy(INDEX_FILE_PATH, $path . '/index.html');
113
114
    //Creation of the file letter in uploads directory
115
    $path = XOOPS_ROOT_PATH . '/uploads/xnewsletter/letter';
116 View Code Duplication
    if (!is_dir($path)) {
0 ignored issues
show
This code seems to be duplicated across your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
117
        if (!mkdir($path, 0777, true) && !is_dir($path)) {
118
            throw new \RuntimeException(sprintf('Directory "%s" was not created', $path));
119
        }
120
    }
121
    chmod($path, 0777);
122
    copy(INDEX_FILE_PATH, $path . '/index.html');
123
124
    //Creation of the file protocol in uploads directory
125
    $path = XOOPS_ROOT_PATH . '/uploads/xnewsletter/protocol';
126 View Code Duplication
    if (!is_dir($path)) {
0 ignored issues
show
This code seems to be duplicated across your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
127
        if (!mkdir($path, 0777, true) && !is_dir($path)) {
128
            throw new \RuntimeException(sprintf('Directory "%s" was not created', $path));
129
        }
130
    }
131
    chmod($path, 0777);
132
    copy(INDEX_FILE_PATH, $path . '/index.html');
133
134
    //Creation of the folder letter_attachment in uploads directory for files
135
    $path = XOOPS_ROOT_PATH . '/uploads' . $configArray['xn_attachment_path'];
136 View Code Duplication
    if (!is_dir($path)) {
0 ignored issues
show
This code seems to be duplicated across your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
137
        if (!mkdir($path, 0777, true) && !is_dir($path)) {
138
            throw new \RuntimeException(sprintf('Directory "%s" was not created', $path));
139
        }
140
    }
141
    chmod($path, 0777);
142
    copy(INDEX_FILE_PATH, $path . '/index.html');
143
144
    return true;
145
}
146