FIX: fix minor bug in user management
This commit is contained in:
@@ -9,7 +9,7 @@ class UserRoles extends BaseEnumeration
|
|||||||
{
|
{
|
||||||
$roles = [
|
$roles = [
|
||||||
User::ROLE_ADMIN => 'admin/userManagement.role_' . User::ROLE_ADMIN,
|
User::ROLE_ADMIN => 'admin/userManagement.role_' . User::ROLE_ADMIN,
|
||||||
User::ROLE_EDITOR => 'admin/userManagement.role_' . User::ROLE_EDITOR,
|
// User::ROLE_EDITOR => 'admin/userManagement.role_' . User::ROLE_EDITOR,
|
||||||
User::ROLE_VISITOR => 'admin/userManagement.role_' . User::ROLE_VISITOR
|
User::ROLE_VISITOR => 'admin/userManagement.role_' . User::ROLE_VISITOR
|
||||||
];
|
];
|
||||||
|
|
||||||
|
|||||||
@@ -39,7 +39,7 @@ class EditUser extends Controller
|
|||||||
public function getEditUser(User $user = null)
|
public function getEditUser(User $user = null)
|
||||||
{
|
{
|
||||||
// when no user specified, lets assume we want to edit "me"
|
// when no user specified, lets assume we want to edit "me"
|
||||||
if (!$user->exists()) {
|
if (!$user->exists) {
|
||||||
$user = Auth::user();
|
$user = Auth::user();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -25,10 +25,11 @@ class UserDetail extends Controller
|
|||||||
public function getDetail(User $user = null)
|
public function getDetail(User $user = null)
|
||||||
{
|
{
|
||||||
// when no user specified, lets assume we want to edit "me"
|
// when no user specified, lets assume we want to edit "me"
|
||||||
if (!$user->exists()) {
|
if (!$user->exists) {
|
||||||
$id = Auth::user();
|
$user = Auth::user();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
$actions = $this->log->getUserActions($user->id, 10);
|
$actions = $this->log->getUserActions($user->id, 10);
|
||||||
$roles = UserRoles::getWithTranslations();
|
$roles = UserRoles::getWithTranslations();
|
||||||
$states = UserStates::getWithTranslations();
|
$states = UserStates::getWithTranslations();
|
||||||
|
|||||||
@@ -5,6 +5,7 @@ namespace App\Http\Controllers\Auth;
|
|||||||
use App\Http\Controllers\Controller;
|
use App\Http\Controllers\Controller;
|
||||||
use Illuminate\Foundation\Auth\AuthenticatesUsers;
|
use Illuminate\Foundation\Auth\AuthenticatesUsers;
|
||||||
use Illuminate\Support\Facades\Auth;
|
use Illuminate\Support\Facades\Auth;
|
||||||
|
use Illuminate\Support\Facades\Session;
|
||||||
|
|
||||||
class LoginController extends Controller
|
class LoginController extends Controller
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -20,7 +20,7 @@ class Authenticate
|
|||||||
public function handle($request, Closure $next, $guard = null)
|
public function handle($request, Closure $next, $guard = null)
|
||||||
{
|
{
|
||||||
if (!Auth::guard($guard)
|
if (!Auth::guard($guard)
|
||||||
->check() || Auth::user()->status != User::STATE_ACTIVE || Auth::user()->role == User::ROLE_VISITOR) {
|
->check() || Auth::user()->status != User::STATE_ACTIVE || Auth::user()->role == User::ROLE_VISITOR || 0) {
|
||||||
Auth::logout();
|
Auth::logout();
|
||||||
|
|
||||||
if ($request->ajax()) {
|
if ($request->ajax()) {
|
||||||
@@ -38,8 +38,7 @@ class Authenticate
|
|||||||
|
|
||||||
return redirect()
|
return redirect()
|
||||||
->route('login')
|
->route('login')
|
||||||
->with('warning', trans($message))
|
->with('warning', trans($message));
|
||||||
->with('redirectTo', $request->fullUrl());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return $next($request);
|
return $next($request);
|
||||||
|
|||||||
Reference in New Issue
Block a user