mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
@@ -96,7 +96,7 @@ class UserController extends Controller
|
||||
$this->updateDashboard($user, $request->get('dashboard'));
|
||||
|
||||
if ($user->save()) {
|
||||
Toastr::success(__('User :username created', ['username', $user->username]));
|
||||
Toastr::success(__('User :username created', ['username' => $user->username]));
|
||||
return redirect(route('users.index'));
|
||||
}
|
||||
|
||||
|
||||
@@ -5,7 +5,8 @@
|
||||
@section('content')
|
||||
<div class="container">
|
||||
<div class="row">
|
||||
<form action="users" method="POST" role="form" class="form-horizontal col-md-8 col-md-offset-2">
|
||||
<form action="{{ route('users.store') }}" method="POST" role="form"
|
||||
class="form-horizontal col-md-8 col-md-offset-2">
|
||||
<legend>@lang('Create User')</legend>
|
||||
|
||||
<div class="form-group @if($errors->has('username')) has-error @endif">
|
||||
|
||||
@@ -5,7 +5,8 @@
|
||||
@section('content')
|
||||
<div class="container">
|
||||
<div class="row">
|
||||
<form action="users/{{ $user->user_id }}" method="POST" role="form" class="form-horizontal col-md-8 col-md-offset-2">
|
||||
<form action="{{ route('users.update', $user->user_id)}}" method="POST" role="form"
|
||||
class="form-horizontal col-md-8 col-md-offset-2">
|
||||
<legend>@lang('Edit User'): {{ $user->username }}</legend>
|
||||
{{ method_field('PUT') }}
|
||||
|
||||
|
||||
@@ -49,14 +49,14 @@
|
||||
user_grid.bootgrid({
|
||||
formatters: {
|
||||
actions: function (column, row) {
|
||||
var edit_button = '<form action="users/' + row['user_id'] + '/edit" method="GET">' +
|
||||
var edit_button = '<form action="{{ route('users.edit', ':user_id') }}'.replace(':user_id', row['user_id']) + '" method="GET">' +
|
||||
'<button type="submit" title="@lang('Edit')" class="btn btn-sm btn-warning"><i class="fa fa-pencil"></i></button>' +
|
||||
'</form> ';
|
||||
|
||||
var delete_button = '<button type="button" title="@lang('Delete')" class="btn btn-sm btn-danger" onclick="return delete_user(' + row['user_id'] + ', \'' + row['username'] + '\');">' +
|
||||
'<i class="fa fa-trash"></i></button> ';
|
||||
|
||||
var manage_button = '<form action="edituser/" method="GET"';
|
||||
var manage_button = '<form action="{{ url('edituser') }}/" method="GET"';
|
||||
|
||||
if (row['level'] >= 5) {
|
||||
manage_button += ' style="visibility:hidden;"'
|
||||
@@ -89,17 +89,17 @@
|
||||
});
|
||||
|
||||
@if(\LibreNMS\Config::get('auth_mechanism') == 'mysql')
|
||||
$('.actionBar').append('<div class="pull-left"><a href="users/create" type="button" class="btn btn-primary">@lang('Add User')</a></div>');
|
||||
$('.actionBar').append('<div class="pull-left"><a href="{{ route('users.create') }}" type="button" class="btn btn-primary">@lang('Add User')</a></div>');
|
||||
@endif
|
||||
|
||||
user_grid.css('display', 'table'); // done loading, show
|
||||
});
|
||||
|
||||
function delete_user(user_id, username)
|
||||
function delete_user(user_id, username, url)
|
||||
{
|
||||
if (confirm('@lang('Are you sure you want to delete ')' + username + '?')) {
|
||||
$.ajax({
|
||||
url: 'users/' + user_id,
|
||||
url: '{{ route('users.destroy', ':user_id') }}'.replace(':user_id', user_id),
|
||||
type: 'DELETE',
|
||||
success: function (msg) {
|
||||
$("#users").bootgrid("remove", [user_id]);
|
||||
|
||||
Reference in New Issue
Block a user