public function upgradeLicense() { $upgrade_app = new Application($this->application->upgrade_app_id); if ($upgrade_app->ok()) { $o = new Order(); $o->app_id = $upgrade_app->id; $o->dt = dater(); $o->first_name = $this->order->first_name; $o->last_name = $this->order->last_name; $o->payer_email = $this->order->payer_email; $o->notes = "Upgrade via Shine"; $o->type = 'Upgrade'; $o->insert(); $o->generateLicense(); return $o; } return null; }
<?php require 'includes/master.inc.php'; $Auth->requireAdmin('login.php'); $app = new Application($_GET['id']); if (!$app->ok()) { redirect('index.php'); } $versions = $app->versions(); ?> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> <html> <head> <title>Shine</title> <meta http-equiv="Content-Type" content="text/html;charset=utf-8" > <link rel="stylesheet" href="http://yui.yahooapis.com/2.7.0/build/reset-fonts-grids/reset-fonts-grids.css" type="text/css"> <link rel="stylesheet" href="css/yuiapp.css" type="text/css"> <link rel="alternate" type="application/rss+xml" title="Appcast Feed" href="appcast.php?id=<?php echo $app->id; ?> " /> </head> <body class="rounded"> <div id="doc3" class="yui-t0"> <div id="hd"> <h1>Shine</h1> <div id="navigation"> <ul id="primary-navigation"> <li class="active"><a href="index.php">Applications</a></li>
function sendConfirmationMail() { // TODO $downloadScriptName = 'download-confirm.php?id=' . $this->id . '&customerEmail=' . urlencode($this->customerEmail) . '&app_id=' . $this->app_id; // TODO $downloadLink = 'http://' . $_SERVER['HTTP_HOST'] . WEB_ROOT . '/' . $downloadScriptName; $app = new Application($this->app_id); if (!$app->ok()) { die('Invalid app ID: ' . $this->app_id); } $body = "Hello {$this->customer_name}\n\n"; $body .= "You have requested to download {$app->name}. Please click on the link below to download the application:\n\n"; $body .= "\t{$downloadLink}\n\n"; $body .= "If your e-mail program does not display the above text as a link, please copy the line above and paste it in your web browser.\n\n"; $body .= "Thank you for your interest in {$app->name}."; /* // Create a random boundary $boundary = base64_encode(md5(rand())); $headers = "From: {$app->from_email}\n"; $headers .= "X-Mailer: PHP/" . phpversion() . "\n"; $headers .= "MIME-Version: 1.0\n"; $headers .= "Content-Type: multipart/mixed; boundary=\"$boundary\"\n"; $headers .= "Content-Transfer-Encoding: 7bit\n\n"; $headers .= "This is a MIME encoded message.\n\n"; $headers .= "--$boundary\n"; $headers .= "Content-Type: text/plain; charset=\"iso-8859-1\"\n"; $headers .= "Content-Transfer-Encoding: 7bit\n\n"; $headers .= $app->getBody($this) . "\n\n\n"; $headers .= "--$boundary\n"; $headers .= "Content-Type: application/octet-stream; name=\"{$app->license_filename}\"\n"; $headers .= "Content-Transfer-Encoding: base64\n"; $headers .= "Content-Disposition: attachment\n\n"; $headers .= chunk_split(base64_encode($this->license))."\n"; $headers .= "--$boundary--"; */ // Create a random boundary $boundary = base64_encode(md5(rand())); $headers = "From: {$app->from_email}\n"; $headers .= "X-Mailer: PHP/" . phpversion() . "\n"; $headers .= "MIME-Version: 1.0\n"; $headers .= "Content-Type: multipart/mixed; boundary=\"{$boundary}\"\n"; $headers .= "Content-Transfer-Encoding: 7bit\n\n"; $headers .= "This is a MIME encoded message.\n\n"; $headers .= "--{$boundary}\n"; $headers .= "Content-Type: text/plain; charset=\"iso-8859-1\"\n"; $headers .= "Content-Transfer-Encoding: 7bit\n\n"; $headers .= $body . "\n"; $headers .= "--{$boundary}--"; return mail($this->customerEmail, $app->name . ' download link', '', utf8_encode($headers)); }