Closes #568, adds copyright information.

This commit is contained in:
James Brooks
2015-04-19 08:52:39 +01:00
parent dc139ef09f
commit 80e3d9167d
210 changed files with 1880 additions and 215 deletions

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@@ -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()
{

View File

@@ -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;
use Illuminate\Foundation\Http\Kernel as HttpKernel;

View File

@@ -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\Middleware;
use Closure;
@@ -19,8 +28,6 @@ class Admin
* Create a new filter instance.
*
* @param Guard $auth
*
* @return void
*/
public function __construct(Guard $auth)
{

View File

@@ -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\Middleware;
use CachetHQ\Cachet\Facades\Setting;

View File

@@ -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\Middleware;
use CachetHQ\Cachet\Models\User;

View File

@@ -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\Middleware;
use CachetHQ\Cachet\Models\Setting;

View File

@@ -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\Middleware;
use Closure;
@@ -18,8 +27,6 @@ class Authenticate
* Create a new filter instance.
*
* @param Guard $auth
*
* @return void
*/
public function __construct(Guard $auth)
{

View File

@@ -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\Middleware;
use Closure;

View File

@@ -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\Middleware;
use CachetHQ\Cachet\Models\Setting;

View File

@@ -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\Middleware;
use Closure;

View File

@@ -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\Middleware;
use Closure;
@@ -19,8 +28,6 @@ class RedirectIfAuthenticated
* Create a new filter instance.
*
* @param Guard $auth
*
* @return void
*/
public function __construct(Guard $auth)
{

View File

@@ -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\Middleware;
use Closure;

View File

@@ -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\Requests;
use Illuminate\Foundation\Http\FormRequest;

View File

@@ -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\Routes;
use Illuminate\Contracts\Routing\Registrar;
@@ -10,8 +19,6 @@ class AdminRoutes
* Define the dashboard routes.
*
* @param \Illuminate\Contracts\Routing\Registrar $router
*
* @return void
*/
public function map(Registrar $router)
{

View File

@@ -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\Routes;
use Illuminate\Contracts\Routing\Registrar;
@@ -10,8 +19,6 @@ class ApiRoutes
* Define the api routes.
*
* @param \Illuminate\Contracts\Routing\Registrar $router
*
* @return void
*/
public function map(Registrar $router)
{

View File

@@ -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\Routes;
use Illuminate\Contracts\Routing\Registrar;
@@ -10,8 +19,6 @@ class AuthRoutes
* Define the auth routes.
*
* @param \Illuminate\Contracts\Routing\Registrar $router
*
* @return void
*/
public function map(Registrar $router)
{

View File

@@ -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\Routes;
use Illuminate\Contracts\Routing\Registrar;
@@ -10,8 +19,6 @@ class SetupRoutes
* Define the setup routes.
*
* @param \Illuminate\Contracts\Routing\Registrar $router
*
* @return void
*/
public function map(Registrar $router)
{

View File

@@ -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\Routes;
use Illuminate\Contracts\Routing\Registrar;
@@ -10,8 +19,6 @@ class StatusPageRoutes
* Define the status page routes.
*
* @param \Illuminate\Contracts\Routing\Registrar $router
*
* @return void
*/
public function map(Registrar $router)
{

View File

@@ -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.
*/
use CachetHQ\Cachet\Facades\Setting;
use CachetHQ\Segment\Facades\Segment;
use Illuminate\Database\QueryException;