server issues, collection management, security issues
This commit is contained in:
parent
ce9f9da8b7
commit
942b1b1911
@ -22,3 +22,5 @@ rajit:bootstrap3-datepicker
|
||||
twbs:bootstrap
|
||||
accounts-google
|
||||
accounts-ui
|
||||
ongoworks:security
|
||||
percolate:synced-cron
|
||||
|
||||
@ -55,7 +55,9 @@ npm-mongo@1.4.39_1
|
||||
oauth@1.1.6
|
||||
oauth2@1.1.5
|
||||
observe-sequence@1.0.7
|
||||
ongoworks:security@1.3.0
|
||||
ordered-dict@1.0.4
|
||||
percolate:synced-cron@1.3.0
|
||||
promise@0.5.1
|
||||
rajit:bootstrap3-datepicker@1.5.0
|
||||
random@1.0.5
|
||||
|
||||
@ -11,12 +11,14 @@
|
||||
|
||||
|
||||
<template name="client">
|
||||
<input type="text" class="form-control" id="date">
|
||||
|
||||
<select id="post">
|
||||
<option value="AC">AC</option>
|
||||
<option value="Health">Health</option>
|
||||
</select>
|
||||
{{#if allowed}}
|
||||
<select id="post">
|
||||
<option value="AC">AC</option>
|
||||
<option value="Health">Health</option>
|
||||
</select>
|
||||
|
||||
<button>Submit</button>
|
||||
<input type="text" class="form-control" id="date">
|
||||
<button>Submit</button>
|
||||
{{/if}}
|
||||
</template>
|
||||
|
||||
@ -1,30 +1,46 @@
|
||||
var allowedu = {};
|
||||
allowedu["ybq987@gmail.com"] = true;
|
||||
allowedu["dweinger@bloomfield.org"] = true;
|
||||
|
||||
var done = false;
|
||||
|
||||
Meteor.subscribe('schedule');
|
||||
|
||||
Template.client.rendered=function() {
|
||||
today = new Date()
|
||||
$('#date').datepicker({
|
||||
startDate: today.toLocaleDateString(),
|
||||
orientation: "top auto",
|
||||
daysOfWeekDisabled: "0,6",
|
||||
autoclose: true,
|
||||
todayHighlight: true
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
// schedule.find({}, {sort: {timestamp: 1}, limit: 2}).fetch()
|
||||
|
||||
Template.client.helpers({
|
||||
|
||||
|
||||
status_class: function() {
|
||||
return statusmap[this.status];
|
||||
}
|
||||
allowed: function() {
|
||||
if (!(Meteor.user() === undefined) && Meteor.user().services.google.email in allowedu) {
|
||||
return true
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
})
|
||||
|
||||
Template.client.events({
|
||||
"focus input": function() {
|
||||
if (!done) {
|
||||
today = new Date()
|
||||
$('#date').datepicker({
|
||||
startDate: today.toLocaleDateString(),
|
||||
orientation: "top auto",
|
||||
daysOfWeekDisabled: "0,6",
|
||||
autoclose: true,
|
||||
todayHighlight: true
|
||||
});
|
||||
done = true;
|
||||
}
|
||||
},
|
||||
|
||||
"click button": function() {
|
||||
pre = document.getElementById("date").value;
|
||||
document.getElementById("date").value = "";
|
||||
|
||||
@ -1,15 +1,31 @@
|
||||
var currentpass = "test";
|
||||
var allowed = {};
|
||||
allowed["ybq987@gmail.com"] = true;
|
||||
allowed["dweinger@bloomfield.org"] = true;
|
||||
|
||||
|
||||
// schedule.permit(['insert', 'update', 'remove']).never().apply();
|
||||
schedule.remove({})
|
||||
schedule.permit(['insert', 'update', 'remove']).never().apply();
|
||||
|
||||
SyncedCron.add({
|
||||
name: 'Remove Entries past today',
|
||||
schedule: function(parser) {
|
||||
return parser.recur().on('00:00:00').time();
|
||||
},
|
||||
job: function() {
|
||||
var today = new Date();
|
||||
|
||||
// Remove matchng Documents
|
||||
schedule.remove({timestamp: {$lt: today}});
|
||||
}
|
||||
});
|
||||
|
||||
SyncedCron.start();
|
||||
|
||||
|
||||
Meteor.methods({
|
||||
|
||||
add_button: function(chrome, pre, post) {
|
||||
if (Meteor.user().services.google.email in allowed) {
|
||||
if (Meteor.user() != undefined && Meteor.user().services.google.email in allowed) {
|
||||
|
||||
madate = pre.split("/");
|
||||
date = new Date();
|
||||
@ -19,7 +35,8 @@ Meteor.methods({
|
||||
|
||||
schedule.insert({
|
||||
"pretext": date.toDateString().slice(0,date.length),
|
||||
"aftertext": post
|
||||
"aftertext": post,
|
||||
"timestamp": date
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user