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 (44)

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/models/Admin.php (1 issue)

Labels
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
namespace Serverfireteam\Panel;
3
4
use Illuminate\Auth\Authenticatable;
5
use Illuminate\Database\Eloquent\Model;
6
use Illuminate\Contracts\Auth\Authenticatable as AuthenticatableContract;
7
use Illuminate\Contracts\Auth\CanResetPassword as CanResetPasswordContract;
8
use Illuminate\Support\Facades\Input;
9
use Illuminate\Notifications\Notifiable;
10
11
class Admin extends Model implements AuthenticatableContract, CanResetPasswordContract {
0 ignored issues
show
There is one abstract method getAuthIdentifierName in this class; you could implement it, or declare this class as abstract.
Loading history...
12
13
    use Authenticatable, AdminCanResetPassword;
14
    use HasRoles;
15
    use Notifiable;
16
	/**
17
	 * The database table used by the model.
18
	 *
19
	 * @var string
20
	 */
21
	protected $table = 'admins';
22
    protected $remember_token_name      = 'remember_token';
23
24
25
    public function getAuthIdentifier()
26
    {
27
        return $this->getKey();
28
    }
29
30
    /**
31
     * Get the password for the user.
32
     *
33
     * @return string
34
     */
35
    public function getAuthPassword()
36
    {
37
        return $this->password;
38
    }
39
    
40
    public function getRememberToken(){
41
        return $this->remember_token;
42
    }
43
    
44
    public function  setRememberToken($value){
45
        $this->remember_token =  $value;
46
    }
47
48
    public function getReminderEmail(){
49
        $email = Input::only('email');
50
        return $email['email'];
51
    }
52
53
54
    public function getRememberTokenName(){
55
        return $this->remember_token_name;
56
    }
57
58
59
    /**
60
     * To get all Admins that has $key and $value on extradata field
61
     * @param $key
62
     * @param $value
63
     * @return mixed
64
     */
65
    public function getAllExtraData($key, $value){
66
        //defined by local scope
67
        return Admin::getExtraData($key, $value)->get();
68
        //return Admin::where('extradata->' + $key, $value)->get();
69
        //JSON_CONTAINS() function accepts the JSON field being searched and another to compare against.
70
        // It returns 1 when a match is found, e.g.
71
        //return Admin::whereRaw('JSON_CONTAINS(extradata->"$.' + $key + '", \'["' + $value + '"]\')')->get();
72
    }
73
74
    /**
75
     * Get all the Admins who has $query in $key on extradata field
76
     * @param $key
77
     * @param $query
78
     * @return mixed
79
     */
80
    public function getSearchInExtraData($key, $query){
81
        //defined by local scope
82
        return Admin::searchInExtraData($key, $query)->get();
83
        //return Admin::where('extradata->' + $key, 'like', '%'+ $query + '%')->get();
84
        //JSON_SEARCH() function returns the path to the given match or NULL when there’s no match.
85
        // It is passed the JSON document being searched, 'one' to find the first match or 'all' to find all matches, and a search string, e.g.
86
        //return Admin::whereRaw('JSON_SEARCH(extradata->"$.' + $key + '", "one", "%'+ $query + '%") IS NOT NULL')->get();
87
    }
88
89
    /**
90
     * add or update admin's picture.
91
     * @param $path_or_pic_base64_encoded
92
     */
93
    public function updateAdminPicture($path_or_pic_base64_encoded){
94
        //use forceFill() which will bypass the mass assignment check to perform update on any JSON path,
95
        // if path is not there, it will be created and if it’s present it will be updated accordingly.
96
        $this->forceFill(['extradata->picture' => $path_or_pic_base64_encoded]);
97
98
        # Save the changes
99
        $this->update();
100
    }
101
102
    /**
103
     * get admin picture from extradata column
104
     * @return mixed
105
     */
106
    public function getAdminPicture(){
107
        $extdata = $this->getExtraDataObj();
108
        if (is_null($extdata)) return null;
109
        return $extdata->picture;
110
    }
111
112
    /**
113
     * find admin by primary key id
114
     * @param $admin_id
115
     * @return mixed
116
     */
117
    public function findById($admin_id){
118
        // Retrieve a model by its primary key...
119
        $admin = Admin::find($admin_id);
120
        // Retrieve the first model matching the query constraints...
121
        //$admin = Admin::where('id', $admin_id)->first();
122
        return $admin;
123
    }
124
125
    /**
126
     * Scope a query to get admin by id.
127
     * @param $query
128
     * @param $admin_id
129
     * @return mixed
130
     */
131
    public function scopeFindById($query, $admin_id){
132
        return $query->where('id', $admin_id);
133
    }
134
135
    /**
136
     * Scope a query to get admin by a $key and $value in extradata.
137
     * @param $query
138
     * @param $key
139
     * @param $value
140
     * @return mixed
141
     */
142
    public function scopeGetExtraData($query, $key, $value){
143
        //JSON_CONTAINS() function accepts the JSON field being searched and another to compare against.
144
        // It returns 1 when a match is found, e.g.
145
        return $query->whereRaw('JSON_CONTAINS(extradata->"$.' + $key + '", \'["' + $value + '"]\')');
146
        //return $query->where('extradata->' + $key, $value);
147
    }
148
149
    /**
150
     * get extradata as json object
151
     * @return mixed
152
     */
153
    public function getExtraDataObj(){
154
        return json_decode($this->extradata);
155
    }
156
157
    /**
158
     * Scope a query to get admin by a $key and search in $value.
159
     * @param $query
160
     * @param $key
161
     * @param $query_value
162
     * @return mixed
163
     */
164
    public function scopeSearchInExtraData($query, $key, $query_value){
165
        //JSON_SEARCH() function returns the path to the given match or NULL when there’s no match.
166
        // It is passed the JSON document being searched, 'one' to find the first match or 'all' to find all matches, and a search string, e.g.
167
        return $query->whereRaw('JSON_SEARCH(extradata->"$.' + $key + '", "one", "%'+ $query_value + '%") IS NOT NULL');
168
        //return $query->where('extradata->' + $key, 'like', '%'+ $query_value + '%');
169
    }
170
171
172
    protected $fillable = array('first_name', 'last_name', 'email', 'password', 'extradata');
173
	/**
174
	 * The attributes excluded from the model's JSON form.
175
	 *
176
	 * @var array
177
	 */
178
	protected $hidden = array('password', 'remember_token');
179
180
181
182
183
}