Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update from upstream repo CachetHQ/Cachet #12

Merged
merged 4 commits into from
Oct 8, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
6 changes: 6 additions & 0 deletions app/Http/Middleware/Acceptable.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,12 @@
use Illuminate\Http\Request;
use Symfony\Component\HttpKernel\Exception\NotAcceptableHttpException;

/**
* This is the acceptable middleware class.
*
* @author Graham Campbell <[email protected]>
* @author James Brooks <[email protected]>
*/
class Acceptable
{
/**
Expand Down
7 changes: 7 additions & 0 deletions app/Http/Middleware/Admin.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,13 @@
use Illuminate\Http\Request;
use Symfony\Component\HttpKernel\Exception\HttpException;

/**
* This is the admin middleware class.
*
* @author Joseph Cohen <[email protected]>
* @author Graham Campbell <[email protected]>
* @author James Brooks <[email protected]>
*/
class Admin
{
/**
Expand Down
7 changes: 7 additions & 0 deletions app/Http/Middleware/ApiAuthentication.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,13 @@
use Illuminate\Http\Request;
use Symfony\Component\HttpKernel\Exception\HttpException;

/**
* This is the api authentication middleware class.
*
* @author Joseph Cohen <[email protected]>
* @author Graham Campbell <[email protected]>
* @author James Brooks <[email protected]>
*/
class ApiAuthentication
{
/**
Expand Down
7 changes: 7 additions & 0 deletions app/Http/Middleware/Authenticate.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,13 @@
use Illuminate\Http\Request;
use Symfony\Component\HttpKernel\Exception\HttpException;

/**
* This is the authenticate middleware class.
*
* @author Joseph Cohen <[email protected]>
* @author Graham Campbell <[email protected]>
* @author James Brooks <[email protected]>
*/
class Authenticate
{
/**
Expand Down
7 changes: 7 additions & 0 deletions app/Http/Middleware/Localize.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,13 @@
use Illuminate\Http\Request;
use Jenssegers\Date\Date;

/**
* This is the localize middleware class.
*
* @author James Brooks <[email protected]>
* @author Joseph Cohen <[email protected]>
* @author Graham Campbell <[email protected]>
*/
class Localize
{
/**
Expand Down
7 changes: 7 additions & 0 deletions app/Http/Middleware/ReadyForUse.php
Original file line number Diff line number Diff line change
Expand Up @@ -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 <[email protected]>
* @author James Brooks <[email protected]>
* @author Joseph Cohen <[email protected]>
*/
class ReadyForUse
{
/**
Expand Down
7 changes: 7 additions & 0 deletions app/Http/Middleware/RedirectIfAuthenticated.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,13 @@
use Illuminate\Http\RedirectResponse;
use Illuminate\Http\Request;

/**
* This is the redirect if authenticated middleware class.
*
* @author Graham Campbell <[email protected]>
* @author Joseph Cohen <[email protected]>
* @author James Brooks <[email protected]>
*/
class RedirectIfAuthenticated
{
/**
Expand Down
32 changes: 29 additions & 3 deletions app/Http/Middleware/SetupAlreadyCompleted.php
Original file line number Diff line number Diff line change
Expand Up @@ -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 <[email protected]>
* @author James Brooks <[email protected]>
* @author Joseph Cohen <[email protected]>
*/
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.
*
Expand All @@ -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);
Expand Down
6 changes: 6 additions & 0 deletions app/Http/Middleware/SubscribersConfigured.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,12 @@
use Illuminate\Http\Request;
use Illuminate\Support\Facades\Redirect;

/**
* This is the subscribers configured middleware class.
*
* @author James Brooks <[email protected]>
* @author Graham Campbell <[email protected]>
*/
class SubscribersConfigured
{
/**
Expand Down
6 changes: 6 additions & 0 deletions app/Http/Middleware/Timezone.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,12 @@
use Illuminate\Contracts\Config\Repository;
use Illuminate\Http\Request;

/**
* This is the timezone middleware class.
*
* @author James Brooks <[email protected]>
* @author Graham Campbell <[email protected]>
*/
class Timezone
{
/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<tr>
<td>
<p class="compressed">
<strong>{!! $status !!} @if($has_component) ({{ $component_name }}) @endif</strong>
<strong>{!! $status !!}</strong>
{!! $html_content !!}
{!! $timestamp !!}
</p>
Expand Down
3 changes: 0 additions & 3 deletions resources/views/emails/incidents/maintenance-text.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
Expand Down