Esempio n. 1
0
 private void WriteLog(string message)
 {
     HarperACL.AppEventLog log = new HarperACL.AppEventLog();
     log.aelAppName     = "ForgotPassword";
     log.aelDateCreated = DateTime.Now;
     log.aelMessage1    = string.Empty;
     log.aelMessage2    = string.Empty;
     log.aelSeverity    = "INFO";
     using (HarperACL.ACLDataDataContext context = new HarperACL.ACLDataDataContext(db_connection))
     {
         context.AppEventLogs.InsertOnSubmit(log);
         context.SubmitChanges();
     }
 }
Esempio n. 2
0
        public void BulkEncrypt()
        {
            GateKeeperProvider        currentProvider = (GateKeeperProvider)Membership.Provider;
            string                    u;
            string                    p;
            List <HarperACL.Customer> customers;

            using (HarperACL.ACLDataDataContext context = new HarperACL.ACLDataDataContext(ConfigurationManager.ConnectionStrings["AHT_MainConnectionString"].ConnectionString))
            {
                customers = (from a in context.Customers
                             join b in context.NetMemberships
                             on a.cusID equals b.cusID
                             where  (a.cusEncryptedPassword == null || a.cusEncryptedPassword == "") &&
                             b.nmbDateEnd >= DateTime.Now &&
                             a.cusDateUpdated < DateTime.Now.AddDays(-2)
                             select a).ToList();

                foreach (HarperACL.Customer customer in customers)
                {
                    if (!string.IsNullOrEmpty(customer.cusUserName))
                    {
                        string z = currentProvider.GetPassword(customer.cusUserName, "");
                        if (!string.IsNullOrEmpty(z))
                        {
                            string enc = HarperCRYPTO.Cryptography.EncryptData(z);
                            if (!string.IsNullOrEmpty(enc))
                            {
                                customer.cusEncryptedPassword = enc;
                                customer.cusDateUpdated       = DateTime.Now;
                            }
                        }
                    }
                }
                context.SubmitChanges();
            }
            Assert.AreEqual(true, true);
        }
Esempio n. 3
0
 private void WriteLog(Exception e)
 {
     HarperACL.AppEventLog log = new HarperACL.AppEventLog();
     log.aelAppName = "ForgotPassword";
     log.aelDateCreated = DateTime.Now;
     log.aelMessage1 = string.Empty;
     log.aelMessage2 = string.Empty;
     log.aelMessage3 = e.Message;
     log.aelSeverity = "EXCEPTION";
     using (HarperACL.ACLDataDataContext context = new HarperACL.ACLDataDataContext(db_connection))
     {
         context.AppEventLogs.InsertOnSubmit(log);
         context.SubmitChanges();
     }
 }
Esempio n. 4
0
 public void BulkEncrypt()
 {
     GateKeeperProvider currentProvider = (GateKeeperProvider)Membership.Provider;
     string u;
     string p;
     List<HarperACL.Customer> customers;
     using (HarperACL.ACLDataDataContext context = new HarperACL.ACLDataDataContext(ConfigurationManager.ConnectionStrings["AHT_MainConnectionString"].ConnectionString))
     {
         customers = (from a in context.Customers
                      join b in context.NetMemberships
                      on a.cusID equals b.cusID
                      where  (a.cusEncryptedPassword == null || a.cusEncryptedPassword == "")
                      && b.nmbDateEnd >= DateTime.Now
                      && a.cusDateUpdated < DateTime.Now.AddDays(-2)
                      select a).ToList();
         
         foreach (HarperACL.Customer customer in customers)
         {
             if (!string.IsNullOrEmpty(customer.cusUserName))
             {
                 string z = currentProvider.GetPassword(customer.cusUserName, "");
                 if (!string.IsNullOrEmpty(z))
                 {
                     string enc = HarperCRYPTO.Cryptography.EncryptData(z);
                     if (!string.IsNullOrEmpty(enc))
                     {
                         customer.cusEncryptedPassword = enc;
                         customer.cusDateUpdated = DateTime.Now;
                     }
                 }
             }
         }
         context.SubmitChanges();
     }
     Assert.AreEqual(true, true);
 }