mirror of
https://github.com/BookStackApp/BookStack.git
synced 2025-05-18 14:21:05 +00:00
Implemented user, api_tokem & role activity logging
Also refactored some role content, primarily updating the permission controller to be RoleController since it only dealt with roles.
This commit is contained in:
parent
3f7180fa99
commit
da37700ac2
12 changed files with 118 additions and 59 deletions
app/Http/Controllers
|
@ -1,9 +1,9 @@
|
|||
<?php namespace BookStack\Http\Controllers;
|
||||
|
||||
use BookStack\Actions\ActivityType;
|
||||
use BookStack\Api\ApiToken;
|
||||
use BookStack\Auth\User;
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Support\Carbon;
|
||||
use Illuminate\Support\Facades\Hash;
|
||||
use Illuminate\Support\Str;
|
||||
|
||||
|
@ -57,6 +57,8 @@ class UserApiTokenController extends Controller
|
|||
|
||||
session()->flash('api-token-secret:' . $token->id, $secret);
|
||||
$this->showSuccessNotification(trans('settings.user_api_token_create_success'));
|
||||
$this->logActivity(ActivityType::API_TOKEN_CREATE, $token);
|
||||
|
||||
return redirect($user->getEditUrl('/api-tokens/' . $token->id));
|
||||
}
|
||||
|
||||
|
@ -93,6 +95,7 @@ class UserApiTokenController extends Controller
|
|||
])->save();
|
||||
|
||||
$this->showSuccessNotification(trans('settings.user_api_token_update_success'));
|
||||
$this->logActivity(ActivityType::API_TOKEN_UPDATE, $token);
|
||||
return redirect($user->getEditUrl('/api-tokens/' . $token->id));
|
||||
}
|
||||
|
||||
|
@ -117,6 +120,8 @@ class UserApiTokenController extends Controller
|
|||
$token->delete();
|
||||
|
||||
$this->showSuccessNotification(trans('settings.user_api_token_delete_success'));
|
||||
$this->logActivity(ActivityType::API_TOKEN_DELETE, $token);
|
||||
|
||||
return redirect($user->getEditUrl('#api_tokens'));
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue