@@ -201,6 +196,7 @@
{{/if}}
+
@@ -209,12 +205,14 @@
+
+
This app is Free Software, under the MIT License
Built by Enrico Fasoli
@@ -223,6 +221,7 @@
+
@@ -233,6 +232,7 @@
+
A fast, free, organized way to manage your school tasks.
@@ -264,3 +264,21 @@
{{/unless}}
+
+
+
+
+
+ {{> yield region='outside'}}
+
+ {{> yield}}
+
+
+
{{> footer}}
+
+ {{> ribbon}}
+
diff --git a/server/accounts.coffee b/server/accounts.coffee
index e6f3795..43b78a8 100644
--- a/server/accounts.coffee
+++ b/server/accounts.coffee
@@ -1,20 +1,23 @@
# Homework - Server side accounts code
+# Regular Expression to see if an email can be valid
validateEmail = (email) ->
x = /^([\w-\.]+)@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.)|(([\w-]+\.)+))([a-zA-Z]{2,4}|[0-9]{1,3})(\]?)$/
x.test email
-Accounts.validateNewUser (user) ->
- mail = user.emails[0].address
- if Match.test(mail,String) is no or validateEmail(mail) is no
- throw new Meteor.Error 403, "Invalid Email"
- return yes
-
Accounts.config {
sendVerificationEmail: true
loginExpirationInDays: 1
}
+# Code that checks if a new user request is valid
+Accounts.validateNewUser (user) ->
+ mail = user.emails[0].address
+ if Match.test(mail,String) is no or validateEmail(mail) is no
+ throw new Meteor.Error 403, "Invalid Email"
+ return yes
+
+# Email configuration code
Accounts.emailTemplates.siteName = "Homework App"
Accounts.emailTemplates.verifyEmail.text = (user,url) ->
urlist = url.split('/'); token = urlist[urlist.length-1]
diff --git a/server/server.coffee b/server/server.coffee
index 7661c4c..e9c5bab 100644
--- a/server/server.coffee
+++ b/server/server.coffee
@@ -29,6 +29,7 @@ notes.allow insert: isUsers, update: isUsers, remove: isUsers
# Methods that the clients can invoke
Meteor.methods
+ # Request another confirmation email.
resendConfirmEmail: ->
u = getUser(@userId)
if not u
@@ -40,6 +41,7 @@ Meteor.methods
else
console.log "User "+u.emails[0].address+" already validated."
return no
+ # Request user's account to be deleted
deleteMe: ->
if @userId
Meteor.users.remove @userId
@@ -47,4 +49,5 @@ Meteor.methods
Meteor.users.update {_id: @userId},
{$set : { "resume.loginTokens" : [] } }, { multi: yes }
return yes
- else no
+ no
+ version: -> "1.0" # Request server version number.