Subscribers don't need to be enabled to send emails. Closes #1994
This commit is contained in:
@@ -12,6 +12,7 @@
|
||||
namespace CachetHQ\Cachet\Http\Middleware;
|
||||
|
||||
use Closure;
|
||||
use Illuminate\Contracts\Config\Repository;
|
||||
use Illuminate\Http\Request;
|
||||
|
||||
/**
|
||||
@@ -22,6 +23,25 @@ use Illuminate\Http\Request;
|
||||
*/
|
||||
class SubscribersConfigured
|
||||
{
|
||||
/**
|
||||
* The config repository instance.
|
||||
*
|
||||
* @var \Illuminate\Contracts\Config\Repository
|
||||
*/
|
||||
protected $config;
|
||||
|
||||
/**
|
||||
* Creates a subscribers configured middleware instance.
|
||||
*
|
||||
* @param \Illuminate\Contracts\Config\Repository $config
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function __construct(Repository $config)
|
||||
{
|
||||
$this->config = $config;
|
||||
}
|
||||
|
||||
/**
|
||||
* Handle an incoming request.
|
||||
*
|
||||
@@ -32,7 +52,7 @@ class SubscribersConfigured
|
||||
*/
|
||||
public function handle(Request $request, Closure $next)
|
||||
{
|
||||
if (!subscribers_enabled()) {
|
||||
if (!$this->config->get('setting.enable_subscribers')) {
|
||||
return cachet_redirect('status-page');
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user