Permalink
Browse files

Allow iPhone users to request vcard via email rather than directly do…

…wnloading (which they can't do)
  • Loading branch information...
NeilCrosby committed Nov 21, 2009
1 parent a9c4261 commit 66605d729269636e9521be0f0f78c5ffb1c8b6b5
Showing with 1,943 additions and 1 deletion.
  1. +15 −1 index.php
  2. +1,831 −0 via-email/geekMail-1.0.php
  3. +83 −0 via-email/index.php
  4. +14 −0 via-email/sent/index.php
View
@@ -81,7 +81,21 @@ public function toString( $userPasscode = null ) {
: '';
$page = $_SERVER['REQUEST_URI'];
$joiner = ('/' == substr($page, -1)) ? '?' : '&';
$url = "http://$server$port$page{$joiner}vcf=1";
// if we're on the iPhone go to the email page
if (false !== strpos($_SERVER['HTTP_USER_AGENT'], 'iPhone')) {
if ('/' == substr($page, -1)) {
$newPage = $page . 'via-email/';
} else {
$bits = explode('/', $page);
$queryString = array_pop($bits);
$newPage = implode('/', $bits).'/via-email/'.$queryString;
}
$url = "http://$server$port$newPage";
// otherwise go to the normal download page
} else {
$url = "http://$server$port$page{$joiner}vcf=1";
}
$success = '';
if ( isset( $_GET['passcode'] ) ) {
Oops, something went wrong.

0 comments on commit 66605d7

Please sign in to comment.