Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def register(user, filename, file, password, confirm)
- if(password != confirm) then return false end
- if(not_found(user) == user)
- user = html_clean(user)
- password = html_clean(password)
- upload_file(filename, file)
- n = SecureRandom.hex
- p = password + n
- hashed = Digest::SHA256.hexdigest p
- @db.prepare("INSERT INTO Users VALUES(?,?,#{filename},
- {n}")").execute([user,hashed])
- end
- true
- end
Add Comment
Please, Sign In to add comment