⚝
One Hat Cyber Team
⚝
Your IP:
216.73.216.142
Server IP:
217.76.53.76
Server:
Linux vmi1397931.contaboserver.net 5.4.0-105-generic #119-Ubuntu SMP Mon Mar 7 18:49:24 UTC 2022 x86_64
Server Software:
Apache
PHP Version:
8.2.27
Buat File
|
Buat Folder
Eksekusi
Dir :
~
/
www
/
wwwroot
/
ppt.com.ng
/
app
/
Http
/
Controllers
/
View File Name :
SuperUsersController.php
user()->hasPermission('READ', env('SUPER_ADMIN_ROUTE').'_'.\Session::get('current_permission'))) return response()->json(['Errors' => ['Error' => 'Unauthorized Action']],422); return view('dashboard.users.home-admin',[ 'page' => [ 'type' => 'dashboard', 'icon' => ' ti ti-users', 'name' => 'Users', 'url' => 'users', 'user_route' => \Session::get('user_route'), ], 'users' => CardOwner::all(), ]); } public function show($id) { if (!auth()->user()->hasPermission('READ', env('SUPER_ADMIN_ROUTE').'_'.\Session::get('current_permission'))) return response()->json(['Errors' => ['Error' => 'Unauthorized Access.']],422); $user = CardOwner::find($id); return view('dashboard.users.view-admin',[ 'type' => 'dashboard', 'icon' => ' ti ti-users', 'url' => '/'.\Session::get('user_route').'/users', 'name' => 'User', 'user' => $user, 'user_route' => \Session::get('user_route'), ]); } public function viewPrint($id) { if (!auth()->user()->hasPermission('READ', env('SUPER_ADMIN_ROUTE').'_'.\Session::get('current_permission'))) return response()->json(['Errors' => ['Error' => 'Unauthorized Access.']],422); $user = CardOwner::find($id); return view('dashboard.users.print-card',[ 'type' => 'dashboard', 'icon' => ' ti ti-users', 'url' => '/'.\Session::get('user_route').'/users', 'name' => 'User', 'user' => $user, 'user_route' => \Session::get('user_route'), ]); } public function viewCard($id) { if (!auth()->user()->hasPermission('READ', env('SUPER_ADMIN_ROUTE').'_'.\Session::get('current_permission'))) return response()->json(['Errors' => ['Error' => 'Unauthorized Access.']],422); $user = CardOwner::find($id); return view('dashboard.users.view-card',[ 'type' => 'dashboard', 'icon' => ' ti ti-users', 'url' => '/'.\Session::get('user_route').'/users', 'name' => 'User', 'user' => $user, 'user_route' => \Session::get('user_route'), ]); } public function changeStatus($id) { $user = CardOwner::find($id); if (!$user) return response()->json(['errors' => ['error' => 'User not Found']]); $user['status'] = $user['status'] == 'Active' ? 'Inactive' : 'Active'; $user->save(); return response()->json([ 'refresh' => true, 'message' => 'Status Updated. Redirecting Now' ]); } public function changeEditStatus($id) { $user = CardOwner::find($id); if (!$user) return response()->json(['errors' => ['error' => 'User not Found']]); $user['editable'] = $user['editable'] == 'Yes' ? 'No' : 'Yes'; $user->save(); return response()->json([ 'refresh' => true, 'message' => 'Status Updated. Redirecting Now' ]); } public function changeCardStatus($id) { $user = CardOwner::find($id); if (!$user) return response()->json(['errors' => ['error' => 'User not Found']]); $user['card_status'] = $user['card_status'] == 'Pending' ? 'Ready' : 'Pending'; $user->save(); if($user['card_status'] == 'Ready'){ $user = Auth::user(); $roleName = $user['user_role']['name']; $name = $user['name'] ?? ('User id[' . $user['id']. ']'); NotificationTrait::createActivity( $user['id'], $name . ' ('. $roleName .') has marked card ready for user having user id (' . $user['qr_string'] . ') ', 'CARD', $roleName, true, true, NotificationTrait::getUserIp() ); } return response()->json([ 'refresh' => true, 'message' => 'Card Status Updated. Redirecting Now' ]); } public function destroy($id) { if (!auth()->user()->hasPermission('DELETE', env('SUPER_ADMIN_ROUTE').'_'.\Session::get('current_permission'))) return response()->json(['Errors' => ['Error' => 'Unauthorized Action']],422); $user = CardOwner::find($id); if(!$user) return response()->json(['errors' => ['error' => 'Card Owner Not Found']],422); $image = UploadFile::find($user['image_id']); if($image){ if (is_file(storage_path('app/public/'.$image['filename']))) unlink(storage_path('app/public/'.$image['filename'])); $image->delete(); } $user->delete(); return response()->json([ 'location' => '/'.\Session::get('user_route').'/users', 'message' => 'Card Owner Deleted. Redirecting Now' ]); } }