UnknownSec Bypass
403
:
/
mnt
/
lmsestudio-instance-vol002
/
lms_2f09a0f3189b
/
app
/
Services
/
Admin
/ [
drwxr-xr-x
]
Menu
Upload
Mass depes
Mass delete
Terminal
Info server
About
name :
ConfigurationServices.php
<?php namespace EstudioLMS\Services\Admin; use EstudioLMS\Repositories\Config\BoletoRepository; use EstudioLMS\Repositories\Config\ConfigRepository; use EstudioLMS\Repositories\Config\GatewayRepository; use EstudioLMS\Repositories\Config\PagarmeRecipientInterface; use EstudioLMS\Repositories\Config\SaasConfigInterface; use EstudioLMS\Repositories\Config\BoletoPaghiperRepository; /** * Class ConfigurationServices * @package EstudioLMS\Services\Admin */ class ConfigurationServices { /** * @var ConfigRepository */ private $configRepository; /** * @var BoletoRepository */ private $boletoRepository; /** * @var BoletoPaghiperRepository */ private $boletoPaghiperRepository; /** * @var SaasConfigInterface */ private $saasConfigRepository; /** * @var PagarmeRecipientInterface */ private $pagarmeRecipient; /** * @var GatewayRepository */ private $gateway; /** * ConfigurationServices constructor. * @param ConfigRepository $configRepository * @param BoletoRepository $boletoRepository * @param BoletoPaghiperRepository $boletoPaghiperRepository * @param SaasConfigInterface $saasConfigRepository * @param PagarmeRecipientInterface $pagarmeRecipient * @param GatewayRepository $gateway */ public function __construct( ConfigRepository $configRepository, BoletoRepository $boletoRepository, BoletoPaghiperRepository $boletoPaghiperRepository, SaasConfigInterface $saasConfigRepository, PagarmeRecipientInterface $pagarmeRecipient, GatewayRepository $gateway ) { $this->configRepository = $configRepository; $this->boletoRepository = $boletoRepository; $this->boletoPaghiperRepository = $boletoPaghiperRepository; $this->saasConfigRepository = $saasConfigRepository; $this->pagarmeRecipient = $pagarmeRecipient; $this->gateway = $gateway; } /** * @return mixed */ public function configuration() { return $this->configRepository->firstRecord(); } /** * @return mixed */ public function saasConfiguration() { return $this->saasConfigRepository->firstRecord(); } /** * @return mixed */ public function paypalConfiguration() { $config = $this->configRepository->firstRecord(); $paypal['email'] = $config['paypal_email']; $paypal['password'] = $config['paypal_password']; $paypal['token'] = $config['paypal_token']; $paypal['sandbox'] = $config['paypal_sandbox']; return $paypal; } /** * @return mixed */ public function pagseguroConfiguration() { $config = $this->configRepository->firstRecord(); $pagseguro['email'] = $config['pagseguro_email']; $pagseguro['token'] = $config['pagseguro_token']; $pagseguro['sandbox'] = $config['pagseguro_sandbox']; return $pagseguro; } /** * @return mixed */ public function boletoConfiguration() { return $this->boletoRepository->firstRecord(); } /** * @param $gatewayTitle * @return bool */ public function validateGateways($gatewayTitle) { $boleto = $this->boletoPaghiperConfiguration(); $gateway = $this->configuration(); $gatewayActive = $this->gateway->findWhere([ ['title', '=', $gatewayTitle], ['show', '=', true] ])->first(); switch ($gatewayTitle) { case 'Boleto': if ($boleto['apiKey'] != '') { return true; } else { return false; } case 'Pagseguro': return !empty($gateway['pagseguro_email']) && $gatewayActive; case 'Paypal': return !empty($gateway['paypal_email']) && $gatewayActive; case 'PagarMe' : $pagarmeRecipient = $this->pagarmeRecipient->firstRecord(); return !empty($pagarmeRecipient->pagarme_account_id) && !empty($pagarmeRecipient->pagarme_recipient_id) && $gatewayActive; case 'Hotmart' : return !empty($gateway['hotmart_hottok']) && $gatewayActive; default: return false; } } /** * @return bool */ public function hasConfiguredGateway() { $gateways = $this->gateway->all(); foreach ($gateways as $gateway) { if ($this->validateGateways($gateway->title)) return true; } return false; } /** * @return mixed */ public function boletoPaghiperConfiguration() { return $this->boletoPaghiperRepository->firstRecord(); } }
Copyright © 2026 - UnknownSec