-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add user_log code from internal razeedash
- Loading branch information
Showing
4 changed files
with
44 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
// Colletion to hold all user log entries | ||
|
||
import { Mongo } from 'meteor/mongo'; | ||
import SimpleSchema from 'simpl-schema'; | ||
|
||
export const UserLog = new Mongo.Collection('user_log'); | ||
|
||
UserLog.deny({ | ||
insert() { return true; }, | ||
update() { return true; }, | ||
remove() { return true; }, | ||
}); | ||
|
||
const userLogSchema = new SimpleSchema({ | ||
userid: { type: String, index: true }, | ||
action: { type: String, index: true }, | ||
message: { type: String, required: true }, | ||
created: { type: Date, required: true, }, | ||
}); | ||
|
||
UserLog.attachSchema(userLogSchema); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
import { UserLog } from './userLog.js'; | ||
|
||
const logUserAction = function(userid, action, message) { | ||
UserLog.insert({ userid: userid, action: action, message: message, created: new Date() }); | ||
}; | ||
|
||
export { logUserAction }; |