Issues (501)

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.

views/templates/scripts.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
<div class="modal fade" id="changeDB" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
2
    <div class="modal-dialog">
3
        <div class="modal-content">
4
            <div class="modal-header">
5
                <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
6
                <h4 class="modal-title"><i class="fa fa-pencil"></i>
7
                    Switch Database
8
                </h4>
9
            </div>
10
            <section class="task-panel tasks-widget">
11
                <div class="panel-heading">
12
                    <div class="pull-left"><h5><i class="fa fa-tasks"></i> <?php echo $lang['database'].'s'  ?></h5></div>
13
                    <br>
14
                </div>
15
                <div class="panel-body">
16
                    <div class="task-content">
17
                        <ul id="sortable" class="task-list ui-sortable">
18
                            <?php
19
                            $sql = 'SELECT `sid`,`dbid`,`type`,`name` FROM `servers`;';
20
                            $result_of_query = $db_connection->query($sql);
21
22 View Code Duplication
                            if ($result_of_query->num_rows > 1) {
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...
23
                                while ($row = mysqli_fetch_assoc($result_of_query)) {
24
                                    if ($row['type'] == 'life') {
25
                                        ?>
26
                                        <li class="list-primary">
27
                                            <i class=" fa fa-ellipsis-v"></i>
28
29
                                            <div class="task-title">
30
                                                <span class="task-title-sp"><?php echo $row['name']; ?></span>
31
                                                <span class="badge bg-theme">Life</span>
32
33
                                                <div class="pull-right hidden-phone">
34
                                                    <form method="post" action="<?php echo $settings['url'] ?>dashboard">
35
                                                        <input type="hidden" name="type"
36
                                                               value="<?php echo $row['type']; ?>">
37
                                                        <input type="hidden" name="dbid"
38
                                                               value="<?php echo $row['dbid']; ?>">
39
                                                        <button class="btn btn-success btn-sm fa fa-eye"
40
                                                                type="submit" style="margin-right: 8px;  margin-bottom: 15px;"></button>
41
                                                    </form>
42
                                                </div>
43
                                            </div>
44
                                        </li>
45
                                    <?php
46
47
                                    } elseif ($row['type'] == 'waste') {
48
                                        ?>
49
                                        <li class="list-danger">
50
                                            <i class=" fa fa-ellipsis-v"></i>
51
52
                                            <div class="task-title">
53
                                                <span class="task-title-sp"><?php echo $row['name']; ?></span>
54
                                                <span class="badge bg-important">Wasteland</span>
55
56
                                                <div class="pull-right hidden-phone">
57
                                                    <form method="post" action="<?php echo $settings['url'] ?>dashboard">
58
                                                        <input type="hidden" name="type"
59
                                                               value="<?php echo $row['type']; ?>">
60
                                                        <input type="hidden" name="dbid"
61
                                                               value="<?php echo $row['dbid']; ?>">
62
                                                        <button class="btn btn-success btn-sm fa fa-eye"
63
                                                                type="submit" style="margin-right: 8px;  margin-bottom: 15px;"></button>
64
                                                    </form>
65
                                                </div>
66
                                        </li>
67
                                    <?php
68
69
                                    }
70
                                }
71
                                echo '</select>';
72
                            }
73
                            ?>
74
                        </ul>
75
                    </div>
76
                </div>
77
            </section>
78
        </div>
79
    </div>
80
</div>
81
<script async src="<?php echo $settings['url'] ?>assets/js/main.min.js"></script>
82
<?php if (isset($_SESSION['forum_lang'])) {
83
                                echo '<script async type="text/javascript" src="'.$settings['url'].'assets/js/language/'.$_SESSION['forum_lang'].'.js"></script>';
84
                            } ?>
85
<script>
86
    function searchpage() {
87
        sn = document.getElementById('searchText').value;
88
        redirecturl = '<?php echo $settings['url'].$currentPage?>/' + sn;
89
        document.location.href = redirecturl;
90
    }
91
</script>
92
<script type="text/javascript">
93
    $('#myTab a').click(function (e) {
94
        if ($(this).parent('li').hasClass('active')) {
95
            var target_pane = $(this).attr('href');
96
            $(target_pane).toggle(!$(target_pane).is(":visible"));
97
        }
98
    });
99
</script>
100
<?php
101
if ($page == 'views/life/dashboard.php' && $settings['lifeVersion'] == 4 || $settings['lifeVersion'] == 5) {
102
                                ?>
103
    <!--Load the AJAX API-->
104
    <script type="text/javascript" src="https://www.gstatic.com/charts/loader.js"></script>
105
    <script type="text/javascript">
106
        // Load the Visualization API and the corechart package.
107
        google.charts.load('current', {'packages':['corechart']});
108
109
        // Set a callback to run when the Google Visualization API is loaded.
110
        google.charts.setOnLoadCallback(drawChart);
111
112
        // Callback that creates and populates a data table,
113
        // instantiates the pie chart, passes in the data and
114
        // draws it.
115
        function drawChart() {
116
117
            // Create the data table.
118
            var data = new google.visualization.DataTable();
119
            data.addColumn('string', 'Date');
120
            data.addColumn('number', 'New Players');
121
            data.addRows([
122
                <?php
123
                    $sql = 'SELECT DATE(`players`.`insert_time`) AS `date`, COUNT(`players`.`uid`) AS `count` FROM `players` GROUP BY `date` ORDER BY `date`';
124
                                $result_of_query = $db_link->query($sql);
125
                                $total_records = mysqli_num_rows($result_of_query);
126
                                $i = 1;
127
                                while ($row = mysqli_fetch_assoc($result_of_query)) {
128
                                    if ($i < $total_records) {
129
                                        echo "['".$row['date']."', ".$row['count'].'],';
130
                                    } else {
131
                                        echo "['".$row['date']."', ".$row['count'].']';
132
                                    }
133
                                    ++$i;
134
                                } ?>
135
            ]);
136
137
            // Set chart options
138
            var options = {
139
                'title':'',
140
                'width':document.getElementById('player_data_chart').offsetWidth,
141
                'height':document.getElementById('player_data_chart').offsetheight
142
            };
143
144
            // Instantiate and draw our chart, passing in some options.
145
            var chart = new google.visualization.BarChart(document.getElementById('player_data_chart'));
146
            chart.draw(data, options);
147
        }
148
    </script>
149
    <?php
150
151
                            }
152
?>
153
<?php
154 View Code Duplication
foreach ($settings['plugins'] as &$plugin) {
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...
155
    if (file_exists('plugins/'.$plugin.'/assets/scripts.js')) {
156
        echo '<script type="text/javascript" src="'.$settings['url'].'plugins/'.$plugin.'/assets/scripts.js"></script>';
157
    }
158
}
0 ignored issues
show
As per coding style, files should not end with a newline character.

This check marks files that end in a newline character, i.e. an empy line.

Loading history...
159