GitHub Access Token became invalid

It seems like the GitHub access token used for retrieving details about this repository from GitHub became invalid. This might prevent certain types of inspections from being run (in particular, everything related to pull requests).
Please ask an admin of your repository to re-new the access token on this website.

Issues (4873)

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.

src/common/frs/FRSLog.class.php (1 issue)

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
 * Copyright (c) STMicroelectronics, 2004-2010. All rights reserved
4
 *
5
 * This file is a part of Codendi.
6
 *
7
 * Codendi is free software; you can redistribute it and/or modify
8
 * it under the terms of the GNU General Public License as published by
9
 * the Free Software Foundation; either version 2 of the License, or
10
 * (at your option) any later version.
11
 *
12
 * Codendi is distributed in the hope that it will be useful,
13
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15
 * GNU General Public License for more details.
16
 *
17
 * You should have received a copy of the GNU General Public License
18
 * along with Codendi. If not, see <http://www.gnu.org/licenses/>.
19
 */
20
21
require_once('common/dao/FRSLogDao.class.php');
22
23
class FRSLog {
24
25
    var $dao;
26
27
    /**
28
     * Constructor of the class.
29
     * It is also used to add FRSLog events to listen in EventManager.
30
     *
31
     * @return FRSLog
0 ignored issues
show
Comprehensibility Best Practice introduced by
Adding a @return annotation to constructors is generally not recommended as a constructor does not have a meaningful return value.

Adding a @return annotation to a constructor is not recommended, since a constructor does not have a meaningful return value.

Please refer to the PHP core documentation on constructors.

Loading history...
32
     */
33
    protected function __construct() {
34
        $em = EventManager::instance();
35
        $packageEventToListen = array('frs_create_package',
36
                                      'frs_update_package', 
37
                                      'frs_delete_package'
38
        );
39
        foreach ($packageEventToListen as $event) {
40
            $em->addListener($event, $this, 'addLogPackage', true);
41
        }
42
43
        $releaseEventToListen = array('frs_create_release',
44
                                      'frs_update_release', 
45
                                      'frs_delete_release'
46
        );
47
        foreach ($releaseEventToListen as $event) {
48
            $em->addListener($event, $this, 'addLogRelease', true);
49
        }
50
51
        $fileEventToListen = array('frs_create_file',
52
                                   'frs_update_file', 
53
                                   'frs_delete_file', 
54
                                   'frs_restore_file'
55
        );
56
        foreach ($fileEventToListen as $event) {
57
            $em->addListener($event, $this, 'addLogFile', true);
58
        }
59
    }
60
61
    protected static $_instance;
62
63
    /**
64
     * Singleton pattern
65
     *
66
     * @return FRSLog
67
     */
68
    public static function instance() {
69
        if (!isset(self::$_instance)) {
70
            $c = __CLASS__;
71
            self::$_instance = new $c;
72
        }
73
        return self::$_instance;
74
    }
75
76
    /**
77
     * Add log for events on FRSPackage
78
     *
79
     * @param String $event
80
     * @param Array  $params
81
     *
82
     * @return void
83
     */
84
    function addLogPackage($event, $params) {
85
        $userID    = $this->_getCurrentUser()->getId();
86
        $projectID = $params['group_id'];
87
        $itemID    = $params['item_id'];
88
        switch ($event) {
89
            case 'frs_create_package' :
90
                $actionID = FRSPackage::EVT_CREATE;
91
                break;
92
            case 'frs_update_package' :
93
                $actionID = FRSPackage::EVT_UPDATE;
94
                break;
95
            case 'frs_delete_package' :
96
                $actionID = FRSPackage::EVT_DELETE;
97
                break;
98
        }
99
        $this->addLog($userID, $projectID, $itemID, $actionID);
100
    }
101
102
    /**
103
     * Add log for events on FRSRelease
104
     *
105
     * @param String $event
106
     * @param Array  $params
107
     *
108
     * @return void
109
     */
110
    function addLogRelease($event, $params) {
111
        $userID    = $this->_getCurrentUser()->getId();
112
        $projectID = $params['group_id'];
113
        $itemID    = $params['item_id'];
114
        switch ($event) {
115
            case 'frs_create_release' :
116
                $actionID = FRSRelease::EVT_CREATE;
117
                break;
118
            case 'frs_update_release' :
119
                $actionID = FRSRelease::EVT_UPDATE;
120
                break;
121
            case 'frs_delete_release' :
122
                $actionID = FRSRelease::EVT_DELETE;
123
                break;
124
        }
125
        $this->addLog($userID, $projectID, $itemID, $actionID);
126
    }
127
128
    /**
129
     * Add log for events on FRSFile
130
     *
131
     * @param String $event
132
     * @param Array  $params
133
     *
134
     * @return void
135
     */
136
    function addLogFile($event, $params) {
137
        $userID    = $this->_getCurrentUser()->getId();
138
        $projectID = $params['group_id'];
139
        $itemID    = $params['item_id'];
140
        switch ($event) {
141
            case 'frs_create_file' :
142
                $actionID = FRSFile::EVT_CREATE;
143
                break;
144
            case 'frs_update_file' :
145
                $actionID = FRSFile::EVT_UPDATE;
146
                break;
147
            case 'frs_delete_file' :
148
                $actionID = FRSFile::EVT_DELETE;
149
                break;
150
            case 'frs_restore_file' :
151
                $actionID = FRSFile::EVT_RESTORE;
152
                break;
153
        }
154
        $this->addLog($userID, $projectID, $itemID, $actionID);
155
    }
156
157
    /**
158
     * Obtain an instance of FRSLogDao
159
     *
160
     * @return FRSLogDao
161
     */
162
    function _getFRSLogDao() {
163
        if (!$this->dao) {
164
            $this->dao = new FRSLogDao(CodendiDataAccess::instance());
165
        }
166
        return $this->dao;
167
    }
168
169
    /**
170
     * Store the event in DB
171
     *
172
     * @param Integer $userID
173
     * @param Integer $projectID
174
     * @param Integer $itemID
175
     * @param Integer $actionID
176
     *
177
     * @return void
178
     */
179
    function addLog($userID, $projectID, $itemID, $actionID) {
180
        $dao = $this->_getFRSLogDao();
181
        $dao->addLog($userID, $projectID, $itemID, $actionID);
182
    }
183
184
    /**
185
     * Obtain the current user
186
     *
187
     * @return PFUser
188
     */
189
    function _getCurrentUser() {
190
        $um = UserManager::instance();
191
        return $um->getCurrentUser();
192
    }
193
194
}
195
196
?>