Issues (128)

Security Analysis    no request data  

This project does not seem to handle request data directly as such no vulnerable execution paths were found.

  Cross-Site Scripting
Cross-Site Scripting enables an attacker to inject code into the response of a web-request that is viewed by other users. It can for example be used to bypass access controls, or even to take over other users' accounts.
  File Exposure
File Exposure allows an attacker to gain access to local files that he should not be able to access. These files can for example include database credentials, or other configuration files.
  File Manipulation
File Manipulation enables an attacker to write custom data to files. This potentially leads to injection of arbitrary code on the server.
  Object Injection
Object Injection enables an attacker to inject an object into PHP code, and can lead to arbitrary code execution, file exposure, or file manipulation attacks.
  Code Injection
Code Injection enables an attacker to execute arbitrary code on the server.
  Response Splitting
Response Splitting can be used to send arbitrary responses.
  File Inclusion
File Inclusion enables an attacker to inject custom files into PHP's file loading mechanism, either explicitly passed to include, or for example via PHP's auto-loading mechanism.
  Command Injection
Command Injection enables an attacker to inject a shell command that is execute with the privileges of the web-server. This can be used to expose sensitive data, or gain access of your server.
  SQL Injection
SQL Injection enables an attacker to execute arbitrary SQL code on your database server gaining access to user data, or manipulating user data.
  XPath Injection
XPath Injection enables an attacker to modify the parts of XML document that are read. If that XML document is for example used for authentication, this can lead to further vulnerabilities similar to SQL Injection.
  LDAP Injection
LDAP Injection enables an attacker to inject LDAP statements potentially granting permission to run unauthorized queries, or modify content inside the LDAP tree.
  Header Injection
  Other Vulnerability
This category comprises other attack vectors such as manipulating the PHP runtime, loading custom extensions, freezing the runtime, or similar.
  Regex Injection
Regex Injection enables an attacker to execute arbitrary code in your PHP process.
  XML Injection
XML Injection enables an attacker to read files on your local filesystem including configuration files, or can be abused to freeze your web-server process.
  Variable Injection
Variable Injection enables an attacker to overwrite program variables with custom data, and can lead to further vulnerabilities.
Unfortunately, the security analysis is currently not available for your project. If you are a non-commercial open-source project, please contact support to gain access.

src/TransmissorProvider.php (1 issue)

Upgrade to new PHP Analysis Engine

These results are based on our legacy PHP analysis, consider migrating to our new PHP analysis engine instead. Learn more

1
<?php
2
3
namespace Transmissor;
4
5
use App;
6
use Config;
7
use Illuminate\Contracts\Events\Dispatcher;
8
use Illuminate\Contracts\Http\Kernel;
9
use Illuminate\Foundation\AliasLoader;
10
11
use Illuminate\Routing\Router;
12
use Illuminate\Support\Collection;
13
use Illuminate\Support\Facades\View;
14
use Illuminate\Support\ServiceProvider;
15
use Log;
16
17
use Muleta\Traits\Providers\ConsoleTools;
18
19
use Route;
20
21
use Transmissor\Facades\Transmissor as TransmissorFacade;
22
use Transmissor\Observers\TransmissorCallbacks;
23
use Transmissor\Services\TransmissorService;
24
25
class TransmissorProvider extends ServiceProvider
26
{
27
    use ConsoleTools;
28
29
    public $packageName = 'transmissor';
30
    const pathVendor = 'sierratecnologia/transmissor';
31
32
    public static $aliasProviders = [
33
        'Transmissor' => \Transmissor\Facades\Transmissor::class,
34
    ];
35
36
    public static $providers = [
37
38
        // \Support\SupportProviderService::class,
39
        \Telefonica\TelefonicaProvider::class,
40
        \Transmissor\Providers\NotificationServiceProvider::class,
41
        \Transmissor\Providers\ActivityServiceProvider::class,
42
43
        
44
    ];
45
46
    /**
47
     * Rotas do Menu
48
     */
49
    public static $menuItens = [
50
        'Admin' => [
51
            [
52
                'text'        => 'Notifications',
53
                'route'       => 'admin.transmissor.notifications.index',
54
                'icon'        => 'puzzle-piece',
55
                'section'     => 'painel',
56
                'level'       => 3,
57
            ],
58
        ],
59
    ];
60
61
    /**
62
     * Alias the services in the boot.
63
     */
64
    public function boot()
65
    {
66
        
67
        // Register configs, migrations, etc
68
        $this->registerDirectories();
69
70
        // COloquei no register pq nao tava reconhecendo as rotas para o adminlte
71
        $this->app->booted(
72
            function () {
73
                $this->routes();
74
            }
75
        );
76
77
        $this->loadLogger();
78
    }
79
80
    /**
81
     * Register the tool's routes.
82
     *
83
     * @return void
84
     */
85
    protected function routes()
86
    {
87
        if ($this->app->routesAreCached()) {
88
            return;
89
        }
90
91
        /**
92
         * Transmissor; Routes
93
         */
94
        $this->loadRoutesForRiCa(__DIR__.DIRECTORY_SEPARATOR.'..'.DIRECTORY_SEPARATOR.'routes');
95
    }
96
97
    /**
98
     * Register the services.
99
     */
100
    public function register()
101
    {
102
        $this->mergeConfigFrom($this->getPublishesPath('config'.DIRECTORY_SEPARATOR.'sitec'.DIRECTORY_SEPARATOR.'transmissor.php'), 'sitec.transmissor');
103
        
104
105
        $this->setProviders();
106
107
        // $kernel = $this->app->make(Kernel::class);
108
        // $kernel->pushMiddleware(TransmissorCallbacks::class);
109
110
111
        // Register Migrations
112
        $this->loadMigrationsFrom(__DIR__.DIRECTORY_SEPARATOR.'..'.DIRECTORY_SEPARATOR.'database'.DIRECTORY_SEPARATOR.'migrations');
113
114
        $this->app->singleton(
115
            'transmissor',
116
            function () {
117
                return new Transmissor();
118
            }
119
        );
120
        
121
        /*
122
        |--------------------------------------------------------------------------
123
        | Register the Utilities
124
        |--------------------------------------------------------------------------
125
        */
126
        /**
127
         * Singleton Transmissor;
128
         */
129
        $this->app->singleton(
130
            TransmissorService::class,
131
            function ($app) {
0 ignored issues
show
The parameter $app is not used and could be removed.

This check looks from parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
132
                Log::channel('sitec-transmissor')->info('Singleton Transmissor;');
133
                return new TransmissorService(\Illuminate\Support\Facades\Config::get('sitec.transmissor'));
134
            }
135
        );
136
137
        // Register commands
138
        $this->registerCommandFolders(
139
            [
140
            base_path('vendor/sierratecnologia/transmissor/src/Console/Commands') => '\Transmissor\Console\Commands',
141
            ]
142
        );
143
144
        // /**
145
        //  * Helpers
146
        //  */
147
        // Aqui noa funciona
148
        // if (!function_exists('transmissor_asset')) {
149
        //     function transmissor_asset($path, $secure = null)
150
        //     {
151
        //         return route('rica.transmissor.assets').'?path='.urlencode($path);
152
        //     }
153
        // }
154
    }
155
156
    /**
157
     * Get the services provided by the provider.
158
     *
159
     * @return array
160
     */
161
    public function provides()
162
    {
163
        return [
164
            'transmissor',
165
        ];
166
    }
167
168
    /**
169
     * Register configs, migrations, etc
170
     *
171
     * @return void
172
     */
173
    public function registerDirectories()
174
    {
175
        // Publish config files
176
        $this->publishes(
177
            [
178
            // Paths
179
            $this->getPublishesPath('config'.DIRECTORY_SEPARATOR.'sitec') => config_path('sitec'),
180
            ],
181
            ['config',  'sitec', 'sitec-config']
182
        );
183
184
        // // Publish transmissor css and js to public directory
185
        // $this->publishes([
186
        //     $this->getDistPath('transmissor') => public_path('assets/transmissor')
187
        // ], ['public',  'sitec', 'sitec-public']);
188
189
        $this->loadViews();
190
        $this->loadTranslations();
191
    }
192
193
    private function loadViews()
194
    {
195
        // View namespace
196
        $viewsPath = $this->getResourcesPath('views');
197
        $this->loadViewsFrom($viewsPath, 'transmissor');
198
        $this->publishes(
199
            [
200
            $viewsPath => base_path('resources'.DIRECTORY_SEPARATOR.'views'.DIRECTORY_SEPARATOR.'vendor'.DIRECTORY_SEPARATOR.'transmissor'),
201
            ],
202
            ['views',  'sitec', 'sitec-views']
203
        );
204
    }
205
    
206
    private function loadTranslations()
207
    {
208
        // Publish lanaguage files
209
        $this->publishes(
210
            [
211
            $this->getResourcesPath('lang') => resource_path('lang'.DIRECTORY_SEPARATOR.'vendor'.DIRECTORY_SEPARATOR.'transmissor')
212
            ],
213
            ['lang',  'sitec', 'sitec-lang', 'translations']
214
        );
215
216
        // Load translations
217
        $this->loadTranslationsFrom($this->getResourcesPath('lang'), 'transmissor');
218
    }
219
220
221
    /**
222
     *
223
     */
224
    private function loadLogger()
225
    {
226
        Config::set(
227
            'logging.channels.sitec-transmissor',
228
            [
229
            'driver' => 'single',
230
            'path' => storage_path('logs'.DIRECTORY_SEPARATOR.'sitec-transmissor.log'),
231
            'level' => env('APP_LOG_LEVEL', 'debug'),
232
            ]
233
        );
234
    }
235
}
236