No new feature,No bug fix, Only refactoring (#3949)

* No change in logic !

Just exchanging the if and else code blocks and negating condition.

* remove unneeded else{} block

* Re-indented the code
This commit is contained in:
Iman 2017-09-12 23:58:42 +04:30 committed by snipe
parent 81e358a01d
commit ed4ea7f1f4

View file

@ -116,16 +116,14 @@ class GroupsController extends Controller
$group->permissions = json_encode(Input::get('permission')); $group->permissions = json_encode(Input::get('permission'));
if (!config('app.lock_passwords')) { if (config('app.lock_passwords')) {
return redirect()->route('update/group', $id)->withInput()->with('error', 'Denied! Editing groups is not allowed in the demo.');
}
if ($group->save()) { if ($group->save()) {
return redirect()->to("admin/groups")->with('success', trans('admin/groups/message.success.update')); return redirect()->to("admin/groups")->with('success', trans('admin/groups/message.success.update'));
} }
return redirect()->back()->withInput()->withErrors($group->getErrors()); return redirect()->back()->withInput()->withErrors($group->getErrors());
} else {
return redirect()->route('update/group', $id)->withInput()->with('error', 'Denied! Editing groups is not allowed in the demo.');
}
} }