fix admin inviter
This commit is contained in:
parent
43d6acd868
commit
e7071fd74c
2 changed files with 5 additions and 4 deletions
|
|
@ -11,10 +11,12 @@ class AdminsController < ApplicationController
|
||||||
def admin_inviter
|
def admin_inviter
|
||||||
user = User.find_by_email params[:idenitifer]
|
user = User.find_by_email params[:idenitifer]
|
||||||
unless user
|
unless user
|
||||||
Invitation.create(:service => 'email', :identifer => params[:identifier], :admin => true)
|
Invitation.create(:service => 'email', :identifier => params[:identifier], :admin => true)
|
||||||
flash[:notice] = "invitation sent to #{params[:identifier]}"
|
flash[:notice] = "invitation sent to #{params[:identifier]}"
|
||||||
|
else
|
||||||
|
flash[:notice]= "error sending invite to #{params[:identifier]}"
|
||||||
end
|
end
|
||||||
redirect_to user_search_path
|
redirect_to user_search_path, :notice => flash[:notice]
|
||||||
end
|
end
|
||||||
|
|
||||||
def stats
|
def stats
|
||||||
|
|
|
||||||
|
|
@ -394,8 +394,7 @@ ActiveRecord::Schema.define(:version => 20110818212541) do
|
||||||
t.string "language"
|
t.string "language"
|
||||||
t.string "email", :default => "", :null => false
|
t.string "email", :default => "", :null => false
|
||||||
t.string "encrypted_password", :limit => 128, :default => "", :null => false
|
t.string "encrypted_password", :limit => 128, :default => "", :null => false
|
||||||
t.string "password_salt", :default => "", :null => false
|
t.string "invitation_token", :limit => 60
|
||||||
t.string "invitation_token", :limit => 20
|
|
||||||
t.datetime "invitation_sent_at"
|
t.datetime "invitation_sent_at"
|
||||||
t.string "reset_password_token"
|
t.string "reset_password_token"
|
||||||
t.string "remember_token"
|
t.string "remember_token"
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue