Skip to content

Commit

Permalink
Email and passwd must be le 255 chars
Browse files Browse the repository at this point in the history
  • Loading branch information
eedeebee committed Mar 2, 2012
1 parent 7ccdd04 commit cf78f37
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion controller/signup.xqy
Expand Up @@ -18,7 +18,13 @@ return if (not(exists($signed_request))) then
let $signup := xdmp:get-request-field("list", "off")

(: validate email addy, passwords, etc :)
let $valid := util:validateEmail($email) and ($password eq $confirm-password) and ($name and not($name eq ""))
let $valid := util:validateEmail($email) and
(fn:string-length($email) le 255) and
(fn:string-length($password) le 255) and
($password and not($password eq "")) and
($password eq $confirm-password) and
($name and not($name eq "")) and
true()

(: rely on nice client side error messages; this validation is for protection, so no need to be nice with error text :)
let $user := if ($valid) then users:createOrUpdateUser($name, $email, $password, $signup)
Expand Down

0 comments on commit cf78f37

Please sign in to comment.