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/mail/MailManager.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) Enalean, 2011. All Rights Reserved.
4
 *
5
 * This file is a part of Tuleap.
6
 *
7
 * Tuleap 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
 * Tuleap 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 Tuleap. If not, see <http://www.gnu.org/licenses/>.
19
 */
20
21
require_once 'common/mail/Codendi_Mail_Interface.class.php';
22
require_once 'common/mail/Mail.class.php';
23
require_once 'common/mail/Codendi_Mail.class.php';
24
require_once 'common/include/Tuleap_Template.class.php';
25
26
require_once 'common/user/UserManager.class.php';
27
28
/**
29
 * Mail manager is the key interface to send emails in the platform
30
 *
31
 */
32
class MailManager {
33
    
34
    /**
35
     * Prepare the mail according to user preferences
36
     * 
37
     * @param PFUser $user The user to whom send the mail
38
     * 
39
     * @return Mail 
40
     */
41
    public function getMailForUser(PFUser $user) {
42
        $mail = $this->getMailByType($this->getMailPreferencesByUser($user));
43
        $mail->setToUser(array($user));
44
        return $mail;
45
    }
46
    
47
    /**
48
     * Return a mail object depending of the requested format
49
     * 
50
     * @param String $type Type of mail (text or html)
51
     * 
52
     * @return Mail
53
     */
54
    public function getMailByType($type = null) {
55
        $mail = new Codendi_Mail();
0 ignored issues
show
Bug Compatibility introduced by
The expression new \Codendi_Mail(); of type Codendi_Mail adds the type Codendi_Mail to the return on line 60 which is incompatible with the return type documented by MailManager::getMailByType of type Mail.
Loading history...
56
        if ($type == Codendi_Mail_Interface::FORMAT_TEXT) {
57
            $mail = new Mail();
58
        }
59
        $mail->setFrom($this->getConfig('sys_noreply'));
60
        return $mail;
61
    }
62
    
63
    /**
64
     * Return users corresponding to email addresses mapped according to their
65
     * preferences.
66
     * 
67
     * @deprecated
68
     * 
69
     * @param Array $addresses A set of addresses
70
     * 
71
     * @return Array of Array of User
72
     */
73
    public function getMailPreferencesByEmail($addresses) {
74
        $default = Codendi_Mail_Interface::FORMAT_HTML;
75
        $res     = array('html' => array(), 'text' => array());
76
        $um      = $this->getUserManager();
77
        foreach ($addresses as $address) {
78
            $users = $um->getAllUsersByEmail($address);
79
            $pref  = $default;
80
            if (count($users) > 0) {
81
                foreach ($users as $user) {
82
                    $pref_user   = $this->getMailPreferencesByUser($user);
83
                    $user_status = $user->getStatus();
84
                    if ($pref_user != $default && ($user_status == 'A' || $user_status == 'R')) {
85
                        $pref = $pref_user;
86
                        break;
87
                    }
88
                }
89
            } else {
90
                $user = new PFUser(array('user_id' => 0, 'language_id' => $this->getConfig('sys_lang')));
91
                $user->setEmail($address);
92
            }
93
            $res[$pref][] = $user;
94
        }
95
        return $res;
96
    }
97
    
98
    /**
99
     * Returns whether the user wants an HTML or a Text notification
100
     * 
101
     * @param PFUser $user
102
     * 
103
     * @return String
104
     */
105
    public function getMailPreferencesByUser(PFUser $user) {
106
        if ($user->getPreference(Codendi_Mail_Interface::PREF_FORMAT) == Codendi_Mail_Interface::FORMAT_TEXT) {
107
            return Codendi_Mail_Interface::FORMAT_TEXT;
108
        }
109
        return Codendi_Mail_Interface::FORMAT_HTML;
110
    }
111
    
112
    /**
113
     * Returns all possible mail formats
114
     * 
115
     * @return Array
116
     */
117
    public function getAllMailFormats() {
118
        return array(Codendi_Mail_Interface::FORMAT_TEXT, Codendi_Mail_Interface::FORMAT_HTML);
119
    }
120
121
    /**
122
     * Wrapper for configuration access
123
     * 
124
     * @param String $var
125
     * 
126
     * @return String 
127
     */
128
    protected function getConfig($var) {
129
        return ForgeConfig::get($var);
130
    }
131
    
132
    /**
133
     * Wrapper for UserManager
134
     * 
135
     * @return UserManager 
136
     */
137
    protected function getUserManager() {
138
        return UserManager::instance();
139
    }
140
}
141
142
?>
143