RewriteBase /
RewriteRule ^viewerh/(.+)$ https://toolbox.fluidbook.com/fluidbook-publication/preview/$1 [R=308,L]
+ RewriteRule ^viewer/(.+)$ https://toolbox.fluidbook.com/fluidbook-publication/preview/$1 [R=308,L]
RewriteRule ^viewers/(.+)$ https://toolbox.fluidbook.com/fluidbook-publication/preview/scorm/$1 [R=308,L]
RewriteRule ^publications$ https://toolbox.fluidbook.com/fluidbook-publication/ [R=308,L]
--- /dev/null
+<?php
+
+namespace App\Console\Commands;
+
+use App\Jobs\AuditLinkRegister;
+use App\Models\FluidbookPublication;
+use Illuminate\Console\Command;
+
+class HemsleyEnableLinkShortener extends Command
+{
+ protected $signature = 'hemsleyfraser:enablelinkshortener';
+
+ public function handle()
+ {
+ /** @var FluidbookPublication[] $fluidbooks */
+ $fluidbooks = \App\Models\FluidbookPublication::where('invoicable_company', 1880)->orderBy('id', 'ASC')->get();
+ foreach ($fluidbooks as $fb) {
+ $fb->linkShortener = 3;
+ $fb->saveQuietly();
+ }
+
+ AuditLinkRegister::dispatchSync();
+ }
+}
500 => __('There is a problem on the server. This should be temporary'),
502 => __('There is a problem on the server. This should be temporary'),
503 => __('There is a problem on the server. This should be temporary'),
+ 601 => __('There was too many redirection. This could be due a redirection infinite loop'),
628 => __('The auditing tool was blocked by CloudFlare DDOS Protection. Please check manually'),
603 => __('The auditing tool was blocked by CloudFlare DDOS Protection. Please check manually'),
695 => __('There is a problem with the SSL certificate. The auditing tool could not check if the URL is valid or not. Please check manually'),
protected function setupDownloadDefaults()
{
- $this->crud->addButtonFromView('line', 'download', 'fluidbook_publication.download', 'end');
+ if (backpack_user() !== null && backpack_user()->company != 1880) {
+ $this->crud->addButtonFromView('line', 'download', 'fluidbook_publication.download', 'end');
+ }
}
protected function delivery($id)
use App\Models\FluidbookAuditLink;
use App\Models\FluidbookPublication;
use App\Models\FluidbookCollection;
+use App\Models\LinkShortener;
use App\Models\ShortLink;
use Fluidbook\Tools\Links\Link as LinkAlias;
use Illuminate\Support\Arr;
$publications = array_merge($publications, $collection->getFluidbooksID());
}
+ $linkShortenerPublications = [];
+
// Add fluidbooks that have enabled linkShortener
foreach (DB::table('fluidbook_publication')->get() as $p) {
$s = json_decode($p->settings);
if (isset($s->linkShortener) && $s->linkShortener && $s->linkShortener !== 'none') {
$publications[] = $p->id;
+ $linkShortenerPublications[$p->id] = $s->linkShortener;
}
}
return (preg_match('/^https?:\/\//', trim($n['to']))) || $n['type'] == LinkAlias::WEBVIDEO;
});
+ $ls = $linkShortenerPublications[$publication] ?? false;
+
foreach ($links as $link) {
$seen[] = $publication . '_' . $link['uid'];
$link['to'] = trim($link['to']);
}
}
+ if ($ls) {
+ LinkShortener::shorturl($link['to'], $ls);
+ }
+
if (isset($existing[$publication . '_' . $link['uid']])) {
$l = $existing[$publication . '_' . $link['uid']];
if ($l['url'] == $link['to'] && $l['page'] == $link['page']) {