private void AddUser(UserList usrs, RRSUser u) { string encPwd = Helper.EncryptString(u.Pwd); string decPwd = Helper.DecryptString(encPwd); int uix = usrs.GetUserIndex(u.User); PSUser n = new PSUser(); n.RUser = u.User; n.RPwd = u.Pwd; n.PSUserIds = null; if (uix < 0) // not found { usrs.AddUser(n); addCnt++; } else { usrs.UpdateUser(n); updCnt++; } }
private static void Test_UpdateUser() { UserList ul = new UserList(@"C:\Docs\Pers\PSInterface\PSITest\bin\Debug\"); ul.Load(); int ix = ul.GetUserIndex("111"); if (ix >= 0) { ul.USrs[ix].PSUserIds.Add("44556"); ul.USrs[ix].RPwd = "newpwd"; ul.Save(); } }
private bool CheckUser(string uname, string upwd) { bool rc = false; cuser = null; cuser_ix = -1; ul = new UserList(Server.MapPath("~/App_Data/")); if (ul.Load() == 0) { int uix = ul.GetUserIndex(uname); //Log.Write("CheckUser:uix " + uix.ToString()); if (uix >= 0) { Log.Write(Helper.DecryptString(ul.USrs[uix].RPwd)); if (uname == ul.USrs[uix].RUser && upwd == Helper.DecryptString(ul.USrs[uix].RPwd)) { rc = true; cuser = ul.USrs[uix]; cuser_ix = uix; Log.Write("Creds match"); } } } else litMsg.Text = "Error loading Users"; return rc; }
private bool CheckUser(string uname, string upwd) { bool rc = false; cuser = null; cuser_ix = -1; ul = new UserList(Server.MapPath("~/App_Data/")); if (ul.Load() == 0) { int uix = ul.GetUserIndex(uname); if (uix >= 0) { if (uname == ul.USrs[uix].RUser && upwd == ul.USrs[uix].RPwd) { rc = true; cuser = ul.USrs[uix]; cuser_ix = uix; } } } else litMsg.Text = "Error loading Users"; return rc; }