Merge pull request #12 from CachetHQ/2.4

Update from upstream repo CachetHQ/Cachet
This commit is contained in:
Davide Bellini
2016-10-08 12:26:02 +02:00
committed by GitHub
13 changed files with 90 additions and 9 deletions

View File

@@ -110,8 +110,6 @@ class SendMaintenanceEmailNotificationHandler
'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,

View File

@@ -15,6 +15,12 @@ use Closure;
use Illuminate\Http\Request;
use Symfony\Component\HttpKernel\Exception\NotAcceptableHttpException;
/**
* This is the acceptable middleware class.
*
* @author Graham Campbell <james@alt-three.com>
* @author James Brooks <james@alt-three.com>
*/
class Acceptable
{
/**

View File

@@ -16,6 +16,13 @@ use Illuminate\Contracts\Auth\Guard;
use Illuminate\Http\Request;
use Symfony\Component\HttpKernel\Exception\HttpException;
/**
* This is the admin middleware class.
*
* @author Joseph Cohen <joe@alt-three.com>
* @author Graham Campbell <james@alt-three.com>
* @author James Brooks <james@alt-three.com>
*/
class Admin
{
/**

View File

@@ -18,6 +18,13 @@ use Illuminate\Database\Eloquent\ModelNotFoundException;
use Illuminate\Http\Request;
use Symfony\Component\HttpKernel\Exception\HttpException;
/**
* This is the api authentication middleware class.
*
* @author Joseph Cohen <joe@alt-three.com>
* @author Graham Campbell <james@alt-three.com>
* @author James Brooks <james@alt-three.com>
*/
class ApiAuthentication
{
/**

View File

@@ -16,6 +16,13 @@ use Illuminate\Contracts\Auth\Guard;
use Illuminate\Http\Request;
use Symfony\Component\HttpKernel\Exception\HttpException;
/**
* This is the authenticate middleware class.
*
* @author Joseph Cohen <joe@alt-three.com>
* @author Graham Campbell <james@alt-three.com>
* @author James Brooks <james@alt-three.com>
*/
class Authenticate
{
/**

View File

@@ -16,6 +16,13 @@ use Illuminate\Config\Repository;
use Illuminate\Http\Request;
use Jenssegers\Date\Date;
/**
* This is the localize middleware class.
*
* @author James Brooks <james@alt-three.com>
* @author Joseph Cohen <joe@alt-three.com>
* @author Graham Campbell <james@alt-three.com>
*/
class Localize
{
/**

View File

@@ -17,6 +17,13 @@ use Illuminate\Http\Request;
use Illuminate\Support\Facades\Config;
use Illuminate\Support\Facades\Redirect;
/**
* This is the ready for use middleware class.
*
* @author Graham Campbell <james@alt-three.com>
* @author James Brooks <james@alt-three.com>
* @author Joseph Cohen <joe@alt-three.com>
*/
class ReadyForUse
{
/**

View File

@@ -16,6 +16,13 @@ use Illuminate\Contracts\Auth\Guard;
use Illuminate\Http\RedirectResponse;
use Illuminate\Http\Request;
/**
* This is the redirect if authenticated middleware class.
*
* @author Graham Campbell <james@alt-three.com>
* @author Joseph Cohen <joe@alt-three.com>
* @author James Brooks <james@alt-three.com>
*/
class RedirectIfAuthenticated
{
/**

View File

@@ -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 <james@alt-three.com>
* @author James Brooks <james@alt-three.com>
* @author Joseph Cohen <joe@alt-three.com>
*/
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);

View File

@@ -15,6 +15,12 @@ use Closure;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\Redirect;
/**
* This is the subscribers configured middleware class.
*
* @author James Brooks <james@alt-three.com>
* @author Graham Campbell <james@alt-three.com>
*/
class SubscribersConfigured
{
/**

View File

@@ -15,6 +15,12 @@ use Closure;
use Illuminate\Contracts\Config\Repository;
use Illuminate\Http\Request;
/**
* This is the timezone middleware class.
*
* @author James Brooks <james@alt-three.com>
* @author Graham Campbell <james@alt-three.com>
*/
class Timezone
{
/**

View File

@@ -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>

View File

@@ -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 }}