Exemplo n.º 1
0
        public string changePass(int idPassTable)
        {
            string        randomPass     = _ireg.defaultPassGenerator(8);
            string        hashRandomPass = _ireg.hashPassGenerator(randomPass);
            PasswordTable passTabel      = new PasswordTable();

            using (var db = new EntitiesRegistrationUser())
            {
                PasswordTable passT = db.PasswordTable.Single(x => x.pass_id == idPassTable);
                passT.pass_haslo = hashRandomPass;
                passT.pass_data  = DateTime.Now;
                db.SaveChanges();
            }
            return(randomPass);
        }
Exemplo n.º 2
0
 public int generatePass(out string haslo)
 {
     using (var db = new EntitiesRegistrationUser())
     {
         string pass = _ireg.defaultPassGenerator(8);
         haslo = pass;
         string        hashPass = _ireg.hashPassGenerator(pass);
         PasswordTable pt       = new PasswordTable();
         pt.pass_aktywny = true;
         pt.pass_data    = DateTime.Now;
         pt.pass_haslo   = hashPass;
         db.PasswordTable.Add(pt);
         db.SaveChanges();
         return(pt.pass_id);
     }
 }
Exemplo n.º 3
0
 public void connectPassworAndUser(UserTable uzytkownik, PasswordTable haslo)
 {
     throw new NotImplementedException();
 }