Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 5 additions & 4 deletions app/models/carnegie_mellon_person.rb
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
class CarnegieMellonPerson < ActiveLdap::Base
ldap_mapping :dn_attribute => "guid",
:prefix => "ou=Person",
:classes => ["cmuPerson"]
:prefix => "ou=AndrewPerson",
:classes => ["cmuAccountPerson"]

def self.find_by_andrewid( andrewid )

begin
person = find("cmuandrewid=#{andrewid}", :attributes => ['cmuandrewid',
person = find("cmuAndrewId=#{andrewid}", :attributes => ['cmuAndrewId',
'cn',
'mail',
'sn',
Expand All @@ -19,7 +19,8 @@ def self.find_by_andrewid( andrewid )
end

return person unless person[:cn] == "Merged Person"
rescue
rescue => e
logger.error e
return nil
end
end
Expand Down
28 changes: 16 additions & 12 deletions config/ldap.yml
Original file line number Diff line number Diff line change
@@ -1,19 +1,23 @@
development:
host: ldap.andrew.cmu.edu
port: 389
base: dc=cmu,dc=edu
host: ldap.cmu.edu
port: 636
method: ssl
base: dc=andrew,dc=cmu,dc=edu

test:
host: ldap.andrew.cmu.edu
port: 389
base: dc=cmu,dc=edu
host: ldap.cmu.edu
port: 636
method: ssl
base: dc=andrew,dc=cmu,dc=edu

staging:
host: ldap.andrew.cmu.edu
port: 389
base: dc=cmu,dc=edu
host: ldap.cmu.edu
port: 636
method: ssl
base: dc=andrew,dc=cmu,dc=edu

production:
host: ldap.andrew.cmu.edu
port: 389
base: dc=cmu,dc=edu
host: ldap.cmu.edu
port: 636
method: ssl
base: dc=andrew,dc=cmu,dc=edu