Exemplo n.º 1
0
 function sendFeedback()
 {
     global $Controller, $USER, $SITE;
     $_POST->setType('feedback', 'string');
     $_POST->setType('description', 'string');
     $report = '<h1>Feedback report</h1><p><b>Generated report from ' . $SITE->Name . ' user feedback form.</b></p>
         <table width="100%" border="1" cellspacing="0" cellpadding="5"><tbody>' . '<tr><td>' . __('Feedback') . '</td><td>' . $_POST['feedback'] . '</td></tr>' . '<tr><td>' . __('Description') . '</td><td>' . $_POST['description'] . '</td></tr>' . '<tr><td>' . __('Page') . '</td><td>' . $_SERVER['HTTP_REFERER'] . '</td></tr>' . '<tr><td>' . __('User') . '</td><td>' . $USER . ' (' . $USER->getEmail() . ')' . '</td></tr>' . '<tr><td>' . __('User agent') . '</td><td>' . $_SERVER['HTTP_USER_AGENT'] . '</td></tr>' . '</tbody></table>';
     $Controller->{(string) ADMIN_GROUP}(OVERRIDE)->mail(MailTools::template($report), MailTools::headers("Yweb" . ' <*****@*****.**>', "Yweb Feedback Report"));
 }
Exemplo n.º 2
0
            foreach ($Recipients as $Recipient) {
                if (in_array($Recipient, $sent_to)) {
                    continue;
                }
                $sent_to[] = $Recipient;
                $Recipient = $Controller->get($Recipient, OVERRIDE, false, false);
                if (!is_object($Recipient) || !is_a($Recipient, 'User')) {
                    continue;
                }
                if (!$Message['override_membercheck'] && !$Recipient->isActive()) {
                    continue;
                }
                $namn['full'] = @$Recipient->userinfo['cn'];
                $namn['first'] = @$Recipient->userinfo['givenName'];
                $namn['sur'] = @$Recipient->userinfo['sn'];
                $msg = str_replace(array('{name}', '{firstname}', '{surname}'), array($namn['full'], $namn['first'], $namn['sur']), $Message['message']);
                $text = html_entity_decode(strip_tags(preg_replace('#<(p|br|/p)[^>]*>#i', "\n", $msg)), ENT_COMPAT, 'UTF-8');
                $hdrs = array();
                if ($Sender = $Controller->{(string) $Message['from']}(OVERRIDE)) {
                    $hdrs['From'] = $Sender . ' <' . ($Sender->getEmail() ? $Sender->getEmail() : $CONFIG->Mail->Sender_email) . '>';
                }
                $hdrs['Subject'] = $Message['subject'];
                $Recipient->mail(MailTools::template($msg), $hdrs, $text);
                //echo ++$i.": ".$Recipient.", ".memory_get_usage()."\n";
                $Recipient = false;
            }
        }
    } catch (Exception $e) {
    }
    $DB->massmail->update(array('#!sent' => 'UNIX_TIMESTAMP()'), array('msg_id' => $Message['msg_id']));
}