Issues (884)

Security Analysis    no request data  

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/functions.php (3 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
 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
 * Alumni module for Xoops
13
 *
14
 * @copyright       XOOPS Project https://xoops.org/
15
 * @license         GPL 2.0 or later
16
 * @package         alumni
17
 * @since           2.6.x
18
 * @author          John Mordo (jlm69)
19
 */
20
21
$moduleDirName = basename(dirname(__DIR__));
22
23
$xoops          = Xoops::getInstance();
24
$listingHandler = $xoops->getModuleHandler('listing', 'alumni');
25
26 View Code Duplication
function alumni_ShowImg()
27
{
28
    global $moduleDirName;
0 ignored issues
show
Compatibility Best Practice introduced by
Use of global functionality is not recommended; it makes your code harder to test, and less reusable.

Instead of relying on global state, we recommend one of these alternatives:

1. Pass all data via parameters

function myFunction($a, $b) {
    // Do something
}

2. Create a class that maintains your state

class MyClass {
    private $a;
    private $b;

    public function __construct($a, $b) {
        $this->a = $a;
        $this->b = $b;
    }

    public function myFunction() {
        // Do something
    }
}
Loading history...
29
30
    echo "<script type=\"text/javascript\">\n";
31
    echo "<!--\n\n";
32
    echo "function showimage() {\n";
33
    echo "if (!document.images)\n";
34
    echo "return\n";
35
    echo "document.images.avatar.src=\n";
36
    echo "'" . XOOPS_URL . "/modules/{$moduleDirName}/assets/images/cat/' + document.imcat.img.options[document.imcat.img.selectedIndex].value\n";
37
    echo "}\n\n";
38
    echo "//-->\n";
39
    echo "</script>\n";
40
}
41
42 View Code Duplication
function alumni_ShowImg2()
43
{
44
    global $moduleDirName;
0 ignored issues
show
Compatibility Best Practice introduced by
Use of global functionality is not recommended; it makes your code harder to test, and less reusable.

Instead of relying on global state, we recommend one of these alternatives:

1. Pass all data via parameters

function myFunction($a, $b) {
    // Do something
}

2. Create a class that maintains your state

class MyClass {
    private $a;
    private $b;

    public function __construct($a, $b) {
        $this->a = $a;
        $this->b = $b;
    }

    public function myFunction() {
        // Do something
    }
}
Loading history...
45
46
    echo "<script type=\"text/javascript\">\n";
47
    echo "<!--\n\n";
48
    echo "function showimage2() {\n";
49
    echo "if (!document.images)\n";
50
    echo "return\n";
51
    echo "document.images.scphoto.src=\n";
52
    echo "'" . XOOPS_URL . "/modules/{$moduleDirName}/assets/images/schools/' + document.imcat.scphoto.options[document.imcat.scphoto.selectedIndex].value\n";
53
    echo "}\n\n";
54
    echo "//-->\n";
55
    echo "</script>\n";
56
}
57
58
//Reusable Link Sorting Functions
59
/**
60
 * @param $orderby
61
 * @return string
62
 */
63
function alumni_convertorderbyin($orderby)
64
{
65
    switch (trim($orderby)) {
66
        case 'nameA':
67
            $orderby = 'lname ASC';
68
            break;
69
        case 'schoolA':
70
            $orderby = 'school ASC';
71
            break;
72
        case 'studiesA':
73
            $orderby = 'studies ASC';
74
            break;
75
        case 'yearA':
76
            $orderby = 'year ASC';
77
            break;
78
        case 'dateA':
79
            $orderby = 'date ASC';
80
            break;
81
        case 'viewA':
82
            $orderby = 'view ASC';
83
            break;
84
        case 'nameD':
85
            $orderby = 'lname DESC';
86
            break;
87
        case 'schoolD':
88
            $orderby = 'school DESC';
89
            break;
90
        case 'studiesD':
91
            $orderby = 'studies DESC';
92
            break;
93
        case 'yearD':
94
            $orderby = 'year DESC';
95
            break;
96
        case 'viewD':
97
            $orderby = 'view DESC';
98
            break;
99
        case 'dateD':
100
        default:
101
            $orderby = 'date DESC';
102
            break;
103
    }
104
105
    return $orderby;
106
}
107
108
/**
109
 * @param $orderby
110
 * @return string
111
 */
112
function alumni_convertorderbytrans($orderby)
113
{
114
    global $main_lang;
0 ignored issues
show
Compatibility Best Practice introduced by
Use of global functionality is not recommended; it makes your code harder to test, and less reusable.

Instead of relying on global state, we recommend one of these alternatives:

1. Pass all data via parameters

function myFunction($a, $b) {
    // Do something
}

2. Create a class that maintains your state

class MyClass {
    private $a;
    private $b;

    public function __construct($a, $b) {
        $this->a = $a;
        $this->b = $b;
    }

    public function myFunction() {
        // Do something
    }
}
Loading history...
115
116
    if ('view ASC' === $orderby) {
117
        $orderbyTrans = '' . constant($main_lang . '_POPULARITYLTOM') . '';
118
    }
119
    if ('view DESC' === $orderby) {
120
        $orderbyTrans = '' . constant($main_lang . '_POPULARITYMTOL') . '';
121
    }
122
    if ('lname ASC' === $orderby) {
123
        $orderbyTrans = '' . constant($main_lang . '_NAMEATOZ') . '';
124
    }
125
    if ('lname DESC' === $orderby) {
126
        $orderbyTrans = '' . constant($main_lang . '_NAMEZTOA') . '';
127
    }
128
    if ('school ASC' === $orderby) {
129
        $orderbyTrans = '' . constant($main_lang . '_SCHOOLATOZ') . '';
130
    }
131
    if ('school DESC' === $orderby) {
132
        $orderbyTrans = '' . constant($main_lang . '_SCHOOLZTOA') . '';
133
    }
134
    if ('studies ASC' === $orderby) {
135
        $orderbyTrans = '' . constant($main_lang . '_STUDIESATOZ') . '';
136
    }
137
    if ('studies DESC' === $orderby) {
138
        $orderbyTrans = '' . constant($main_lang . '_STUDIESZTOA') . '';
139
    }
140
    if ('year ASC' === $orderby) {
141
        $orderbyTrans = '' . constant($main_lang . '_YEAROLD') . '';
142
    }
143
    if ('year DESC' === $orderby) {
144
        $orderbyTrans = '' . constant($main_lang . '_YEARNEW') . '';
145
    }
146
    if ('date ASC' === $orderby) {
147
        $orderbyTrans = '' . constant($main_lang . '_DATEOLD') . '';
148
    }
149
    if ('date DESC' === $orderby) {
150
        $orderbyTrans = '' . constant($main_lang . '_DATENEW') . '';
151
    }
152
153
    return $orderbyTrans;
154
}
155
156
/**
157
 * @param $orderby
158
 * @return string
159
 */
160
function alumni_convertorderbyout($orderby)
161
{
162
    if ('lname ASC' === $orderby) {
163
        $orderby = 'nameA';
164
    }
165
    if ('school ASC' === $orderby) {
166
        $orderby = 'schoolA';
167
    }
168
    if ('studies ASC' === $orderby) {
169
        $orderby = 'studiesA';
170
    }
171
    if ('year ASC' === $orderby) {
172
        $orderby = 'yearA';
173
    }
174
    if ('date ASC' === $orderby) {
175
        $orderby = 'dateA';
176
    }
177
    if ('view ASC' === $orderby) {
178
        $orderby = 'viewA';
179
    }
180
    if ('lname DESC' === $orderby) {
181
        $orderby = 'nameD';
182
    }
183
    if ('school DESC' === $orderby) {
184
        $orderby = 'schoolD';
185
    }
186
    if ('studies DESC' === $orderby) {
187
        $orderby = 'studiesD';
188
    }
189
    if ('year DESC' === $orderby) {
190
        $orderby = 'yearD';
191
    }
192
    if ('date DESC' === $orderby) {
193
        $orderby = 'dateD';
194
    }
195
    if ('view DESC' === $orderby) {
196
        $orderby = 'viewD';
197
    }
198
199
    return $orderby;
200
}
201