Skip to content

Commit

Permalink
Merge pull request #12 from CachetHQ/2.4
Browse files Browse the repository at this point in the history
Update from upstream repo CachetHQ/Cachet
  • Loading branch information
billmn committed Oct 8, 2016
2 parents 2825b62 + dfeab93 commit 7dca0bb
Show file tree
Hide file tree
Showing 13 changed files with 90 additions and 9 deletions.
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

0 comments on commit 7dca0bb

Please sign in to comment.