Issues (563)

Security Analysis    not enabled

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.

app/Admin/Controllers/UserController.php (10 issues)

Labels
Severity
1
<?php
2
3
namespace App\Admin\Controllers;
4
5
use App\Models\Eloquent\User;
6
use App\Http\Controllers\Controller;
7
use Encore\Admin\Controllers\HasResourceActions;
8
use Encore\Admin\Form;
9
use Encore\Admin\Grid;
10
use Encore\Admin\Layout\Content;
11
use Encore\Admin\Show;
12
13
class UserController extends Controller
14
{
15
    use HasResourceActions;
16
17
    /**
18
     * Index interface.
19
     *
20
     * @param Content $content
21
     * @return Content
22
     */
23
    public function index(Content $content)
24
    {
25
        return $content
26
            ->header(__('admin.users.index.header'))
0 ignored issues
show
It seems like __('admin.users.index.header') can also be of type array and array; however, parameter $header of Encore\Admin\Layout\Content::header() does only seem to accept string, maybe add an additional type check? ( Ignorable by Annotation )

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

26
            ->header(/** @scrutinizer ignore-type */ __('admin.users.index.header'))
Loading history...
27
            ->description(__('admin.users.index.description'))
0 ignored issues
show
It seems like __('admin.users.index.description') can also be of type array and array; however, parameter $description of Encore\Admin\Layout\Content::description() does only seem to accept string, maybe add an additional type check? ( Ignorable by Annotation )

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

27
            ->description(/** @scrutinizer ignore-type */ __('admin.users.index.description'))
Loading history...
28
            ->body($this->grid()->render());
29
    }
30
31
    /**
32
     * Show interface.
33
     *
34
     * @param mixed $id
35
     * @param Content $content
36
     * @return Content
37
     */
38
    public function show($id, Content $content)
39
    {
40
        return $content
41
            ->header(__('admin.users.show.header'))
0 ignored issues
show
It seems like __('admin.users.show.header') can also be of type array and array; however, parameter $header of Encore\Admin\Layout\Content::header() does only seem to accept string, maybe add an additional type check? ( Ignorable by Annotation )

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

41
            ->header(/** @scrutinizer ignore-type */ __('admin.users.show.header'))
Loading history...
42
            ->description(__('admin.users.show.description'))
0 ignored issues
show
It seems like __('admin.users.show.description') can also be of type array and array; however, parameter $description of Encore\Admin\Layout\Content::description() does only seem to accept string, maybe add an additional type check? ( Ignorable by Annotation )

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

42
            ->description(/** @scrutinizer ignore-type */ __('admin.users.show.description'))
Loading history...
43
            ->body($this->detail($id));
44
    }
45
46
    /**
47
     * Edit interface.
48
     *
49
     * @param mixed $id
50
     * @param Content $content
51
     * @return Content
52
     */
53
    public function edit($id, Content $content)
54
    {
55
        return $content
56
            ->header(__('admin.users.edit.header'))
0 ignored issues
show
It seems like __('admin.users.edit.header') can also be of type array and array; however, parameter $header of Encore\Admin\Layout\Content::header() does only seem to accept string, maybe add an additional type check? ( Ignorable by Annotation )

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

56
            ->header(/** @scrutinizer ignore-type */ __('admin.users.edit.header'))
Loading history...
57
            ->description(__('admin.users.edit.description'))
0 ignored issues
show
It seems like __('admin.users.edit.description') can also be of type array and array; however, parameter $description of Encore\Admin\Layout\Content::description() does only seem to accept string, maybe add an additional type check? ( Ignorable by Annotation )

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

57
            ->description(/** @scrutinizer ignore-type */ __('admin.users.edit.description'))
Loading history...
58
            ->body($this->form()->edit($id));
59
    }
60
61
    /**
62
     * Create interface.
63
     *
64
     * @param Content $content
65
     * @return Content
66
     */
67
    public function create(Content $content)
68
    {
69
        return $content
70
            ->header(__('admin.users.create.header'))
0 ignored issues
show
It seems like __('admin.users.create.header') can also be of type array and array; however, parameter $header of Encore\Admin\Layout\Content::header() does only seem to accept string, maybe add an additional type check? ( Ignorable by Annotation )

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

70
            ->header(/** @scrutinizer ignore-type */ __('admin.users.create.header'))
Loading history...
71
            ->description(__('admin.users.create.description'))
0 ignored issues
show
It seems like __('admin.users.create.description') can also be of type array and array; however, parameter $description of Encore\Admin\Layout\Content::description() does only seem to accept string, maybe add an additional type check? ( Ignorable by Annotation )

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

71
            ->description(/** @scrutinizer ignore-type */ __('admin.users.create.description'))
Loading history...
72
            ->body($this->form());
73
    }
74
75
    /**
76
     * Make a grid builder.
77
     *
78
     * @return Grid
79
     */
80
    protected function grid()
81
    {
82
        $grid=new Grid(new User);
83
        $grid->id('ID')->sortable();
84
        $grid->name(__('admin.users.name'))->editable();
85
        $grid->email(__('admin.users.email'));
86
        $grid->created_at(__('admin.created_at'));
87
        $grid->updated_at(__('admin.updated_at'));
88
        $grid->filter(function(Grid\Filter $filter) {
89
            $filter->disableIdFilter();
90
            $filter->like('name', __('admin.users.name'));
91
            $filter->like('email', __('admin.users.email'))->email();
92
        });
93
        return $grid;
94
    }
95
96
    /**
97
     * Make a show builder.
98
     *
99
     * @param mixed $id
100
     * @return Show
101
     */
102
    protected function detail($id)
103
    {
104
        $show=new Show(User::findOrFail($id));
105
        return $show;
106
    }
107
108
    /**
109
     * Make a form builder.
110
     *
111
     * @return Form
112
     */
113
    protected function form()
114
    {
115
        $form=new Form(new User);
116
        $form->model()->makeVisible('password');
117
        $form->tab(__('admin.users.basic'), function(Form $form) {
0 ignored issues
show
It seems like __('admin.users.basic') can also be of type array and array; however, parameter $title of Encore\Admin\Form::tab() does only seem to accept string, maybe add an additional type check? ( Ignorable by Annotation )

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

117
        $form->tab(/** @scrutinizer ignore-type */ __('admin.users.basic'), function(Form $form) {
Loading history...
118
            if ($form->isEditing()) {
119
                $form->display('id', 'ID');
120
            }
121
            $form->text('name', __('admin.users.name'))->rules('required');
122
            $form->email('email', __('admin.users.email'))->rules('required');
123
            if ($form->isEditing()) {
124
                $form->display('created_at', __('admin.created_at'));
125
                $form->display('updated_at', __('admin.updated_at'));
126
            }
127
        })->tab(__('admin.users.password'), function(Form $form) {
128
            $form->password('password', __('admin.password'))->rules('confirmed');
129
            $form->password('password_confirmation', __('admin.password_confirmation'));
130
        });
131
        $form->ignore(['password_confirmation']);
132
        $form->saving(function(Form $form) {
133
            if ($form->password && $form->model()->password!=$form->password) {
134
                $form->password=bcrypt($form->password);
0 ignored issues
show
It seems like $form->password can also be of type array; however, parameter $value of bcrypt() does only seem to accept string, maybe add an additional type check? ( Ignorable by Annotation )

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

134
                $form->password=bcrypt(/** @scrutinizer ignore-type */ $form->password);
Loading history...
135
            }
136
        });
137
        return $form;
138
    }
139
}
140