This commit is contained in:
Bryan Ashby 2023-01-02 16:55:36 -07:00
parent bc0f7690f8
commit 092acc0138
No known key found for this signature in database
GPG Key ID: C2C1B501E4EFD994
4 changed files with 8480 additions and 8489 deletions

View File

@ -22,6 +22,16 @@ exports.moduleInfo = {
packageName: 'codes.l33t.enigma.web.handler.finger', packageName: 'codes.l33t.enigma.web.handler.finger',
}; };
// :TODO: more info in default
const DefaultProfileTemplate = `
User information for: %USERNAME%
Real Name: %REAL_NAME%
Login Count: %LOGIN_COUNT%
Affiliations: %AFFILIATIONS%
Achievement Points: %ACHIEVEMENT_POINTS%
`;
// //
// WebFinger: https://www.rfc-editor.org/rfc/rfc7033 // WebFinger: https://www.rfc-editor.org/rfc/rfc7033
// //
@ -175,17 +185,7 @@ exports.getModule = class WebFingerServerModule extends WebHandlerModule {
); );
} }
// :TODO: more info in default return cb(DefaultProfileTemplate, 'text/plain');
return cb(
`
User information for: %USERNAME%
Real Name: %REAL_NAME%
Login Count: %LOGIN_COUNT%
Affiliations: %AFFILIATIONS%
Achievement Points: %ACHIEVEMENT_POINTS%`,
'text/plain'
);
} }
return cb(data, mimeTypes.contentType(paths.basename(templateFile))); return cb(data, mimeTypes.contentType(paths.basename(templateFile)));
}); });
@ -313,7 +313,10 @@ Achievement Points: %ACHIEVEMENT_POINTS%`,
} }
const accountStatus = user.getPropertyAsNumber(UserProps.AccountStatus); const accountStatus = user.getPropertyAsNumber(UserProps.AccountStatus);
if (User.AccountStatus.disabled == accountStatus || User.AccountStatus.inactive == accountStatus) { if (
User.AccountStatus.disabled == accountStatus ||
User.AccountStatus.inactive == accountStatus
) {
this._notFound(resp); this._notFound(resp);
return cb( return cb(
Errors.AccessDenied('Account disabled', ErrorReasons.Disabled) Errors.AccessDenied('Account disabled', ErrorReasons.Disabled)

3658
yarn.lock

File diff suppressed because it is too large Load Diff