mirror of
https://github.com/BookStackApp/BookStack.git
synced 2024-10-01 01:36:00 -04:00
Ran phpcbf
This commit is contained in:
parent
adc866cb3d
commit
3f83c548f8
@ -224,7 +224,7 @@ class UserRepo
|
|||||||
*/
|
*/
|
||||||
public function getRecentlyCreated(User $user, $count = 20)
|
public function getRecentlyCreated(User $user, $count = 20)
|
||||||
{
|
{
|
||||||
$createdByUserQuery = function(Builder $query) use ($user) {
|
$createdByUserQuery = function (Builder $query) use ($user) {
|
||||||
$query->where('created_by', '=', $user->id);
|
$query->where('created_by', '=', $user->id);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -31,4 +31,4 @@ class BreadcrumbsViewComposer
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -37,7 +37,6 @@ class EntityContextManager
|
|||||||
if ($shelf && $shelf->contains($book)) {
|
if ($shelf && $shelf->contains($book)) {
|
||||||
return $shelf;
|
return $shelf;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
@ -58,5 +57,4 @@ class EntityContextManager
|
|||||||
{
|
{
|
||||||
$this->session->forget($this->KEY_SHELF_CONTEXT_ID);
|
$this->session->forget($this->KEY_SHELF_CONTEXT_ID);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
}
|
|
||||||
|
@ -62,5 +62,4 @@ class PageRevision extends Model
|
|||||||
{
|
{
|
||||||
return $type === 'revision';
|
return $type === 'revision';
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -132,7 +132,7 @@ abstract class Controller extends BaseController
|
|||||||
*/
|
*/
|
||||||
protected function checkPermissionOrCurrentUser(string $permissionName, int $userId)
|
protected function checkPermissionOrCurrentUser(string $permissionName, int $userId)
|
||||||
{
|
{
|
||||||
return $this->checkPermissionOr($permissionName, function() use ($userId) {
|
return $this->checkPermissionOr($permissionName, function () use ($userId) {
|
||||||
return $userId === $this->currentUser->id;
|
return $userId === $this->currentUser->id;
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
@ -85,5 +85,4 @@ class DrawioImageController extends Controller
|
|||||||
'content' => base64_encode($imageData)
|
'content' => base64_encode($imageData)
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -61,5 +61,4 @@ class GalleryImageController extends Controller
|
|||||||
|
|
||||||
return response()->json($image);
|
return response()->json($image);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -368,5 +368,4 @@ class UserController extends Controller
|
|||||||
|
|
||||||
return redirect()->back(302, [], "/settings/users/$userId");
|
return redirect()->back(302, [], "/settings/users/$userId");
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -25,8 +25,7 @@ class ImageRepo
|
|||||||
ImageService $imageService,
|
ImageService $imageService,
|
||||||
PermissionService $permissionService,
|
PermissionService $permissionService,
|
||||||
Page $page
|
Page $page
|
||||||
)
|
) {
|
||||||
{
|
|
||||||
$this->image = $image;
|
$this->image = $image;
|
||||||
$this->imageService = $imageService;
|
$this->imageService = $imageService;
|
||||||
$this->restrictionService = $permissionService;
|
$this->restrictionService = $permissionService;
|
||||||
@ -87,8 +86,7 @@ class ImageRepo
|
|||||||
int $uploadedTo = null,
|
int $uploadedTo = null,
|
||||||
string $search = null,
|
string $search = null,
|
||||||
callable $whereClause = null
|
callable $whereClause = null
|
||||||
)
|
) {
|
||||||
{
|
|
||||||
$imageQuery = $this->image->newQuery()->where('type', '=', strtolower($type));
|
$imageQuery = $this->image->newQuery()->where('type', '=', strtolower($type));
|
||||||
|
|
||||||
if ($uploadedTo !== null) {
|
if ($uploadedTo !== null) {
|
||||||
@ -126,13 +124,12 @@ class ImageRepo
|
|||||||
int $pageSize = 24,
|
int $pageSize = 24,
|
||||||
int $uploadedTo = null,
|
int $uploadedTo = null,
|
||||||
string $search = null
|
string $search = null
|
||||||
)
|
) {
|
||||||
{
|
|
||||||
$contextPage = $this->page->findOrFail($uploadedTo);
|
$contextPage = $this->page->findOrFail($uploadedTo);
|
||||||
$parentFilter = null;
|
$parentFilter = null;
|
||||||
|
|
||||||
if ($filterType === 'book' || $filterType === 'page') {
|
if ($filterType === 'book' || $filterType === 'page') {
|
||||||
$parentFilter = function(Builder $query) use ($filterType, $contextPage) {
|
$parentFilter = function (Builder $query) use ($filterType, $contextPage) {
|
||||||
if ($filterType === 'page') {
|
if ($filterType === 'page') {
|
||||||
$query->where('uploaded_to', '=', $contextPage->id);
|
$query->where('uploaded_to', '=', $contextPage->id);
|
||||||
} elseif ($filterType === 'book') {
|
} elseif ($filterType === 'book') {
|
||||||
|
@ -73,8 +73,7 @@ class ImageService extends UploadService
|
|||||||
int $resizeWidth = null,
|
int $resizeWidth = null,
|
||||||
int $resizeHeight = null,
|
int $resizeHeight = null,
|
||||||
bool $keepRatio = true
|
bool $keepRatio = true
|
||||||
)
|
) {
|
||||||
{
|
|
||||||
$imageName = $uploadedFile->getClientOriginalName();
|
$imageName = $uploadedFile->getClientOriginalName();
|
||||||
$imageData = file_get_contents($uploadedFile->getRealPath());
|
$imageData = file_get_contents($uploadedFile->getRealPath());
|
||||||
|
|
||||||
|
@ -52,7 +52,8 @@ function signedInUser() : bool
|
|||||||
* Check if the current user has general access.
|
* Check if the current user has general access.
|
||||||
* @return bool
|
* @return bool
|
||||||
*/
|
*/
|
||||||
function hasAppAccess() : bool {
|
function hasAppAccess() : bool
|
||||||
|
{
|
||||||
return !auth()->guest() || setting('app-public');
|
return !auth()->guest() || setting('app-public');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user