Group colour API, and make getUser more specific.

このコミットが含まれているのは:
テクニカル諏訪子 2018-01-30 18:38:55 +09:00
コミット 9b4da2246a
2個のファイルの変更46行の追加7行の削除

ファイルの表示

@ -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();
}
}

ファイルの表示

@ -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 () {