Subversion-Projekte lars-tiefland.laravel_shop

Revision

Revision 1299 | Revision 1310 | Zur aktuellen Revision | Ganze Datei anzeigen | Leerzeichen ignorieren | Details | Blame | Letzte Änderung | Log anzeigen | RSS feed

Revision 1299 Revision 1304
Zeile 13... Zeile 13...
13
         *
13
         *
14
         * @return bool
14
         * @return bool
15
         */
15
         */
16
        public function authorize(): bool
16
        public function authorize(): bool
17
        {
17
        {
-
 
18
            if ( $_SESSION["admin"]["uid"] == $this->user()->id || $_SESSION["admin"]["user"]->admin == 1 || isset( $GLOBALS["user_rechte"]["admin"]["admin"] ) )
-
 
19
            {
18
            return true;
20
                return true;
-
 
21
            }
-
 
22
            return false;
19
        }
23
        }
Zeile 20... Zeile 24...
20
 
24
 
21
        /**
25
        /**
22
         * Get the validation rules that apply to the request.
26
         * Get the validation rules that apply to the request.
23
         *
27
         *
24
         * @return array<string, mixed>
28
         * @return array<string, mixed>
25
         */
29
         */
26
        public function rules(): array
30
        public function rules(): array
27
        {
31
        {
28
            return [
32
            return [
29
                'email'  => 'bail|required|email|max:255', Rule::unique(BackendUser::class)->ignore($this->user()->email),
33
                'email' => 'bail|required|email|max:255', Rule::unique( BackendUser::class )->ignore( $this->user()->email ),
30
            ];
34
            ];
Zeile 31... Zeile 35...
31
        }
35
        }
32
 
36