Exemple #1
0
 public ActionResult ClientLogon(AllClientsAccountModel model) {
   if( ModelState.IsValid ) {
     var clientAuth = new ClientFormsAuthenticationService();
     var authenticated = clientAuth.SignIn( model );
     if( authenticated )
       return RedirectToAction( "Index", "Import" );
     else
       ModelState.AddModelError( "", "The user name or password provided is incorrect." );
   }
   // If we got this far, something failed, redisplay form
   return View( model );
 }
Exemple #2
0
 public ActionResult RemoteLogon(string username, string password)
 {
     var clientAuth = new ClientFormsAuthenticationService();
     var authenticated = clientAuth.SignIn(new AllClientsAccountModel { UserName = username, Password = password });
     return JavaScript(String.Format("var valid={0};", authenticated.ToString().ToLower()));
 }