Skip to content

Commit

Permalink
feature: Code cleanup and removed old parts
Browse files Browse the repository at this point in the history
  • Loading branch information
dogukanoksuz committed Oct 9, 2023
1 parent ecd2961 commit 5184064
Show file tree
Hide file tree
Showing 169 changed files with 552 additions and 21,818 deletions.
1 change: 0 additions & 1 deletion app/Classes/Ldap.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
namespace App\Classes;

use Exception;
use ReturnTypeWillChange;
use Throwable;

/**
Expand Down
26 changes: 26 additions & 0 deletions app/Http/Controllers/API/ExtensionController.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
use App\Models\UserSettings;
use GuzzleHttp\Client;
use GuzzleHttp\Exception\GuzzleException;
use GuzzleHttp\Psr7\MimeType;
use Illuminate\Http\JsonResponse;
use Illuminate\Http\Request;
use Illuminate\Http\Response;
Expand Down Expand Up @@ -318,4 +319,29 @@ private function checkPermissions($extension)
}
}
}

/**
* Get files from extensions public folder
*
* @return BinaryFileResponse|void
*/
public function publicFolder()
{
$basePath =
'/liman/extensions/' . strtolower((string) extension()->name) . '/public/';

$targetPath = $basePath . explode('public/', (string) url()->current(), 2)[1];

if (realpath($targetPath) != $targetPath) {
abort(404);
}

if (is_file($targetPath)) {
return response()->download($targetPath, null, [
'Content-Type' => MimeType::fromExtension(pathinfo($targetPath, PATHINFO_EXTENSION)),
]);
} else {
abort(404);
}
}
}
6 changes: 3 additions & 3 deletions app/Http/Controllers/API/SearchController.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ public function search(Request $request)

// Get constant searchables
if (user()->isAdmin()) {
foreach (config('liman.new_search.admin') as $constant) {
foreach (config('liman.search.admin') as $constant) {
if (isset($constant['children'])) {
foreach ($constant['children'] as $child) {
if (! isset($searchable[$constant['name']])) {
Expand All @@ -46,7 +46,7 @@ public function search(Request $request)
}
}

foreach (config('liman.new_search.user') as $constant) {
foreach (config('liman.search.user') as $constant) {
if (isset($constant['children'])) {
foreach ($constant['children'] as $child) {
if (! isset($searchable[$constant['name']])) {
Expand All @@ -64,7 +64,7 @@ public function search(Request $request)
}
}

foreach (config('liman.new_search.common') as $constant) {
foreach (config('liman.search.common') as $constant) {
if (isset($constant['children'])) {
foreach ($constant['children'] as $child) {
if (! isset($searchable[$constant['name']])) {
Expand Down
214 changes: 0 additions & 214 deletions app/Http/Controllers/Auth/LoginController.php

This file was deleted.

47 changes: 0 additions & 47 deletions app/Http/Controllers/Auth/LogoutController.php

This file was deleted.

31 changes: 0 additions & 31 deletions app/Http/Controllers/Auth/_routes.php

This file was deleted.

Loading

0 comments on commit 5184064

Please sign in to comment.