diff --git a/app/Http/Controllers/UserController.php b/app/Http/Controllers/UserController.php index e79ecb8..0e69a89 100644 --- a/app/Http/Controllers/UserController.php +++ b/app/Http/Controllers/UserController.php @@ -10,15 +10,53 @@ use Illuminate\Support\Facades\Log; class UserController extends Controller { public function getUsers() { // /api/rpc/user/getusers - return DB::table('for_users') - ->select('*') - ->get(); + return DB::table('for_users') + ->select('*') + ->get(); } public function getUser($id) { // /api/rpc/user/getuser/id - return DB::table('for_users') - ->select('*') - ->where('id', $id) - ->get(); + return DB::table('for_users') + ->select( + 'id', + 'username', + 'perm_id', // Can't remember if this was used TBH. + 'member_title', + 'permission_id', // Same goes for this one. + 'reg_date', + 'website_address', + 'website_name', + 'gender', + 'location', + 'birthday', + 'bio', + 'avatar', + 'timezone', + 'strikes', + 'name_colour', + 'display_name', + 'yt_channel', + 'country', + 'curTZ', 'curDF', 'curTF', // Time and date stuff + 'usr_per_id', 'str_per_id', // Permission stuff. + // TODO: hide the following stuff away from unprivileaged users. + 'email', + 'ip_address', + 'strikes' + ) + ->where('id', $id) + ->get(); + } + + public function getGroupColours() { // /api/rpc/user/getgroupcolours + return DB::table('usr_perm_module') + ->select( + 'name', + 'colour_m', + 'colour_f', + 'colour_u' + // 'badge' (this is a pipeline feature, please don't uncomment for now!) + ) + ->get(); } } diff --git a/routes/web.php b/routes/web.php index a4b030b..ea2383c 100644 --- a/routes/web.php +++ b/routes/web.php @@ -63,6 +63,7 @@ Route::get('/api/rpc/permission/getuserpermissionuser/{id}', 'PermissionControll // Users Route::get('/api/rpc/user/getusers', 'UserController@getUsers'); Route::get('/api/rpc/user/getuser/{id}', 'UserController@getUser'); +Route::get('/api/rpc/user/getgroupcolours', 'UserController@getGroupColours'); // Localization Route::get('/js/lang.js', function () {