refactored navbar and added roles to wiki to allow renters to register

This commit is contained in:
2019-02-28 23:30:43 -06:00
parent cfb0126086
commit bd572cc7dc
2 changed files with 10 additions and 5 deletions

View File

@@ -48,6 +48,12 @@ class WikiController extends Controller
$password = md5($request->password);
}
if(Auth::user()->hasRole('User')) {
$role = 1; //User role id from wiki_groupname table
} else if(Auth::user()->hasRole('Renter')) {
$role = 8; //Renter role id from wiki_groupname table
}
//Load the model
$user = new DokuUser;
$member = new DokuMember;
@@ -66,7 +72,7 @@ class WikiController extends Controller
//Get the user from the table to get the uid
$uid = DB::select('SELECT id FROM wiki_user WHERE login = ?', [$name]);
$member->uid = $uid[0]->id;
$member->gid = 1;
$member->gid = $role;
$member->save();
//Return to the dashboard view
return redirect('/dashboard')->with('success', 'Registration successful. Your username is: ' . $name);