Closes #568, adds copyright information.
This commit is contained in:
@@ -1,5 +1,14 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of Cachet.
|
||||
*
|
||||
* (c) James Brooks <james@cachethq.io>
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace CachetHQ\Cachet\Http\Controllers;
|
||||
|
||||
use Illuminate\Foundation\Bus\DispatchesCommands;
|
||||
|
||||
@@ -1,5 +1,14 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of Cachet.
|
||||
*
|
||||
* (c) James Brooks <james@cachethq.io>
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace CachetHQ\Cachet\Http\Controllers\Admin;
|
||||
|
||||
use CachetHQ\Cachet\Http\Controllers\AbstractController;
|
||||
|
||||
@@ -1,5 +1,14 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of Cachet.
|
||||
*
|
||||
* (c) James Brooks <james@cachethq.io>
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace CachetHQ\Cachet\Http\Controllers\Admin;
|
||||
|
||||
use CachetHQ\Cachet\Http\Controllers\AbstractController;
|
||||
@@ -112,7 +121,7 @@ class ComponentController extends AbstractController
|
||||
|
||||
$component->update($_component);
|
||||
|
||||
if (! $component->isValid()) {
|
||||
if (!$component->isValid()) {
|
||||
segment_track('Dashboard', [
|
||||
'event' => 'Edit Component',
|
||||
'success' => false,
|
||||
@@ -182,7 +191,7 @@ class ComponentController extends AbstractController
|
||||
|
||||
$component = Component::create($_component);
|
||||
|
||||
if (! $component->isValid()) {
|
||||
if (!$component->isValid()) {
|
||||
segment_track('Dashboard', [
|
||||
'event' => 'Created Component',
|
||||
'success' => false,
|
||||
@@ -301,7 +310,7 @@ class ComponentController extends AbstractController
|
||||
{
|
||||
$group = ComponentGroup::create(Binput::get('group'));
|
||||
|
||||
if (! $group->isValid()) {
|
||||
if (!$group->isValid()) {
|
||||
segment_track('Dashboard', [
|
||||
'event' => 'Created Component Group',
|
||||
'success' => false,
|
||||
@@ -342,7 +351,7 @@ class ComponentController extends AbstractController
|
||||
$groupData = Binput::get('group');
|
||||
$group->update($groupData);
|
||||
|
||||
if (! $group->isValid()) {
|
||||
if (!$group->isValid()) {
|
||||
segment_track('Dashboard', [
|
||||
'event' => 'Edit Component Group',
|
||||
'success' => false,
|
||||
|
||||
@@ -1,5 +1,14 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of Cachet.
|
||||
*
|
||||
* (c) James Brooks <james@cachethq.io>
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace CachetHQ\Cachet\Http\Controllers\Admin;
|
||||
|
||||
use CachetHQ\Cachet\Http\Controllers\AbstractController;
|
||||
|
||||
@@ -1,5 +1,14 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of Cachet.
|
||||
*
|
||||
* (c) James Brooks <james@cachethq.io>
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace CachetHQ\Cachet\Http\Controllers\Admin;
|
||||
|
||||
use CachetHQ\Cachet\Http\Controllers\AbstractController;
|
||||
@@ -106,7 +115,7 @@ class IncidentController extends AbstractController
|
||||
|
||||
$incident = Incident::create($incidentData);
|
||||
|
||||
if (! $incident->isValid()) {
|
||||
if (!$incident->isValid()) {
|
||||
segment_track('Dashboard', [
|
||||
'event' => 'Created Incident',
|
||||
'success' => false,
|
||||
@@ -197,7 +206,7 @@ class IncidentController extends AbstractController
|
||||
$_template = Binput::get('template');
|
||||
$template = IncidentTemplate::create($_template);
|
||||
|
||||
if (! $template->isValid()) {
|
||||
if (!$template->isValid()) {
|
||||
segment_track('Dashboard', [
|
||||
'event' => 'Created Incident Template',
|
||||
'success' => false,
|
||||
@@ -277,7 +286,7 @@ class IncidentController extends AbstractController
|
||||
$incidentData['user_id'] = Auth::user()->id;
|
||||
$incident->update($incidentData);
|
||||
|
||||
if (! $incident->isValid()) {
|
||||
if (!$incident->isValid()) {
|
||||
segment_track('Dashboard', [
|
||||
'event' => 'Edited Incident',
|
||||
'success' => false,
|
||||
|
||||
@@ -1,5 +1,14 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of Cachet.
|
||||
*
|
||||
* (c) James Brooks <james@cachethq.io>
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace CachetHQ\Cachet\Http\Controllers\Admin;
|
||||
|
||||
use CachetHQ\Cachet\Http\Controllers\AbstractController;
|
||||
@@ -62,7 +71,7 @@ class MetricController extends AbstractController
|
||||
$metricData = Binput::get('metric');
|
||||
$metric = Metric::create($metricData);
|
||||
|
||||
if (! $metric->isValid()) {
|
||||
if (!$metric->isValid()) {
|
||||
segment_track('Dashboard', [
|
||||
'event' => 'Created Metric',
|
||||
'success' => false,
|
||||
@@ -113,7 +122,7 @@ class MetricController extends AbstractController
|
||||
$_point = Binput::get('point');
|
||||
$point = MetricPoint::create($_point);
|
||||
|
||||
if (! $point->isValid()) {
|
||||
if (!$point->isValid()) {
|
||||
return Redirect::back()->withInput(Binput::all())
|
||||
->with('title', sprintf(
|
||||
'<strong>%s</strong> %s',
|
||||
@@ -173,7 +182,7 @@ class MetricController extends AbstractController
|
||||
$_metric = Binput::get('metric');
|
||||
$metric->update($_metric);
|
||||
|
||||
if (! $metric->isValid()) {
|
||||
if (!$metric->isValid()) {
|
||||
segment_track('Dashboard', [
|
||||
'event' => 'Edited Metric',
|
||||
'success' => false,
|
||||
|
||||
@@ -1,5 +1,14 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of Cachet.
|
||||
*
|
||||
* (c) James Brooks <james@cachethq.io>
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace CachetHQ\Cachet\Http\Controllers\Admin;
|
||||
|
||||
use CachetHQ\Cachet\Facades\Setting;
|
||||
@@ -104,7 +113,7 @@ class ScheduleController extends AbstractController
|
||||
|
||||
$incident = Incident::create($scheduleData);
|
||||
|
||||
if (! $incident->isValid()) {
|
||||
if (!$incident->isValid()) {
|
||||
segment_track('Dashboard', [
|
||||
'event' => 'Created Scheduled Maintenance',
|
||||
'success' => false,
|
||||
@@ -180,7 +189,7 @@ class ScheduleController extends AbstractController
|
||||
|
||||
$schedule->update($scheduleData);
|
||||
|
||||
if (! $schedule->isValid()) {
|
||||
if (!$schedule->isValid()) {
|
||||
segment_track('Dashboard', [
|
||||
'event' => 'Edited Schedule',
|
||||
'success' => false,
|
||||
|
||||
@@ -1,5 +1,14 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of Cachet.
|
||||
*
|
||||
* (c) James Brooks <james@cachethq.io>
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace CachetHQ\Cachet\Http\Controllers\Admin;
|
||||
|
||||
use CachetHQ\Cachet\Http\Controllers\AbstractController;
|
||||
|
||||
@@ -1,5 +1,14 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of Cachet.
|
||||
*
|
||||
* (c) James Brooks <james@cachethq.io>
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace CachetHQ\Cachet\Http\Controllers\Admin;
|
||||
|
||||
use CachetHQ\Cachet\Http\Controllers\AbstractController;
|
||||
@@ -59,7 +68,7 @@ class TeamController extends AbstractController
|
||||
{
|
||||
$user = User::create(Binput::all());
|
||||
|
||||
if (! $user->isValid()) {
|
||||
if (!$user->isValid()) {
|
||||
segment_track('Dashboard', [
|
||||
'event' => 'Added User',
|
||||
'success' => false,
|
||||
@@ -107,7 +116,7 @@ class TeamController extends AbstractController
|
||||
|
||||
$user->update($items);
|
||||
|
||||
if (! $user->isValid()) {
|
||||
if (!$user->isValid()) {
|
||||
segment_track('Dashboard', [
|
||||
'event' => 'Updated User',
|
||||
'success' => false,
|
||||
|
||||
@@ -1,5 +1,14 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of Cachet.
|
||||
*
|
||||
* (c) James Brooks <james@cachethq.io>
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace CachetHQ\Cachet\Http\Controllers\Admin;
|
||||
|
||||
use CachetHQ\Cachet\Http\Controllers\AbstractController;
|
||||
@@ -37,14 +46,14 @@ class UserController extends AbstractController
|
||||
$enable2FA = (bool) array_pull($items, 'google2fa');
|
||||
|
||||
// Let's enable/disable auth
|
||||
if ($enable2FA && ! Auth::user()->hasTwoFactor) {
|
||||
if ($enable2FA && !Auth::user()->hasTwoFactor) {
|
||||
$items['google_2fa_secret'] = Google2FA::generateSecretKey();
|
||||
|
||||
segment_track('User Management', [
|
||||
'event' => 'enabled_two_factor',
|
||||
'value' => true,
|
||||
]);
|
||||
} elseif (! $enable2FA) {
|
||||
} elseif (!$enable2FA) {
|
||||
$items['google_2fa_secret'] = '';
|
||||
|
||||
segment_track('User Management', [
|
||||
@@ -60,7 +69,7 @@ class UserController extends AbstractController
|
||||
$user = Auth::user();
|
||||
$user->update($items);
|
||||
|
||||
if (! $user->isValid()) {
|
||||
if (!$user->isValid()) {
|
||||
return Redirect::back()->withInput(Binput::except('password'))
|
||||
->with('title', sprintf(
|
||||
'<strong>%s</strong> %s',
|
||||
|
||||
@@ -1,5 +1,14 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of Cachet.
|
||||
*
|
||||
* (c) James Brooks <james@cachethq.io>
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace CachetHQ\Cachet\Http\Controllers\Api;
|
||||
|
||||
use CachetHQ\Cachet\Http\Controllers\AbstractController as BaseController;
|
||||
@@ -145,7 +154,7 @@ abstract class AbstractApiController extends BaseController
|
||||
*/
|
||||
protected function respond()
|
||||
{
|
||||
if (! empty($this->meta)) {
|
||||
if (!empty($this->meta)) {
|
||||
$response['meta'] = $this->meta;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,5 +1,14 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of Cachet.
|
||||
*
|
||||
* (c) James Brooks <james@cachethq.io>
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace CachetHQ\Cachet\Http\Controllers\Api;
|
||||
|
||||
use CachetHQ\Cachet\Models\Tag;
|
||||
@@ -20,8 +29,6 @@ class ComponentController extends AbstractApiController
|
||||
* Create a new component controller instance.
|
||||
*
|
||||
* @param \CachetHQ\Cachet\Repositories\Component\ComponentRepository $component
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function __construct(ComponentRepository $component)
|
||||
{
|
||||
|
||||
@@ -1,5 +1,14 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of Cachet.
|
||||
*
|
||||
* (c) James Brooks <james@cachethq.io>
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace CachetHQ\Cachet\Http\Controllers\Api;
|
||||
|
||||
use CachetHQ\Cachet\Repositories\Incident\IncidentRepository;
|
||||
@@ -19,8 +28,6 @@ class IncidentController extends AbstractApiController
|
||||
* Create a new incident controller instance.
|
||||
*
|
||||
* @param \CachetHQ\Cachet\Repositories\Incident\IncidentRepository $incident
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function __construct(IncidentRepository $incident)
|
||||
{
|
||||
|
||||
@@ -1,5 +1,14 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of Cachet.
|
||||
*
|
||||
* (c) James Brooks <james@cachethq.io>
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace CachetHQ\Cachet\Http\Controllers\Api;
|
||||
|
||||
use CachetHQ\Cachet\Repositories\Metric\MetricRepository;
|
||||
@@ -19,8 +28,6 @@ class MetricController extends AbstractApiController
|
||||
* Create a new metric controller instance.
|
||||
*
|
||||
* @param \CachetHQ\Cachet\Repositories\Metric\MetricRepository $metric
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function __construct(MetricRepository $metric)
|
||||
{
|
||||
|
||||
@@ -1,5 +1,14 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of Cachet.
|
||||
*
|
||||
* (c) James Brooks <james@cachethq.io>
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace CachetHQ\Cachet\Http\Controllers\Api;
|
||||
|
||||
use CachetHQ\Cachet\Repositories\MetricPoint\MetricPointRepository;
|
||||
@@ -18,8 +27,6 @@ class MetricPointController extends AbstractApiController
|
||||
* Create a new metric point controller instance.
|
||||
*
|
||||
* @param \CachetHQ\Cachet\Repositories\MetricPoint\MetricPointRepository $metricPoint
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function __construct(MetricPointRepository $metricPoint)
|
||||
{
|
||||
|
||||
@@ -1,5 +1,14 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of Cachet.
|
||||
*
|
||||
* (c) James Brooks <james@cachethq.io>
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace CachetHQ\Cachet\Http\Controllers;
|
||||
|
||||
use CachetHQ\Cachet\Facades\Setting;
|
||||
@@ -44,8 +53,6 @@ class AtomController extends AbstractController
|
||||
*
|
||||
* @param Roumen\Feed\Facades\Feed $feed
|
||||
* @param \CachetHQ\Cachet\Models\Incident $incident
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
private function feedAddItem(&$feed, $incident)
|
||||
{
|
||||
|
||||
@@ -1,5 +1,14 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of Cachet.
|
||||
*
|
||||
* (c) James Brooks <james@cachethq.io>
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace CachetHQ\Cachet\Http\Controllers;
|
||||
|
||||
use GrahamCampbell\Binput\Facades\Binput;
|
||||
|
||||
@@ -1,5 +1,14 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of Cachet.
|
||||
*
|
||||
* (c) James Brooks <james@cachethq.io>
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace CachetHQ\Cachet\Http\Controllers;
|
||||
|
||||
use CachetHQ\Cachet\Facades\Setting;
|
||||
|
||||
@@ -1,5 +1,14 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of Cachet.
|
||||
*
|
||||
* (c) James Brooks <james@cachethq.io>
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace CachetHQ\Cachet\Http\Controllers;
|
||||
|
||||
use CachetHQ\Cachet\Facades\Setting;
|
||||
@@ -45,8 +54,6 @@ class RssController extends AbstractController
|
||||
*
|
||||
* @param Roumen\Feed\Facades\Feed $feed
|
||||
* @param \CachetHQ\Cachet\Models\Incident $incident
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
private function feedAddItem(&$feed, $incident)
|
||||
{
|
||||
|
||||
@@ -1,5 +1,14 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of Cachet.
|
||||
*
|
||||
* (c) James Brooks <james@cachethq.io>
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace CachetHQ\Cachet\Http\Controllers;
|
||||
|
||||
use CachetHQ\Cachet\Models\Setting;
|
||||
@@ -17,8 +26,6 @@ class SetupController extends AbstractController
|
||||
{
|
||||
/**
|
||||
* Create a new setup controller instance.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user