-
Notifications
You must be signed in to change notification settings - Fork 331
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Improve channel, user and api_key models with basic scopes, correct r…
…eferences and protect attributes. Simplify channels & user controllers and models, moving code to the models. Remove catch-all route and ensure all actions are specified, fixing url paths. Change clone to dup in feed_controller as using clone seems to affect the cloned object (problem only in ruby 1.9.3?)
- Loading branch information
1 parent
bfd5b29
commit 4f03543
Showing
21 changed files
with
207 additions
and
181 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -1,23 +1,20 @@ | |||
class MailerController < ApplicationController | class MailerController < ApplicationController | ||
|
|
||
def resetpassword | def resetpassword | ||
# protect against bots | |||
render :text => '' and return if params[:userlogin].length > 0 | |||
|
|||
@user = User.find_by_login_or_email(params[:user][:login]) | @user = User.find_by_login_or_email(params[:user][:login]) | ||
|
|||
if @user.nil? | if @user.nil? | ||
sleep 2 | |||
session[:mail_message] = t(:account_not_found) | session[:mail_message] = t(:account_not_found) | ||
else | else | ||
begin | begin | ||
@user.reset_perishable_token! | @user.reset_perishable_token! | ||
#Mailer.password_reset(@user, "https://www.thingspeak.com/users/reset_password/#{@user.id}?token=#{@user.perishable_token}").deliver | # Mailer.password_reset(@user, "https://www.thingspeak.com/users/#{@user.id}/reset_password?token=#{@user.perishable_token}").deliver | ||
session[:mail_message] = t(:password_reset_mailed) | session[:mail_message] = t(:password_reset_mailed) | ||
rescue | rescue | ||
session[:mail_message] = t(:password_reset_error) | session[:mail_message] = t(:password_reset_error) | ||
end | end | ||
end | end | ||
redirect_to :controller => 'user_session', :action => 'new' | redirect_to login_path | ||
end | end | ||
|
|
||
end | end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.