Issues (73)

Security Analysis    no request data  

This project does not seem to handle request data directly as such no vulnerable execution paths were found.

  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.
  Regex Injection
Regex Injection enables an attacker to execute arbitrary code in your PHP process.
  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.
  Response Splitting
Response Splitting can be used to send arbitrary responses.
  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.
  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.
  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.
  Code Injection
Code Injection enables an attacker to execute arbitrary code on the server.
  Variable Injection
Variable Injection enables an attacker to overwrite program variables with custom data, and can lead to further vulnerabilities.
  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.
  Other Vulnerability
This category comprises other attack vectors such as manipulating the PHP runtime, loading custom extensions, freezing the runtime, or similar.
  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.
  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.
  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.
  Header Injection
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.

code/actions/GridfieldInviteResendAction.php (8 issues)

1
<?php
2
3
/**
4
 * class GridfieldInviteResendAction adds the resend button to the CMS for easy re-inviting
5
 */
6
class GridfieldInviteResendAction implements GridField_ColumnProvider, GridField_ActionProvider
0 ignored issues
show
The type GridField_ColumnProvider was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
The type GridField_ActionProvider was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
7
{
8
9
    /**
10
     * @param GridField $gridField
11
     * @param array $columns
12
     */
13
    public function augmentColumns($gridField, &$columns)
14
    {
15
        if (!in_array('Actions', $columns, true)) {
16
            $columns[] = 'Actions';
17
        }
18
    }
19
20
    /**
21
     * {@inheritDoc}
22
     */
23
    public function getColumnAttributes($gridField, $record, $columnName)
24
    {
25
        return array('class' => 'col-buttons');
26
    }
27
28
    /**
29
     * {@inheritDoc}
30
     */
31
    public function getColumnMetadata($gridField, $columnName)
32
    {
33
        if ($columnName === 'Actions') {
34
            return array('title' => '');
35
        }
36
    }
37
38
    /**
39
     * {@inheritDoc}
40
     */
41
    public function getColumnsHandled($gridField)
42
    {
43
        return array('Actions');
44
    }
45
46
    /**
47
     * @param GridField $gridField
48
     * @param SlackInvite $record
49
     * @param string $columnName
50
     * @return HTMLText
0 ignored issues
show
The type HTMLText was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
51
     */
52
    public function getColumnContent($gridField, $record, $columnName)
53
    {
54
        $config = SiteConfig::current_site_config();
0 ignored issues
show
The type SiteConfig was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
55
        // No point in showing the re-send button, if there's no token
56
        if ($config->SlackToken) {
57
            if (!$record->Invited) {
58
                $field = GridField_FormAction::create(
0 ignored issues
show
The type GridField_FormAction was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
59
                    $gridField,
60
                    'Retry' . $record->ID,
61
                    false,
62
                    'resend',
63
                    ['RecordID' => $record->ID]
64
                )
65
                    ->addExtraClass('gridfield-button-resend')
66
                    ->setAttribute('title', 'Retry invite')
67
                    ->setAttribute('data-icon', 'arrow-circle-135-left')
68
                    ->setDescription(_t('GridfieldInviteResendAction.Resend', 'Retry failed invitation'));
0 ignored issues
show
The function _t was not found. Maybe you did not declare it correctly or list all dependencies? ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

68
                    ->setDescription(/** @scrutinizer ignore-call */ _t('GridfieldInviteResendAction.Resend', 'Retry failed invitation'));
Loading history...
69
            } else {
70
                $field = GridField_FormAction::create(
71
                    $gridField,
72
                    'Resend',
73
                    false,
74
                    'resend',
75
                    ['RecordID' => $record->ID]
76
                )
77
                    ->addExtraClass('gridfield-button-resend')
78
                    ->setAttribute('title', 'Resend invite')
79
                    ->setAttribute('data-icon', 'arrow-circle-double')
80
                    ->setDescription('Resend invite');
81
            }
82
83
            return $field->Field();
84
        }
85
    }
86
87
    /**
88
     * {@inheritDoc}
89
     */
90
    public function getActions($gridField)
91
    {
92
        return array('resend');
93
    }
94
95
    /**
96
     * @param GridField $gridField
97
     * @param $actionName
98
     * @param $arguments
99
     * @param $data
100
     * @throws \ValidationException
101
     */
102
    public function handleAction(GridField $gridField, $actionName, $arguments, $data)
103
    {
104
        if ($actionName === 'resend') {
105
            /** @var SlackInvite $item */
106
            $item = SlackInvite::get()->byID($arguments['RecordID']);
107
            if (!$item) {
108
                return;
109
            }
110
111
            $result = $item->resendInvite();
0 ignored issues
show
Are you sure the assignment to $result is correct as $item->resendInvite() targeting SlackInvite::resendInvite() seems to always return null.

This check looks for function or method calls that always return null and whose return value is assigned to a variable.

class A
{
    function getObject()
    {
        return null;
    }

}

$a = new A();
$object = $a->getObject();

The method getObject() can return nothing but null, so it makes no sense to assign that value to a variable.

The reason is most likely that a function or method is imcomplete or has been reduced for debug purposes.

Loading history...
112
            if ($result === true) {
113
                Controller::curr()->getResponse()->setStatusCode(
0 ignored issues
show
The type Controller was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
114
                    200,
115
                    'User successfully invited.'
116
                );
117
            } else {
118
                Controller::curr()->getResponse()->setStatusCode(
119
                    200,
120
                    $result
121
                );
122
            }
123
        }
124
    }
125
}
126