Find this useful? Enter your email to receive occasional updates for securing PHP code.
Signing you up...
Thank you for signing up!
PHP Decode
<?php namespace App\Listeners\Update\V30; use App\Abstracts\Listeners\Update as Listener..
Decoded Output download
<?php
namespace App\Listeners\Update\V30;
use App\Abstracts\Listeners\Update as Listener;
use App\Events\Install\UpdateFinished as Event;
use App\Traits\Permissions;
use Illuminate\Support\Facades\Log;
class Version309 extends Listener
{
use Permissions;
const ALIAS = 'core';
const VERSION = '3.0.9';
/**
* Handle the event.
*
* @param $event
* @return void
*/
public function handle(Event $event)
{
if ($this->skipThisUpdate($event)) {
return;
}
Log::channel('stdout')->info('Updating to 3.0.9 version...');
$this->updatePermissions();
Log::channel('stdout')->info('Done!');
}
public function updatePermissions(): void
{
Log::channel('stdout')->info('Updating permissions...');
$rows = [
'accountant' => [
'auth-profile' => 'r,u',
'common-reports' => 'r',
'widgets-account-balance' => 'r',
'widgets-bank-feeds' => 'r',
'widgets-cash-flow' => 'r',
'widgets-currencies' => 'r',
'widgets-expenses-by-category' => 'r',
'widgets-payables' => 'r',
'widgets-profit-loss' => 'r',
'widgets-receivables' => 'r',
],
];
Log::channel('stdout')->info('Attaching new permissions...');
// c=create, r=read, u=update, d=delete
$this->attachPermissionsByRoleNames($rows);
Log::channel('stdout')->info('Permissions updated.');
}
}
?>
Did this file decode correctly?
Original Code
<?php
namespace App\Listeners\Update\V30;
use App\Abstracts\Listeners\Update as Listener;
use App\Events\Install\UpdateFinished as Event;
use App\Traits\Permissions;
use Illuminate\Support\Facades\Log;
class Version309 extends Listener
{
use Permissions;
const ALIAS = 'core';
const VERSION = '3.0.9';
/**
* Handle the event.
*
* @param $event
* @return void
*/
public function handle(Event $event)
{
if ($this->skipThisUpdate($event)) {
return;
}
Log::channel('stdout')->info('Updating to 3.0.9 version...');
$this->updatePermissions();
Log::channel('stdout')->info('Done!');
}
public function updatePermissions(): void
{
Log::channel('stdout')->info('Updating permissions...');
$rows = [
'accountant' => [
'auth-profile' => 'r,u',
'common-reports' => 'r',
'widgets-account-balance' => 'r',
'widgets-bank-feeds' => 'r',
'widgets-cash-flow' => 'r',
'widgets-currencies' => 'r',
'widgets-expenses-by-category' => 'r',
'widgets-payables' => 'r',
'widgets-profit-loss' => 'r',
'widgets-receivables' => 'r',
],
];
Log::channel('stdout')->info('Attaching new permissions...');
// c=create, r=read, u=update, d=delete
$this->attachPermissionsByRoleNames($rows);
Log::channel('stdout')->info('Permissions updated.');
}
}
Function Calls
None |
Stats
MD5 | fb6aa5b20bda6cdb5f4626e901e8ed84 |
Eval Count | 0 |
Decode Time | 101 ms |