Class: Fcid::User

Inherits:
Base
  • Object
show all
Defined in:
app/models/fcid/user.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.authenticate(username_or_email, password) ⇒ Object



24
25
26
# File 'app/models/fcid/user.rb', line 24

def self.authenticate(username_or_email,password)
  get(:authenticate,:email=>username_or_email,:password=>password)
end

.authenticate_by_auth_token(token) ⇒ Object

通过auto_token来验证用户,成功返回用户,失败返回 false



19
20
21
22
# File 'app/models/fcid/user.rb', line 19

def self.authenticate_by_auth_token(token)
  user = get(:info,:token=>token)
  rsync(user['username'])
end

.columnsObject



29
30
31
# File 'app/models/fcid/user.rb', line 29

def self.columns
  Fcid.columns
end

.configObject



14
15
16
# File 'app/models/fcid/user.rb', line 14

def self.config
  Fcid.config
end

.sub_domain?(domain) ⇒ Boolean

Returns:

  • (Boolean)


6
7
8
9
10
11
12
# File 'app/models/fcid/user.rb', line 6

def self.sub_domain?(domain)
  a = domain.split(".").reverse[0,2]
  b = Fcid.host.split(".").reverse[0,2]
  return b == a
  rescue
    false
end

Instance Method Details

#avatar(style = "thumb") ⇒ Object



33
34
35
# File 'app/models/fcid/user.rb', line 33

def avatar(style = "thumb") 
  avatar_url
end