Removed tracking
This commit is contained in:
@@ -120,11 +120,6 @@ class ComponentController extends AbstractController
|
||||
$component->update($_component);
|
||||
|
||||
if (!$component->isValid()) {
|
||||
segment_track('Dashboard', [
|
||||
'event' => 'Edit Component',
|
||||
'success' => false,
|
||||
]);
|
||||
|
||||
return Redirect::back()->withInput(Binput::all())
|
||||
->with('title', sprintf(
|
||||
'%s %s',
|
||||
@@ -134,11 +129,6 @@ class ComponentController extends AbstractController
|
||||
->with('errors', $component->getErrors());
|
||||
}
|
||||
|
||||
segment_track('Dashboard', [
|
||||
'event' => 'Edit Component',
|
||||
'success' => true,
|
||||
]);
|
||||
|
||||
// The component was added successfully, so now let's deal with the tags.
|
||||
$tags = preg_split('/ ?, ?/', $tags);
|
||||
|
||||
@@ -189,11 +179,6 @@ class ComponentController extends AbstractController
|
||||
$component = Component::create($_component);
|
||||
|
||||
if (!$component->isValid()) {
|
||||
segment_track('Dashboard', [
|
||||
'event' => 'Created Component',
|
||||
'success' => false,
|
||||
]);
|
||||
|
||||
return Redirect::back()->withInput(Binput::all())
|
||||
->with('title', sprintf(
|
||||
'%s %s',
|
||||
@@ -203,11 +188,6 @@ class ComponentController extends AbstractController
|
||||
->with('errors', $component->getErrors());
|
||||
}
|
||||
|
||||
segment_track('Dashboard', [
|
||||
'event' => 'Created Component',
|
||||
'success' => true,
|
||||
]);
|
||||
|
||||
// The component was added successfully, so now let's deal with the tags.
|
||||
$tags = preg_split('/ ?, ?/', $tags);
|
||||
|
||||
@@ -238,10 +218,6 @@ class ComponentController extends AbstractController
|
||||
*/
|
||||
public function deleteComponentAction(Component $component)
|
||||
{
|
||||
segment_track('Dashboard', [
|
||||
'event' => 'Deleted Component',
|
||||
]);
|
||||
|
||||
$component->delete();
|
||||
|
||||
return Redirect::back();
|
||||
@@ -256,10 +232,6 @@ class ComponentController extends AbstractController
|
||||
*/
|
||||
public function deleteComponentGroupAction(ComponentGroup $group)
|
||||
{
|
||||
segment_track('Dashboard', [
|
||||
'event' => 'Deleted Component Group',
|
||||
]);
|
||||
|
||||
$group->components->map(function ($component) {
|
||||
$component->update([
|
||||
'group_id' => 0,
|
||||
@@ -308,11 +280,6 @@ class ComponentController extends AbstractController
|
||||
$group = ComponentGroup::create(Binput::get('group'));
|
||||
|
||||
if (!$group->isValid()) {
|
||||
segment_track('Dashboard', [
|
||||
'event' => 'Created Component Group',
|
||||
'success' => false,
|
||||
]);
|
||||
|
||||
return Redirect::back()->withInput(Binput::all())
|
||||
->with('title', sprintf(
|
||||
'%s %s',
|
||||
@@ -322,11 +289,6 @@ class ComponentController extends AbstractController
|
||||
->with('errors', $group->getErrors());
|
||||
}
|
||||
|
||||
segment_track('Dashboard', [
|
||||
'event' => 'Created Component Group',
|
||||
'success' => true,
|
||||
]);
|
||||
|
||||
$successMsg = sprintf(
|
||||
'%s %s',
|
||||
trans('dashboard.notifications.awesome'),
|
||||
@@ -349,11 +311,6 @@ class ComponentController extends AbstractController
|
||||
$group->update($groupData);
|
||||
|
||||
if (!$group->isValid()) {
|
||||
segment_track('Dashboard', [
|
||||
'event' => 'Edit Component Group',
|
||||
'success' => false,
|
||||
]);
|
||||
|
||||
return Redirect::back()->withInput(Binput::all())
|
||||
->with('title', sprintf(
|
||||
'%s %s',
|
||||
@@ -363,11 +320,6 @@ class ComponentController extends AbstractController
|
||||
->with('errors', $group->getErrors());
|
||||
}
|
||||
|
||||
segment_track('Dashboard', [
|
||||
'event' => 'Edit Component Group',
|
||||
'success' => true,
|
||||
]);
|
||||
|
||||
$successMsg = sprintf(
|
||||
'%s %s',
|
||||
trans('dashboard.notifications.awesome'),
|
||||
|
||||
@@ -26,8 +26,6 @@ class DashboardController extends AbstractController
|
||||
{
|
||||
$components = Component::orderBy('order')->get();
|
||||
|
||||
segment_page('Dashboard');
|
||||
|
||||
return View::make('dashboard.index')->with([
|
||||
'components' => $components,
|
||||
]);
|
||||
|
||||
@@ -126,11 +126,6 @@ class IncidentController extends AbstractController
|
||||
$incident = Incident::create($incidentData);
|
||||
|
||||
if (!$incident->isValid()) {
|
||||
segment_track('Dashboard', [
|
||||
'event' => 'Created Incident',
|
||||
'success' => false,
|
||||
]);
|
||||
|
||||
return Redirect::back()->withInput(Binput::all())
|
||||
->with('title', sprintf(
|
||||
'%s %s',
|
||||
@@ -147,11 +142,6 @@ class IncidentController extends AbstractController
|
||||
]);
|
||||
}
|
||||
|
||||
segment_track('Dashboard', [
|
||||
'event' => 'Created Incident',
|
||||
'success' => true,
|
||||
]);
|
||||
|
||||
$successMsg = sprintf(
|
||||
'%s %s',
|
||||
trans('dashboard.notifications.awesome'),
|
||||
@@ -206,10 +196,6 @@ class IncidentController extends AbstractController
|
||||
*/
|
||||
public function deleteTemplateAction(IncidentTemplate $template)
|
||||
{
|
||||
segment_track('Dashboard', [
|
||||
'event' => 'Deleted Incident Template',
|
||||
]);
|
||||
|
||||
$template->delete();
|
||||
|
||||
return Redirect::back();
|
||||
@@ -226,11 +212,6 @@ class IncidentController extends AbstractController
|
||||
$template = IncidentTemplate::create($_template);
|
||||
|
||||
if (!$template->isValid()) {
|
||||
segment_track('Dashboard', [
|
||||
'event' => 'Created Incident Template',
|
||||
'success' => false,
|
||||
]);
|
||||
|
||||
return Redirect::back()->withInput(Binput::all())
|
||||
->with('title', sprintf(
|
||||
'%s %s',
|
||||
@@ -240,11 +221,6 @@ class IncidentController extends AbstractController
|
||||
->with('errors', $template->getErrors());
|
||||
}
|
||||
|
||||
segment_track('Dashboard', [
|
||||
'event' => 'Created Incident Template',
|
||||
'success' => true,
|
||||
]);
|
||||
|
||||
$successMsg = sprintf(
|
||||
'%s %s',
|
||||
trans('dashboard.notifications.awesome'),
|
||||
@@ -263,10 +239,6 @@ class IncidentController extends AbstractController
|
||||
*/
|
||||
public function deleteIncidentAction(Incident $incident)
|
||||
{
|
||||
segment_track('Dashboard', [
|
||||
'event' => 'Deleted Incident',
|
||||
]);
|
||||
|
||||
$incident->delete();
|
||||
|
||||
return Redirect::back();
|
||||
@@ -314,11 +286,6 @@ class IncidentController extends AbstractController
|
||||
$incident->update($incidentData);
|
||||
|
||||
if (!$incident->isValid()) {
|
||||
segment_track('Dashboard', [
|
||||
'event' => 'Edited Incident',
|
||||
'success' => false,
|
||||
]);
|
||||
|
||||
return Redirect::back()->withInput(Binput::all())
|
||||
->with('title', sprintf(
|
||||
'%s %s',
|
||||
@@ -335,11 +302,6 @@ class IncidentController extends AbstractController
|
||||
]);
|
||||
}
|
||||
|
||||
segment_track('Dashboard', [
|
||||
'event' => 'Edited Incident',
|
||||
'success' => true,
|
||||
]);
|
||||
|
||||
$successMsg = sprintf(
|
||||
'%s %s',
|
||||
trans('dashboard.notifications.awesome'),
|
||||
@@ -358,10 +320,6 @@ class IncidentController extends AbstractController
|
||||
*/
|
||||
public function editTemplateAction(IncidentTemplate $template)
|
||||
{
|
||||
segment_track('Dashboard', [
|
||||
'event' => 'Edited Incident Template',
|
||||
]);
|
||||
|
||||
$template->update(Binput::get('template'));
|
||||
|
||||
return Redirect::back()->with('updatedTemplate', $template);
|
||||
|
||||
@@ -72,11 +72,6 @@ class MetricController extends AbstractController
|
||||
$metric = Metric::create($metricData);
|
||||
|
||||
if (!$metric->isValid()) {
|
||||
segment_track('Dashboard', [
|
||||
'event' => 'Created Metric',
|
||||
'success' => false,
|
||||
]);
|
||||
|
||||
return Redirect::back()->withInput(Binput::all())
|
||||
->with('title', sprintf(
|
||||
'%s %s',
|
||||
@@ -86,11 +81,6 @@ class MetricController extends AbstractController
|
||||
->with('errors', $metric->getErrors());
|
||||
}
|
||||
|
||||
segment_track('Dashboard', [
|
||||
'event' => 'Created Metric',
|
||||
'success' => true,
|
||||
]);
|
||||
|
||||
$successMsg = sprintf(
|
||||
'%s %s',
|
||||
trans('dashboard.notifications.awesome'),
|
||||
@@ -183,11 +173,6 @@ class MetricController extends AbstractController
|
||||
$metric->update($metricData);
|
||||
|
||||
if (!$metric->isValid()) {
|
||||
segment_track('Dashboard', [
|
||||
'event' => 'Edited Metric',
|
||||
'success' => false,
|
||||
]);
|
||||
|
||||
return Redirect::back()->withInput(Binput::all())
|
||||
->with('title', sprintf(
|
||||
'<strong>%s</strong>',
|
||||
@@ -196,11 +181,6 @@ class MetricController extends AbstractController
|
||||
->with('errors', $metric->getErrors());
|
||||
}
|
||||
|
||||
segment_track('Dashboard', [
|
||||
'event' => 'Edited Metric',
|
||||
'success' => true,
|
||||
]);
|
||||
|
||||
$successMsg = sprintf(
|
||||
'%s %s',
|
||||
trans('dashboard.notifications.awesome'),
|
||||
|
||||
@@ -113,11 +113,6 @@ class ScheduleController extends AbstractController
|
||||
$incident = Incident::create($scheduleData);
|
||||
|
||||
if (!$incident->isValid()) {
|
||||
segment_track('Dashboard', [
|
||||
'event' => 'Created Scheduled Maintenance',
|
||||
'success' => false,
|
||||
]);
|
||||
|
||||
return Redirect::back()->withInput(Binput::all())
|
||||
->with('success', sprintf(
|
||||
'%s %s',
|
||||
@@ -127,11 +122,6 @@ class ScheduleController extends AbstractController
|
||||
->with('errors', $incident->getErrors());
|
||||
}
|
||||
|
||||
segment_track('Dashboard', [
|
||||
'event' => 'Created Scheduled Maintenance',
|
||||
'success' => true,
|
||||
]);
|
||||
|
||||
$successMsg = sprintf(
|
||||
'%s %s',
|
||||
trans('dashboard.notifications.awesome'),
|
||||
@@ -197,11 +187,6 @@ class ScheduleController extends AbstractController
|
||||
$schedule->update($scheduleData);
|
||||
|
||||
if (!$schedule->isValid()) {
|
||||
segment_track('Dashboard', [
|
||||
'event' => 'Edited Schedule',
|
||||
'success' => false,
|
||||
]);
|
||||
|
||||
return Redirect::back()->withInput(Binput::all())
|
||||
->with('title', sprintf(
|
||||
'%s %s',
|
||||
@@ -211,11 +196,6 @@ class ScheduleController extends AbstractController
|
||||
->with('errors', $schedule->getErrors());
|
||||
}
|
||||
|
||||
segment_track('Dashboard', [
|
||||
'event' => 'Edited Schedule',
|
||||
'success' => true,
|
||||
]);
|
||||
|
||||
$successMsg = sprintf(
|
||||
'%s %s',
|
||||
trans('dashboard.notifications.awesome'),
|
||||
@@ -234,10 +214,6 @@ class ScheduleController extends AbstractController
|
||||
*/
|
||||
public function deleteScheduleAction(Incident $schedule)
|
||||
{
|
||||
segment_track('Dashboard', [
|
||||
'event' => 'Deleted Schedule',
|
||||
]);
|
||||
|
||||
$schedule->delete();
|
||||
|
||||
return Redirect::back()->with('warning', sprintf(
|
||||
|
||||
@@ -64,11 +64,6 @@ class SubscriberController extends AbstractController
|
||||
]);
|
||||
|
||||
if (!$subscriber->isValid()) {
|
||||
segment_track('Dashboard', [
|
||||
'event' => 'Created Subscriber',
|
||||
'success' => false,
|
||||
]);
|
||||
|
||||
return Redirect::back()
|
||||
->withInput(Binput::all())
|
||||
->with('title', sprintf(
|
||||
@@ -79,11 +74,6 @@ class SubscriberController extends AbstractController
|
||||
->with('errors', $subscriber->getErrors());
|
||||
}
|
||||
|
||||
segment_track('Dashboard', [
|
||||
'event' => 'Created Subscriber',
|
||||
'success' => true,
|
||||
]);
|
||||
|
||||
$successMsg = sprintf(
|
||||
'%s %s',
|
||||
trans('dashboard.notifications.awesome'),
|
||||
@@ -107,10 +97,6 @@ class SubscriberController extends AbstractController
|
||||
*/
|
||||
public function deleteSubscriberAction(Subscriber $subscriber)
|
||||
{
|
||||
segment_track('Dashboard', [
|
||||
'event' => 'Deleted Subscriber',
|
||||
]);
|
||||
|
||||
$subscriber->delete();
|
||||
|
||||
return Redirect::back();
|
||||
|
||||
@@ -69,11 +69,6 @@ class TeamController extends AbstractController
|
||||
$user = User::create(Binput::all());
|
||||
|
||||
if (!$user->isValid()) {
|
||||
segment_track('Dashboard', [
|
||||
'event' => 'Added User',
|
||||
'success' => false,
|
||||
]);
|
||||
|
||||
return Redirect::back()->withInput(Binput::except('password'))
|
||||
->with('title', sprintf(
|
||||
'%s %s',
|
||||
@@ -83,11 +78,6 @@ class TeamController extends AbstractController
|
||||
->with('errors', $user->getErrors());
|
||||
}
|
||||
|
||||
segment_track('Dashboard', [
|
||||
'event' => 'Added User',
|
||||
'success' => true,
|
||||
]);
|
||||
|
||||
$successMsg = sprintf(
|
||||
'%s %s',
|
||||
trans('dashboard.notifications.awesome'),
|
||||
@@ -117,11 +107,6 @@ class TeamController extends AbstractController
|
||||
$user->update($items);
|
||||
|
||||
if (!$user->isValid()) {
|
||||
segment_track('Dashboard', [
|
||||
'event' => 'Updated User',
|
||||
'success' => false,
|
||||
]);
|
||||
|
||||
return Redirect::back()->withInput(Binput::except('password'))
|
||||
->with('title', sprintf(
|
||||
'%s %s',
|
||||
@@ -131,11 +116,6 @@ class TeamController extends AbstractController
|
||||
->with('errors', $user->getErrors());
|
||||
}
|
||||
|
||||
segment_track('Dashboard', [
|
||||
'event' => 'Updated User',
|
||||
'success' => true,
|
||||
]);
|
||||
|
||||
$successMsg = sprintf(
|
||||
'%s %s',
|
||||
trans('dashboard.notifications.awesome'),
|
||||
|
||||
@@ -48,18 +48,8 @@ class UserController extends AbstractController
|
||||
// Let's enable/disable auth
|
||||
if ($enable2FA && !Auth::user()->hasTwoFactor) {
|
||||
$items['google_2fa_secret'] = Google2FA::generateSecretKey();
|
||||
|
||||
segment_track('User Management', [
|
||||
'event' => 'enabled_two_factor',
|
||||
'value' => true,
|
||||
]);
|
||||
} elseif (!$enable2FA) {
|
||||
$items['google_2fa_secret'] = '';
|
||||
|
||||
segment_track('User Management', [
|
||||
'event' => 'enabled_two_factor',
|
||||
'value' => false,
|
||||
]);
|
||||
}
|
||||
|
||||
if (trim($passwordChange) === '') {
|
||||
@@ -95,10 +85,6 @@ class UserController extends AbstractController
|
||||
*/
|
||||
public function regenerateApiKey(User $user)
|
||||
{
|
||||
segment_track('User Management', [
|
||||
'event' => 'regenrated_api_token',
|
||||
]);
|
||||
|
||||
$user->api_key = User::generateApiKey();
|
||||
$user->save();
|
||||
|
||||
|
||||
@@ -57,11 +57,9 @@ class AuthController extends AbstractController
|
||||
return Redirect::route('two-factor');
|
||||
}
|
||||
|
||||
// We probably wan't to add support for "Remember me" here.
|
||||
// We probably want to add support for "Remember me" here.
|
||||
Auth::attempt(Binput::only(['email', 'password']));
|
||||
|
||||
segment_track('Logged In');
|
||||
|
||||
return Redirect::intended('dashboard');
|
||||
}
|
||||
|
||||
@@ -122,8 +120,6 @@ class AuthController extends AbstractController
|
||||
{
|
||||
Auth::logout();
|
||||
|
||||
segment_track('Logged Out');
|
||||
|
||||
return Redirect::to('/');
|
||||
}
|
||||
}
|
||||
|
||||
@@ -35,18 +35,12 @@ class HomeController extends AbstractController
|
||||
$today = Date::now();
|
||||
$startDate = Date::now();
|
||||
|
||||
segment_page('Status Page');
|
||||
|
||||
// Check if we have another starting date
|
||||
if (Binput::has('start_date')) {
|
||||
try {
|
||||
// If date provided is valid
|
||||
$oldDate = Date::createFromFormat('Y-m-d', Binput::get('start_date'));
|
||||
|
||||
segment_track('Status Page', [
|
||||
'start_date' => $oldDate->format('Y-m-d'),
|
||||
]);
|
||||
|
||||
// If trying to get a future date fallback to today
|
||||
if ($today->gt($oldDate)) {
|
||||
$startDate = $oldDate;
|
||||
|
||||
@@ -54,9 +54,7 @@ class SetupController extends AbstractController
|
||||
*/
|
||||
public function getIndex()
|
||||
{
|
||||
segment_page('Setup');
|
||||
|
||||
// If we've copied the .env.example file, then we should try and reset it ready for Segment to kick in.
|
||||
// If we've copied the .env.example file, then we should try and reset it.
|
||||
if (getenv('APP_KEY') === 'SomeRandomString') {
|
||||
$this->keyGenerate();
|
||||
}
|
||||
@@ -83,19 +81,8 @@ class SetupController extends AbstractController
|
||||
]);
|
||||
|
||||
if ($v->passes()) {
|
||||
segment_track('Setup', [
|
||||
'event' => 'Step 1',
|
||||
'success' => true,
|
||||
]);
|
||||
|
||||
return Response::json(['status' => 1]);
|
||||
} else {
|
||||
// No good, let's try that again.
|
||||
segment_track('Setup', [
|
||||
'event' => 'Step 1',
|
||||
'success' => false,
|
||||
]);
|
||||
|
||||
return Response::json(['errors' => $v->messages()], 400);
|
||||
}
|
||||
}
|
||||
@@ -120,19 +107,8 @@ class SetupController extends AbstractController
|
||||
]);
|
||||
|
||||
if ($v->passes()) {
|
||||
segment_track('Setup', [
|
||||
'event' => 'Step 2',
|
||||
'success' => true,
|
||||
]);
|
||||
|
||||
return Response::json(['status' => 1]);
|
||||
} else {
|
||||
// No good, let's try that again.
|
||||
segment_track('Setup', [
|
||||
'event' => 'Step 2',
|
||||
'success' => false,
|
||||
]);
|
||||
|
||||
return Response::json(['errors' => $v->messages()], 400);
|
||||
}
|
||||
}
|
||||
@@ -190,25 +166,12 @@ class SetupController extends AbstractController
|
||||
|
||||
Session::flash('setup.done', true);
|
||||
|
||||
segment_track('Setup', [
|
||||
'event' => 'Step 3',
|
||||
'success' => true,
|
||||
'cache_driver' => $envData['cache_driver'],
|
||||
'session_driver' => $envData['session_driver'],
|
||||
]);
|
||||
|
||||
if (Request::ajax()) {
|
||||
return Response::json(['status' => 1]);
|
||||
}
|
||||
|
||||
return Redirect::to('dashboard');
|
||||
} else {
|
||||
segment_track('Setup', [
|
||||
'event' => 'Step 3',
|
||||
'success' => false,
|
||||
]);
|
||||
|
||||
// No good, let's try that again.
|
||||
if (Request::ajax()) {
|
||||
return Response::json(['errors' => $v->messages()], 400);
|
||||
}
|
||||
|
||||
@@ -46,11 +46,6 @@ class SubscribeController extends AbstractController
|
||||
$subscriber = Subscriber::create(['email' => Binput::get('email')]);
|
||||
|
||||
if (!$subscriber->isValid()) {
|
||||
segment_track('Subscribers', [
|
||||
'event' => 'Customer Subscribed',
|
||||
'success' => false,
|
||||
]);
|
||||
|
||||
return Redirect::back()->withInput(Binput::all())
|
||||
->with('title', sprintf(
|
||||
'<strong>%s</strong> %s',
|
||||
@@ -60,11 +55,6 @@ class SubscribeController extends AbstractController
|
||||
->with('errors', $subscriber->getErrors());
|
||||
}
|
||||
|
||||
segment_track('Subscribers', [
|
||||
'event' => 'Customer Subscribed',
|
||||
'success' => true,
|
||||
]);
|
||||
|
||||
$successMsg = sprintf(
|
||||
'<strong>%s</strong> %s',
|
||||
trans('dashboard.notifications.awesome'),
|
||||
@@ -98,11 +88,6 @@ class SubscribeController extends AbstractController
|
||||
$subscriber->verified_at = Carbon::now();
|
||||
$subscriber->save();
|
||||
|
||||
segment_track('Subscribers', [
|
||||
'event' => 'Customer Email Verified',
|
||||
'success' => true,
|
||||
]);
|
||||
|
||||
$successMsg = sprintf(
|
||||
'<strong>%s</strong> %s',
|
||||
trans('dashboard.notifications.awesome'),
|
||||
@@ -133,11 +118,6 @@ class SubscribeController extends AbstractController
|
||||
|
||||
$subscriber->delete();
|
||||
|
||||
segment_track('Subscribers', [
|
||||
'event' => 'Customer Unsubscribed',
|
||||
'success' => true,
|
||||
]);
|
||||
|
||||
$successMsg = sprintf(
|
||||
'<strong>%s</strong> %s',
|
||||
trans('dashboard.notifications.awesome'),
|
||||
|
||||
Reference in New Issue
Block a user