mirror of
https://git.friendi.ca/friendica/friendica-addons.git
synced 2024-11-22 00:13:42 +00:00
Merge pull request #601 from tobiasd/20180513-4976
notifyall: enclose senders name in quotation marks
This commit is contained in:
commit
a2203e3d09
1 changed files with 22 additions and 13 deletions
|
@ -11,42 +11,51 @@
|
||||||
use Friendica\Content\Text\BBCode;
|
use Friendica\Content\Text\BBCode;
|
||||||
use Friendica\Core\L10n;
|
use Friendica\Core\L10n;
|
||||||
use Friendica\Util\Emailer;
|
use Friendica\Util\Emailer;
|
||||||
|
use Friendica\App;
|
||||||
|
|
||||||
function notifyall_install() {
|
function notifyall_install()
|
||||||
|
{
|
||||||
logger("installed notifyall");
|
logger("installed notifyall");
|
||||||
}
|
}
|
||||||
|
|
||||||
function notifyall_uninstall() {
|
function notifyall_uninstall()
|
||||||
|
{
|
||||||
logger("removed notifyall");
|
logger("removed notifyall");
|
||||||
}
|
}
|
||||||
|
|
||||||
function notifyall_module() {}
|
function notifyall_module() {}
|
||||||
|
|
||||||
function notifyall_addon_admin(&$a, &$o) {
|
function notifyall_addon_admin(App $a, &$o)
|
||||||
|
{
|
||||||
$o = '<div></div> <a href="' . z_root() . '/notifyall">' . L10n::t('Send email to all members') . '</a></br/>';
|
$o = '<div></div> <a href="' . z_root() . '/notifyall">' . L10n::t('Send email to all members') . '</a></br/>';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
function notifyall_post(&$a) {
|
function notifyall_post(App $a)
|
||||||
if(! is_site_admin())
|
{
|
||||||
|
if(!is_site_admin()) {
|
||||||
return;
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
$text = trim($_REQUEST['text']);
|
$text = trim($_REQUEST['text']);
|
||||||
if(! $text)
|
|
||||||
|
if(! $text) {
|
||||||
return;
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
$sitename = $a->config['sitename'];
|
$sitename = $a->config['sitename'];
|
||||||
|
|
||||||
if (!x($a->config['admin_name']))
|
if (empty($a->config['admin_name'])) {
|
||||||
$sender_name = L10n::t('%s Administrator', $sitename);
|
$sender_name = '"' . L10n::t('%s Administrator', $sitename) . '"';
|
||||||
else
|
} else {
|
||||||
$sender_name = L10n::t('%1$s, %2$s Administrator', $a->config['admin_name'], $sitename);
|
$sender_name = '"' . L10n::t('%1$s, %2$s Administrator', $a->config['admin_name'], $sitename) . '"';
|
||||||
|
}
|
||||||
|
|
||||||
if (! x($a->config['sender_email']))
|
if (! x($a->config['sender_email'])) {
|
||||||
$sender_email = 'noreply@' . $a->get_hostname();
|
$sender_email = 'noreply@' . $a->get_hostname();
|
||||||
else
|
} else {
|
||||||
$sender_email = $a->config['sender_email'];
|
$sender_email = $a->config['sender_email'];
|
||||||
|
}
|
||||||
|
|
||||||
$subject = $_REQUEST['subject'];
|
$subject = $_REQUEST['subject'];
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue