change to User ID - change mail var _DISPLAYNAME _DISPLAY_NAME

This commit is contained in:
negue
2019-01-04 21:04:41 +01:00
parent 73ecdced01
commit 61606cb69d
11 changed files with 22 additions and 21 deletions

View File

@@ -15,7 +15,7 @@ module.exports = {
guildsPaginateBooleanString: 'req.query.paginate must be a boolean string.', guildsPaginateBooleanString: 'req.query.paginate must be a boolean string.',
groupIdRequired: 'req.params.groupId must contain a groupId.', groupIdRequired: 'req.params.groupId must contain a groupId.',
groupRemainOrLeaveChallenges: 'req.query.keep must be either "remain-in-challenges" or "leave-challenges"', groupRemainOrLeaveChallenges: 'req.query.keep must be either "remain-in-challenges" or "leave-challenges"',
managerIdRequired: 'req.body.managerId must contain a user ID.', managerIdRequired: 'req.body.managerId must contain a User ID.',
noSudoAccess: 'You don\'t have sudo access.', noSudoAccess: 'You don\'t have sudo access.',
eventRequired: '"req.params.event" is required.', eventRequired: '"req.params.event" is required.',

View File

@@ -230,9 +230,9 @@
"memberCannotRemoveYourself": "You cannot remove yourself!", "memberCannotRemoveYourself": "You cannot remove yourself!",
"groupMemberNotFound": "User not found among group's members", "groupMemberNotFound": "User not found among group's members",
"mustBeGroupMember": "Must be member of the group.", "mustBeGroupMember": "Must be member of the group.",
"canOnlyInviteEmailUuid": "Can only invite using user IDs, emails, or usernames.", "canOnlyInviteEmailUuid": "Can only invite using User IDs, emails, or usernames.",
"inviteMissingEmail": "Missing email address in invite.", "inviteMissingEmail": "Missing email address in invite.",
"inviteMissingUuid": "Missing user id in invite", "inviteMissingUuid": "Missing User ID in invite",
"inviteMustNotBeEmpty": "Invite must not be empty.", "inviteMustNotBeEmpty": "Invite must not be empty.",
"partyMustbePrivate": "Parties must be private", "partyMustbePrivate": "Parties must be private",
"userAlreadyInGroup": "UserID: <%= userId %>, User \"<%= username %>\" already in that group.", "userAlreadyInGroup": "UserID: <%= userId %>, User \"<%= username %>\" already in that group.",

View File

@@ -45,7 +45,7 @@
"messageAuthEmailTaken": "Email already taken", "messageAuthEmailTaken": "Email already taken",
"messageAuthNoUserFound": "No user found.", "messageAuthNoUserFound": "No user found.",
"messageAuthMustBeLoggedIn": "You must be logged in.", "messageAuthMustBeLoggedIn": "You must be logged in.",
"messageAuthMustIncludeTokens": "You must include a token and uid (user id) in your request", "messageAuthMustIncludeTokens": "You must include a token and uid (User ID) in your request",
"messageGroupAlreadyInParty": "Already in a party, try refreshing.", "messageGroupAlreadyInParty": "Already in a party, try refreshing.",
"messageGroupOnlyLeaderCanUpdate": "Only the group leader can update the group!", "messageGroupOnlyLeaderCanUpdate": "Only the group leader can update the group!",

View File

@@ -49,7 +49,7 @@ let api = {};
* @apiSuccess {String} challenge.name Full name of challenge. * @apiSuccess {String} challenge.name Full name of challenge.
* @apiSuccess {String} challenge.shortName A shortened name for the challenge, to be used as a tag. * @apiSuccess {String} challenge.shortName A shortened name for the challenge, to be used as a tag.
* @apiSuccess {Object} challenge.leader User details of challenge leader. * @apiSuccess {Object} challenge.leader User details of challenge leader.
* @apiSuccess {UUID} challenge.leader._id User id of challenge leader. * @apiSuccess {UUID} challenge.leader._id User ID of challenge leader.
* @apiSuccess {Object} challenge.leader.profile Profile information of leader. * @apiSuccess {Object} challenge.leader.profile Profile information of leader.
* @apiSuccess {Object} challenge.leader.profile.name Display Name of leader. * @apiSuccess {Object} challenge.leader.profile.name Display Name of leader.
* @apiSuccess {String} challenge.updatedAt Timestamp of last update. * @apiSuccess {String} challenge.updatedAt Timestamp of last update.

View File

@@ -289,7 +289,7 @@ api.likeChat = {
* @apiSuccess {Object} data.likes The likes of the message * @apiSuccess {Object} data.likes The likes of the message
* @apiSuccess {Object} data.flags The flags of the message * @apiSuccess {Object} data.flags The flags of the message
* @apiSuccess {Number} data.flagCount The number of flags the message has * @apiSuccess {Number} data.flagCount The number of flags the message has
* @apiSuccess {UUID} data.uuid The user id of the author of the message * @apiSuccess {UUID} data.uuid The User ID of the author of the message
* @apiSuccess {String} data.user The username of the author of the message * @apiSuccess {String} data.user The username of the author of the message
* *
* @apiUse GroupNotFound * @apiUse GroupNotFound

View File

@@ -941,11 +941,11 @@ api.removeGroupMember = {
* {"name": "User2", "email": "user-2@example.com"} * {"name": "User2", "email": "user-2@example.com"}
* ] * ]
* } * }
* @apiParamExample {json} User Ids * @apiParamExample {json} User IDs
* { * {
* "uuids": ["user-id-of-existing-user", "user-id-of-another-existing-user"] * "uuids": ["user-id-of-existing-user", "user-id-of-another-existing-user"]
* } * }
* @apiParamExample {json} User Ids and Emails * @apiParamExample {json} User IDs and Emails
* { * {
* "emails": [ * "emails": [
* {"email": "user-1@example.com"}, * {"email": "user-1@example.com"},
@@ -955,7 +955,7 @@ api.removeGroupMember = {
* } * }
* *
* @apiSuccess {Array} data The invites * @apiSuccess {Array} data The invites
* @apiSuccess {Object} data[0] If the invitation was a user id, you'll receive back an object. You'll receive one Object for each succesful user id invite. * @apiSuccess {Object} data[0] If the invitation was a User ID, you'll receive back an object. You'll receive one Object for each succesful User ID invite.
* @apiSuccess {String} data[1] If the invitation was an email, you'll receive back the email. You'll receive one String for each successful email invite. * @apiSuccess {String} data[1] If the invitation was an email, you'll receive back the email. You'll receive one String for each successful email invite.
* *
* @apiSuccessExample {json} Successful Response with Emails * @apiSuccessExample {json} Successful Response with Emails
@@ -966,13 +966,13 @@ api.removeGroupMember = {
* ] * ]
* } * }
* *
* @apiSuccessExample {json} Successful Response with User Id * @apiSuccessExample {json} Successful Response with User ID
* { * {
* "data": [ * "data": [
* { id: 'the-id-of-the-invited-user', name: 'The group name', inviter: 'your-user-id' } * { id: 'the-id-of-the-invited-user', name: 'The group name', inviter: 'your-user-id' }
* ] * ]
* } * }
* @apiSuccessExample {json} Successful Response with User Ids and Emails * @apiSuccessExample {json} Successful Response with User IDs and Emails
* { * {
* "data": [ * "data": [
* "user-1@example.com", * "user-1@example.com",
@@ -987,9 +987,9 @@ api.removeGroupMember = {
* param `Array`. * param `Array`.
* @apiError (400) {BadRequest} UuidOrEmailOnly The `emails` and `uuids` params were both missing and/or a * @apiError (400) {BadRequest} UuidOrEmailOnly The `emails` and `uuids` params were both missing and/or a
* key other than `emails` or `uuids` was provided in the body param. * key other than `emails` or `uuids` was provided in the body param.
* @apiError (400) {BadRequest} CannotInviteSelf User id or email of invitee matches that of the inviter. * @apiError (400) {BadRequest} CannotInviteSelf User ID or email of invitee matches that of the inviter.
* @apiError (400) {BadRequest} MustBeArray The `uuids` or `emails` body param was not an array. * @apiError (400) {BadRequest} MustBeArray The `uuids` or `emails` body param was not an array.
* @apiError (400) {BadRequest} TooManyInvites A max of 100 invites (combined emails and user ids) can * @apiError (400) {BadRequest} TooManyInvites A max of 100 invites (combined emails and User IDs) can
* be sent out at a time. * be sent out at a time.
* @apiError (400) {BadRequest} ExceedsMembersLimit A max of 30 members can join a party. * @apiError (400) {BadRequest} ExceedsMembersLimit A max of 30 members can join a party.
* *

View File

@@ -143,7 +143,7 @@ const heroAdminFields = 'contributor balance profile.name purchased items auth f
/** /**
* @api {get} /api/v3/hall/heroes/:heroId Get any user ("hero") given the UUID * @api {get} /api/v3/hall/heroes/:heroId Get any user ("hero") given the UUID
* @apiParam (Path) {UUID} heroId user ID * @apiParam (Path) {UUID} heroId User ID
* @apiName GetHero * @apiName GetHero
* @apiGroup Hall * @apiGroup Hall
* @apiPermission Admin * @apiPermission Admin
@@ -188,7 +188,7 @@ const gemsPerTier = {1: 3, 2: 3, 3: 3, 4: 4, 5: 4, 6: 4, 7: 4, 8: 0, 9: 0};
/** /**
* @api {put} /api/v3/hall/heroes/:heroId Update any user ("hero") * @api {put} /api/v3/hall/heroes/:heroId Update any user ("hero")
* @apiParam (Path) {UUID} heroId user ID * @apiParam (Path) {UUID} heroId User ID
* @apiName UpdateHero * @apiName UpdateHero
* @apiGroup Hall * @apiGroup Hall
* @apiPermission Admin * @apiPermission Admin

View File

@@ -18,12 +18,13 @@ let api = {};
* @apiSuccess {Object} data.likes The likes of the message (always an empty object) * @apiSuccess {Object} data.likes The likes of the message (always an empty object)
* @apiSuccess {Object} data.flags The flags of the message * @apiSuccess {Object} data.flags The flags of the message
* @apiSuccess {Number} data.flagCount The number of flags the message has * @apiSuccess {Number} data.flagCount The number of flags the message has
* @apiSuccess {UUID} data.uuid The user id of the author of the message, or of the recipient if `sent` is true * @apiSuccess {UUID} data.uuid The User ID of the author of the message, or of the recipient if `sent` is true
* @apiSuccess {String} data.user The Display Name of the author of the message, or of the recipient if `sent` is true * @apiSuccess {String} data.user The Display Name of the author of the message, or of the recipient if `sent` is true
* @apiSuccess {String} data.username The Username of the author of the message, or of the recipient if `sent` is true
* *
* @apiUse MessageNotFound * @apiUse MessageNotFound
* @apiUse MessageIdRequired * @apiUse MessageIdRequired
* @apiError (400) {BadRequest} messageGroupChatFlagAlreadyReported The message has already been flagged * @apiError (400) {BadRequest} messageGroupChatFlagAlreadyReported You have already reported this message
*/ */
api.flagPrivateMessage = { api.flagPrivateMessage = {
method: 'POST', method: 'POST',

View File

@@ -19,7 +19,7 @@ export default class ChatReporter {
{name: 'MESSAGE_TIME', content: (new Date(message.timestamp)).toString()}, {name: 'MESSAGE_TIME', content: (new Date(message.timestamp)).toString()},
{name: 'MESSAGE_TEXT', content: message.text}, {name: 'MESSAGE_TEXT', content: message.text},
{name: 'REPORTER_DISPLAYNAME', content: this.user.profile.name}, {name: 'REPORTER_DISPLAY_NAME', content: this.user.profile.name},
{name: 'REPORTER_USERNAME', content: this.user.auth.local.username}, {name: 'REPORTER_USERNAME', content: this.user.auth.local.username},
{name: 'REPORTER_UUID', content: this.user._id}, {name: 'REPORTER_UUID', content: this.user._id},
{name: 'REPORTER_EMAIL', content: reporterEmail}, {name: 'REPORTER_EMAIL', content: reporterEmail},
@@ -36,7 +36,7 @@ export default class ChatReporter {
createGenericAuthorVariables (prefix, {user, username, uuid, email}) { createGenericAuthorVariables (prefix, {user, username, uuid, email}) {
return [ return [
{name: `${prefix}_DISPLAYNAME`, content: user}, {name: `${prefix}_DISPLAY_NAME`, content: user},
{name: `${prefix}_USERNAME`, content: username}, {name: `${prefix}_USERNAME`, content: username},
{name: `${prefix}_UUID`, content: uuid}, {name: `${prefix}_UUID`, content: uuid},
{name: `${prefix}_EMAIL`, content: email}, {name: `${prefix}_EMAIL`, content: email},

View File

@@ -6,7 +6,7 @@ import { Strategy as GoogleStrategy } from 'passport-google-oauth20';
// Passport session setup. // Passport session setup.
// To support persistent login sessions, Passport needs to be able to // To support persistent login sessions, Passport needs to be able to
// serialize users into and deserialize users out of the session. Typically, // serialize users into and deserialize users out of the session. Typically,
// this will be as simple as storing the user ID when serializing, and finding // this will be as simple as storing the User ID when serializing, and finding
// the user by ID when deserializing. However, since this example does not // the user by ID when deserializing. However, since this example does not
// have a database of user records, the complete Facebook profile is serialized // have a database of user records, the complete Facebook profile is serialized
// and deserialized. // and deserialized.

View File

@@ -392,7 +392,7 @@ function getInviteCount (uuids, emails) {
/** /**
* Checks invitation uuids and emails for possible errors. * Checks invitation uuids and emails for possible errors.
* *
* @param uuids An array of user ids * @param uuids An array of User IDs
* @param emails An array of emails * @param emails An array of emails
* @param res Express res object for use with translations * @param res Express res object for use with translations
* @throws BadRequest An error describing the issue with the invitations * @throws BadRequest An error describing the issue with the invitations