This commit is contained in:
Dennis Eichhorn 2023-07-09 02:32:01 +00:00
parent e513f0a950
commit 7f52d076e6
3 changed files with 16 additions and 5 deletions

View File

@ -1092,7 +1092,7 @@ final class ApiController extends Controller
$data['guard'] = __DIR__ . '/../Files';
}
} else {
if (!isset($data, $data['guard'])) {
if (empty($data) || !isset($data['guard'])) {
$this->fillJsonResponse($request, $response, NotificationLevel::HIDDEN, '', '', []);
$response->header->status = RequestStatusCode::R_403;
}

View File

@ -16,4 +16,15 @@ use \phpOMS\Uri\UriFactory;
?>
<style>html, body, iframe { margin: 0; padding: 0; border: 0; }</style>
<iframe class="col-simple" id="iMediaFrame" width="100%" height="100%" src="<?= UriFactory::build('/Resources/mozilla/Pdf/web/viewer.html?file=' . \urlencode(UriFactory::build('{/api}media/export?id=' . $this->media->id))); ?>" allowfullscreen></iframe>
<iframe
class="col-simple"
id="iMediaFrame"
width="100%"
height="100%"
src="<?= UriFactory::build(
'/Resources/mozilla/Pdf/web/viewer.html?file='
. ($this->media->id === 0
? \urlencode(UriFactory::build('{/api}media/export?path=' . $this->media->getPath()))
: \urlencode(UriFactory::build('{/api}media/export?id=' . $this->media->id)
)));
?>" allowfullscreen></iframe>

View File

@ -302,7 +302,7 @@ if (\defined('RESET') && RESET === '1') {
$db->exec('DROP DATABASE IF EXISTS ' . $CONFIG['db']['core']['masters']['admin']['database']);
$db->exec('CREATE DATABASE IF NOT EXISTS ' . $CONFIG['db']['core']['masters']['admin']['database']);
$db = null;
} catch (\Throwable $t) {
} catch (\Throwable $_) {
echo "\nCouldn't connect to MYSQL DB\n";
}
}
@ -317,7 +317,7 @@ if (\defined('RESET') && RESET === '1') {
$db->exec('DROP DATABASE IF EXISTS ' . $CONFIG['db']['core']['postgresql']['admin']['database']);
$db->exec('CREATE DATABASE ' . $CONFIG['db']['core']['postgresql']['admin']['database']);
$db = null;
} catch (\Throwable $t) {
} catch (\Throwable $_) {
echo "\nCouldn't connect to POSTGRESQL DB\n";
}
}
@ -332,7 +332,7 @@ if (\defined('RESET') && RESET === '1') {
$db->exec('DROP DATABASE IF EXISTS ' . $CONFIG['db']['core']['mssql']['admin']['database']);
$db->exec('CREATE DATABASE ' . $CONFIG['db']['core']['mssql']['admin']['database']);
$db = null;
} catch (\Throwable $t) {
} catch (\Throwable $_) {
echo "\nCouldn't connect to MSSQL DB\n";
}
}