v1.4.0 - Added category search on the app
Added comments Fixed code Fixed pagination still being there without using it
This commit is contained in:
@@ -71,8 +71,6 @@ class UserController extends Controller
|
||||
"email" => "required",
|
||||
"password" => "required|max:60",
|
||||
"phone" => "required|max:8|min:8",
|
||||
//"eduenddate" => "",
|
||||
//"education" => "required"
|
||||
]);
|
||||
|
||||
|
||||
@@ -97,9 +95,6 @@ class UserController extends Controller
|
||||
$user->assignRole($roles);
|
||||
$user->save();
|
||||
|
||||
|
||||
|
||||
|
||||
return redirect()->route('users.index');
|
||||
}
|
||||
|
||||
@@ -132,7 +127,6 @@ class UserController extends Controller
|
||||
if($id == 1)
|
||||
return redirect()->route("users.index");
|
||||
|
||||
|
||||
return Response::detect("users.edit", [
|
||||
"user" => $user,
|
||||
"roles" => $roles,
|
||||
@@ -162,6 +156,7 @@ class UserController extends Controller
|
||||
$allUsersEmail = User::query()->where('email', '=', $request->email)->where('id', '!=', $id)->get();
|
||||
$allUsersPhone = User::query()->where('phone', '=', $request->phone)->where('id', '!=', $id)->get();
|
||||
|
||||
// If you're editing yourself or you have permission to edit others...
|
||||
if($id === Auth::id() || auth()->user()->hasPermissionTo("user.edit")) {
|
||||
if ($request->roles != null && auth()->user()->hasPermissionTo("user.edit")) { //You can only edit roles on the admin site, so if there is an input roles, then update user info and edit roles
|
||||
if(count($allUsersEmail) > 0)
|
||||
@@ -190,7 +185,7 @@ class UserController extends Controller
|
||||
}
|
||||
}
|
||||
}
|
||||
$users = User::query()->paginate(20);
|
||||
$users = User::query()->get();
|
||||
|
||||
return redirect()->route("users.index");
|
||||
}
|
||||
@@ -234,8 +229,6 @@ class UserController extends Controller
|
||||
return redirect()->route("root.index");
|
||||
}
|
||||
|
||||
|
||||
|
||||
if (request()->cookie('languagesSetting') == "dk")
|
||||
return redirect()->back(303)->with('error#wrongcredentials', '<p class="text-center text-white"><b>Email eller Password matchede ikke!</b></p>');
|
||||
if (request()->cookie('languagesSetting') == "en")
|
||||
@@ -382,7 +375,7 @@ class UserController extends Controller
|
||||
else
|
||||
return redirect()->route("users.account")->with('success#credentialschanged', '<p class="text-center"><b>Dine oplysninger er hermed ændret!</b></p>');
|
||||
}
|
||||
$users = User::query()->paginate(20);
|
||||
$users = User::query()->get();
|
||||
|
||||
return redirect()->route("users.index");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user