- added Aportador Solidario to registration
- added email_paypal and username_telegram
This commit is contained in:
@@ -34,9 +34,6 @@ var UserSchema = new mongoose.Schema({
|
||||
message: '{VALUE} is not a valid email'
|
||||
}*/
|
||||
},
|
||||
cell: {
|
||||
type: String,
|
||||
},
|
||||
idapp: {
|
||||
type: String,
|
||||
required: true,
|
||||
@@ -111,6 +108,9 @@ var UserSchema = new mongoose.Schema({
|
||||
news_on: {
|
||||
type: Boolean
|
||||
},
|
||||
aportador_solidario: {
|
||||
type: String,
|
||||
},
|
||||
profile: {
|
||||
img: {
|
||||
type: String
|
||||
@@ -118,6 +118,12 @@ var UserSchema = new mongoose.Schema({
|
||||
cell: {
|
||||
type: String
|
||||
},
|
||||
email_paypal: {
|
||||
type: String
|
||||
},
|
||||
username_telegram: {
|
||||
type: String
|
||||
},
|
||||
dateofbirth: {
|
||||
type: Date,
|
||||
},
|
||||
@@ -376,7 +382,7 @@ UserSchema.statics.getUsersListByParams = function (params) {
|
||||
*/
|
||||
|
||||
UserSchema.statics.getFieldsForSearch = function () {
|
||||
return ['name', 'surname', 'email', 'cell']
|
||||
return ['name', 'surname', 'email', 'profile.cell', 'profile.email_paypal', 'profile.username_telegram', 'aportador_solidario']
|
||||
};
|
||||
|
||||
UserSchema.statics.executeQueryTable = function (idapp, params) {
|
||||
|
||||
@@ -246,7 +246,8 @@ router.patch('/chval', authenticate, (req, res) => {
|
||||
|
||||
tools.mylogshow('PATCH CHVAL: ', id, fieldsvalue);
|
||||
|
||||
if (!User.isAdmin(req.user) && !User.isManager(req.user)) {
|
||||
// If I change my record...
|
||||
if ((!User.isAdmin(req.user) && !User.isManager(req.user)) || (req.user._id === id)) {
|
||||
// If without permissions, exit
|
||||
return res.status(404).send({ code: server_constants.RIS_CODE_ERR_UNAUTHORIZED, msg: '' });
|
||||
}
|
||||
@@ -388,6 +389,11 @@ router.get('/loadsite/:userId/:idapp/:sall', authenticate_noerror, (req, res) =>
|
||||
return Promise.all([bookedevent, eventlist, operators, wheres, contribtype, settings, permissions, disciplines, newstosent, mailinglist, mypage, gallery])
|
||||
.then((arrdata) => {
|
||||
// console.table(arrdata);
|
||||
const myuser = req.user;
|
||||
if (myuser) {
|
||||
myuser.password = '';
|
||||
}
|
||||
|
||||
res.send({
|
||||
bookedevent: arrdata[0],
|
||||
eventlist: arrdata[1],
|
||||
@@ -401,6 +407,7 @@ router.get('/loadsite/:userId/:idapp/:sall', authenticate_noerror, (req, res) =>
|
||||
mailinglist: arrdata[9],
|
||||
mypage: arrdata[10],
|
||||
gallery: arrdata[11],
|
||||
myuser,
|
||||
});
|
||||
})
|
||||
.catch((e) => {
|
||||
|
||||
@@ -12,7 +12,7 @@ module.exports = {
|
||||
},
|
||||
|
||||
fieldsUserToChange() {
|
||||
return ['_id', 'username', 'email', 'cell', 'name', 'surname', 'perm', 'date_reg', 'verified_email', 'img', 'ipaddr', 'lasttimeonline', 'profile', 'news_on']
|
||||
return ['_id', 'username', 'email', 'name', 'surname', 'perm', 'date_reg', 'verified_email', 'ipaddr', 'lasttimeonline', 'profile', 'news_on', 'aportador_solidario']
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user