예제 #1
0
 public function showPage()
 {
     $data = file_get_contents("php://input");
     preg_match_all("`<key>UDID</key>\n.<string>(.*)</string>`", $data, $out);
     if (isset($out[1][0])) {
         header("Location: /end?udid=" . urlencode(Encryption::encrypt($out[1][0])) . (strlen($out[1][0]) == 40 ? "&ios" : "&osx"), true, 301);
     } else {
         header("Location: /end", true, 301);
     }
 }
예제 #2
0
 public function showPage()
 {
     if (isset($_GET['udid'])) {
         $udid = Encryption::decrypt(urldecode($_GET['udid']));
         if (strlen($udid) == 40 || isset($_GET['osx'])) {
             setcookie("udid", $_GET['udid'], time() + 86400 * 365);
             echo $this->getTemplateEngine()->render($this->getTemplateSnip("page"), ["title" => "Closing...", "content" => $this->getTemplateEngine()->render($this->getTemplate())]);
         } else {
             (new index())->showPage("Your UDID data is invalid.");
         }
     } else {
         (new index())->showPage("No UDID could be found in the stream.");
     }
 }
예제 #3
0
 public function showPage($message = false)
 {
     //$user = SessionStore::getCurrentSession();
     echo $this->getTemplateEngine()->render($this->getTemplateSnip("page"), ["title" => "Welcome!", "content" => $this->getTemplateEngine()->render($this->getTemplate(), ["message" => $message === false ? false : $message, "udid" => isset($_COOKIE['udid']) ? Encryption::decrypt($_COOKIE['udid']) : false, "ios" => preg_match('~^(?:(?:(?:Mozilla/\\d\\.\\d\\s*\\()+|Mobile\\s*Safari\\s*\\d+\\.\\d+(\\.\\d+)?\\s*)(?:iPhone(?:\\s+Simulator)?|iPad|iPod);\\s*(?:U;\\s*)?(?:[a-z]+(?:-[a-z]+)?;\\s*)?CPU\\s*(?:iPhone\\s*)?(?:OS\\s*\\d+_\\d+(?:_\\d+)?\\s*)?(?:like|comme)\\s*Mac\\s*O?S?\\s*X(?:;\\s*[a-z]+(?:-[a-z]+)?)?\\)\\s*)?(?:AppleWebKit/\\d+(?:\\.\\d+(?:\\.\\d+)?|\\s*\\+)?\\s*)?(?:\\(KHTML,\\s*(?:like|comme)\\s*Gecko\\s*\\)\\s*)?(?:Version/\\d+\\.\\d+(?:\\.\\d+)?\\s*)?(?:Mobile/\\w+\\s*)?(?:Safari/\\d+\\.\\d+(?:\\.\\d+)?.*)?$~', $_SERVER['HTTP_USER_AGENT']), "callback" => isset($_GET['callback']) ? base64_decode($_GET['callback']) : false])]);
 }