Use the Auth::user()->id throughout the controller. Closes #483
This commit is contained in:
@@ -57,7 +57,6 @@
|
||||
</div>
|
||||
</fieldset>
|
||||
|
||||
<input type="hidden" name="component[user_id]" value="{{ $loggedUser->id }}">
|
||||
<input type="hidden" name="component[order]" value="0">
|
||||
|
||||
<div class="btn-group">
|
||||
|
||||
@@ -89,8 +89,6 @@
|
||||
</div>
|
||||
</fieldset>
|
||||
|
||||
<input type="hidden" name="incident[user_id]" value="{{ $loggedUser->id }}">
|
||||
|
||||
<div class="form-group">
|
||||
<div class="btn-group">
|
||||
<button type="submit" class="btn btn-success">{{ trans('forms.add') }}</button>
|
||||
|
||||
@@ -78,7 +78,6 @@
|
||||
</div>
|
||||
</fieldset>
|
||||
|
||||
<input type="hidden" name="incident[user_id]" value="{{ $loggedUser->id }}">
|
||||
<input type="hidden" name="incident[id]" value={{$incident->id}}>
|
||||
|
||||
<div class="form-group">
|
||||
|
||||
@@ -44,8 +44,6 @@
|
||||
</div>
|
||||
</fieldset>
|
||||
|
||||
<input type="hidden" name="incident[user_id]" value="{{ $loggedUser->id }}">
|
||||
|
||||
<div class="form-group">
|
||||
<div class="btn-group">
|
||||
<button type="submit" class="btn btn-success">{{ trans('forms.add') }}</button>
|
||||
|
||||
@@ -44,8 +44,6 @@
|
||||
</div>
|
||||
</fieldset>
|
||||
|
||||
<input type="hidden" name="incident[user_id]" value="{{ $loggedUser->id }}">
|
||||
|
||||
<div class="form-group">
|
||||
<div class="btn-group">
|
||||
<button type="submit" class="btn btn-success">{{ trans('forms.save') }}</button>
|
||||
|
||||
@@ -7,6 +7,7 @@ use CachetHQ\Cachet\Models\ComponentGroup;
|
||||
use CachetHQ\Cachet\Models\Tag;
|
||||
use GrahamCampbell\Binput\Facades\Binput;
|
||||
use Illuminate\Routing\Controller;
|
||||
use Illuminate\Support\Facades\Auth;
|
||||
use Illuminate\Support\Facades\Redirect;
|
||||
use Illuminate\Support\Facades\View;
|
||||
|
||||
@@ -105,7 +106,9 @@ class DashComponentController extends Controller
|
||||
public function updateComponentAction(Component $component)
|
||||
{
|
||||
$_component = Binput::get('component');
|
||||
$_component['user_id'] = Auth::user()->id;
|
||||
$tags = array_pull($_component, 'tags');
|
||||
|
||||
$component->update($_component);
|
||||
|
||||
if (! $component->isValid()) {
|
||||
@@ -172,6 +175,7 @@ class DashComponentController extends Controller
|
||||
public function createComponentAction()
|
||||
{
|
||||
$_component = Binput::get('component');
|
||||
$_component['user_id'] = Auth::user()->id;
|
||||
// We deal with tags separately.
|
||||
$tags = array_pull($_component, 'tags');
|
||||
|
||||
|
||||
@@ -7,6 +7,7 @@ use CachetHQ\Cachet\Models\Incident;
|
||||
use CachetHQ\Cachet\Models\IncidentTemplate;
|
||||
use GrahamCampbell\Binput\Facades\Binput;
|
||||
use Illuminate\Routing\Controller;
|
||||
use Illuminate\Support\Facades\Auth;
|
||||
use Illuminate\Support\Facades\Redirect;
|
||||
use Illuminate\Support\Facades\View;
|
||||
|
||||
@@ -95,7 +96,9 @@ class DashIncidentController extends Controller
|
||||
public function createIncidentAction()
|
||||
{
|
||||
$incidentData = Binput::get('incident');
|
||||
$incidentData['user_id'] = Auth::user()->id;
|
||||
$componentStatus = array_pull($incidentData, 'component_status');
|
||||
|
||||
$incident = Incident::create($incidentData);
|
||||
|
||||
if (! $incident->isValid()) {
|
||||
@@ -261,8 +264,9 @@ class DashIncidentController extends Controller
|
||||
*/
|
||||
public function editIncidentAction(Incident $incident)
|
||||
{
|
||||
$_incident = Binput::get('incident');
|
||||
$incident->update($_incident);
|
||||
$incidentData = Binput::get('incident');
|
||||
$incidentData['user_id'] = Auth::user()->id;
|
||||
$incident->update($incidentData);
|
||||
|
||||
if (! $incident->isValid()) {
|
||||
segment_track('Dashboard', [
|
||||
|
||||
@@ -7,6 +7,7 @@ use CachetHQ\Cachet\Models\IncidentTemplate;
|
||||
use Carbon\Carbon;
|
||||
use GrahamCampbell\Binput\Facades\Binput;
|
||||
use Illuminate\Routing\Controller;
|
||||
use Illuminate\Support\Facades\Auth;
|
||||
use Illuminate\Support\Facades\Redirect;
|
||||
use Illuminate\Support\Facades\View;
|
||||
use Illuminate\Support\MessageBag;
|
||||
@@ -81,6 +82,7 @@ class DashScheduleController extends Controller
|
||||
public function addScheduleAction()
|
||||
{
|
||||
$scheduleData = Binput::get('incident');
|
||||
$scheduleData['user_id'] = Auth::user()->id;
|
||||
// Parse the schedule date.
|
||||
$scheduledAt = Carbon::createFromFormat('d/m/Y H:i', $scheduleData['scheduled_at']);
|
||||
|
||||
@@ -155,6 +157,7 @@ class DashScheduleController extends Controller
|
||||
public function editScheduleAction(Incident $schedule)
|
||||
{
|
||||
$scheduleData = Binput::get('incident');
|
||||
$scheduleData['user_id'] = Auth::user()->id
|
||||
// Parse the schedule date.
|
||||
$scheduledAt = Carbon::createFromFormat('d/m/Y H:i', $scheduleData['scheduled_at']);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user