]> git.mxchange.org Git - friendica-addons.git/commitdiff
Some Renames:
authornupplaPhil <admin@philipp.info>
Sun, 26 Jan 2020 22:47:15 +0000 (23:47 +0100)
committernupplaPhil <admin@philipp.info>
Sun, 26 Jan 2020 22:47:15 +0000 (23:47 +0100)
- EMail => EMail
- toEmail => toAddress
- fromEmail => fromAddress

notifyall/NotifyAllEMail.php [deleted file]
notifyall/NotifyAllEmail.php [new file with mode: 0644]
notifyall/notifyall.php
securemail/SecureTestEMail.php [deleted file]
securemail/SecureTestEmail.php [new file with mode: 0644]
securemail/securemail.php

diff --git a/notifyall/NotifyAllEMail.php b/notifyall/NotifyAllEMail.php
deleted file mode 100644 (file)
index eeca4fa..0000000
+++ /dev/null
@@ -1,40 +0,0 @@
-<?php
-
-namespace Friendica\Addon\notifyall;
-
-use Friendica\App\BaseURL;
-use Friendica\Content\Text\BBCode;
-use Friendica\Core\Config\IConfig;
-use Friendica\Core\L10n;
-use Friendica\Object\EMail;
-
-/**
- * Class for creating a Notify-All EMail
- */
-class NotifyAllEMail extends EMail
-{
-       public function __construct(L10n $l10n, IConfig $config, BaseURL $baseUrl, string $text)
-       {
-               $sitename = $config->get('config', 'sitename');
-
-               if (empty($config->get('config', 'admin_name'))) {
-                       $sender_name = '"' . $l10n->t('%s Administrator', $sitename) . '"';
-               } else {
-                       $sender_name = '"' . $l10n->t('%1$s, %2$s Administrator', $config->get('config', 'admin_name'), $sitename) . '"';
-               }
-
-               if (!$config->get('config', 'sender_email')) {
-                       $sender_email = 'noreply@' . $baseUrl->getHostname();
-               } else {
-                       $sender_email = $config->get('config', 'sender_email');
-               }
-
-               $subject = $_REQUEST['subject'];
-
-               $textversion = strip_tags(html_entity_decode(BBCode::convert(stripslashes(str_replace(["\\r", "\\n"], ["", "\n"], $text))), ENT_QUOTES, 'UTF-8'));
-
-               $htmlversion = BBCode::convert(stripslashes(str_replace(["\\r", "\\n"], ["", "<br />\n"], $text)));
-
-               parent::__construct($sender_name, $sender_email, $sender_email, '', $subject, $htmlversion, $textversion);
-       }
-}
diff --git a/notifyall/NotifyAllEmail.php b/notifyall/NotifyAllEmail.php
new file mode 100644 (file)
index 0000000..96a57a6
--- /dev/null
@@ -0,0 +1,40 @@
+<?php
+
+namespace Friendica\Addon\notifyall;
+
+use Friendica\App\BaseURL;
+use Friendica\Content\Text\BBCode;
+use Friendica\Core\Config\IConfig;
+use Friendica\Core\L10n;
+use Friendica\Object\Email;
+
+/**
+ * Class for creating a Notify-All EMail
+ */
+class NotifyAllEmail extends Email
+{
+       public function __construct(L10n $l10n, IConfig $config, BaseURL $baseUrl, string $text)
+       {
+               $sitename = $config->get('config', 'sitename');
+
+               if (empty($config->get('config', 'admin_name'))) {
+                       $sender_name = '"' . $l10n->t('%s Administrator', $sitename) . '"';
+               } else {
+                       $sender_name = '"' . $l10n->t('%1$s, %2$s Administrator', $config->get('config', 'admin_name'), $sitename) . '"';
+               }
+
+               if (!$config->get('config', 'sender_email')) {
+                       $sender_email = 'noreply@' . $baseUrl->getHostname();
+               } else {
+                       $sender_email = $config->get('config', 'sender_email');
+               }
+
+               $subject = $_REQUEST['subject'];
+
+               $textversion = strip_tags(html_entity_decode(BBCode::convert(stripslashes(str_replace(["\\r", "\\n"], ["", "\n"], $text))), ENT_QUOTES, 'UTF-8'));
+
+               $htmlversion = BBCode::convert(stripslashes(str_replace(["\\r", "\\n"], ["", "<br />\n"], $text)));
+
+               parent::__construct($sender_name, $sender_email, $sender_email, '', $subject, $htmlversion, $textversion);
+       }
+}
index c2391fcc03f304688edd93d5641046cda677cfda..6d1793804dbacebc090cce5052453495c5aed20b 100644 (file)
@@ -8,7 +8,7 @@
  * Author: Rabuzarus <https://friendica.kommune4.de/profile/rabuzarus> (Port to Friendica)
  */
 
-use Friendica\Addon\notifyall\NotifyAllEMail;
+use Friendica\Addon\notifyall\NotifyAllEmail;
 use Friendica\App;
 use Friendica\Database\DBA;
 use Friendica\Core\Logger;
@@ -60,7 +60,7 @@ function notifyall_post(App $a)
                return;
        }
 
-       $notifyEmail = new NotifyAllEMail(DI::l10n(), DI::config(), DI::baseUrl(), $text);
+       $notifyEmail = new NotifyAllEmail(DI::l10n(), DI::config(), DI::baseUrl(), $text);
 
        foreach ($recipients as $recipient) {
                DI::emailer()->send($notifyEmail->withRecipient($recipient['email']));
diff --git a/securemail/SecureTestEMail.php b/securemail/SecureTestEMail.php
deleted file mode 100644 (file)
index d7f9a29..0000000
+++ /dev/null
@@ -1,40 +0,0 @@
-<?php
-
-namespace Friendica\Addon\securemail;
-
-use Friendica\App;
-use Friendica\App\BaseURL;
-use Friendica\Core\Config\IConfig;
-use Friendica\Core\PConfig\IPConfig;
-use Friendica\Object\EMail;
-
-/**
- * Class for creating a Test email for the securemail addon
- */
-class SecureTestEMail extends EMail
-{
-       public function __construct(App $a, IConfig $config, IPConfig $pConfig, BaseURL $baseUrl)
-       {
-               $sitename = $config->get('config', 'sitename');
-
-               $hostname = $baseUrl->getHostname();
-               if (strpos($hostname, ':')) {
-                       $hostname = substr($hostname, 0, strpos($hostname, ':'));
-               }
-
-               $sender_email = $config->get('config', 'sender_email');
-               if (empty($sender_email)) {
-                       $sender_email = 'noreply@' . $hostname;
-               }
-
-               $subject = 'Friendica - Secure Mail - Test';
-               $message = 'This is a test message from your Friendica Secure Mail addon.';
-
-               // enable addon for test
-               $pConfig->set(local_user(), 'securemail', 'enable', 1);
-
-               parent::__construct($sitename, $sender_email, $sender_email, $a->user['email'],
-                       $subject, "<p>{$message}</p>", $message,
-                       '', local_user());
-       }
-}
diff --git a/securemail/SecureTestEmail.php b/securemail/SecureTestEmail.php
new file mode 100644 (file)
index 0000000..37fe5d7
--- /dev/null
@@ -0,0 +1,40 @@
+<?php
+
+namespace Friendica\Addon\securemail;
+
+use Friendica\App;
+use Friendica\App\BaseURL;
+use Friendica\Core\Config\IConfig;
+use Friendica\Core\PConfig\IPConfig;
+use Friendica\Object\Email;
+
+/**
+ * Class for creating a Test email for the securemail addon
+ */
+class SecureTestEmail extends Email
+{
+       public function __construct(App $a, IConfig $config, IPConfig $pConfig, BaseURL $baseUrl)
+       {
+               $sitename = $config->get('config', 'sitename');
+
+               $hostname = $baseUrl->getHostname();
+               if (strpos($hostname, ':')) {
+                       $hostname = substr($hostname, 0, strpos($hostname, ':'));
+               }
+
+               $sender_email = $config->get('config', 'sender_email');
+               if (empty($sender_email)) {
+                       $sender_email = 'noreply@' . $hostname;
+               }
+
+               $subject = 'Friendica - Secure Mail - Test';
+               $message = 'This is a test message from your Friendica Secure Mail addon.';
+
+               // enable addon for test
+               $pConfig->set(local_user(), 'securemail', 'enable', 1);
+
+               parent::__construct($sitename, $sender_email, $sender_email, $a->user['email'],
+                       $subject, "<p>{$message}</p>", $message,
+                       '', local_user());
+       }
+}
index e25e96695c05b5cc6864aa5a23a6a5fd4869d9b2..55d032072702a2d3ed9e06d6c98354e22dd2ac2a 100644 (file)
@@ -6,7 +6,7 @@
  * Author: Fabio Comuni <http://kirgroup.com/profile/fabrixxm>
  */
 
-use Friendica\Addon\securemail\SecureTestEMail;
+use Friendica\Addon\securemail\SecureTestEmail;
 use Friendica\App;
 use Friendica\Core\Hook;
 use Friendica\Core\Logger;
@@ -89,7 +89,7 @@ function securemail_settings_post(App &$a, array &$b)
 
                if ($_POST['securemail-submit'] == DI::l10n()->t('Save and send test')) {
 
-                       $res = DI::emailer()->send(new SecureTestEMail(DI::app(), DI::config(), DI::pConfig(), DI::baseUrl()));
+                       $res = DI::emailer()->send(new SecureTestEmail(DI::app(), DI::config(), DI::pConfig(), DI::baseUrl()));
 
                        // revert to saved value
                        DI::pConfig()->set(local_user(), 'securemail', 'enable', $enable);