예제 #1
0
            die("You have not purchased or installed that app.\n");
        }
        switch ($_POST['item']) {
            case 'feedback':
                $body = <<<BODY
{$LOGIN_DATA['nickname']} has sent you {$_POST['item']} feedback about your app "{$package['name']}" version {$_POST['version']}.

They are using {$_POST['os']} (platform: {$_POST['platform']}) version {$_POST['osVersion']} on {$_POST['machine']}.

{$_POST['body']}
BODY;
                require dirname(__FILE__) . '/../include/emailclass.php';
                if ($package['developer_public_key']) {
                    $mail = new sendmail();
                    $mail->gpg_add_key("0x{$package['developer_public_key']}");
                    $mail->gpg_set_type(GPG_ASYMMETRIC);
                    $mail->gpg_set_sign(1);
                } else {
                    $mail = new sendmail_gpgsign();
                }
                $mail->gpg_set_signing_key('0x0DD626E6');
                // Verifies it was sent by our server
                $mail->gpg_set_homedir('/home/apt/.gnupg/');
                $mail->sender("*****@*****.**");
                $mail->from('"' . $LOGIN_DATA['nickname'] . '" <' . $LOGIN_DATA['email'] . '>');
                $mail->add_to($package['developer_email']);
                $mail->subject("[TVE] {$_POST['type']} feedback for {$package['package']}");
                $mail->body($body);
                if ($mail->send()) {
                    header('Content-Type: text/plain; charset=utf-8');
                    echo "OK\n";