This commit is contained in:
Steve Coast 2006-08-01 14:53:49 +00:00
parent d2877982a2
commit 88297a682c
7 changed files with 25 additions and 19 deletions

View file

@ -1,8 +1,9 @@
class UserController < ApplicationController
def create
# do some checks, find the user then send the mail
Notifier::deliver_confirm_signup(user)
def save
@user = User.new(params[:user])
# @user.save
#Notifier::deliver_confirm_signup(user)
end
def new

View file

@ -3,17 +3,20 @@ require 'digest/md5'
class User < ActiveRecord::Base
has_many :traces
def passwd=(str)
write_attribute("pass_crypt", Digest::MD5.hexdigest(str))
end
validates_confirmation_of :pass_crypt
def passwd
return self.pass_crypt
end
# def password=(str)
# write_attribute("pass_crypt", Digest::MD5.hexdigest(str))
# end
def self.authenticate(username, passwd)
find_first([ "display_name = ? AND pass_crypt =?",
username,
Digest::MD5.hexdigest(passwd) ])
end
# def password
# return self.pass_crypt
# end
# def self.authenticate(username, passwd)
# find_first([ "display_name = ? AND pass_crypt =?",
# username,
# Digest::MD5.hexdigest(passwd) ])
# end
end

View file

@ -3,12 +3,12 @@ Fill in the form and we'll send you a quick email to activate your account.<br><
By creating an account, you agree that all work uploaded to openstreetmap.org and all data created by use of any tools on openstreetmap.org is to be licensed under <a href="http://creativecommons.org/licenses/by-sa/2.0/">this</a> Creative Commons license.<br><br>
<%= start_form_tag :action => 'signup' %>
<%= start_form_tag :action => 'save' %>
<table>
<tr><td>email address:</td><td><%= text_field('user', 'email',{:size => 50, :maxlength => 255}) %></td></tr>
<tr><td>Login name</td><td><%= text_field('user', 'display_name',{:size => 50, :maxlength => 255}) %></td></tr>
<tr><td>password:</td><td><%= password_field('user', 'password',{:size => 50, :maxlength => 255}) %></td></tr>
<tr><td>retype password:</td><td><%= password_field('user', 'password_confirm',{:size => 50, :maxlength => 255}) %></td></tr>
<tr><td>password:</td><td><%= password_field('user', 'pass_crypt',{:size => 50, :maxlength => 255}) %></td></tr>
<tr><td>retype password:</td><td><%= password_field('user', 'pass_crypt_confirmation',{:size => 50, :maxlength => 255}) %></td></tr>
</table>
<br>

View file

@ -1 +1,3 @@
blah
<%= @user.email %>