How to create a change password web form and send email noti

Hi all

I am looking for a web page or application that will allow an user to
change his/her database password. I am thinking about a web form where
end users enter the current password and the new password, hit submit
and the new password replaces the old one. Then the web form sends an
email notification

The database is an Oracle 10G database.

Is there any RoR project that does that?

thanks

simple version from one of our apps:

model:

attr_accessor :password_confirmation
attr_protected :password, :password_confirmation

validates_confirmation_of :password, :message => “the passwords don’t
match”

form:

<%= error_messages_for(:login) if @login %>

<% form_for(@login, :url => update_login_members_path) do %> Inloggegevens Gebruikersnaam:<%= h(@login.user_name) %>

<%= label(:login, :password, "* Wachtwoord:") %><%= password_field(:login, :password, :size => 40) %> (minimaal 6 tekens)
<%= label(:login, :password_confirmation, "* Wachtwoord 2:") %>< %= password_field(:login, :password_confirmation, :size => 40) %>  (minimaal 6 tekens)
<%= submit_tag 'Wijzigen' %> <% end %>

controller:

def update_login
@login = current_login
@login.password = params[:login][:password]
@login.password_confirmation = params[:login]
[:password_confirmation]

if @login.update_attributes(params[:login])
  flash[:notice] = 'Uw inlog gegevens zijn geupdate.'

# here would go your code to send an email

end
render :action => 'edit_login'

end

anything missing?

Thorsten M.,

Does it work with Oracle?

I’m using this: http://github.com/greenisus/forgot_password/tree/master

Pepe,

To use the mailing list define your problem better. okz? When the
details
and scope of the question has quality the answer may me too.

To create a project to use oracle database engine, do it:

rails --database=oracle project_name

To add/delete users you’ll need to study something like:

UserController << ApplicationController

def create
@user = User.new(params[:user])
if request.post?
if @user.save
render :text => ‘tasks completed’
else
render :text => ‘try again’
end
end
end

At migration file:

class CreateUser < ActiveRecord::Migration
def self.up
t.column :name, :string
t.column :surname, :string
t.email, :string
t.timestamps
end

def self.down
drop_tables :users
end
end

At user.rb

class User << ActiveRecord::Base
validates_presence_of :name, :surname, :email
validates_uniqueness_of :email
validates_format_of :email, :with =>
/^([^@\s]+)@((?:[-a-z0-9]+.)+[a-z]{2,})$/i
end

At app/view/user/index.html.erb

<% form_for :user do |form| %>

<%= form.text_field :email %>
<%= form.text_field :name %>
<%= form.text_field :surname %>

<%= submit_tag ‘send’ %>

<% end %>

Now you can see the form at: http://localhost:3000/user/create

This is the very basic flow to add new users. Google for something like
it
and learn :wink:

Regards,

On Sun, Aug 17, 2008 at 11:32 PM, Pepe S. <
[email protected]> wrote:


Regards,

Luiz Vitor Martinez C.
cel.: (11) 8187-8662
blog: rubz.org
engineer student at maua.br

“Posso nunca chegar a ser o melhor engenheiro do mundo, mas tenha
certeza de
que eu vou lutar com todas as minhas forças para ser o melhor engenheiro
que
eu puder ser”

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs