From 33b73f56aa40b416c9d18fd7d7ef6f2317188b39 Mon Sep 17 00:00:00 2001 From: Xenomporio <> Date: Tue, 28 Jun 2022 17:01:23 +0200 Subject: [PATCH] Improvement of emailbackup page including button for SMTP test --- www/pages/content/emailbackup_edit.tpl | 160 ++++++++++++++++++------- www/pages/emailbackup.php | 39 +++++- 2 files changed, 152 insertions(+), 47 deletions(-) diff --git a/www/pages/content/emailbackup_edit.tpl b/www/pages/content/emailbackup_edit.tpl index 9eef7d3c..e91ed189 100644 --- a/www/pages/content/emailbackup_edit.tpl +++ b/www/pages/content/emailbackup_edit.tpl @@ -13,60 +13,128 @@
[FORMHANDLEREVENT]
-
-
+
+
+
+
+ {|Allgemein|} + + + + + + +
{|E-Mail-Adresse|}:
{|Angezeigter Name|}:
{|Interne Beschreibung|}:
{|Benutzername|}:
{|Passwort|}:
+
+
+
+
+
+
+
+
- {|emailbackup|} - - - - - - + {|SMTP|} +
{|email|}:
{|angezeigtername|}:
{|internebeschreibung|}:
{|benutzername|}:
{|passwort|}:
+ + + + + + + + + + + +
{|SMTP benutzen|}:0 = nein, 1 = ja
{|Server|}:
{|Verschlüsselung|}:0 = keine, 1 = TLS, 2 = SSL
{|Port|}:
{|Authtype|}:'', 'smtp', 'oauth_google'
{|Authparam|}:
{|Client_alias|}:
{|Loglevel|}:
Testmail: +  Bitte erst speichern und dann senden! +
+
+
+
+
+
+
+
+
+
+
+ {|IMAP|} + - - - + +
{|IMAP server|}:
{|SMTP server|}:
{|ticket|}:
{|imap_sentfolder_aktiv|}:
{|imap_sentfolder|}:
{|imap_port|}:
{|imap_type|}:
{|imap_type|}:0 = standard, 1 = SSL
+
+
+
+
+
+
+
+
+
+
+ {|Archiv|} + + + +
{|E-Mailarchiv aktiv|}:
{|Löschen nach wievielen Tagen?|}:
+
+
+
+
+
+
+
+
+
+
+ {|Ticketsystem|} + + + + + + + + +
{|ticket|}:
{|ticketprojekt|}:
{|ticketqueue|}:
{|abdatum|}:
{|ticketloeschen|}:
{|ticketabgeschlossen|}:
{|ticketemaileingehend|}:
+
+
+
+
+
+
+
+
+
+
+ {|Sonstiges|} + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - -
{|autosresponder_blacklist|}:
{|eigenesignatur|}:
{|signatur|}:
{|adresse|}:
{|firma|}:
{|geloescht|}:
{|mutex|}:
{|autoresponder|}:
{|geschaeftsbriefvorlage|}:
{|autoresponderbetreff|}:
{|autorespondertext|}:
{|projekt|}:
{|emailbackup|}:
{|adresse|}:
{|firma|}:
{|loeschtage|}:
{|geloescht|}:
{|ticketloeschen|}:
{|ticketabgeschlossen|}:
{|ticketqueue|}:
{|ticketprojekt|}:
{|ticketemaileingehend|}:
{|smtp_extra|}:
{|smtp_ssl|}:
{|smtp_port|}:
{|smtp_frommail|}:
{|smtp_fromname|}:
{|client_alias|}:
{|smtp_authtype|}:
{|smtp_authparam|}:
{|smtp_loglevel|}:
{|autosresponder_blacklist|}:
{|eigenesignatur|}:
{|signatur|}:
{|mutex|}:
{|abdatum|}:
-
-
-
-
-
- + + +
+
+ + +
+
+ + + +
+ diff --git a/www/pages/emailbackup.php b/www/pages/emailbackup.php index 9c09a3de..94f4c15b 100644 --- a/www/pages/emailbackup.php +++ b/www/pages/emailbackup.php @@ -18,6 +18,8 @@ class Emailbackup { $this->app->ActionHandler("create", "emailbackup_edit"); // This automatically adds a "New" button $this->app->ActionHandler("edit", "emailbackup_edit"); $this->app->ActionHandler("delete", "emailbackup_delete"); + $this->app->ActionHandler("test_smtp",'emailbackup_test_smtp'); + $this->app->DefaultActionHandler("list"); $this->app->ActionHandlerListen($app); } @@ -203,8 +205,8 @@ $width = array('10%'); // Fill out manually later $input['smtp_extra'] = $this->app->Secure->GetPOST('smtp_extra'); $input['smtp_ssl'] = $this->app->Secure->GetPOST('smtp_ssl'); $input['smtp_port'] = $this->app->Secure->GetPOST('smtp_port'); - $input['smtp_frommail'] = $this->app->Secure->GetPOST('smtp_frommail'); - $input['smtp_fromname'] = $this->app->Secure->GetPOST('smtp_fromname'); + $input['smtp_frommail'] = $this->app->Secure->GetPOST('email'); // use only these + $input['smtp_fromname'] = $this->app->Secure->GetPOST('angezeigtername'); // use only these $input['client_alias'] = $this->app->Secure->GetPOST('client_alias'); $input['smtp_authtype'] = $this->app->Secure->GetPOST('smtp_authtype'); $input['smtp_authparam'] = $this->app->Secure->GetPOST('smtp_authparam'); @@ -255,8 +257,6 @@ $width = array('10%'); // Fill out manually later $this->app->Tpl->Set('SMTP_EXTRA', $input['smtp_extra']); $this->app->Tpl->Set('SMTP_SSL', $input['smtp_ssl']); $this->app->Tpl->Set('SMTP_PORT', $input['smtp_port']); - $this->app->Tpl->Set('SMTP_FROMMAIL', $input['smtp_frommail']); - $this->app->Tpl->Set('SMTP_FROMNAME', $input['smtp_fromname']); $this->app->Tpl->Set('CLIENT_ALIAS', $input['client_alias']); $this->app->Tpl->Set('SMTP_AUTHTYPE', $input['smtp_authtype']); $this->app->Tpl->Set('SMTP_AUTHPARAM', $input['smtp_authparam']); @@ -270,4 +270,35 @@ $width = array('10%'); // Fill out manually later } + function emailbackup_test_smtp() { + + $id = $this->app->Secure->GetGET('id'); + + $result = $this->app->DB->SelectArr("SELECT angezeigtername, email FROM emailbackup WHERE id='$id' LIMIT 1"); + + if( + $this->app->erp->MailSend( + $result[0]['email'], + $result[0]['angezeigtername'], + $result[0]['email'], + $result[0]['angezeigtername'], + 'Xenomporio ERP: Testmail', + 'Dies ist eine Testmail', + '',0,true,'','', + true + ) + ) { + $msg = $this->app->erp->base64_url_encode( + '
Die Testmail wurde erfolgreich versendet an '.$result[0]['email'].'. '.$this->app->erp->mail_error.'
' + ); + } + else { + $msg = $this->app->erp->base64_url_encode( + '
Die Testmail wurde nicht versendet: '.$this->app->erp->mail_error.'
' + ); + } + $this->app->Location->execute("index.php?module=emailbackup&id=$id&action=edit&msg=$msg"); + } + + }