public function executeInstall() { $pf = $this->package->getPlatform(); $ua = mfwRequest::userAgent(); if ($pf === Package::PF_IOS && $ua->isIOS()) { // itms-service での接続はセッションを引き継げない // 一時トークンをURLパラメータに付けることで認証する $scheme = Config::get('enable_https') ? 'https' : null; // HTTPSが使えるならHTTPS優先 $plist_url = mfwHttp::composeUrl(mfwRequest::makeUrl('/package/install_plist', $scheme), array('id' => $this->package->getId(), 't' => $this->makeToken())); $url = 'itms-services://?action=download-manifest&url=' . urlencode($plist_url); } else { // iPhone以外でのアクセスはパッケージを直接DL $url = $this->package->getFileUrl('+60 min'); } $con = mfwDBConnection::getPDO(); $con->beginTransaction(); try { InstallLog::Logging($this->login_user, $this->package, $ua, $con); $con->commit(); } catch (Exception $e) { $con->rollback(); error_log(__METHOD__ . '(' . __LINE__ . '): ' . get_class($e) . ":{$e->getMessage()}"); throw $e; } apache_log('app_id', $this->app->getId()); apache_log('pkg_id', $this->package->getId()); apache_log('platform', $this->package->getPlatform()); return $this->redirect($url); }
public function executeGoogle() { $callback_url = mfwRequest::makeUrl('/login/google_callback'); $url_base = 'https://accounts.google.com/o/oauth2/auth'; $query = array('client_id' => $this->config['google_app_id'], 'redirect_uri' => $callback_url, 'scope' => 'https://www.googleapis.com/auth/userinfo.email', 'response_type' => 'code', 'approval_prompt' => 'auto'); $dialog_url = mfwHttp::composeUrl($url_base, $query); return $this->redirect($dialog_url); }
protected function redirect($query, $params = array()) { $query = mfwHttp::composeUrl($query, $params); if (strpos($query, 'http') !== 0) { $query = mfwRequest::makeUrl($query); } $headers = array("Location: {$query}"); return array($headers, null); }
</a></li> <?php } } if ($end < $max_page - 1) { ?> <li class="disabled omission"> <span>..</span> </li> <?php } if ($end != $max_page) { ?> <li<?php echo $cur_page == $max_page ? ' class="active"' : ''; ?> > <a href="<?php echo mfwHttp::composeUrl($urlbase, array('page' => $max_page)); ?> "><?php echo $max_page; ?> </a> </li> <?php } ?> </ul>
$url = mfwHttp::composeUrl($baseurl, array($paramname => 1)); echo "<a href=\"{$url}\">1</a>\n...\n"; for ($i = $page - 2; $i < $page; ++$i) { $url = mfwHttp::composeUrl($baseurl, array($paramname => $i)); echo "<a href=\"{$url}\">{$i}</a>\n"; } echo "{$page}\n"; for ($i = $page + 1; $i <= $page + 2; ++$i) { $url = mfwHttp::composeUrl($baseurl, array($paramname => $i)); echo "<a href=\"{$url}\">{$i}</a>\n"; } $url = mfwHttp::composeUrl($baseurl, array($paramname => $page_max)); echo "...\n<a href=\"{$url}\">{$page_max}</a>\n"; } if ($page < $page_max) { $url = mfwHttp::composeUrl($baseurl, array($paramname => $page + 1)); echo "<a class=\"next\" href=\"{$url}\">Next</a>\n"; } else { echo "<span class=\"next\">Next</span>\n"; } ?> <form action="<?php echo $baseurl; ?> " method="get"> page: <input type="text" size="3" name="<?php echo $paramname; ?> " value="<?php echo $page; ?>