⚝
One Hat Cyber Team
⚝
Your IP:
216.73.216.23
Server IP:
178.33.27.10
Server:
Linux cpanel.dev-unit.com 3.10.0-1160.108.1.el7.x86_64 #1 SMP Thu Jan 25 16:17:31 UTC 2024 x86_64
Server Software:
Apache/2.4.57 (Unix) OpenSSL/1.0.2k-fips
PHP Version:
8.2.11
Buat File
|
Buat Folder
Eksekusi
Dir :
~
/
home
/
id
/
public_html
/
app
/
Http
/
Controllers
/
Admin
/
View File Name :
EmailController.php
<?php namespace App\Http\Controllers\Admin; use App\Models\BasicExtended; use Illuminate\Http\Request; use App\Http\Controllers\Controller; use App\Models\EmailTemplate; use Session; class EmailController extends Controller { public function mailFromAdmin() { $data['abe'] = BasicExtended::first(); return view('admin.basic.email.mail_from_admin', $data); } public function updateMailFromAdmin(Request $request) { $messages = [ 'from_mail.required_if' => 'The smtp host field is required when smtp status is active.', 'from_name.required_if' => 'The from name field is required when smtp status is active.', 'smtp_host.required_if' => 'The smtp host field is required when smtp status is active.', 'smtp_port.required_if' => 'The smtp port field is required when smtp status is active.', 'encryption.required_if' => 'The encryption field is required when smtp status is active.', 'smtp_username.required_if' => 'The smtp username field is required when smtp status is active.', 'smtp_password.required_if' => 'The smtp password field is required when smtp status is active.' ]; $request->validate([ 'from_mail' => 'required_if:is_smtp,1', 'from_name' => 'required_if:is_smtp,1', 'is_smtp' => 'required', 'smtp_host' => 'required_if:is_smtp,1', 'smtp_port' => 'required_if:is_smtp,1', 'encryption' => 'required_if:is_smtp,1', 'smtp_username' => 'required_if:is_smtp,1', 'smtp_password' => 'required_if:is_smtp,1', ], $messages); $bes = BasicExtended::all(); foreach ($bes as $key => $be) { $be->from_mail = $request->from_mail; $be->from_name = $request->from_name; $be->is_smtp = $request->is_smtp; $be->smtp_host = $request->smtp_host; $be->smtp_port = $request->smtp_port; $be->encryption = $request->encryption; $be->smtp_username = $request->smtp_username; $be->smtp_password = $request->smtp_password; $be->save(); } Session::flash('success', __('Updated successfully!')); return back(); } public function mailToAdmin() { $data['abe'] = BasicExtended::first(); return view('admin.basic.email.mail_to_admin', $data); } public function updateMailToAdmin(Request $request) { $messages = [ 'to_mail.required' => 'Mail Address is required.' ]; $request->validate([ 'to_mail' => 'required', ], $messages); $bes = BasicExtended::all(); foreach ($bes as $key => $be) { $be->to_mail = $request->to_mail; $be->save(); } Session::flash('success', __('Updated successfully!')); return back(); } }