Fixed all known bugs; Modified the menu to hide; Fixed the tables to scroll with a fixed header.
This commit is contained in:
@@ -296,7 +296,7 @@ if(Meteor.isServer) {
|
||||
comment: Match.Optional(String)
|
||||
});
|
||||
|
||||
let dateString = date.toString();
|
||||
let dateString = sale.date.toString();
|
||||
|
||||
sale.createdAt = new Date();
|
||||
sale.timestamp = new Date(dateString.substring(0, 4) + "-" + dateString.substring(4, 6) + "-" + dateString.substring(6, 8) + "T00:00:00Z");
|
||||
|
||||
@@ -9,22 +9,22 @@ if(Meteor.isServer) {
|
||||
});
|
||||
|
||||
Meteor.methods({
|
||||
"insertUser": function(user, roles) {
|
||||
"insertUser": function(user) {
|
||||
check(user, {
|
||||
username: String,
|
||||
email: String
|
||||
email: String,
|
||||
roles: [String]
|
||||
});
|
||||
check(roles, [String]);
|
||||
|
||||
//Verify the currently logged in user has authority to manage users.
|
||||
if(Roles.userIsInRole(this.userId, [Meteor.UserRoles.ROLE_MANAGE])) {
|
||||
//Verify the user name isn't already used.
|
||||
if(Meteor.collections.Users.findOne({username: user.username}) == undefined) {
|
||||
if(Meteor.collections.Users.findOne({username: user.username}) === undefined) {
|
||||
let pwd = Random.secret(20);
|
||||
let id = Accounts.createUser({password: pwd, username: user.username, email: user.email});
|
||||
|
||||
//Requires the alanning:roles package.
|
||||
Roles.addUsersToRoles(id, roles);
|
||||
Roles.addUsersToRoles(id, user.roles);
|
||||
}
|
||||
else {
|
||||
throw new Meteor.Error(400, "User already exists.");
|
||||
|
||||
Reference in New Issue
Block a user