Code cleanup.
This commit is contained in:
parent
0dd055f2eb
commit
335751f133
3 changed files with 1 additions and 17 deletions
|
@ -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,
|
||||
|
|
|
@ -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() || []
|
||||
|
|
Loading…
Reference in a new issue