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.

include/admindelegationPlugin.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, 2009. All Rights Reserved.
4
 *
5
 * Originally written by Manuel Vacelet, 2009
6
 *
7
 * This file is a part of Codendi.
8
 *
9
 * Codendi is free software; you can redistribute it and/or modify
10
 * it under the terms of the GNU General Public License as published by
11
 * the Free Software Foundation; either version 2 of the License, or
12
 * (at your option) any later version.
13
 *
14
 * Codendi is distributed in the hope that it will be useful,
15
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
17
 * GNU General Public License for more details.
18
 *
19
 * You should have received a copy of the GNU General Public License
20
 * along with Codendi; if not, write to the Free Software
21
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
22
 */
23
24
/**
25
 * AdminDelegationPlugin
26
 * 
27
 * This plugin is made of two parts:
28
 * - The admin one, that allows to delegate some rights (called services to 
29
 *   selected users).
30
 * - The user one, made of widget in personal page, for the granted (selected)
31
 *   user to access to the information.
32
 * 
33
 * Each admin action (grant/revoke) is logged but as of today, the log is only in
34
 * the database.
35
 * 
36
 * There is no table dedicated to store services, the services are identified by
37
 * their id and a label. The id is a constant in the AdminDelegation_Service class.
38
 * 
39
 * @see AdminDelegation_Service
40
 * 
41
 */
42
class AdminDelegationPlugin extends Plugin {
43
44
    public function __construct($id) {
45
        parent::__construct($id);
46
        $this->_addHook('cssfile',                'cssFile',                false);
47
        $this->_addHook('site_admin_option_hook', 'site_admin_option_hook', false);
48
        $this->_addHook('widget_instance',        'widget_instance',        false);
49
        $this->_addHook('widgets',                'widgets',                false);
50
    }
51
52
    public function getPluginInfo() {
53
        if (!is_a($this->pluginInfo, 'AdminDelegationPluginInfo')) {
54
            include_once 'AdminDelegationPluginInfo.class.php';
55
            $this->pluginInfo = new AdminDelegationPluginInfo($this);
56
        }
57
        return $this->pluginInfo;
58
    }
59
60
    /**
61
     * Check if current user is allowed to use given widget
62
     * 
63
     * @param String  $widget
64
     * 
65
     * @return Boolean
66
     */
67
    protected function _userCanViewWidget($widget) {
68
        $um      = UserManager::instance();
69
        $user    = $um->getCurrentUser();
70
        if ($user) {
71
            $service = AdminDelegation_Service::getServiceFromWidget($widget);
72
            if ($service) {
0 ignored issues
show
Bug Best Practice introduced by
The expression $service of type integer|false is loosely compared to true; this is ambiguous if the integer can be zero. You might want to explicitly use !== null instead.

In PHP, under loose comparison (like ==, or !=, or switch conditions), values of different types might be equal.

For integer values, zero is a special case, in particular the following results might be unexpected:

0   == false // true
0   == null  // true
123 == false // false
123 == null  // false

// It is often better to use strict comparison
0 === false // false
0 === null  // false
Loading history...
73
                $usm = new AdminDelegation_UserServiceManager();
74
                return $usm->isUserGrantedForService($user, $service);
75
            }
76
        }
77
        return false;
78
    }
79
80
    public function cssFile($params) {
81
        // Only show the stylesheet if we're actually in the Docman pages.
82
        // This stops styles inadvertently clashing with the main site.
83
        if (strpos($_SERVER['REQUEST_URI'], $this->getPluginPath()) === 0 ||
84
            strpos($_SERVER['REQUEST_URI'], '/widgets/') === 0
85
        ) {
86
            echo '<link rel="stylesheet" type="text/css" href="'.$this->getThemePath().'/css/style.css" />'."\n";
87
        }
88
    }
89
    
90
    /**
91
     * Hook: admin link to plugin
92
     *
93
     * @param Array $params
94
     */
95
    public function site_admin_option_hook($params) {
96
        echo '<li><a href="'.$this->getPluginPath().'/">Admin delegation</a></li>';
97
    }
98
99
    /**
100
     * Hook: event raised when widget are instanciated
101
     * 
102
     * @param Array $params
103
     */
104
    public function widget_instance($params) {
105
        if ($params['widget'] == 'admindelegation' && $this->_userCanViewWidget('admindelegation')) {
106
            include_once 'AdminDelegation_UserWidget.class.php';
107
            $params['instance'] = new AdminDelegation_UserWidget($this);
108
        }
109
        if ($params['widget'] == 'admindelegation_projects' && $this->_userCanViewWidget('admindelegation_projects')) {
110
            include_once 'AdminDelegation_ShowProjectWidget.class.php';
111
            $params['instance'] = new AdminDelegation_ShowProjectWidget($this);
112
        }
113
         
114
    }
115
116
    /**
117
     * Hook: event raised when user lists all available widget
118
     *
119
     * @param Array $params
120
     */
121
    public function widgets($params) {
122
        include_once 'common/widget/WidgetLayoutManager.class.php';
123
        if ($params['owner_type'] == WidgetLayoutManager::OWNER_TYPE_USER) {
124
            if ($this->_userCanViewWidget('admindelegation')) {
125
                include_once 'AdminDelegation_UserWidget.class.php';
126
                $params['codendi_widgets'][] = 'admindelegation';
127
            }
128
            if ($this->_userCanViewWidget('admindelegation_projects')) {
129
                include_once 'AdminDelegation_ShowProjectWidget.class.php';
130
                $params['codendi_widgets'][] = 'admindelegation_projects';
131
            }
132
        }
133
    }
134
}
135
136
?>