Closes #688 - Drop user_id column

This commit is contained in:
James Brooks
2015-06-10 13:33:00 +01:00
parent d9e515c62d
commit 620e7fed56
12 changed files with 78 additions and 27 deletions

View File

@@ -16,7 +16,6 @@ use CachetHQ\Cachet\Models\Component;
use CachetHQ\Cachet\Models\ComponentGroup;
use CachetHQ\Cachet\Models\Tag;
use GrahamCampbell\Binput\Facades\Binput;
use Illuminate\Support\Facades\Auth;
use Illuminate\Support\Facades\Redirect;
use Illuminate\Support\Facades\View;
@@ -116,7 +115,6 @@ class ComponentController extends AbstractController
public function updateComponentAction(Component $component)
{
$_component = Binput::get('component');
$_component['user_id'] = Auth::user()->id;
$tags = array_pull($_component, 'tags');
$component->update($_component);
@@ -185,7 +183,6 @@ class ComponentController extends AbstractController
public function createComponentAction()
{
$_component = Binput::get('component');
$_component['user_id'] = Auth::user()->id;
// We deal with tags separately.
$tags = array_pull($_component, 'tags');

View File

@@ -18,7 +18,6 @@ use CachetHQ\Cachet\Models\ComponentGroup;
use CachetHQ\Cachet\Models\Incident;
use CachetHQ\Cachet\Models\IncidentTemplate;
use GrahamCampbell\Binput\Facades\Binput;
use Illuminate\Support\Facades\Auth;
use Illuminate\Support\Facades\Config;
use Illuminate\Support\Facades\Redirect;
use Illuminate\Support\Facades\View;
@@ -113,7 +112,6 @@ class IncidentController extends AbstractController
public function createIncidentAction()
{
$incidentData = Binput::get('incident');
$incidentData['user_id'] = Auth::user()->id;
$componentStatus = array_pull($incidentData, 'component_status');
if (array_has($incidentData, 'created_at') && $incidentData['created_at']) {
@@ -294,7 +292,6 @@ class IncidentController extends AbstractController
public function editIncidentAction(Incident $incident)
{
$incidentData = Binput::get('incident');
$incidentData['user_id'] = Auth::user()->id;
if (array_has($incidentData, 'created_at') && $incidentData['created_at']) {
$incidentDate = Date::createFromFormat('d/m/Y H:i', $incidentData['created_at'], Setting::get('app_timezone'))->setTimezone(Config::get('app.timezone'));

View File

@@ -16,7 +16,6 @@ use CachetHQ\Cachet\Http\Controllers\AbstractController;
use CachetHQ\Cachet\Models\Incident;
use CachetHQ\Cachet\Models\IncidentTemplate;
use GrahamCampbell\Binput\Facades\Binput;
use Illuminate\Support\Facades\Auth;
use Illuminate\Support\Facades\Config;
use Illuminate\Support\Facades\Redirect;
use Illuminate\Support\Facades\View;
@@ -93,7 +92,6 @@ class ScheduleController extends AbstractController
public function addScheduleAction()
{
$scheduleData = Binput::get('incident');
$scheduleData['user_id'] = Auth::user()->id;
// Parse the schedule date.
$scheduledAt = Date::createFromFormat('d/m/Y H:i', $scheduleData['scheduled_at'], Setting::get('app_timezone'))
->setTimezone(Config::get('app.timezone'));
@@ -169,7 +167,6 @@ class ScheduleController extends AbstractController
public function editScheduleAction(Incident $schedule)
{
$scheduleData = Binput::get('incident');
$scheduleData['user_id'] = Auth::user()->id;
// Parse the schedule date.
$scheduledAt = Date::createFromFormat('d/m/Y H:i', $scheduleData['scheduled_at'], Setting::get('app_timezone'))
->setTimezone(Config::get('app.timezone'));

View File

@@ -57,7 +57,6 @@ class ComponentController extends AbstractApiController
public function postComponents(Guard $auth)
{
$componentData = Binput::except('tags');
$componentData['user_id'] = $auth->user()->id;
try {
$component = Component::create($componentData);

View File

@@ -57,7 +57,6 @@ class IncidentController extends AbstractApiController
public function postIncidents(Guard $auth)
{
$incidentData = Binput::all();
$incidentData['user_id'] = $auth->user()->id;
try {
$incident = Incident::create($incidentData);