Ejemplo n.º 1
0
 /**
  * Show the form for editing the specified resource.
  *
  * @param  int  $id
  * @return \Illuminate\Http\Response
  */
 public function edit($id)
 {
     if (userIsMod() == NULL) {
         return redirect(route("home"))->withErrors(["Non hai i privilegi necessari per l'amministrazione."]);
     }
     return view('layouts.admin.edituser')->withUser(User::find($id));
 }
Ejemplo n.º 2
0
                $course->refs()->attach($uref);
            }
        }
    }
    return redirect(route("admin"))->withSuccess("Referenti impostati con successo.");
}]);
Route::get('/administration/messages', ['as' => 'admin.feedback', 'uses' => 'IssueController@index']);
Route::get('/contact', ['uses' => 'IssueController@create']);
Route::post('/contact', ['as' => 'postContact', 'uses' => 'IssueController@store']);
Route::delete('/administration/feedback/delete/{id}', "IssueController@destroy");
Route::post('/administration/calls/generate', function () {
    if (userIsMod() == NULL) {
        return redirect(route("home"))->withErrors(["Non hai i privilegi necessari per l'amministrazione."]);
    }
    $input = Input::all();
    $class_ = $input['class'] . strtolower($input['section']);
    $users = User::where('class', $class_)->get();
    return view('layouts.admin.genCall')->withUsers($users);
});
Route::get('/administration/courses/{id}/generate', ['as' => 'genCourseCall', function ($id) {
    if (userIsMod() == NULL) {
        return redirect(route("home"))->withErrors(["Non hai i privilegi necessari per l'amministrazione."]);
    }
    if (!$id) {
        return redirect(route("home"))->withErrors(["Corso con id selezionato non presente"]);
    }
    $course = Course::find($id);
    return view('layouts.admin.genCallCourse')->withCourse($course);
}]);
Route::get('/user/{target_id}/edit', ['as' => 'admin.editUser', 'uses' => 'UserController@edit']);
Route::post('/user/{target_id}/update', ['as' => 'admin.updateUser', 'uses' => 'UserController@update']);