From 335751f1333d65af63aa15d3f6e058dd4ef27ac4 Mon Sep 17 00:00:00 2001 From: Martin Edenhofer Date: Fri, 20 Apr 2012 09:07:07 +0200 Subject: [PATCH] Code cleanup. --- app/controllers/sessions_controller.rb | 1 - app/controllers/ticket_overviews_controller.rb | 2 +- app/models/user.rb | 15 --------------- 3 files changed, 1 insertion(+), 17 deletions(-) diff --git a/app/controllers/sessions_controller.rb b/app/controllers/sessions_controller.rb index ba44038b9..912d73e31 100644 --- a/app/controllers/sessions_controller.rb +++ b/app/controllers/sessions_controller.rb @@ -32,7 +32,6 @@ class SessionsController < ApplicationController # check logon session logon_session_key = nil if params['logon_session'] - puts 'create sessions session con' logon_session_key = Digest::MD5.hexdigest( rand(999999).to_s + Time.new.to_s ) ActiveRecord::SessionStore::Session.create( :session_id => logon_session_key, diff --git a/app/controllers/ticket_overviews_controller.rb b/app/controllers/ticket_overviews_controller.rb index f3be59117..bb65c3f53 100644 --- a/app/controllers/ticket_overviews_controller.rb +++ b/app/controllers/ticket_overviews_controller.rb @@ -4,7 +4,7 @@ class TicketOverviewsController < ApplicationController # GET /tickets # GET /tickets.json def show - + # build up attributes hash overview_selected = nil overviews = Overview.all diff --git a/app/models/user.rb b/app/models/user.rb index 011622bc8..2e32bc924 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -15,29 +15,15 @@ class User < ApplicationModel def self.authenticate( username, password ) user = User.where( :login => username, :active => true ).first return nil if user.nil? - logger.debug 'auth' - logger.debug username - logger.debug user.login - logger.debug password - logger.debug user.password - logger.debug user.inspect -# return user return user if user.password == password return end def self.create_from_hash!(hash) -# logger.debug(hash.inspect) -# raise hash.to_yaml -# exit url = '' if hash['info']['urls'] then url = hash['info']['urls']['Website'] || hash['info']['urls']['Twitter'] || '' end -# logger.debug(hash['info'].inspect) -# raise url.to_yaml -# exit -# logger.debug('aaaaaaaa') roles = Role.where( :name => 'Customer' ) create( :login => hash['info']['nickname'] || hash['uid'], @@ -61,7 +47,6 @@ class User < ApplicationModel user = User.find(user_id) data = user.attributes - # get linked accounts data['accounts'] = {} authorizations = user.authorizations() || []