public ActionResult Index(FormCollection form, LdapConfiguration model)
        {
            var email = form["email"];
            var password = form["password"];

            if (ModelState.IsValid && !string.IsNullOrEmpty(email) && !string.IsNullOrEmpty(password))
            {
                var objLdap = new LdapManager(model);
                
                if (objLdap.Authenticate(email, password))
                {
                    TempData["Message"] = "Connection sucessful establish.";
                }
                else
                {
                    ModelState.AddModelError("",@"Test failed");
                }
            }
            else
            {
                ModelState.AddModelError("",@"Please input username password");
            }

            return View("Index");
        }
示例#2
0
 public CorpLdapDataController(ClientManager clientManager, DirectoryManager directoryManager, SecurityPoolManager poolManager, RoleManager roleManager, LdapManager ldapManager)
 {
     _clientManager    = clientManager;
     _directoryManager = directoryManager;
     _poolManager      = poolManager;
     _roleManager      = roleManager;
     _ldapManager      = ldapManager;
 }
示例#3
0
 public SignInController(IConfigurationFacade facade, LdapManager ldapManager)
 {
     _facade      = facade;
     _ldapManager = ldapManager;
 }
示例#4
0
 public CorpLdapDetails(DirectoryManager directoryManager, LdapManager ldapManager)
 {
     _directoryManager = directoryManager;
     _ldapManager      = ldapManager;
 }