} //End public static void AutocreateYear(ActionExecutedContext context) public static Boolean isValidDBLogin(string psUsername, string psPassword, int?pnMdleId) { UserloginVM oVM = new UserloginVM();; //if Ultimate User if ((psUsername.ToUpper() == valDFLT.SYSADMIN_USER) && (psPassword == valDFLT.SYSADMIN_PASSWORD)) { setValidCredential(psUsername, valDFLT.SYSADMIN_USER, null, null, hlpConfig.ConstantaInfo.MDLE_ID); return(true); } //End if ((psUsername.ToUpper() == "SYSADMIN") && (psPassword == "kuy4bulu5")) //if selain Ultimate User UserDS oDS = new UserDS(); var oQRY = oDS.getData_Usercredential(psUsername); if (oQRY != null) { string stes = hlpObf.randomDecrypt(oQRY.PASSWORD); if ((psUsername.ToUpper() == oQRY.USERNAME.ToUpper()) && (psPassword == hlpObf.randomDecrypt(oQRY.PASSWORD))) { //setValidCredential(psUsername, oQRY.DISPLAY_NAME, oQRY.ID, oQRY.ROLE_ID, hlpConfig.ConstantaInfo.MDLE_ID); setValidCredential(psUsername, oQRY, hlpConfig.ConstantaInfo.MDLE_ID); return(true); } //End if ((psUsername.ToUpper() == oQRY.USERNAME) && } //End if (oQRY != null) return(false); } //End public static Boolean isValidDBLogin
public ActionResult Login(UserloginVM model, string returnUrl) { if ((ModelState.IsValid) && (hlpCredentialInfo.isValidDBLogin(model.USR_ID, model.USR_PSWD, hlpConfig.ConstantaInfo.MDLE_RUID))) { return(RedirectToAction("Index", "Home")); } // If we got this far, something failed, redisplay form ModelState.AddModelError("", "Login salah user atau password."); return(View(model)); }
public ActionResult Changepassword(UserloginVM poVM, string returnUrl) { if ((ModelState.IsValid) && (hlpCredentialInfo.isValidDBLogin(poVM.USERNAME, poVM.PASSWORD, hlpConfig.ConstantaInfo.MDLE_ID))) { return(RedirectToAction("Index", "Home")); } // If we got this far, something failed, redisplay form ModelState.AddModelError("", "Login salah user atau password."); return(View(poVM)); }