checking for double registration on the wiki

This commit is contained in:
2018-10-27 04:02:46 -05:00
parent 9529ad90a0
commit 0b917bc456

View File

@@ -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;