Example #1
0
 /**
  * Saves the settings
  */
 protected function OnSuccess()
 {
     $this->settings->SetLogLifetime((int) $this->Value('LogLifetime'));
     $this->settings->SetMailFromEMail($this->Value('MailFromEMail'));
     $this->settings->SetMailFromName($this->Value('MailFromName'));
     $this->settings->SetSmtpHost($this->Value('SmtpHost'));
     $this->settings->SetSmtpPort($this->Value('SmtpPort'));
     $this->settings->SetSmtpUser($this->Value('SmtpUser'));
     $this->settings->SetSmtpPassword($this->Value('SmtpPassword'));
     $this->settings->SetSmtpSecurity($this->Value('SmtpSecurity'));
     Response::Redirect($this->BackLink());
 }
Example #2
0
 /**
  * Creates the settings initally
  */
 private function CreateSettings()
 {
     $this->settings = new Settings();
     $this->settings->SetLogLifetime(90);
     $this->settings->SetSmtpSecurity((string) Enums\SmtpSecurity::None());
     $admin = $this->FirstAdmin();
     if ($admin) {
         $this->settings->SetMailFromEMail($admin->GetEMail());
         if ($admin->GetFirstName() && $admin->GetLastName()) {
             $this->settings->SetMailFromName($admin->GetFirstName() . ' ' . $admin->GetLastName());
         }
     }
     $this->settings->Save();
 }