From c5afbb9131697900eca783f854b3ac0ad2438922 Mon Sep 17 00:00:00 2001 From: ro Date: Wed, 17 Jul 2024 15:08:10 -0600 Subject: [PATCH] API Decouplng Part 2 removed all remaining API requests from the front end and removed the FipamoAdminAPI js file, changing it to ContentRequest as it now handles posting data to the system directly, authenticating it self by checking the embedded CSRF token that regulary rotates also renamed MaintenanceManager to Maintenance request and moved it to the same dir as ContentRequest as they are both libraries that connect to the backend --- app/Http/Controllers/RouteGetController.php | 38 +++++++++-- app/Http/Controllers/RoutePostController.php | 67 ++++++++++++++++++- app/Http/Controllers/RoutePutController.php | 31 +++++++-- app/Services/Upkeep/MaintenanceService.php | 4 +- .../assets/scripts/dash/app/actions/Mailer.js | 4 +- .../dash/app/controllers/DashManager.js | 44 ------------ .../dash/app/controllers/InitController.js | 4 +- .../scripts/dash/app/controllers/NavIndex.js | 8 +-- .../dash/app/controllers/PageEditor.js | 16 ++--- .../dash/app/controllers/SettingsIndex.js | 20 +++--- .../assets/scripts/dash/app/ui/FileManager.js | 12 ++-- .../{FipamoAdminAPI.js => ContentRequest.js} | 4 +- .../MaintenanceRequest.js} | 48 ++++--------- resources/views/back/settings.blade.php | 4 +- routes/api.php | 4 -- 15 files changed, 176 insertions(+), 132 deletions(-) delete mode 100644 public/assets/scripts/dash/app/controllers/DashManager.js rename public/assets/scripts/dash/libraries/{FipamoAdminAPI.js => ContentRequest.js} (99%) rename public/assets/scripts/dash/{app/controllers/MaintenanceManager.js => libraries/MaintenanceRequest.js} (84%) diff --git a/app/Http/Controllers/RouteGetController.php b/app/Http/Controllers/RouteGetController.php index d15665f..467c960 100644 --- a/app/Http/Controllers/RouteGetController.php +++ b/app/Http/Controllers/RouteGetController.php @@ -3,6 +3,7 @@ namespace App\Http\Controllers; use App\Interfaces\MemberRepositoryInterface; +use App\Services\Data\SettingsService; class RouteGetController extends Controller { @@ -11,6 +12,7 @@ class RouteGetController extends Controller protected $theme; protected $front; protected $member; + protected $settings; public function __construct( DashController $dashController, @@ -18,12 +20,14 @@ class RouteGetController extends Controller ThemeController $themeController, FrontController $frontController, MemberRepositoryInterface $memberRepo, + SettingsService $settingsService, ) { - $this->dash = $dashController; - $this->gate = $authController; - $this->theme = $themeController; - $this->front = $frontController; - $this->member = $memberRepo; + $this->dash = $dashController; + $this->gate = $authController; + $this->theme = $themeController; + $this->front = $frontController; + $this->member = $memberRepo; + $this->settings = $settingsService; } public function handleRequest($first = null, $second = null, $third = null, $fourth = null) @@ -52,9 +56,33 @@ class RouteGetController extends Controller case 'archives': return $this->front->page($first, $second, $third); break; + case 'backup': + return $this->downloadBackup($second); + break; } } else { return $this->front->index($first, $second, $third); } } + + private function downloadBackup($type) + { + if ($this->member::status()) { + $latest = ''; + $file = ''; + if ($type == 'content-download') { + $latest = $this->settings->getGlobal()['last_content_backup']; + $file = 'backup-content-' . $latest . '.zip'; + } else { + $latest = $this->settings->getGlobal()['last_files_backup']; + $file = 'backup-files-' . $latest . '.zip'; + } + + return response()->download( + '../content/backups/' . $file, + $file, + ['Content-Type: application/zip'] + ); + } + } } diff --git a/app/Http/Controllers/RoutePostController.php b/app/Http/Controllers/RoutePostController.php index 25e7781..d1ab009 100644 --- a/app/Http/Controllers/RoutePostController.php +++ b/app/Http/Controllers/RoutePostController.php @@ -6,23 +6,51 @@ use Illuminate\Http\Request; use Illuminate\Support\Facades\Mail; use App\Mail\SystemEmail; use App\Interfaces\PageRepositoryInterface; +use App\Services\Upkeep\MaintenanceService; +use App\Services\Assets\FileUploadService; +use App\Interfaces\MemberRepositoryInterface; +use App\Services\Data\SettingsService; +use App\Services\UpKeep\InitService; +use App\Services\UpKeep\ResetService; class RoutePostController extends Controller { protected $page; + protected $gate; + protected $maintenance; + protected $upload; + protected $settings; + protected $member; + protected $init; + protected $reset; public function __construct( PageRepositoryInterface $pageRepo, AuthController $authController, + MaintenanceService $maintenanceService, + FileUploadService $fileUploadService, + SettingsService $settingsService, + MemberRepositoryInterface $memberRepo, + InitService $initService, + ResetService $resetService, ) { - $this->page = $pageRepo; - $this->gate = $authController; + $this->page = $pageRepo; + $this->gate = $authController; + $this->maintenance = $maintenanceService; + $this->upload = $fileUploadService; + $this->settings = $settingsService; + $this->member = $memberRepo; + $this->init = $initService; + $this->reset = $resetService; } public function handleRequest(Request $request) { $path = explode('/', $request->path()); switch ($path[0]) { + case 'init': + return $this->initTask($path[1], $request); + break; case 'login': return $this->gate->enter($request); break; @@ -36,9 +64,44 @@ class RoutePostController extends Controller return $this->sendNotify($request); } break; + case 'upload': + $type = null; + $result = $result = $this->upload->handleFile($request, $type); + //update configs for specfic uploads + switch ($request['source']) { + case 'avatar-upload': + $member = []; + $member = session('member'); + $member['avatar'] = $result['filePath']; + $member = (object) $member; + $this->member->update($member); + break; + case 'background-upload': + $this->settings->updateGlobalData('background', $result['filePath']); + break; + } + return $result; + break; } } + private function initTask($task, $request) + { + $result = []; + switch ($task) { + case 'fresh': + $result = $this->init->fresh(json_decode($request->getContent())); + break; + case 'restore': + $result = $this->init->restore($request); + break; + case 'reset': + $result = $this->reset->site($request); + break; + } + return response()->json($result)->header('Content-Type', 'application/json'); + } + private function sendNotify($request) { $result = []; diff --git a/app/Http/Controllers/RoutePutController.php b/app/Http/Controllers/RoutePutController.php index 12075ba..fb3a078 100644 --- a/app/Http/Controllers/RoutePutController.php +++ b/app/Http/Controllers/RoutePutController.php @@ -7,6 +7,7 @@ use App\Services\Assets\AssetService; use App\Services\Assets\RenderService; use App\Interfaces\MemberRepositoryInterface; use App\Services\Data\SettingsService; +use App\Services\Upkeep\MaintenanceService; use Illuminate\Http\Request; class RoutePutController extends Controller @@ -16,6 +17,7 @@ class RoutePutController extends Controller protected $render; protected $settings; protected $member; + protected $maintenance; public function __construct( PageRepositoryInterface $pageRepo, @@ -23,12 +25,14 @@ class RoutePutController extends Controller RenderService $renderService, SettingsService $settingsService, MemberRepositoryInterface $memberRepo, + MaintenanceService $maintenanceService, ) { - $this->page = $pageRepo; - $this->assets = $assetService; - $this->render = $renderService; - $this->settings = $settingsService; - $this->member = $memberRepo; + $this->page = $pageRepo; + $this->assets = $assetService; + $this->render = $renderService; + $this->settings = $settingsService; + $this->member = $memberRepo; + $this->maintenance = $maintenanceService; } public function handleRequest(Request $request) @@ -43,6 +47,23 @@ class RoutePutController extends Controller case 'settings': return $this->settingsTasks($request, $path[1]); break; + case 'backup': + return $this->createBackup($request); + break; + } + } + + private function createBackup($request) + { + $body = json_decode($request->getContent()); + if ($body->task == 'content_backup') { + return response()->json( + $this->maintenance->createContentBackUp() + )->header('Content-Type', 'application/json'); + } else { + return response()->json( + $this->maintenance->createFileBackUp() + )->header('Content-Type', 'application/json'); } } diff --git a/app/Services/Upkeep/MaintenanceService.php b/app/Services/Upkeep/MaintenanceService.php index fbcf883..eef2524 100644 --- a/app/Services/Upkeep/MaintenanceService.php +++ b/app/Services/Upkeep/MaintenanceService.php @@ -21,7 +21,7 @@ class MaintenanceService public function createContentBackUp() { //make sure back directory is there - $stamp = Carbon::now()->format("YmdGis"); + $stamp = Carbon::now()->format("YmdHis"); if (!is_dir(env('FIPAMO_BACKUPS'))) { mkdir(env('FIPAMO_BACKUPS'), 0755, true); } @@ -130,7 +130,7 @@ class MaintenanceService public function createFileBackUp() { - $stamp = Carbon::now()->format("YmdGis"); + $stamp = Carbon::now()->format("YmdHis"); $zip = new \ZipArchive(); $zip->open( env('FIPAMO_BACKUPS') . '/backup-files-' . $stamp . '.zip', diff --git a/public/assets/scripts/dash/app/actions/Mailer.js b/public/assets/scripts/dash/app/actions/Mailer.js index cd04234..1e73214 100644 --- a/public/assets/scripts/dash/app/actions/Mailer.js +++ b/public/assets/scripts/dash/app/actions/Mailer.js @@ -1,4 +1,4 @@ -import FipamoAdminAPI from '../../libraries/FipamoAdminAPI.js'; +import ContentRequest from '../../libraries/ContentRequest.js'; import Notficaton from '../ui/Notifications.js'; const notify = new Notficaton(); export default class Mailer { @@ -20,7 +20,7 @@ export default class Mailer { content: text, mail_task: task }; - let admin = new FipamoAdminAPI(); + let admin = new ContentRequest(); admin .sendMail(mailData) .then(result => { diff --git a/public/assets/scripts/dash/app/controllers/DashManager.js b/public/assets/scripts/dash/app/controllers/DashManager.js deleted file mode 100644 index 375012f..0000000 --- a/public/assets/scripts/dash/app/controllers/DashManager.js +++ /dev/null @@ -1,44 +0,0 @@ -import PostIndex from './PostIndex'; -import SettingsIndex from './SettingsIndex'; -import NaviIndex from './NavIndex'; -import Menu from '../ui/Menu'; - -export default class DashManager { - //-------------------------- - // constructor - //-------------------------- - constructor() { - this.currentDisplay = ''; - this.urlPieces = document.URL.split('/'); - this.chooseDisplay(this.urlPieces[4], this.urlPieces[5]); - //start main menu handler - new Menu(); - } - //-------------------------- - // methods - //-------------------------- - start() {} - - chooseDisplay(section, page) { - this.currentDisplay = ''; - switch (section) { - case 'page': - this.currentDisplay = new PostIndex(page); - break; - case 'settings': - this.currentDisplay = new SettingsIndex(); - break; - case 'navigation': - this.currentDisplay = new NaviIndex(); - break; - - default: - //just chill - break; - } - this.start(); - } - //-------------------------- - // event handlers - //-------------------------- -} diff --git a/public/assets/scripts/dash/app/controllers/InitController.js b/public/assets/scripts/dash/app/controllers/InitController.js index e8b1256..a8c9ddb 100644 --- a/public/assets/scripts/dash/app/controllers/InitController.js +++ b/public/assets/scripts/dash/app/controllers/InitController.js @@ -1,5 +1,5 @@ -import FipamoAdminAPI from '../../libraries/FipamoAdminAPI.js'; -import Maintenance from './MaintenanceManager.js'; +import ContentRequest from '../../libraries/ContentRequest.js'; +import Maintenance from '../../libraries/MaintenanceRequest.js'; import DataUitls from '../utils/DataUtils.js'; import * as DataEvent from '../events/DataEvent.js'; import Notfications from '../ui/Notifications.js'; diff --git a/public/assets/scripts/dash/app/controllers/NavIndex.js b/public/assets/scripts/dash/app/controllers/NavIndex.js index 6872fef..8fb6744 100644 --- a/public/assets/scripts/dash/app/controllers/NavIndex.js +++ b/public/assets/scripts/dash/app/controllers/NavIndex.js @@ -1,4 +1,4 @@ -import FipamoAdminAPI, { TASK_SYNC_NAV } from '../../libraries/FipamoAdminAPI.js'; +import ContentRequest, { TASK_SYNC_NAV } from '../../libraries/ContentRequest.js'; import NavActions from '../actions/NavActions.js'; import * as DataEvent from '../events/DataEvent.js'; import Notifications from '../ui/Notifications.js'; @@ -11,7 +11,7 @@ export default class NavIndex { //-------------------------- constructor() { this.processing = false; - this.admin = new FipamoAdminAPI(null); + this.cr = new ContentRequest(null); this.start(); } //-------------------------- @@ -24,7 +24,7 @@ export default class NavIndex { onUpdate: () => { new NavActions().syncMenu().then(data => { notify.alert('Updating Menu', null); - self.admin.sync(TASK_SYNC_NAV, data).then(r => { + self.cr.sync(TASK_SYNC_NAV, data).then(r => { if (r.type == DataEvent.MENU_UPDATED) { notify.alert(r.message, true); } else { @@ -55,7 +55,7 @@ export default class NavIndex { data.remove = e.target.getAttribute('data-uuid'); notify.alert('Editing Menu', null); self.processing = true; - self.admin.sync(TASK_SYNC_NAV, data).then(r => { + self.cr.sync(TASK_SYNC_NAV, data).then(r => { self.processing = false; if (r.type == DataEvent.MENU_UPDATED) { notify.alert(r.message, true); diff --git a/public/assets/scripts/dash/app/controllers/PageEditor.js b/public/assets/scripts/dash/app/controllers/PageEditor.js index 2e039d6..3ac893a 100644 --- a/public/assets/scripts/dash/app/controllers/PageEditor.js +++ b/public/assets/scripts/dash/app/controllers/PageEditor.js @@ -1,10 +1,10 @@ //TOOLS -import FipamoAdminAPI, { +import ContentRequest, { TASK_PAGE_CREATE, TASK_PAGE_EDIT, TASK_PAGE_DELETE -} from '../../libraries/FipamoAdminAPI.js'; -import Maintenance from './MaintenanceManager.js'; +} from '../../libraries/ContentRequest.js'; +import Maintenance from '../../libraries/MaintenanceRequest.js'; import * as DataEvent from '../events/DataEvent.js'; import PageActions from '../actions/PageActions.js'; import * as EditorEvent from '../events/EditorEvent.js'; @@ -19,8 +19,8 @@ export default class PostEditor { constructor() { this.processing = false; let self = 'this'; - this.admin = new FipamoAdminAPI(null, document.getElementById('notify-progress')); - this.mm = new Maintenance(null, null); + this.cr = new ContentRequest(null, document.getElementById('notify-progress')); + this.mr = new Maintenance(null, null); this.urlPieces = document.URL.split('/'); this.post = []; this.postID = null; @@ -145,7 +145,7 @@ export default class PostEditor { new PageActions().collectInfo(this.fm.getFileOrder()).then(page => { self.processing = true; notify.alert('Writing down changes', null); - self.admin + self.cr .pageActions(task, page) .then(r => { self.processing = false; @@ -179,7 +179,7 @@ export default class PostEditor { .collectInfo(this.fm.getFileOrder()) .then(page => { self.processing = true; - this.admin + this.cr .pageActions(TASK_PAGE_DELETE, page) .then(() => { self.processing = false; @@ -207,7 +207,7 @@ export default class PostEditor { let upload = new FormData(); upload.enctype = 'multipart/form-data'; upload.append('upload_files[]', files[0], files[0].name); - this.mm + this.mr .filesUpload(files[0].type, upload) .then(result => { if (result.message == 'File Uploaded. Great!') { diff --git a/public/assets/scripts/dash/app/controllers/SettingsIndex.js b/public/assets/scripts/dash/app/controllers/SettingsIndex.js index f20d5ae..48521e8 100644 --- a/public/assets/scripts/dash/app/controllers/SettingsIndex.js +++ b/public/assets/scripts/dash/app/controllers/SettingsIndex.js @@ -1,6 +1,6 @@ import SettingsActions from '../actions/SettingsActions.js'; -import Maintenance from './MaintenanceManager.js'; -import FipamoAdminAPI, { TASK_SYNC_SETTNIGS } from '../../libraries/FipamoAdminAPI.js'; +import Maintenance from '../../libraries/MaintenanceRequest.js'; +import ContentRequest, { TASK_SYNC_SETTNIGS } from '../../libraries/ContentRequest.js'; import * as DataEvent from '../../../dash/app/events/DataEvent.js'; import Mailer from '../actions/Mailer.js'; import Notifications from '../ui/Notifications.js'; @@ -12,8 +12,8 @@ export default class SettingsIndex { constructor() { this.processing = false; this.start(); - this.admin = new FipamoAdminAPI(null); - this.mm = new Maintenance(null, null); + this.cr = new ContentRequest(null); + this.mr = new Maintenance(null, null); } //-------------------------- // methods @@ -26,7 +26,7 @@ export default class SettingsIndex { .getInfo() .then(data => { notify.alert('Saving Settings', null); - self.admin.sync(TASK_SYNC_SETTNIGS, data).then(r => { + self.cr.sync(TASK_SYNC_SETTNIGS, data).then(r => { if (r.type == DataEvent.SETTINGS_UPDATED) { notify.alert(r.message, true); } else { @@ -98,7 +98,7 @@ export default class SettingsIndex { 'This cannot be undone, so please confirm.' ) ) { - this.mm + this.mr .reset() .then(r => { if (r.type == 'COOL') { @@ -223,7 +223,7 @@ export default class SettingsIndex { upload.append('source', type); upload.append('upload_files[]', files[0], files[0].name); - this.mm + this.mr .filesUpload(files[0].type, upload) .then(r => { if (type == 'avatar-upload') { @@ -248,7 +248,7 @@ export default class SettingsIndex { let task = { task: 'PUBLISH_ALL' }; this.processing = true; notify.alert('Publishing site...', null); - this.admin + this.cr .publish(task) .then(r => { self.processing = false; @@ -274,7 +274,7 @@ export default class SettingsIndex { notify.alert('Creating File Backup', null); type = { task: 'file_backup' }; } - this.mm + this.mr .backup(type) .then(r => { notify.alert(r.message, true); @@ -292,7 +292,7 @@ export default class SettingsIndex { let task = { task: 'cleanup pages indexes' }; this.processing = true; notify.alert('Cleaning up page indexes', null); - this.admin + this.cr .handleReindex(task) .then(r => { self.processing = false; diff --git a/public/assets/scripts/dash/app/ui/FileManager.js b/public/assets/scripts/dash/app/ui/FileManager.js index 44b6c72..bc7ee04 100644 --- a/public/assets/scripts/dash/app/ui/FileManager.js +++ b/public/assets/scripts/dash/app/ui/FileManager.js @@ -2,7 +2,7 @@ import Sortable from '../vendor/sortable.core.esm.js'; import anime from '../vendor/anime.es.js'; import DataUtils from '../utils/DataUtils.js'; import Notfications from './Notifications.js'; -import Maintenance from '../controllers/MaintenanceManager.js'; +import Maintenance from '../../libraries/MaintenanceRequest.js'; const notify = new Notfications(); export default class FileManager { @@ -10,7 +10,7 @@ export default class FileManager { // constructor //-------------------------- constructor(upload, input, imageList, fileList) { - this.mm = new Maintenance(null, null, document.getElementById('notify-progress')); + this.mr = new Maintenance(null, null, document.getElementById('notify-progress')); this.upload = upload; this.input = input; this.imageList = imageList; @@ -115,7 +115,7 @@ export default class FileManager { progress = document.getElementById( 'pgs' + item.getAttribute('id') ); - self.mm + self.mr .filesUpload(theFile.type, upload, progress) .then(result => { item.setAttribute('data-id', result.filePath); @@ -140,7 +140,7 @@ export default class FileManager { progress = document.getElementById( 'pgs' + item.getAttribute('id') ); - self.mm + self.mr .filesUpload(theFile.type, upload, progress) .then(result => { item.setAttribute('data-id', result.filePath); @@ -166,7 +166,7 @@ export default class FileManager { progress = document.getElementById( 'pgs' + item.getAttribute('id') ); - self.mm + self.mr .filesUpload(theFile.type, upload, progress) .then(result => { item.setAttribute('data-id', result.filePath); @@ -195,7 +195,7 @@ export default class FileManager { progress = document.getElementById( 'pgs' + item.getAttribute('id') ); - self.mm + self.mr .filesUpload(theFile.type, upload, progress) .then(result => { item.setAttribute('data-id', result.filePath); diff --git a/public/assets/scripts/dash/libraries/FipamoAdminAPI.js b/public/assets/scripts/dash/libraries/ContentRequest.js similarity index 99% rename from public/assets/scripts/dash/libraries/FipamoAdminAPI.js rename to public/assets/scripts/dash/libraries/ContentRequest.js index c0f27b8..dba8aa8 100644 --- a/public/assets/scripts/dash/libraries/FipamoAdminAPI.js +++ b/public/assets/scripts/dash/libraries/ContentRequest.js @@ -41,7 +41,7 @@ export const API_ACCESS_BAD = 'apiUseNotAuthorized'; * A can of methods used to edit install settings, navigation pages and content pages */ -class FipamoAdminAPI { +class ContentRequest { /** * @constructor * @param {string} baseURL - url of site; uses local when empty @@ -413,4 +413,4 @@ class FipamoAdminAPI { } } -export { FipamoAdminAPI as default }; +export { ContentRequest as default }; diff --git a/public/assets/scripts/dash/app/controllers/MaintenanceManager.js b/public/assets/scripts/dash/libraries/MaintenanceRequest.js similarity index 84% rename from public/assets/scripts/dash/app/controllers/MaintenanceManager.js rename to public/assets/scripts/dash/libraries/MaintenanceRequest.js index 0e2c9a9..11932af 100644 --- a/public/assets/scripts/dash/app/controllers/MaintenanceManager.js +++ b/public/assets/scripts/dash/libraries/MaintenanceRequest.js @@ -7,19 +7,16 @@ export const REQUEST_TYPE_DELETE = 'DELETE'; export const CONTENT_TYPE_JSON = 'json'; export const CONTENT_TYPE_FORM = 'x-www-form-urlencoded'; //** API URLS **// -export const API_STATUS = '/api/v1/status'; -export const API_INIT = '/api/v1/init'; -export const API_RESTORE = '/api/v1/restore'; -export const API_RESET = '/api/v1/reset'; -export const API_GET_SECRET = '/api/v1/get-secret'; -export const API_RESET_PASS = '/api/v1/reset-password'; -export const API_CREATE_BACKUP = '/api/v1/backup/create'; -export const API_DOWNLOAD_BACKUP = '/api/v1/backup/download'; -export const API_RESTORE_BACKUP = '/api/v1/backup/restore'; -export const API_UPLOAD_AVATAR = '/api/v1/settings/add-avatar'; -export const API_UPLOAD_BACKGROUND = '/api/v1/settings/add-feature-background'; -export const API_IMAGE_UPLOAD = '/api/v1/page/add-entry-image'; -export const API_FILES_UPLOAD = '/api/v1/files'; +export const API_INIT = '/init/fresh'; +export const API_RESTORE = '/init/restore'; +export const API_RESET = '/init/reset'; +export const API_CREATE_BACKUP = '/backup/create'; +export const API_DOWNLOAD_BACKUP = '/backup/download'; +export const API_RESTORE_BACKUP = '/backup/restore'; +export const API_FILES_UPLOAD = '/upload/files'; + +//export const API_RESET_PASS = '/api/v1/reset-password'; + //** API TASKS **// export const TASK_SITE_INIT = 'blogInit'; export const TASK_BACKUP_RESTORE = 'restoreBackup'; @@ -58,19 +55,6 @@ class MaintenanceManager { this.key = null; if (key) this.key = key; if (baseURL) this.baseURL = baseURL; - //if key is valid, checks to see if a session is active and returns - this._request( - this.baseURL - ? this.baseURL + API_STATUS + '?key=' + this.key - : API_STATUS + '?key=' + this.key - ).then(response => { - if (response.type === API_ACCESS_GOOD) { - this.token = response.token; - } else { - //don't set token - //console.log("NO TOKEN"); - } - }); } /** @@ -271,6 +255,10 @@ class MaintenanceManager { self.handleLoadProgress(e, progressBar) ); request.open(requestType, requestURL, true); + request.setRequestHeader( + 'X-CSRF-TOKEN', + document.querySelector('meta[name="csrf-token"]').content + ); request.onload = () => { if (request.status == 200) { let response = JSON.parse(request['response']); @@ -281,14 +269,6 @@ class MaintenanceManager { } }; if (requestType == REQUEST_TYPE_PUT || requestType == REQUEST_TYPE_POST) { - if ( - eventType === TASK_UPLOAD_FILES || - eventType === TASK_BACKUP_CREATE || - eventType === TASK_SITE_INIT - ) { - request.setRequestHeader('fipamo-access-token', self.token); - } - switch (contentType) { case CONTENT_TYPE_JSON: request.setRequestHeader( diff --git a/resources/views/back/settings.blade.php b/resources/views/back/settings.blade.php index c862106..f8fa25d 100644 --- a/resources/views/back/settings.blade.php +++ b/resources/views/back/settings.blade.php @@ -100,7 +100,7 @@ @if($lastContentBackup != '') MOST RECENT: - {{ $lastContentBackup }}
+ {{ $lastContentBackup }}
@else span No back ups. Frowny face. @endif @@ -116,7 +116,7 @@ @if($lastFilesBackup != '') MOST RECENT: - {{ $lastFilesBackup }}
+ {{ $lastFilesBackup }}
@else span No back ups. Frowny face. @endif diff --git a/routes/api.php b/routes/api.php index bb6fb86..64ae2ad 100644 --- a/routes/api.php +++ b/routes/api.php @@ -1,7 +1,6 @@