checking for double registration on the wiki
This commit is contained in:
@@ -38,6 +38,13 @@ class WikiController extends Controller
|
||||
$name = Auth::user()->name;
|
||||
$name = strtolower($name);
|
||||
$name = str_replace(' ', '_', $name);
|
||||
|
||||
//Check to see if the user is already registered in the database
|
||||
$check = DB::select('SELECT login FROM wiki_user WHERE login = ?', [$name]);
|
||||
if($check[0]->login === $name) {
|
||||
return redirect('/dashboard')->with('error', 'Already registered for the wiki!');
|
||||
}
|
||||
|
||||
//Add the new user to the wiki
|
||||
$user->login = $name;
|
||||
$user->pass = $password;
|
||||
|
||||
Reference in New Issue
Block a user