Class: Domain

Inherits:
ActiveRecord::Base
  • Object
show all
Defined in:
app/models/domain.rb

Overview

Domain

This is actually nothing more than a User class generated by the standard Rails login generator.

Its data structure is very basic, as a result:

name

The domain’s name.

password

A SHA1 hash of the domain’s password.

Its use as a login service is mainly for the purposes of the Mailservice web service–the middle layer (the SOAP client) logs into the domain, and then the users can log into that.

Constant Summary collapse

@@salt =

Please change the salt to something else, Every application should use a different one

'thuchpog10.?guf'

Class Method Summary collapse

Class Method Details

.authenticate(name, pass) ⇒ Object

Authenticate a user.

Example:

@user = User.authenticate('bob', 'bobpass')


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

def self.authenticate(name, pass)
    find_by_name_and_password name, sha1(pass)
end