magick encoding
This commit is contained in:
parent
2e22001662
commit
6947f1aaea
@ -12,14 +12,5 @@ class Admin < ActiveRecord::Base
|
|||||||
attr_accessible :email, :password, :password_confirmation, :remember_me, :username, :name, :firstname
|
attr_accessible :email, :password, :password_confirmation, :remember_me, :username, :name, :firstname
|
||||||
# attr_accessible :title, :body
|
# attr_accessible :title, :body
|
||||||
|
|
||||||
|
|
||||||
protected
|
|
||||||
|
|
||||||
def self.find_for_database_authentication(warden_conditions)
|
|
||||||
conditions = warden_conditions.dup
|
|
||||||
login = conditions.delete(:login)
|
|
||||||
where(conditions).where(["username = :value OR email = :value", { :value => login }]).first
|
|
||||||
end
|
|
||||||
|
|
||||||
|
|
||||||
end
|
end
|
||||||
|
@ -1,8 +1,8 @@
|
|||||||
<h2>Sign in</h2>
|
<h2>Sign in</h2>
|
||||||
|
|
||||||
<%= form_for(resource, :as => resource_name, :url => session_path(resource_name)) do |f| %>
|
<%= form_for(resource, :as => resource_name, :url => session_path(resource_name)) do |f| %>
|
||||||
<div><%= f.label :login %><br />
|
<div><%= f.label :username %><br />
|
||||||
<%= f.text_field :login %></div>
|
<%= f.text_field :username %></div>
|
||||||
|
|
||||||
<div><%= f.label :password %><br />
|
<div><%= f.label :password %><br />
|
||||||
<%= f.password_field :password %></div>
|
<%= f.password_field :password %></div>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user