-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #14 from ucdavis/feature/directory
Addresses most of Brandon's concerns
- Loading branch information
Showing
10 changed files
with
239 additions
and
95 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,8 +10,8 @@ public class IndividualSearchResult | |
{ | ||
public string ClientId { get; set; } = string.Empty; | ||
public string MothraId { get; set; } = string.Empty; | ||
public string UCDPersonUUID { get; set; } = string.Empty; | ||
public string? LoginId { get; set; } = string.Empty; | ||
public string? Email { get; set; } = string.Empty; | ||
public string? MailId { get; set; } = string.Empty; | ||
public string? EmailHost { get; set; } = string.Empty; | ||
public string LastName { get; set; } = string.Empty; | ||
|
@@ -58,7 +58,8 @@ public IndividualSearchResult(AaudUser? aaudUser, LdapUserContact? ldapUserConta | |
if (aaudUser != null) { | ||
MothraId = aaudUser.MothraId; | ||
LoginId = aaudUser.LoginId; | ||
MailId = aaudUser.MailId; | ||
Email = aaudUser.MailId; | ||
MailId = aaudUser.MailId?.Split("@").First(); | ||
LastName = aaudUser.LastName; | ||
FirstName = aaudUser.FirstName; | ||
MiddleName = aaudUser.MiddleName; | ||
|
@@ -86,14 +87,20 @@ public IndividualSearchResult(AaudUser? aaudUser, LdapUserContact? ldapUserConta | |
} | ||
if (ldapUserContact != null) | ||
{ | ||
// displayname=Francisco Javier Acosta,ucdPersonAffiliation=student:undergraduate,ucdPersonUUID=02198608,[email protected],ucdPersonPIDM=3817514,ucdStudentSID=921084299,sn=Acosta,givenName=Francisco,employeeNumber=10665044,ucdStudentLevel=Sophomore,title=STDT 2,ucdPersonIAMID=1000459572,uid=fcobay04,ou=STUDENT HOUSING DINING SVCS | ||
DisplayFullName = ldapUserContact.DisplayName; | ||
FirstName = ldapUserContact.GivenName; | ||
MiddleName = ldapUserContact.MiddleName; | ||
LastName = ldapUserContact.Sn; | ||
Title = ldapUserContact.Title; | ||
//Department = ldapUserContact.Department; | ||
Department = ldapUserContact.Ou; | ||
Phone = ldapUserContact.TelephoneNumber; | ||
Mobile = ldapUserContact.Mobile; | ||
Email = ldapUserContact.Mail; | ||
MailId = ldapUserContact.Mail?.Split("@").First(); | ||
UserName = ldapUserContact.Uid; | ||
PostalAddress = (ldapUserContact.PostalAddress ?? "").Replace("$", '\n'.ToString()); | ||
UCDAffiliation = ldapUserContact.UcdPersonAffiliation; | ||
UCDPersonUUID = ldapUserContact.UcdPersonUuid; | ||
if (string.IsNullOrEmpty(DisplayFullName)) | ||
{ | ||
DisplayFullName = ldapUserContact.DisplayName; | ||
|
@@ -102,15 +109,20 @@ public IndividualSearchResult(AaudUser? aaudUser, LdapUserContact? ldapUserConta | |
{ | ||
Name = ldapUserContact.DisplayName; | ||
} | ||
originalObject = ldapUserContact.originalObject; | ||
} | ||
|
||
|
||
using (var context = new Classes.SQLContext.AAUDContext()) | ||
{ | ||
var query = $"SELECT * FROM OPENQUERY(UCDMothra,'SELECT (USERPART || ''@'' || HOSTPART) AS USERATHOST FROM MOTHRA.MAILIDS WHERE MOTHRAID = ''{MothraId}'' AND MAILID = ''{MailId}'' AND MAILSTATUS = ''A'' AND MAILTYPE = ''P''')".ToString(); | ||
var results = context.Database.SqlQuery<string>(FormattableStringFactory.Create(query)).ToList(); | ||
foreach (var r in results) | ||
if (MailId != null) | ||
{ | ||
EmailHost = r.Split("@").Last(); | ||
var query = $"SELECT * FROM OPENQUERY(UCDMothra,'SELECT (USERPART || ''@'' || HOSTPART) AS USERATHOST FROM MOTHRA.MAILIDS WHERE MAILID = ''{MailId}'' AND MAILSTATUS = ''A'' AND MAILTYPE = ''P''')".ToString(); | ||
var results = context.Database.SqlQuery<string>(FormattableStringFactory.Create(query)).ToList(); | ||
foreach (var r in results) | ||
{ | ||
EmailHost = r.Split("@").Last(); | ||
} | ||
} | ||
} | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.