-
Notifications
You must be signed in to change notification settings - Fork 35
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix indendation in controllers, models and .gitmodules
- Loading branch information
Showing
9 changed files
with
214 additions
and
211 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
[submodule "public"] | ||
path = public | ||
url=git://github.com/Darep/Beatstream-client.git | ||
url=git://github.com/Darep/Beatstream-client.git |
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 | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,18 @@ | ||
class ApplicationController < ActionController::Base | ||
before_filter :authorize | ||
before_filter :redirect_to_https | ||
protect_from_forgery | ||
before_filter :authorize | ||
before_filter :redirect_to_https | ||
protect_from_forgery | ||
|
||
protected | ||
protected | ||
|
||
def authorize | ||
unless User.find_by_id(session[:user_id]) | ||
redirect_to login_url | ||
end | ||
end | ||
def authorize | ||
unless User.find_by_id(session[:user_id]) | ||
redirect_to login_url | ||
end | ||
end | ||
|
||
def redirect_to_https | ||
redirect_to :protocol => "https://" unless (request.ssl? || request.local?) | ||
end | ||
|
||
def redirect_to_https | ||
redirect_to :protocol => "https://" unless (request.ssl? || request.local?) | ||
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,9 @@ | ||
class PlaylistsController < ApplicationController | ||
def index | ||
# TODO: return a list of users' playlists | ||
end | ||
def index | ||
# TODO: return a list of users' playlists | ||
end | ||
|
||
def new | ||
# TODO: this | ||
end | ||
def new | ||
# TODO: this | ||
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,23 +1,23 @@ | ||
class SessionsController < ApplicationController | ||
skip_before_filter :authorize | ||
skip_before_filter :authorize | ||
|
||
def new | ||
render :layout => 'login' | ||
end | ||
def new | ||
render :layout => 'login' | ||
end | ||
|
||
def create | ||
if params[:password] && user = User.authenticate(params[:username], params[:password]) | ||
session[:username] = user.username | ||
session[:user_id] = user.id | ||
redirect_to root_url | ||
else | ||
redirect_to login_url, :alert => "Oops! Now that wasn't right, was it?" | ||
end | ||
def create | ||
if params[:password] && user = User.authenticate(params[:username], params[:password]) | ||
session[:username] = user.username | ||
session[:user_id] = user.id | ||
redirect_to root_url | ||
else | ||
redirect_to login_url, :alert => "Oops! Now that wasn't right, was it?" | ||
end | ||
end | ||
|
||
def destroy | ||
session[:username] = nil | ||
session[:user_id] = nil | ||
redirect_to login_url | ||
end | ||
def destroy | ||
session[:username] = nil | ||
session[:user_id] = nil | ||
redirect_to login_url | ||
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,43 +1,42 @@ | ||
class SettingsController < ApplicationController | ||
|
||
def index | ||
@user = User.find(session[:user_id]) | ||
render :layout => false | ||
end | ||
|
||
def save | ||
@user = User.find(session[:user_id]) | ||
if @user.update_attributes(params[:user]) | ||
respond_to do |format| | ||
format.html { redirect_to :action => 'index' } | ||
format.json { render :nothing => true } | ||
end | ||
else | ||
render :action => 'index', :layout => false | ||
end | ||
def index | ||
@user = User.find(session[:user_id]) | ||
render :layout => false | ||
end | ||
|
||
def save | ||
@user = User.find(session[:user_id]) | ||
if @user.update_attributes(params[:user]) | ||
respond_to do |format| | ||
format.html { redirect_to :action => 'index' } | ||
format.json { render :nothing => true } | ||
end | ||
else | ||
render :action => 'index', :layout => false | ||
end | ||
end | ||
|
||
def lastfm_callback | ||
token = params[:token] | ||
def lastfm_callback | ||
token = params[:token] | ||
|
||
lastfm_session = Rockstar::Auth.new.session(token) | ||
lastfm_session = Rockstar::Auth.new.session(token) | ||
|
||
@user = User.find(session[:user_id]) | ||
@user.update_attributes(:lastfm_session_key => lastfm_session.key, :lastfm_username => lastfm_session.username) | ||
@user = User.find(session[:user_id]) | ||
@user.update_attributes(:lastfm_session_key => lastfm_session.key, :lastfm_username => lastfm_session.username) | ||
|
||
respond_to do |format| | ||
format.html { redirect_to :action => 'index' } | ||
format.json { render :nothing => true } | ||
end | ||
respond_to do |format| | ||
format.html { redirect_to :action => 'index' } | ||
format.json { render :nothing => true } | ||
end | ||
end | ||
|
||
def lastfm_disconnect | ||
@user = User.find(session[:user_id]) | ||
@user.update_attributes(:lastfm_session_key => nil, :lastfm_username => nil) | ||
def lastfm_disconnect | ||
@user = User.find(session[:user_id]) | ||
@user.update_attributes(:lastfm_session_key => nil, :lastfm_username => nil) | ||
|
||
respond_to do |format| | ||
format.html { redirect_to :action => 'index' } | ||
format.json { render :nothing => true } | ||
end | ||
respond_to do |format| | ||
format.html { redirect_to :action => 'index' } | ||
format.json { render :nothing => true } | ||
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,8 @@ | ||
require 'rockstar' | ||
|
||
module SettingsHelper | ||
def lastfm_token_url | ||
auth = Rockstar::Auth.new | ||
auth.token | ||
end | ||
def lastfm_token_url | ||
auth = Rockstar::Auth.new | ||
auth.token | ||
end | ||
end |
Oops, something went wrong.