Пример #1
0
 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);
 }
Пример #2
0
 public function executeDelete()
 {
     $appid = mfwRequest::param('id');
     $instapp = InstallLog::getInstallApp($this->login_user, $appid);
     if ($instapp) {
         $instapp->delete();
     }
     return $this->redirect('/myapps/installed');
 }
 public function executeNotification_setting()
 {
     try {
         $app_id = mfwRequest::param('id');
         $notify = mfwRequest::param('value', false);
         $instapp = InstallLog::getInstallApp($this->login_user, $app_id);
         if (!$instapp) {
             return $this->jsonResponse(self::HTTP_404_NOTFOUND, array('error' => 'installed application not found.'));
         }
         $instapp->updateNotifySetting($notify);
     } catch (Exception $e) {
         error_log(__METHOD__ . '(' . __LINE__ . '): ' . get_class($e) . ":{$e->getMessage()}");
         return $this->jsonResponse(self::HTTP_500_INTERNALSERVERERROR, array('error' => $e->getMessage(), 'exception' => get_class($e)));
     }
     return $this->jsonResponse(self::HTTP_200_OK, $instapp->toArray());
 }
Пример #4
0
 public function getInstallPackages($app_id)
 {
     $pkg_ids = InstallLog::getInstallPackageIds($this, $app_id);
     return PackageDb::retrieveByPKs($pkg_ids);
 }
Пример #5
0
 public function getInstallUsers()
 {
     if ($this->install_users === null) {
         $this->install_users = InstallLog::getInstallUsers($this);
     }
     return $this->install_users;
 }