private bool IsValidOutlookLogin(Page _Page, string sEmailID, string sEmailPass) { bool bRet = false; try { ExchangeService service = GetServiceEx(sEmailID, sEmailPass); List <AttendeeInfo> attendees = new List <AttendeeInfo>(); attendees.Add(new AttendeeInfo(sEmailID)); GetUserAvailabilityResults results = service.GetUserAvailability(attendees, new TimeWindow(DateTime.Now, DateTime.Now.AddHours(24)), AvailabilityData.FreeBusy); AttendeeAvailability myAvailablity = results.AttendeesAvailability.FirstOrDefault(); if (myAvailablity != null) { Console.WriteLine(String.Format("FREE", myAvailablity.CalendarEvents.Count)); } return(true); } catch (Exception ex) { var w32ex = ex as Win32Exception; uh.ShowHTMLMessage(_Page, ErrorNumber.SetType("00", errorType.LoginError), ex.Message); bRet = false; } return(bRet); }
public bool IsValidLogin_SCIMail(Page _Page, string sEmailID, string sEmailPass) { bool bRet = false; if (IsValidOutlookLogin(_Page, sEmailID, sEmailPass)) { bRet = true; } else { uh.ShowHTMLMessage(_Page, ErrorNumber.SetType(ErrorNumber.PermissionDenied, errorType.LoginError), "Login Failure. You are not authorized user!!"); bRet = false; } return(bRet); }
public bool IsValidLogin_SCIAD(Page _Page, string ADUserName, string ADPassword) { bool bRet = false; string adPath = "LDAP://dhaka.org"; LdapAuthentication adAuth = new LdapAuthentication(adPath); if (adAuth.IsAuthenticated("dhaka.org", ADUserName, ADPassword)) { bRet = true; } else { uh.ShowHTMLMessage(_Page, ErrorNumber.SetType(ErrorNumber.PermissionDenied, errorType.LoginError), "Login Failure. You are not authorized user!!"); bRet = false; } return(bRet); }