Ejemplo n.º 1
0
 public void SendRecoveryEmail(string userEmail, int recoveryCode)
 {
     if (userEmail != null)
     {
         MailF.SendEmail(userEmail, "Recovery password",
                         "Recovery code=" + recoveryCode);
     }
 }
Ejemplo n.º 2
0
 public Worker(ref Database callDB, ref LogProgram logprogram)
 {
     this.database    = callDB;
     this.logger      = logprogram;
     this.mail        = new MailF(database, logger);
     this.tasker      = new TaskManager(logger);
     this.loaderFile  = new LoaderFile(ref database, ref logger);
     this.excelModule = new ExcelModule(ref database, ref logger, ref loaderFile);
     tasker.EmailMonitoring(this);
 }
Ejemplo n.º 3
0
 public void SendConfirmEmail(string userEmail, string userHash)
 {
     if (userEmail != null)
     {
         if (userHash != null)
         {
             MailF.SendEmail(userEmail, "Confirm account",
                             "Confirm account: <a href=http://devinstasoft.yobidev.com/mailLink/"
                             + userHash + ">Confirm url!</a>");
         }
     }
 }
Ejemplo n.º 4
0
        public Authentication(Context context, Validator validator)
        {
            this.context   = context;
            this.validator = validator;
            mail           = new MailF();
            Config config = new Config();

            IP   = config.IP;
            PORT = config.Port;
            log  = new LoggerConfiguration()
                   .WriteTo.File("./logs/log", rollingInterval: RollingInterval.Day)
                   .CreateLogger();
        }
Ejemplo n.º 5
0
        public void RecoveryPassword(ref HttpRequest request)
        {
            string     admin_email = request.FormField("admin_email");
            AdminCache admin       = new AdminCache();

            if (Database.admin.SelectAdmin(ref admin_email, ref admin))
            {
                admin.recovery_code = Validator.random.Next(100000, 999999);
                MailF.SendEmail(admin.admin_email, "Recovery password", "Recovery code=" + admin.recovery_code);
                Database.admin.UpdateRecoveryCode(admin.admin_id, admin.recovery_code);
                request.ResponseJsonAnswer(true, "Recovery password. Send message with code to email=" + admin.admin_email);
                Logger.WriteLog("Recovery password, admin_id=" + admin.admin_id, LogLevel.Usual);
            }
            else
            {
                request.ResponseJsonAnswer(false, "No admin with that email.");
                Logger.WriteLog("No admin with that email.", LogLevel.Error);
            }
        }