Issues (174)

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.

widgets/UserListWidget.php (3 issues)

Severity

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
/**
4
 *  _   __ __ _____ _____ ___  ____  _____
5
 * | | / // // ___//_  _//   ||  __||_   _|
6
 * | |/ // /(__  )  / / / /| || |     | |
7
 * |___//_//____/  /_/ /_/ |_||_|     |_|
8
 * @link https://vistart.me/
9
 * @copyright Copyright (c) 2016 - 2017 vistart
10
 * @license https://vistart.me/license/
11
 */
12
13
namespace rhosocial\user\widgets;
14
15
use rhosocial\user\grid\ActionColumn;
16
use Yii;
17
use yii\base\Widget;
18
use yii\data\ActiveDataProvider;
19
use yii\helpers\Url;
20
use yii\web\ServerErrorHttpException;
21
22
class UserListWidget extends Widget
23
{
24
    /**
25
     * @var ActiveDataProvider
26
     */
27
    public $dataProvider;
28
    /**
29
     * @var array|null|string ActionColumn class configuration. Null if you do not need it.
30
     * 'default' if you want to use the default configuration.
31
     * Note: If you want to use your own ActionColumn class configuration, please do not
32
     * forget to attach the 'class' key.
33
     */
34
    public $actionColumn;
35
36
    /**
37
     * @var array|null Additional columns' configuration arrays.
38
     * It will be appended after the existed columns.
39
     * If you do not need additional columns, please set null.
40
     */
41
    public $additionalColumns;
42
43
    const ACTION_COLUMN_DEFAULT = 'default';
44
45
    /**
46
     * @var array Column visibles.
47
     */
48
    public $visible = [
49
        'guid' => false,
50
    ];
51
52
    /**
53
     * @var boolean|array Tips.
54
     * If you do not want to show tips, please set false.
55
     * If you want to show default tips, please set true.
56
     * If you want to show tips including default ones and your owns, please set an array contains all tip text.
57
     */
58
    public $tips = true;
59
60
    /**
61
     * Initialize attributes.
62
     */
63
    public function init()
64
    {
65
        if (empty($this->dataProvider)) {
66
            throw new ServerErrorHttpException('Invalid User Provider.');
67
        }
68
        if (is_string($this->actionColumn) && strtolower($this->actionColumn) == self::ACTION_COLUMN_DEFAULT) {
69
            $this->actionColumn = [
70
                'class' => ActionColumn::class,
71
                'header' => Yii::t('user', 'Action'),
72
                'useIcon' => false,
73
                'urlCreator' => function ($action, $model, $key, $index, ActionColumn $column) {
0 ignored issues
show
The parameter $key is not used and could be removed.

This check looks from parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
The parameter $index is not used and could be removed.

This check looks from parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
The parameter $column is not used and could be removed.

This check looks from parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
74
                    /* @var $model User */
75
                    if ($action == 'view') {
76
                        return Url::to(['view', 'id' => $model->id]);
77
                    } elseif ($action == 'update') {
78
                        return Url::to(['update', 'id' => $model->id]);
79
                    } elseif ($action == 'delete') {
80
                        return Url::to(['deregister', 'id' => $model->id]);
81
                    }
82
                    return '#';
83
                },
84
                'visibleButtons' => [
85
                    'view' => Yii::$app->user->can('viewUser'),
86
                    'update' => Yii::$app->user->can('updateUser'),
87
                    'delete' => Yii::$app->user->can('deleteUser'),
88
                ],
89
            ];
90
        }
91
        parent::init();
92
    }
93
94
    /**
95
     * Run action.
96
     * @return string
97
     */
98
    public function run()
99
    {
100
        return $this->render('user-list', [
101
            'dataProvider' => $this->dataProvider,
102
            'additionalColumns' => $this->additionalColumns,
103
            'actionColumn' => $this->actionColumn,
104
            'visible' => $this->visible,
105
            'tips' => $this->tips,
106
        ]);
107
    }
108
}
109