mirror of
https://github.com/snipe/snipe-it.git
synced 2025-01-12 14:27:33 -08:00
Fix delete method for groups
This commit is contained in:
parent
a0bff94de3
commit
d927aa3273
|
@ -48,7 +48,6 @@ class GroupsController extends Controller
|
||||||
// Get all the available permissions
|
// Get all the available permissions
|
||||||
$permissions = config('permissions');
|
$permissions = config('permissions');
|
||||||
|
|
||||||
|
|
||||||
$selectedPermissions = Input::old('permissions', array());
|
$selectedPermissions = Input::old('permissions', array());
|
||||||
|
|
||||||
// Show the page
|
// Show the page
|
||||||
|
@ -67,12 +66,10 @@ class GroupsController extends Controller
|
||||||
{
|
{
|
||||||
// create a new group instance
|
// create a new group instance
|
||||||
$group = new Group();
|
$group = new Group();
|
||||||
// Update the consumable data
|
|
||||||
$group->name = e(Input::get('name'));
|
$group->name = e(Input::get('name'));
|
||||||
|
$group->permissions = json_encode(Input::get('permission'));
|
||||||
|
|
||||||
// Was the consumable created?
|
|
||||||
if ($group->save()) {
|
if ($group->save()) {
|
||||||
// Redirect to the new consumable page
|
|
||||||
return Redirect::to("admin/groups")->with('success', trans('admin/groups/message.create.success'));
|
return Redirect::to("admin/groups")->with('success', trans('admin/groups/message.create.success'));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -121,9 +118,7 @@ class GroupsController extends Controller
|
||||||
|
|
||||||
if (!config('app.lock_passwords')) {
|
if (!config('app.lock_passwords')) {
|
||||||
|
|
||||||
// Was the consumable created?
|
|
||||||
if ($group->save()) {
|
if ($group->save()) {
|
||||||
// Redirect to the new consumable page
|
|
||||||
return Redirect::to("admin/groups")->with('success', trans('admin/groups/message.create.success'));
|
return Redirect::to("admin/groups")->with('success', trans('admin/groups/message.create.success'));
|
||||||
}
|
}
|
||||||
return Redirect::back()->withInput()->withErrors($group->getErrors());
|
return Redirect::back()->withInput()->withErrors($group->getErrors());
|
||||||
|
@ -148,7 +143,7 @@ class GroupsController extends Controller
|
||||||
if (!config('app.lock_passwords')) {
|
if (!config('app.lock_passwords')) {
|
||||||
try {
|
try {
|
||||||
// Get group information
|
// Get group information
|
||||||
$group = Sentry::getGroupProvider()->findById($id);
|
$group = Group::find($id);
|
||||||
|
|
||||||
// Delete the group
|
// Delete the group
|
||||||
$group->delete();
|
$group->delete();
|
||||||
|
|
Loading…
Reference in a new issue