Applied StyleCI changes
This commit is contained in:
parent
025442fcd9
commit
505d7e604e
@ -11,7 +11,6 @@ use BookStack\Interfaces\Loggable;
|
||||
use Illuminate\Database\Eloquent\Builder;
|
||||
use Illuminate\Database\Eloquent\Relations\Relation;
|
||||
use Illuminate\Support\Facades\Log;
|
||||
use Illuminate\Support\Facades\Request;
|
||||
|
||||
class ActivityService
|
||||
{
|
||||
@ -57,6 +56,7 @@ class ActivityService
|
||||
protected function newActivityForUser(string $type): Activity
|
||||
{
|
||||
$ip = request()->ip() ?? '';
|
||||
|
||||
return $this->activity->newInstance()->forceFill([
|
||||
'type' => strtolower($type),
|
||||
'user_id' => user()->id,
|
||||
|
@ -642,7 +642,7 @@ class PermissionService
|
||||
$query->whereExists(function ($permissionQuery) use (&$tableDetails, $morphClass) {
|
||||
/** @var Builder $permissionQuery */
|
||||
$permissionQuery->select('id')->from('joint_permissions')
|
||||
->whereColumn('joint_permissions.entity_id', '=', $tableDetails['tableName'] . '.' . $tableDetails['entityIdColumn'])
|
||||
->whereColumn('joint_permissions.entity_id', '=', $tableDetails['tableName'] . '.' . $tableDetails['entityIdColumn'])
|
||||
->where('entity_type', '=', $morphClass)
|
||||
->where('action', '=', 'view')
|
||||
->whereIn('role_id', $this->getCurrentUserRoles())
|
||||
|
@ -152,13 +152,13 @@ class AuditLogTest extends TestCase
|
||||
'name' => 'Updated page',
|
||||
'html' => '<p>Updated content</p>',
|
||||
], [
|
||||
'X-Forwarded-For' => '192.123.45.1'
|
||||
'X-Forwarded-For' => '192.123.45.1',
|
||||
])->assertRedirect($page->refresh()->getUrl());
|
||||
|
||||
$this->assertDatabaseHas('activities', [
|
||||
'type' => ActivityType::PAGE_UPDATE,
|
||||
'ip' => '192.123.45.1',
|
||||
'user_id' => $editor->id,
|
||||
'type' => ActivityType::PAGE_UPDATE,
|
||||
'ip' => '192.123.45.1',
|
||||
'user_id' => $editor->id,
|
||||
'entity_id' => $page->id,
|
||||
]);
|
||||
|
||||
@ -179,13 +179,13 @@ class AuditLogTest extends TestCase
|
||||
'html' => '<p>Updated content</p>',
|
||||
], [
|
||||
'X-Forwarded-For' => '192.123.45.1',
|
||||
'REMOTE_ADDR' => '192.123.45.2',
|
||||
'REMOTE_ADDR' => '192.123.45.2',
|
||||
])->assertRedirect($page->refresh()->getUrl());
|
||||
|
||||
$this->assertDatabaseHas('activities', [
|
||||
'type' => ActivityType::PAGE_UPDATE,
|
||||
'ip' => '127.0.0.1',
|
||||
'user_id' => $editor->id,
|
||||
'type' => ActivityType::PAGE_UPDATE,
|
||||
'ip' => '127.0.0.1',
|
||||
'user_id' => $editor->id,
|
||||
'entity_id' => $page->id,
|
||||
]);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user