diff --git a/app/Bus/Handlers/Events/Incident/SendMaintenanceEmailNotificationHandler.php b/app/Bus/Handlers/Events/Incident/SendMaintenanceEmailNotificationHandler.php index d87abf6a8ae3..c9a12462d416 100644 --- a/app/Bus/Handlers/Events/Incident/SendMaintenanceEmailNotificationHandler.php +++ b/app/Bus/Handlers/Events/Incident/SendMaintenanceEmailNotificationHandler.php @@ -110,8 +110,6 @@ public function notify(MaintenanceWasScheduledEvent $event, $subscriber) 'subject' => trans('cachet.subscriber.email.maintenance.subject', [ 'name' => $incident->name, ]), - 'has_component' => ($event->incident->component) ? true : false, - 'component_name' => $component ? $component->name : null, 'name' => $incident->name, 'timestamp' => $incident->scheduled_at_formatted, 'status' => $incident->human_status, diff --git a/app/Http/Middleware/Acceptable.php b/app/Http/Middleware/Acceptable.php index 2c22a6a21e26..7db13506338d 100644 --- a/app/Http/Middleware/Acceptable.php +++ b/app/Http/Middleware/Acceptable.php @@ -15,6 +15,12 @@ use Illuminate\Http\Request; use Symfony\Component\HttpKernel\Exception\NotAcceptableHttpException; +/** + * This is the acceptable middleware class. + * + * @author Graham Campbell + * @author James Brooks + */ class Acceptable { /** diff --git a/app/Http/Middleware/Admin.php b/app/Http/Middleware/Admin.php index 5088b091ac20..5c83c82141e8 100644 --- a/app/Http/Middleware/Admin.php +++ b/app/Http/Middleware/Admin.php @@ -16,6 +16,13 @@ use Illuminate\Http\Request; use Symfony\Component\HttpKernel\Exception\HttpException; +/** + * This is the admin middleware class. + * + * @author Joseph Cohen + * @author Graham Campbell + * @author James Brooks + */ class Admin { /** diff --git a/app/Http/Middleware/ApiAuthentication.php b/app/Http/Middleware/ApiAuthentication.php index f4c10611d6f4..0ae7a0683aad 100644 --- a/app/Http/Middleware/ApiAuthentication.php +++ b/app/Http/Middleware/ApiAuthentication.php @@ -18,6 +18,13 @@ use Illuminate\Http\Request; use Symfony\Component\HttpKernel\Exception\HttpException; +/** + * This is the api authentication middleware class. + * + * @author Joseph Cohen + * @author Graham Campbell + * @author James Brooks + */ class ApiAuthentication { /** diff --git a/app/Http/Middleware/Authenticate.php b/app/Http/Middleware/Authenticate.php index 0400413194c2..6139df30c200 100644 --- a/app/Http/Middleware/Authenticate.php +++ b/app/Http/Middleware/Authenticate.php @@ -16,6 +16,13 @@ use Illuminate\Http\Request; use Symfony\Component\HttpKernel\Exception\HttpException; +/** + * This is the authenticate middleware class. + * + * @author Joseph Cohen + * @author Graham Campbell + * @author James Brooks + */ class Authenticate { /** diff --git a/app/Http/Middleware/Localize.php b/app/Http/Middleware/Localize.php index 718e2ddb74d2..62948a855966 100644 --- a/app/Http/Middleware/Localize.php +++ b/app/Http/Middleware/Localize.php @@ -16,6 +16,13 @@ use Illuminate\Http\Request; use Jenssegers\Date\Date; +/** + * This is the localize middleware class. + * + * @author James Brooks + * @author Joseph Cohen + * @author Graham Campbell + */ class Localize { /** diff --git a/app/Http/Middleware/ReadyForUse.php b/app/Http/Middleware/ReadyForUse.php index 364c7f42a50d..b6c33281607b 100644 --- a/app/Http/Middleware/ReadyForUse.php +++ b/app/Http/Middleware/ReadyForUse.php @@ -17,6 +17,13 @@ use Illuminate\Support\Facades\Config; use Illuminate\Support\Facades\Redirect; +/** + * This is the ready for use middleware class. + * + * @author Graham Campbell + * @author James Brooks + * @author Joseph Cohen + */ class ReadyForUse { /** diff --git a/app/Http/Middleware/RedirectIfAuthenticated.php b/app/Http/Middleware/RedirectIfAuthenticated.php index 7b79128b3a20..57f5958e6b59 100644 --- a/app/Http/Middleware/RedirectIfAuthenticated.php +++ b/app/Http/Middleware/RedirectIfAuthenticated.php @@ -16,6 +16,13 @@ use Illuminate\Http\RedirectResponse; use Illuminate\Http\Request; +/** + * This is the redirect if authenticated middleware class. + * + * @author Graham Campbell + * @author Joseph Cohen + * @author James Brooks + */ class RedirectIfAuthenticated { /** diff --git a/app/Http/Middleware/SetupAlreadyCompleted.php b/app/Http/Middleware/SetupAlreadyCompleted.php index 96db9729f5f3..d8d664ef084a 100644 --- a/app/Http/Middleware/SetupAlreadyCompleted.php +++ b/app/Http/Middleware/SetupAlreadyCompleted.php @@ -12,12 +12,38 @@ namespace CachetHQ\Cachet\Http\Middleware; use Closure; +use Illuminate\Contracts\Config\Repository; use Illuminate\Http\Request; -use Illuminate\Support\Facades\Config; use Illuminate\Support\Facades\Redirect; +/** + * This is the setup already completed middelware class. + * + * @author Graham Campbell + * @author James Brooks + * @author Joseph Cohen + */ class SetupAlreadyCompleted { + /** + * The config repository instance. + * + * @var \Illuminate\Contracts\Config\Repository + */ + protected $config; + + /** + * Creates a new setup already completed middleware instance. + * + * @param \Illuminate\Contracts\Config\Repository $config + * + * @return void + */ + public function __construct(Repository $config) + { + $this->config = $config; + } + /** * Handle an incoming request. * @@ -28,8 +54,8 @@ class SetupAlreadyCompleted */ public function handle(Request $request, Closure $next) { - if (Config::get('setting.app_name')) { - return Redirect::to('dashboard'); + if ($this->config->get('setting.app_name')) { + return Redirect::route('dashboard.index'); } return $next($request); diff --git a/app/Http/Middleware/SubscribersConfigured.php b/app/Http/Middleware/SubscribersConfigured.php index 50cdeedb6edf..d549555f68fc 100644 --- a/app/Http/Middleware/SubscribersConfigured.php +++ b/app/Http/Middleware/SubscribersConfigured.php @@ -15,6 +15,12 @@ use Illuminate\Http\Request; use Illuminate\Support\Facades\Redirect; +/** + * This is the subscribers configured middleware class. + * + * @author James Brooks + * @author Graham Campbell + */ class SubscribersConfigured { /** diff --git a/app/Http/Middleware/Timezone.php b/app/Http/Middleware/Timezone.php index 8b56ddbbdbee..40afe9e066a7 100644 --- a/app/Http/Middleware/Timezone.php +++ b/app/Http/Middleware/Timezone.php @@ -15,6 +15,12 @@ use Illuminate\Contracts\Config\Repository; use Illuminate\Http\Request; +/** + * This is the timezone middleware class. + * + * @author James Brooks + * @author Graham Campbell + */ class Timezone { /** diff --git a/resources/views/emails/incidents/maintenance-html.blade.php b/resources/views/emails/incidents/maintenance-html.blade.php index c30598c001b9..b521492502ba 100644 --- a/resources/views/emails/incidents/maintenance-html.blade.php +++ b/resources/views/emails/incidents/maintenance-html.blade.php @@ -7,7 +7,7 @@

- {!! $status !!} @if($has_component) ({{ $component_name }}) @endif + {!! $status !!} {!! $html_content !!} {!! $timestamp !!}

diff --git a/resources/views/emails/incidents/maintenance-text.blade.php b/resources/views/emails/incidents/maintenance-text.blade.php index 0702491199ec..6c2d54bbfc27 100644 --- a/resources/views/emails/incidents/maintenance-text.blade.php +++ b/resources/views/emails/incidents/maintenance-text.blade.php @@ -4,9 +4,6 @@ {!! $text_content !!} {!! $timestamp !!} -@if($has_component) -({{ $component_name }}) -@endif {!! trans('cachet.subscriber.email.manage') !!} {{ $manage_link }} {!! trans('cachet.subscriber.email.unsubscribe') !!} {{ $unsubscribe_link }}