Skip to content
This repository has been archived by the owner on Apr 24, 2019. It is now read-only.

Commit

Permalink
Bits n pieces from the private fork.
Browse files Browse the repository at this point in the history
  • Loading branch information
Tyler Hall committed May 3, 2011
1 parent 6034060 commit 3496a68
Show file tree
Hide file tree
Showing 7 changed files with 50 additions and 10 deletions.
17 changes: 17 additions & 0 deletions appcast.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,15 @@

$db->query("UPDATE shine_versions SET updates = updates + 1 WHERE app_id = '{$app->id}' ORDER BY dt DESC LIMIT 1");

$pirate = false;
if(isset($_GET['serialNumber'])) {
$sn = $db->quote(trim($_GET['serialNumber']));
$count = $db->getValue("SELECT COUNT(*) FROM shine_orders WHERE license = $sn");
if($count == 0) {
$pirate = true;
}
}

header("Content-type: application/xml");
?>
<?PHP echo '<'; ?>?xml version="1.0" encoding="utf-8"?>
Expand All @@ -37,5 +46,13 @@
<enclosure url="<?PHP echo $v->url; ?>" sparkle:shortVersionString="<?PHP echo $v->human_version; ?>" sparkle:version="<?PHP echo $v->version_number; ?>" length="<?PHP echo $v->filesize; ?>" type="application/octet-stream" sparkle:dsaSignature="<?PHP echo $v->signature; ?>" />
</item>
<?PHP endforeach; ?>
<?PHP if($pirate === true) : ?>
<item>
<title>sparkle</title>
<description></description>
<pubDate></pubDate>
<enclosure url="http://clickontyler.com" sparkle:shortVersionString="1.0" sparkle:version="1.0" length="3000000" type="application/octet-stream" sparkle:dsaSignature="abc123" />
</item>
<?PHP endif; ?>
</channel>
</rss>
2 changes: 1 addition & 1 deletion includes/Postmark.php
Original file line number Diff line number Diff line change
Expand Up @@ -300,7 +300,7 @@ public function send()
'Content-Type: application/json',
'X-Postmark-Server-Token: ' . $this->_apiKey
);

$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, 'https://api.postmarkapp.com/email');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
Expand Down
4 changes: 2 additions & 2 deletions includes/class.objects.php
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,7 @@ public function applicationName()

return $cache[$this->app_id];
}

public function generateLicense()
{
$app = new Application($this->app_id);
Expand All @@ -237,7 +237,7 @@ public function emailLicense()
$engine->order = $this;
$engine->emailLicense();
}

public function upgradeLicense()
{
$app = new Application($this->app_id);
Expand Down
2 changes: 1 addition & 1 deletion license-inapp.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
$o = new Order();
$o->select($a->serial_number, 'serial_number');
if(!$o->ok()) die('serial');

// Because we die before the activation is updated with the found order id,
// this has the added benefit of highlighting the activation as "fraudulent"
// in the activations list. It's not fraudulent obviously, but it does let
Expand Down
22 changes: 22 additions & 0 deletions missing.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
<?PHP
// Given a text file with one FastSpring order number per line,
// this script finds any orders that were not successfully stored
// in Shine.

require 'includes/master.inc.php';

$orders = file('orders.txt');

$db = Database::getDatabase();

foreach($orders as $o)
{
$o = trim($o);
$count = $db->getValue("SELECT COUNT(*) FROM shine_orders WHERE `txn_id` = '$o'");
if($count == 0)
{
echo "$o<br>\n";
}
}

echo "Done";
11 changes: 5 additions & 6 deletions of.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,11 +38,10 @@
$message .= "Criticality: {$_POST['critical']}\n\n";
$message .= "Message: " . str_replace("\\n", "\n", $_POST['message']) . "\n\n";

// Send mail via http://postmarkapp.com
// Mail_Postmark::compose()
// ->addTo('[email protected]')
// ->subject($_POST['appname'] . ' ' . ucwords($_POST['type']))
// ->messagePlain($message)
// ->send();
Mail_Postmark::compose()
->addTo('[email protected]')
->subject($_POST['appname'] . ' ' . ucwords($_POST['type']))
->messagePlain($message)
->send();

echo "ok";
2 changes: 2 additions & 0 deletions order.php
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,8 @@
<div class="bd">
<?PHP if($app->engine_class_name == 'aquaticprime') : ?>
<textarea style="width:100%;"><?PHP echo $o->license; ?></textarea>
<?PHP elseif($app->engine_class_name == 'dual') : ?>
<textarea style="width:100%;"><?PHP echo "Email: {$o->payer_email}\nSerial Number: {$o->serial_number}"; ?></textarea>
<?PHP else : ?>
<textarea style="width:100%;"><?PHP echo "Email: {$o->payer_email}\nReg Key: {$o->license}"; ?></textarea>
<?PHP endif; ?>
Expand Down

0 comments on commit 3496a68

Please sign in to comment.