Esempio n. 1
0
 public function execute()
 {
     // Prevent the page fron being embeded in an iframe
     header('X-Frame-Options: DENY');
     // Check if user already logged in and redirect to kmc2
     if ($this->getRequest()->getCookie('kmcks')) {
         $this->redirect('kmc/kmc2');
     }
     if (infraRequestUtils::getProtocol() != infraRequestUtils::PROTOCOL_HTTPS && kConf::get('kmc_secured_login')) {
         $url = 'https://' . $_SERVER['SERVER_NAME'] . $_SERVER['REQUEST_URI'];
         header('Location:' . $url);
         die;
     }
     $this->www_host = kConf::get('www_host');
     $https_enabled = !empty($_SERVER['HTTPS']) && $_SERVER['HTTPS'] !== 'off' || $_SERVER['SERVER_PORT'] == 443 ? true : false;
     $this->securedLogin = kConf::get('kmc_secured_login') || $https_enabled ? true : false;
     $swfUrl = $this->securedLogin ? 'https://' : 'http://';
     $swfUrl .= $this->www_host . myContentStorage::getFSFlashRootPath();
     $swfUrl .= '/kmc/login/' . kConf::get('kmc_login_version') . '/login.swf';
     $this->swfUrl = $swfUrl;
     $this->partner_id = $this->getRequestParameter("partner_id");
     $this->logoUrl = null;
     if ($this->partner_id) {
         $partner = PartnerPeer::retrieveByPK($this->partner_id);
         if ($partner) {
             $this->logoUrl = kmcUtils::getWhitelabelData($partner, 'logo_url');
         }
     }
     $this->beta = $this->getRequestParameter("beta");
     //prevent script injections - allow only base64_encode chars , which is used when creating A new hash key
     $passHashparam = $this->getRequestParameter("setpasshashkey");
     if ($passHashparam && !preg_match(self::BASE64_ENCODE_CHARS_REGEX, $passHashparam)) {
         KExternalErrors::dieError(KExternalErrors::INVALID_HASH);
     }
     $this->setPassHashKey = $passHashparam;
     $this->hashKeyErrorCode = null;
     $this->displayErrorFromServer = false;
     if ($this->setPassHashKey) {
         try {
             $loginData = UserLoginDataPeer::isHashKeyValid($this->setPassHashKey);
             $partnerId = $loginData->getConfigPartnerId();
             $partner = PartnerPeer::retrieveByPK($partnerId);
             if ($partner && $partner->getPasswordStructureValidations()) {
                 $this->displayErrorFromServer = true;
             }
         } catch (kCoreException $e) {
             $this->hashKeyErrorCode = $e->getCode();
         }
     }
     sfView::SUCCESS;
 }
Esempio n. 2
0
 public function execute()
 {
     sfView::SUCCESS;
     $this->partner_id = $this->getP("pid");
     $this->subp_id = $this->getP("subpid", (int) $this->partner_id * 100);
     $this->uid = $this->getP("uid");
     $this->ks = $this->getP("kmcks");
     if (!$this->ks) {
         // if kmcks from cookie doesn't exist, try ks from REQUEST
         $this->ks = $this->getP('ks');
     }
     $this->screen_name = $this->getP("screen_name");
     $this->email = $this->getP("email");
     $this->allow_reports = false;
     if (!$this->ks) {
         $this->redirect("kmc/kmc");
         die;
     }
     //		$this->beta = $this->getRequestParameter( "beta" );
     $this->embed_code = "";
     $this->ui_conf_width = "";
     $this->ui_conf_height = "";
     if ($this->partner_id !== null) {
         $widget = widgetPeer::retrieveByPK("_" . $this->partner_id);
         if ($widget) {
             $this->embed_code = $widget->getWidgetHtml("kaltura_player");
             $ui_conf = $widget->getuiConf();
             //				$this->ui_conf_width = 0; // $ui_conf->getWidth();
             //				$this->ui_conf_height = 0 ; // $ui_conf->getHeight();
         }
     }
     $this->partner = $partner = null;
     $this->templatePartnerId = 0;
     if ($this->partner_id !== NULL) {
         $this->partner = $partner = PartnerPeer::retrieveByPK($this->partner_id);
         kmcUtils::redirectPartnerToCorrectKmc($partner, $this->ks, $this->uid, $this->screen_name, $this->email, 2);
         $this->templatePartnerId = $this->partner ? $this->partner->getTemplatePartnerId() : 0;
     }
     $this->payingPartner = 'false';
     if ($partner && $partner->getPartnerPackage() != PartnerPackages::PARTNER_PACKAGE_FREE) {
         $this->payingPartner = 'true';
     }
     $this->enable_live_streaming = 'false';
     if (kConf::get('kmc_content_enable_live_streaming') && $partner) {
         if ($partner->getLiveStreamEnabled() && $partner->getKmcVersion() == 3) {
             $this->enable_live_streaming = 'true';
         }
     }
     // this is Andromeda kmc2Action - following are irrelevant so we set them to false & empty
     // just to make sure they don't get a black-eye value
     $this->enable_live_streaming = 'false';
     $this->silverLightPlayerUiConfs = array();
     $this->silverLightPlaylistUiConfs = array();
     /*
     		// remarked - no silverlight players in Andromeda
     		if($partner->getKmcVersion() == 3)
     		{
     			$this->silverLightPlayerUiConfs = kmcUtils::getSilverLightPlayerUiConfs('slp');
     			$this->silverLightPlaylistUiConfs = kmcUtils::getSilverLightPlayerUiConfs('sll');
     		}
     */
     // 2009-08-27 is the date we added ON2 to KMC trial account
     // TODO - should be depracated
     if ($partner) {
         if (strtotime($partner->getCreatedAt()) >= strtotime('2009-08-27') || $partner->getEnableAnalyticsTab()) {
             $this->allow_reports = true;
         }
         if ($partner->getEnableAnalyticsTab()) {
             $this->allow_reports = true;
         }
     }
     // set content kdp version according to partner id
     $moderated_partners = array(31079, 28575, 32774);
     $this->content_kdp_version = 'v2.7.0';
     if (in_array($this->partner_id, $moderated_partners)) {
         $this->content_kdp_version = 'v2.1.2.29057';
     }
     $this->playlist_uiconf_list = $this->getUiconfList('playlist');
     $this->player_uiconf_list = $this->getUiconfList('player');
     $this->first_login = false;
     if ($partner) {
         $this->first_login = $partner->getIsFirstLogin();
         if ($this->first_login === true) {
             $partner->setIsFirstLogin(false);
             $partner->save();
         }
         $this->jw_license = $partner->getLicensedJWPlayer();
     }
     // if the email is empty - it is an indication that the kaltura super user is logged in
     if (!$this->email) {
         $this->allow_reports = true;
     }
     /* applications versioning */
     $this->kmc_content_version = 'v2.1.6.1';
     $this->kmc_account_version = 'v2.1.2.3';
     $this->kmc_appstudio_version = 'v2.0.4';
     $this->kmc_rna_version = 'v1.1.3';
     $this->kmc_dashboard_version = 'v1.0.10';
     $this->jw_uiconfs_array = kmcUtils::getJWPlayerUIConfs();
     $this->jw_uiconf_playlist = kmcUtils::getJWPlaylistUIConfs();
     $this->advanced_editor = $this->getAdvancedEditorUiConf();
     $this->simple_editor = $this->getSimpleEditorUiConf();
 }
Esempio n. 3
0
 public function execute()
 {
     sfView::SUCCESS;
     /** check parameters and verify user is logged-in **/
     $this->ks = $this->getP("kmcks");
     if (!$this->ks) {
         // if kmcks from cookie doesn't exist, try ks from REQUEST
         $this->ks = $this->getP('ks');
     }
     /** if no KS found, redirect to login page **/
     if (!$this->ks) {
         $this->redirect("kmc/kmc");
         die;
     }
     $ksObj = kSessionUtils::crackKs($this->ks);
     // Set partnerId from KS
     $this->partner_id = $ksObj->partner_id;
     // Check if the KMC can be framed
     $allowFrame = PermissionPeer::isValidForPartner(PermissionName::FEATURE_KMC_ALLOW_FRAME, $this->partner_id);
     if (!$allowFrame) {
         header('X-Frame-Options: DENY');
     }
     // Check for forced HTTPS
     $force_ssl = PermissionPeer::isValidForPartner(PermissionName::FEATURE_KMC_ENFORCE_HTTPS, $this->partner_id);
     if ($force_ssl && (!isset($_SERVER['HTTPS']) || $_SERVER['HTTPS'] != 'on')) {
         header("Location: " . infraRequestUtils::PROTOCOL_HTTPS . "://" . $_SERVER['SERVER_NAME'] . $_SERVER["REQUEST_URI"]);
         die;
     }
     /** END - check parameters and verify user is logged-in **/
     /** Get array of allowed partners for the current user **/
     $allowedPartners = array();
     $this->full_name = "";
     $currentUser = kuserPeer::getKuserByPartnerAndUid($this->partner_id, $ksObj->user, true);
     if ($currentUser) {
         $partners = myPartnerUtils::getPartnersArray($currentUser->getAllowedPartnerIds());
         foreach ($partners as $partner) {
             $allowedPartners[] = array('id' => $partner->getId(), 'name' => $partner->getName());
         }
         $this->full_name = $currentUser->getFullName();
     }
     $this->showChangeAccount = count($allowedPartners) > 1 ? true : false;
     // Load partner
     $this->partner = $partner = PartnerPeer::retrieveByPK($this->partner_id);
     if (!$partner) {
         KExternalErrors::dieError(KExternalErrors::PARTNER_NOT_FOUND);
     }
     if (!$partner->validateApiAccessControl()) {
         KExternalErrors::dieError(KExternalErrors::SERVICE_ACCESS_CONTROL_RESTRICTED);
     }
     kmcUtils::redirectPartnerToCorrectKmc($partner, $this->ks, null, null, null, self::CURRENT_KMC_VERSION);
     $this->templatePartnerId = $this->partner ? $this->partner->getTemplatePartnerId() : self::SYSTEM_DEFAULT_PARTNER;
     $ignoreEntrySeoLinks = PermissionPeer::isValidForPartner(PermissionName::FEATURE_IGNORE_ENTRY_SEO_LINKS, $this->partner_id);
     $useEmbedCodeProtocolHttps = PermissionPeer::isValidForPartner(PermissionName::FEATURE_EMBED_CODE_DEFAULT_PROTOCOL_HTTPS, $this->partner_id);
     $showFlashStudio = PermissionPeer::isValidForPartner(PermissionName::FEATURE_SHOW_FLASH_STUDIO, $this->partner_id);
     $showHTMLStudio = PermissionPeer::isValidForPartner(PermissionName::FEATURE_SHOW_HTML_STUDIO, $this->partner_id);
     $deliveryTypes = $partner->getDeliveryTypes();
     $embedCodeTypes = $partner->getEmbedCodeTypes();
     $defaultDeliveryType = $partner->getDefaultDeliveryType() ? $partner->getDefaultDeliveryType() : 'http';
     $defaultEmbedCodeType = $partner->getDefaultEmbedCodeType() ? $partner->getDefaultEmbedCodeType() : 'auto';
     $this->previewEmbedV2 = PermissionPeer::isValidForPartner(PermissionName::FEATURE_PREVIEW_AND_EMBED_V2, $this->partner_id);
     /** set values for template **/
     $this->service_url = requestUtils::getRequestHost();
     $this->host = $this->stripProtocol($this->service_url);
     $this->embed_host = $this->stripProtocol(myPartnerUtils::getHost($this->partner_id));
     if (kConf::hasParam('cdn_api_host') && kConf::hasParam('www_host') && $this->host == kConf::get('cdn_api_host')) {
         $this->host = kConf::get('www_host');
     }
     if ($this->embed_host == kConf::get("www_host") && kConf::hasParam('cdn_api_host')) {
         $this->embed_host = kConf::get('cdn_api_host');
     }
     $this->embed_host_https = kConf::hasParam('cdn_api_host_https') ? kConf::get('cdn_api_host_https') : kConf::get('www_host');
     $this->cdn_url = myPartnerUtils::getCdnHost($this->partner_id);
     $this->cdn_host = $this->stripProtocol($this->cdn_url);
     $this->rtmp_host = kConf::get("rtmp_url");
     $this->flash_dir = $this->cdn_url . myContentStorage::getFSFlashRootPath();
     /** set payingPartner flag **/
     $this->payingPartner = 'false';
     if ($partner && $partner->getPartnerPackage() != PartnerPackages::PARTNER_PACKAGE_FREE) {
         $this->payingPartner = 'true';
         $ignoreSeoLinks = true;
     } else {
         $ignoreSeoLinks = $this->partner->getIgnoreSeoLinks();
     }
     /** get partner languae **/
     $language = null;
     if ($partner->getKMCLanguage()) {
         $language = $partner->getKMCLanguage();
     }
     $first_login = $partner->getIsFirstLogin();
     if ($first_login === true) {
         $partner->setIsFirstLogin(false);
         $partner->save();
     }
     /** get logout url **/
     $logoutUrl = null;
     if ($partner->getLogoutUrl()) {
         $logoutUrl = $partner->getLogoutUrl();
     }
     $this->kmc_swf_version = kConf::get('kmc_version');
     $akamaiEdgeServerIpURL = null;
     if (kConf::hasParam('akamai_edge_server_ip_url')) {
         $akamaiEdgeServerIpURL = kConf::get('akamai_edge_server_ip_url');
     }
     /** uiconf listing work **/
     /** fill $confs with all uiconf objects for all modules **/
     $kmcGeneralUiConf = kmcUtils::getAllKMCUiconfs('kmc', $this->kmc_swf_version, self::SYSTEM_DEFAULT_PARTNER);
     $kmcGeneralTemplateUiConf = kmcUtils::getAllKMCUiconfs('kmc', $this->kmc_swf_version, $this->templatePartnerId);
     /** for each module, create separated lists of its uiconf, for each need **/
     /** kmc general uiconfs **/
     $this->kmc_general = kmcUtils::find_confs_by_usage_tag($kmcGeneralTemplateUiConf, "kmc_kmcgeneral", false, $kmcGeneralUiConf);
     $this->kmc_permissions = kmcUtils::find_confs_by_usage_tag($kmcGeneralTemplateUiConf, "kmc_kmcpermissions", false, $kmcGeneralUiConf);
     /** P&E players: **/
     //$this->content_uiconfs_previewembed = kmcUtils::find_confs_by_usage_tag($kmcGeneralTemplateUiConf, "kmc_previewembed", true, $kmcGeneralUiConf);
     //$this->content_uiconfs_previewembed_list = kmcUtils::find_confs_by_usage_tag($kmcGeneralTemplateUiConf, "kmc_previewembed_list", true, $kmcGeneralUiConf);
     $this->content_uiconfs_flavorpreview = kmcUtils::find_confs_by_usage_tag($kmcGeneralTemplateUiConf, "kmc_flavorpreview", false, $kmcGeneralUiConf);
     /* KCW uiconfs */
     $this->content_uiconfs_upload_webcam = kmcUtils::find_confs_by_usage_tag($kmcGeneralTemplateUiConf, "kmc_uploadWebCam", false, $kmcGeneralUiConf);
     $this->content_uiconfs_upload_import = kmcUtils::find_confs_by_usage_tag($kmcGeneralTemplateUiConf, "kmc_uploadImport", false, $kmcGeneralUiConf);
     $this->content_uiconds_clipapp_kdp = kmcUtils::find_confs_by_usage_tag($kmcGeneralTemplateUiConf, "kmc_kdpClipApp", false, $kmcGeneralUiConf);
     $this->content_uiconds_clipapp_kclip = kmcUtils::find_confs_by_usage_tag($kmcGeneralTemplateUiConf, "kmc_kClipClipApp", false, $kmcGeneralUiConf);
     $this->studioUiConf = kmcUtils::getStudioUiconf(kConf::get("studio_version"));
     $this->content_uiconfs_studio_v2 = isset($this->studioUiConf) ? array_values($this->studioUiConf) : null;
     $this->content_uiconf_studio_v2 = is_array($this->content_uiconfs_studio_v2) && reset($this->content_uiconfs_studio_v2) ? reset($this->content_uiconfs_studio_v2) : null;
     $this->liveAUiConf = kmcUtils::getLiveAUiconf();
     $this->content_uiconfs_livea = isset($this->liveAUiConf) ? array_values($this->liveAUiConf) : null;
     $this->content_uiconf_livea = is_array($this->content_uiconfs_livea) && reset($this->content_uiconfs_livea) ? reset($this->content_uiconfs_livea) : null;
     $kmcVars = array('kmc_version' => $this->kmc_swf_version, 'kmc_general_uiconf' => $this->kmc_general->getId(), 'kmc_permissions_uiconf' => $this->kmc_permissions->getId(), 'allowed_partners' => $allowedPartners, 'kmc_secured' => (bool) kConf::get("kmc_secured_login"), 'enableLanguageMenu' => true, 'service_url' => $this->service_url, 'host' => $this->host, 'cdn_host' => $this->cdn_host, 'rtmp_host' => $this->rtmp_host, 'embed_host' => $this->embed_host, 'embed_host_https' => $this->embed_host_https, 'flash_dir' => $this->flash_dir, 'getuiconfs_url' => '/index.php/kmc/getuiconfs', 'terms_of_use' => kConf::get('terms_of_use_uri'), 'ks' => $this->ks, 'partner_id' => $this->partner_id, 'first_login' => (bool) $first_login, 'whitelabel' => $this->templatePartnerId, 'ignore_seo_links' => (bool) $ignoreSeoLinks, 'ignore_entry_seo' => (bool) $ignoreEntrySeoLinks, 'embed_code_protocol_https' => (bool) $useEmbedCodeProtocolHttps, 'delivery_types' => $deliveryTypes, 'embed_code_types' => $embedCodeTypes, 'default_delivery_type' => $defaultDeliveryType, 'default_embed_code_type' => $defaultEmbedCodeType, 'kcw_webcam_uiconf' => $this->content_uiconfs_upload_webcam->getId(), 'kcw_import_uiconf' => $this->content_uiconfs_upload_import->getId(), 'default_kdp' => array('id' => $this->content_uiconfs_flavorpreview->getId(), 'height' => $this->content_uiconfs_flavorpreview->getHeight(), 'width' => $this->content_uiconfs_flavorpreview->getWidth(), 'swf_version' => $this->content_uiconfs_flavorpreview->getswfUrlVersion()), 'clipapp' => array('version' => kConf::get("clipapp_version"), 'kdp' => $this->content_uiconds_clipapp_kdp->getId(), 'kclip' => $this->content_uiconds_clipapp_kclip->getId()), 'studio' => array('version' => kConf::get("studio_version"), 'uiConfID' => isset($this->content_uiconf_studio_v2) ? $this->content_uiconf_studio_v2->getId() : '', 'config' => isset($this->content_uiconf_studio_v2) ? $this->content_uiconf_studio_v2->getConfig() : '', 'showFlashStudio' => $showFlashStudio, 'showHTMLStudio' => $showHTMLStudio), 'liveanalytics' => array('version' => kConf::get("liveanalytics_version"), 'player_id' => isset($this->content_uiconf_livea) ? $this->content_uiconf_livea->getId() : '', 'map_zoom_levels' => kConf::hasParam("map_zoom_levels") ? kConf::get("map_zoom_levels") : '', 'map_urls' => kConf::hasParam("cdn_static_hosts") ? array_map(function ($s) {
         return "{$s}/content/static/maps/v1";
     }, kConf::get("cdn_static_hosts")) : ''), 'usagedashboard' => array('version' => kConf::get("usagedashboard_version")), 'disable_analytics' => (bool) kConf::get("kmc_disable_analytics"), 'google_analytics_account' => kConf::get("ga_account"), 'language' => $language, 'logoutUrl' => $logoutUrl, 'allowFrame' => (bool) $allowFrame, 'akamaiEdgeServerIpURL' => $akamaiEdgeServerIpURL, 'logoUrl' => kmcUtils::getWhitelabelData($partner, 'logo_url'), 'supportUrl' => kmcUtils::getWhitelabelData($partner, 'support_url'));
     $this->kmcVars = $kmcVars;
 }
 public function execute()
 {
     sfView::SUCCESS;
     /** check parameters and verify user is logged-in **/
     $this->partner_id = $this->getP("pid");
     $this->subp_id = $this->getP("subpid", (int) $this->partner_id * 100);
     $this->uid = $this->getP("uid");
     $this->ks = $this->getP("kmcks");
     if (!$this->ks) {
         // if kmcks from cookie doesn't exist, try ks from REQUEST
         $this->ks = $this->getP('ks');
     }
     $this->screen_name = $this->getP("screen_name");
     $this->email = $this->getP("email");
     /** if no KS found, redirect to login page **/
     if (!$this->ks) {
         $this->redirect("kmc/kmc");
         die;
     }
     $ksObj = kSessionUtils::crackKs($this->ks);
     /** END - check parameters and verify user is logged-in **/
     /** Get array of allowed partners for the current user **/
     $this->allowedPartners = array();
     $currentUser = kuserPeer::getKuserByPartnerAndUid($this->partner_id, $ksObj->user, true);
     if ($currentUser) {
         $partners = myPartnerUtils::getPartnersArray($currentUser->getAllowedPartnerIds());
         foreach ($partners as $partner) {
             $this->allowedPartners[] = array('id' => $partner->getId(), 'name' => $partner->getName());
         }
         $this->full_name = $currentUser->getFullName();
     }
     /** load partner from DB, and set templatePartnerId **/
     $this->partner = $partner = null;
     $this->templatePartnerId = self::SYSTEM_DEFAULT_PARTNER;
     $this->ignoreSeoLinks = false;
     $this->ignoreEntrySeoLinks = false;
     $this->useEmbedCodeProtocolHttps = false;
     $this->v2Flavors = false;
     if ($this->partner_id !== NULL) {
         $this->partner = $partner = PartnerPeer::retrieveByPK($this->partner_id);
         kmcUtils::redirectPartnerToCorrectKmc($partner, $this->ks, $this->uid, $this->screen_name, $this->email, self::CURRENT_KMC_VERSION);
         $this->templatePartnerId = $this->partner ? $this->partner->getTemplatePartnerId() : self::SYSTEM_DEFAULT_PARTNER;
         $this->ignoreSeoLinks = $this->partner->getIgnoreSeoLinks();
         $this->ignoreEntrySeoLinks = PermissionPeer::isValidForPartner(PermissionName::FEATURE_IGNORE_ENTRY_SEO_LINKS, $this->partner_id);
         $this->useEmbedCodeProtocolHttps = PermissionPeer::isValidForPartner(PermissionName::FEATURE_EMBED_CODE_DEFAULT_PROTOCOL_HTTPS, $this->partner_id);
         $this->v2Flavors = PermissionPeer::isValidForPartner(PermissionName::FEATURE_V2_FLAVORS, $this->partner_id);
     }
     /** END - load partner from DB, and set templatePartnerId **/
     /** set default flags **/
     $this->payingPartner = 'false';
     $this->kdp508_players = array();
     $this->first_login = false;
     /** END - set default flags **/
     /** set values for template **/
     $this->service_url = myPartnerUtils::getHost($this->partner_id);
     $this->host = $this->stripProtocol($this->service_url);
     $this->embed_host = $this->host;
     if (kConf::hasParam('cdn_api_host') && kConf::hasParam('www_host') && $this->host == kConf::get('cdn_api_host')) {
         $this->host = kConf::get('www_host');
     }
     $this->cdn_url = myPartnerUtils::getCdnHost($this->partner_id);
     $this->cdn_host = $this->stripProtocol($this->cdn_url);
     $this->rtmp_host = myPartnerUtils::getRtmpUrl($this->partner_id);
     $this->flash_dir = $this->cdn_url . myContentStorage::getFSFlashRootPath();
     // Decide if to hide akamai delivery type
     $this->hideAkamaiHDNetwork = $partner->getDisableAkamaiHDNetwork();
     /** set payingPartner flag **/
     if ($partner && $partner->getPartnerPackage() != PartnerPackages::PARTNER_PACKAGE_FREE) {
         $this->payingPartner = 'true';
     }
     /** END - set payingPartner flag **/
     /** get partner languae **/
     $this->language = null;
     if ($partner->getKMCLanguage()) {
         $this->language = $partner->getKMCLanguage();
     }
     /** END - get partner languae **/
     /** set first_login flag **/
     $this->first_login = $partner->getIsFirstLogin();
     if ($this->first_login === true) {
         $partner->setIsFirstLogin(false);
         $partner->save();
     }
     /** END - set first_login flag **/
     /** get logout url **/
     $this->logoutUrl = null;
     if ($partner->getLogoutUrl()) {
         $this->logoutUrl = $partner->getLogoutUrl();
     }
     /** END - get logout url**/
     /** partner-specific: change KDP version for partners working with auto-moderaion **/
     // set content kdp version according to partner id
     $moderated_partners = array(31079, 28575, 32774);
     $this->content_kdp_version = 'v2.7.0';
     if (in_array($this->partner_id, $moderated_partners)) {
         $this->content_kdp_version = 'v2.1.2.29057';
     }
     /** END - partner-specific: change KDP version for partners working with auto-moderaion **/
     $this->kmc_swf_version = kConf::get('kmc_version');
     /** uiconf listing work **/
     /** fill $this->confs with all uiconf objects for all modules **/
     $kmcGeneralUiConf = kmcUtils::getAllKMCUiconfs('kmc', $this->kmc_swf_version, self::SYSTEM_DEFAULT_PARTNER);
     $kmcGeneralTemplateUiConf = kmcUtils::getAllKMCUiconfs('kmc', $this->kmc_swf_version, $this->templatePartnerId);
     /** for each module, create separated lists of its uiconf, for each need **/
     /** kmc general uiconfs **/
     $this->kmc_general = kmcUtils::find_confs_by_usage_tag($kmcGeneralTemplateUiConf, "kmc_kmcgeneral", false, $kmcGeneralUiConf);
     $this->kmc_permissions = kmcUtils::find_confs_by_usage_tag($kmcGeneralTemplateUiConf, "kmc_kmcpermissions", false, $kmcGeneralUiConf);
     /** P&E players: **/
     //$this->content_uiconfs_previewembed = kmcUtils::find_confs_by_usage_tag($kmcGeneralTemplateUiConf, "kmc_previewembed", true, $kmcGeneralUiConf);
     //$this->content_uiconfs_previewembed_list = kmcUtils::find_confs_by_usage_tag($kmcGeneralTemplateUiConf, "kmc_previewembed_list", true, $kmcGeneralUiConf);
     $this->content_uiconfs_flavorpreview = kmcUtils::find_confs_by_usage_tag($kmcGeneralTemplateUiConf, "kmc_flavorpreview", false, $kmcGeneralUiConf);
     /* KCW uiconfs */
     $this->content_uiconfs_upload_webcam = kmcUtils::find_confs_by_usage_tag($kmcGeneralTemplateUiConf, "kmc_uploadWebCam", false, $kmcGeneralUiConf);
     $this->content_uiconfs_upload_import = kmcUtils::find_confs_by_usage_tag($kmcGeneralTemplateUiConf, "kmc_uploadImport", false, $kmcGeneralUiConf);
     $this->content_uiconds_clipapp_kdp = kmcUtils::find_confs_by_usage_tag($kmcGeneralTemplateUiConf, "kmc_kdpClipApp", false, $kmcGeneralUiConf);
     $this->content_uiconds_clipapp_kclip = kmcUtils::find_confs_by_usage_tag($kmcGeneralTemplateUiConf, "kmc_kClipClipApp", false, $kmcGeneralUiConf);
     /** content KCW,KSE,KAE **/
     //$this->content_uiconfs_upload = kmcUtils::find_confs_by_usage_tag($kmcGeneralTemplateUiConf, "kmc_upload", false, $kmcGeneralUiConf);
     //$this->simple_editor = kmcUtils::find_confs_by_usage_tag($kmcGeneralTemplateUiConf, "kmc_simpleedit", false, $kmcGeneralUiConf);
     //$this->advanced_editor = kmcUtils::find_confs_by_usage_tag($kmcGeneralTemplateUiConf, "kmc_advanceedit", false, $kmcGeneralUiConf);
     /** END - uiconf listing work **/
     /** get templateXmlUrl for whitelabeled partners **/
     //$this->appstudio_templatesXmlUrl = $this->getAppStudioTemplatePath();
 }
Esempio n. 5
0
 public function execute()
 {
     sfView::SUCCESS;
     /** check parameters and verify user is logged-in **/
     $this->partner_id = $this->getP("pid");
     $this->subp_id = $this->getP("subpid", (int) $this->partner_id * 100);
     $this->uid = $this->getP("uid");
     $this->ks = $this->getP("kmcks");
     if (!$this->ks) {
         // if kmcks from cookie doesn't exist, try ks from REQUEST
         $this->ks = $this->getP('ks');
     }
     $this->screen_name = $this->getP("screen_name");
     $this->email = $this->getP("email");
     /** if no KS found, redirect to login page **/
     if (!$this->ks) {
         $this->redirect("kmc/kmc");
         die;
     }
     /** END - check parameters and verify user is logged-in **/
     /** load partner from DB, and set templatePartnerId **/
     $this->partner = $partner = null;
     $this->templatePartnerId = self::SYSTEM_DEFAULT_PARTNER;
     if ($this->partner_id !== NULL) {
         $this->partner = $partner = PartnerPeer::retrieveByPK($this->partner_id);
         kmcUtils::redirectPartnerToCorrectKmc($partner, $this->ks, $this->uid, $this->screen_name, $this->email, self::CURRENT_KMC_VERSION);
         $this->templatePartnerId = $this->partner ? $this->partner->getTemplatePartnerId() : self::SYSTEM_DEFAULT_PARTNER;
     }
     /** END - load partner from DB, and set templatePartnerId **/
     /** set default flags **/
     $this->allow_reports = false;
     $this->payingPartner = 'false';
     $this->embed_code = "";
     $this->enable_live_streaming = 'false';
     $this->kmc_enable_custom_data = 'false';
     $this->kdp508_players = array();
     $this->first_login = false;
     $this->enable_vast = 'false';
     /** END - set default flags **/
     /** set values for template **/
     $this->service_url = myPartnerUtils::getHost($this->partner_id);
     $this->host = str_replace("http://", "", $this->service_url);
     $this->cdn_url = myPartnerUtils::getCdnHost($this->partner_id);
     $this->cdn_host = str_replace("http://", "", $this->cdn_url);
     $this->rtmp_host = myPartnerUtils::getRtmpUrl($this->partner_id);
     $this->flash_dir = $this->cdn_url . myContentStorage::getFSFlashRootPath();
     /** set embed_code value **/
     if ($this->partner_id !== null) {
         $widget = widgetPeer::retrieveByPK("_" . $this->partner_id);
         if ($widget) {
             $this->embed_code = $widget->getWidgetHtml("kaltura_player");
             $ui_conf = $widget->getuiConf();
         }
     }
     /** END - set embed_code value **/
     /** set payingPartner flag **/
     if ($partner && $partner->getPartnerPackage() != PartnerPackages::PARTNER_PACKAGE_FREE) {
         $this->payingPartner = 'true';
     }
     /** END - set payingPartner flag **/
     /** set enable_live_streaming flag **/
     if (kConf::get('kmc_content_enable_live_streaming') && $partner) {
         if ($partner->getLiveStreamEnabled()) {
             $this->enable_live_streaming = 'true';
         }
     }
     /** END - set enable_live_streaming flag **/
     /** set enable_live_streaming flag **/
     if ($partner && $partner->getEnableVast()) {
         $this->enable_vast = 'true';
     }
     /** END - set enable_live_streaming flag **/
     /** set kmc_enable_custom_data flag **/
     $defaultPlugins = kConf::get('default_plugins');
     if (is_array($defaultPlugins) && in_array('MetadataPlugin', $defaultPlugins) && $partner) {
         if ($partner->getPluginEnabled(MetadataPlugin::PLUGIN_NAME) && $partner->getKmcVersion() == self::CURRENT_KMC_VERSION) {
             $this->kmc_enable_custom_data = 'true';
         }
     }
     /** END - set kmc_enable_custom_data flag **/
     /** set allow_reports flag **/
     // 2009-08-27 is the date we added ON2 to KMC trial account
     // TODO - should be depracated
     if (strtotime($partner->getCreatedAt()) >= strtotime('2009-08-27') || $partner->getEnableAnalyticsTab()) {
         $this->allow_reports = true;
     }
     if ($partner->getEnableAnalyticsTab()) {
         $this->allow_reports = true;
     }
     // if the email is empty - it is an indication that the kaltura super user is logged in
     if (!$this->email) {
         $this->allow_reports = true;
     }
     /** END - set allow_reports flag **/
     /** set first_login and jw_license flags **/
     if ($partner) {
         $this->first_login = $partner->getIsFirstLogin();
         if ($this->first_login === true) {
             $partner->setIsFirstLogin(false);
             $partner->save();
         }
         $this->jw_license = $partner->getLicensedJWPlayer();
     }
     /** END - set first_login and jw_license flags **/
     /** partner-specific: change KDP version for partners working with auto-moderaion **/
     // set content kdp version according to partner id
     $moderated_partners = array(31079, 28575, 32774);
     $this->content_kdp_version = 'v2.7.0';
     if (in_array($this->partner_id, $moderated_partners)) {
         $this->content_kdp_version = 'v2.1.2.29057';
     }
     /** END - partner-specific: change KDP version for partners working with auto-moderaion **/
     /** applications versioning **/
     $this->kmc_content_version = kConf::get('kmc_content_version');
     $this->kmc_account_version = kConf::get('kmc_account_version');
     $this->kmc_appstudio_version = kConf::get('kmc_appstudio_version');
     $this->kmc_rna_version = kConf::get('kmc_rna_version');
     $this->kmc_dashboard_version = kConf::get('kmc_dashboard_version');
     /** END - applications versioning **/
     /** uiconf listing work **/
     /** fill $this->confs with all uiconf objects for all modules **/
     $contentSystemUiConfs = kmcUtils::getAllKMCUiconfs('content', $this->kmc_content_version, self::SYSTEM_DEFAULT_PARTNER);
     $contentTemplateUiConfs = kmcUtils::getAllKMCUiconfs('content', $this->kmc_content_version, $this->templatePartnerId);
     //$this->confs = kmcUtils::getAllKMCUiconfs('content',   $this->kmc_content_version, $this->templatePartnerId);
     $appstudioSystemUiConfs = kmcUtils::getAllKMCUiconfs('appstudio', $this->kmc_appstudio_version, self::SYSTEM_DEFAULT_PARTNER);
     $appstudioTemplateUiConfs = kmcUtils::getAllKMCUiconfs('appstudio', $this->kmc_appstudio_version, $this->templatePartnerId);
     //$this->confs = array_merge($this->confs, kmcUtils::getAllKMCUiconfs('appstudio', $this->kmc_appstudio_version, $this->templatePartnerId));
     $reportsSystemUiConfs = kmcUtils::getAllKMCUiconfs('reports', $this->kmc_rna_version, self::SYSTEM_DEFAULT_PARTNER);
     $reportsTemplateUiConfs = kmcUtils::getAllKMCUiconfs('reports', $this->kmc_rna_version, $this->templatePartnerId);
     //$this->confs = array_merge($this->confs, kmcUtils::getAllKMCUiconfs('reports',   $this->kmc_rna_version, $this->templatePartnerId));
     /** for each module, create separated lists of its uiconf, for each need **/
     /** content players: **/
     $this->content_uiconfs_previewembed = kmcUtils::find_confs_by_usage_tag($contentTemplateUiConfs, "content_previewembed", true, $contentSystemUiConfs);
     $this->content_uiconfs_previewembed_list = kmcUtils::find_confs_by_usage_tag($contentTemplateUiConfs, "content_previewembed_list", true, $contentSystemUiConfs);
     $this->content_uiconfs_moderation = kmcUtils::find_confs_by_usage_tag($contentTemplateUiConfs, "content_moderation", false, $contentSystemUiConfs);
     $this->content_uiconfs_drilldown = kmcUtils::find_confs_by_usage_tag($contentTemplateUiConfs, "content_drilldown", false, $contentSystemUiConfs);
     $this->content_uiconfs_flavorpreview = kmcUtils::find_confs_by_usage_tag($contentTemplateUiConfs, "content_flavorpreview", false, $contentSystemUiConfs);
     $this->content_uiconfs_metadataview = kmcUtils::find_confs_by_usage_tag($contentTemplateUiConfs, "content_metadataview", false, $contentSystemUiConfs);
     /** content KCW,KSE,KAE **/
     $this->content_uiconfs_upload = kmcUtils::find_confs_by_usage_tag($contentTemplateUiConfs, "content_upload", false, $contentSystemUiConfs);
     $this->simple_editor = kmcUtils::find_confs_by_usage_tag($contentTemplateUiConfs, "content_simpleedit", false, $contentSystemUiConfs);
     $this->advanced_editor = kmcUtils::find_confs_by_usage_tag($contentTemplateUiConfs, "content_advanceedit", false, $contentSystemUiConfs);
     /** appStudio templates uiconf **/
     $this->appstudio_uiconfs_templates = kmcUtils::find_confs_by_usage_tag($appstudioTemplateUiConfs, "appstudio_templates", false, $appstudioSystemUiConfs);
     /** reports drill-down player **/
     $this->reports_uiconfs_drilldown = kmcUtils::find_confs_by_usage_tag($reportsTemplateUiConfs, "reports_drilldown", false, $reportsSystemUiConfs);
     /** silverlight uiconfs **/
     $this->silverLightPlayerUiConfs = array();
     $this->silverLightPlaylistUiConfs = array();
     if ($partner->getKmcVersion() == self::CURRENT_KMC_VERSION && $partner->getEnableSilverLight()) {
         $this->silverLightPlayerUiConfs = kmcUtils::getSilverLightPlayerUiConfs('slp');
         $this->silverLightPlaylistUiConfs = kmcUtils::getSilverLightPlayerUiConfs('sll');
     }
     /** jw uiconfs **/
     $this->jw_uiconfs_array = kmcUtils::getJWPlayerUIConfs();
     $this->jw_uiconf_playlist = kmcUtils::getJWPlaylistUIConfs();
     /** 508 uicinfs **/
     if ($partner->getKmcVersion() == self::CURRENT_KMC_VERSION && $partner->getEnable508Players()) {
         $this->kdp508_players = kmcUtils::getKdp508PlayerUiconfs();
     }
     /** partner's preview&embed uiconfs **/
     $this->content_pne_partners_player = kmcUtils::getPartnersUiconfs($this->partner_id, 'player');
     $this->content_pne_partners_playlist = kmcUtils::getPartnersUiconfs($this->partner_id, 'playlist');
     /** appstudio: default entry and playlists **/
     $this->appStudioExampleEntry = $partner->getAppStudioExampleEntry();
     $appStudioExampleEntry = entryPeer::retrieveByPK($this->appStudioExampleEntry);
     if (!($appStudioExampleEntry && $appStudioExampleEntry->getDisplayInSearch() == mySearchUtils::DISPLAY_IN_SEARCH_KALTURA_NETWORK && $appStudioExampleEntry->getStatus() == entryStatus::READY && $appStudioExampleEntry->getType() == entryType::MEDIA_CLIP)) {
         $this->appStudioExampleEntry = "_KMCLOGO1";
     }
     $this->appStudioExamplePlayList0 = $partner->getAppStudioExamplePlayList0();
     $appStudioExamplePlayList0 = entryPeer::retrieveByPK($this->appStudioExamplePlayList0);
     if (!($appStudioExamplePlayList0 && $appStudioExamplePlayList0->getStatus() == entryStatus::READY && $appStudioExamplePlayList0->getType() == entryType::PLAYLIST)) {
         $this->appStudioExamplePlayList0 = "_KMCSPL1";
     }
     $this->appStudioExamplePlayList1 = $partner->getAppStudioExamplePlayList1();
     $appStudioExamplePlayList1 = entryPeer::retrieveByPK($this->appStudioExamplePlayList1);
     if (!($appStudioExamplePlayList1 && $appStudioExamplePlayList1->getStatus() == entryStatus::READY && $appStudioExamplePlayList1->getType() == entryType::PLAYLIST)) {
         $this->appStudioExamplePlayList1 = "_KMCSPL2";
     }
     /** END - appstudio: default entry and playlists **/
     /** END - uiconf listing work **/
     /** get templateXmlUrl for whitelabeled partners **/
     $this->appstudio_templatesXmlUrl = $this->getAppStudioTemplatePath();
 }
Esempio n. 6
0
 public function execute()
 {
     sfView::SUCCESS;
     $this->module = $this->getP("module", "dashboard");
     $this->partner_id = $this->getP("partner_id");
     $this->subp_id = $this->getP("subp_id");
     $this->uid = $this->getP("uid");
     $this->ks = $this->getP("ks");
     $this->screen_name = $this->getP("screen_name");
     $this->email = $this->getP("email");
     $this->allow_reports = false;
     $this->beta = $this->getRequestParameter("beta");
     $this->embed_code = "";
     $this->ui_conf_width = "";
     $this->ui_conf_height = "";
     if ($this->partner_id !== null) {
         $widget = widgetPeer::retrieveByPK("_" . $this->partner_id);
         if ($widget) {
             $this->embed_code = $widget->getWidgetHtml("kaltura_player");
             $ui_conf = $widget->getuiConf();
             //				$this->ui_conf_width = 0; // $ui_conf->getWidth();
             //				$this->ui_conf_height = 0 ; // $ui_conf->getHeight();
         }
     }
     $this->partner = $partner = null;
     $this->templatePartnerId = 0;
     if ($this->partner_id !== NULL) {
         $this->partner = $partner = PartnerPeer::retrieveByPK($this->partner_id);
         kmcUtils::redirectPartnerToCorrectKmc($partner, $this->ks, $this->uid, $this->screen_name, $this->email, 1);
         $this->templatePartnerId = $this->partner ? $this->partner->getTemplatePartnerId() : 0;
     }
     $this->payingPartner = 'false';
     if ($partner && $partner->getPartnerPackage() != PartnerPackages::PARTNER_PACKAGE_FREE) {
         $this->payingPartner = 'true';
     }
     $this->visibleCT = 'false';
     if (kConf::get('kmc_content_enable_commercial_transcoding') && $partner) {
         // 2009-08-27 is the date we added ON2 to KMC trial account
         if ($partner->getPartnerPackage() != PartnerPackages::PARTNER_PACKAGE_FREE || $partner->getType() == 1 && strtotime($partner->getCreatedAt()) >= strtotime('2009-08-27')) {
             $this->visibleCT = 'true';
         }
     }
     // 2009-08-27 is the date we added ON2 to KMC trial account
     // TODO - should be depracated
     if (strtotime($partner->getCreatedAt()) >= strtotime('2009-08-27') || $partner->getEnableAnalyticsTab()) {
         $this->allow_reports = true;
     }
     if ($partner->getEnableAnalyticsTab()) {
         $this->allow_reports = true;
     }
     // set content kdp version according to partner id
     $moderated_partners = array(31079, 28575, 32774);
     $this->content_kdp_version = 'v2.7.0';
     if (in_array($this->partner_id, $moderated_partners)) {
         $this->content_kdp_version = 'v2.1.2.29057';
     }
     /*
     $c = $this->getCritria();
     $c->addAnd ( uiConfPeer::TAGS, "%playlist%" , Criteria::LIKE ); //
     $c->addAnd ( uiConfPeer::TAGS, "%jwplaylist%" , Criteria::NOT_LIKE ); //
     */
     $this->playlist_uiconf_list = $this->getUiconfList('playlist');
     /*
     $c = $this->getCritria();
     $c->addAnd ( uiConfPeer::TAGS, "%player%" , Criteria::LIKE ); //
     $c->addAnd ( uiConfPeer::TAGS, "%jwplayer%" , Criteria::NOT_LIKE ); //
     */
     $this->player_uiconf_list = $this->getUiconfList('player');
     $this->first_login = false;
     if ($partner) {
         $this->first_login = $partner->getIsFirstLogin();
         if ($this->first_login === true) {
             $partner->setIsFirstLogin(false);
             $partner->save();
         }
         $this->jw_license = $partner->getLicensedJWPlayer();
     }
     // if the email is empty - it is an indication that the kaltura super user is logged in
     if (!$this->email) {
         $this->allow_reports = true;
     }
     /* applications versioning */
     $this->kmc_content_version = 'v1.1.11';
     $this->kmc_account_version = 'v1.1.7';
     $this->kmc_appstudio_version = 'v1.2.4';
     $this->kmc_rna_version = 'v1.0.5';
     $this->kmc_dashboard_version = 'v1.0.1';
     $this->jw_uiconfs_array = $this->getJWPlayerUIConfs();
     $this->jw_uiconf_playlist = $this->getJWPlaylistUIConfs();
     if (!$this->module) {
         $this->redirect("kmc/kmc");
         die;
     }
 }
Esempio n. 7
0
 public static function TrimArray($arr)
 {
     if (!is_array($arr)) {
         return $arr;
     }
     while (list($key, $value) = each($arr)) {
         if (is_array($value)) {
             $arr[$key] = kmcUtils::TrimArray($value);
         } else {
             $arr[$key] = trim($value);
         }
     }
     return $arr;
 }
Esempio n. 8
0
 public function execute()
 {
     header('Access-Control-Allow-Origin:*');
     $this->partner_id = $this->getP("partner_id");
     $this->ks = $this->getP("ks");
     $type = $this->getP("type");
     $this->partner = PartnerPeer::retrieveByPK($this->partner_id);
     if (!$this->partner) {
         KExternalErrors::dieError(KExternalErrors::PARTNER_NOT_FOUND);
     }
     if (!$this->partner->validateApiAccessControl()) {
         KExternalErrors::dieError(KExternalErrors::SERVICE_ACCESS_CONTROL_RESTRICTED);
     }
     $this->templatePartnerId = $this->partner ? $this->partner->getTemplatePartnerId() : 0;
     $this->isKDP3 = $this->partner->getKmcVersion() != '1' ? true : false;
     // FIXME: validate the ks!
     $partnerUiconfs = kmcUtils::getPartnersUiconfs($this->partner_id, $type);
     $partner_uiconfs_array = array();
     foreach ($partnerUiconfs as $uiconf) {
         $uiconf_array = array();
         $uiconf_array["id"] = $uiconf->getId();
         $uiconf_array["name"] = $uiconf->getName();
         $uiconf_array["width"] = $uiconf->getWidth();
         $uiconf_array["height"] = $uiconf->getHeight();
         //$uiconf_array["swfUrlVersion"] = $uiconf->getSwfUrlVersion();
         $uiconf_array["swf_version"] = "v" . $uiconf->getSwfUrlVersion();
         $uiconf_array["html5Url"] = $uiconf->getHtml5Url();
         $partner_uiconfs_array[] = $uiconf_array;
     }
     // default uiconf array
     $this->kmc_swf_version = kConf::get('kmc_version');
     $kmcGeneralUiConf = array();
     $kmcGeneralTemplateUiConf = array();
     if (!PermissionPeer::isValidForPartner(PermissionName::FEATURE_HIDE_TEMPLATE_PARTNER_UICONFS, $this->partner->getId())) {
         $kmcGeneralUiConf = kmcUtils::getAllKMCUiconfs('kmc', $this->kmc_swf_version, $this->templatePartnerId);
         $kmcGeneralTemplateUiConf = kmcUtils::getAllKMCUiconfs('kmc', $this->kmc_swf_version, $this->templatePartnerId);
     }
     if ($type == 'player') {
         $content_uiconfs_previewembed = kmcUtils::find_confs_by_usage_tag($kmcGeneralTemplateUiConf, "kmc_previewembed", true, $kmcGeneralUiConf);
     } else {
         $content_uiconfs_previewembed = kmcUtils::find_confs_by_usage_tag($kmcGeneralTemplateUiConf, "kmc_previewembed_list", true, $kmcGeneralUiConf);
     }
     $default_uiconfs_array = array();
     foreach ($content_uiconfs_previewembed as $uiconf) {
         $uiconf_array = array();
         $uiconf_array["id"] = $uiconf->getId();
         $uiconf_array["name"] = $uiconf->getName();
         $uiconf_array["width"] = $uiconf->getWidth();
         $uiconf_array["height"] = $uiconf->getHeight();
         //$uiconf_array["swfUrlVersion"] = $uiconf->getSwfUrlVersion();
         $uiconf_array["swf_version"] = "v" . $uiconf->getSwfUrlVersion();
         $uiconf_array["html5Url"] = $uiconf->getHtml5Url();
         $default_uiconfs_array[] = $uiconf_array;
     }
     $kdp508_uiconfs = array();
     if ($type == 'player' && $this->partner->getEnable508Players()) {
         $kdp508_uiconfs = kmcUtils::getPlayerUiconfsByTag('kdp508');
     }
     // Add HTML5 v2.0.0 Preview Player
     $v2_preview_players = array();
     if ($type == 'player' && PermissionPeer::isValidForPartner(PermissionName::FEATURE_HTML5_V2_PLAYER_PREVIEW, $this->partner_id)) {
         $v2_preview_players = kmcUtils::getPlayerUiconfsByTag('html5_v2_preview');
     }
     $merged_list = array();
     if (count($default_uiconfs_array)) {
         foreach ($default_uiconfs_array as $uiconf) {
             $merged_list[] = $uiconf;
         }
     }
     if (count($kdp508_uiconfs)) {
         foreach ($kdp508_uiconfs as $uiconf) {
             $merged_list[] = $uiconf;
         }
     }
     if (count($v2_preview_players)) {
         foreach ($v2_preview_players as $uiconf) {
             $merged_list[] = $uiconf;
         }
     }
     if (count($partner_uiconfs_array)) {
         foreach ($partner_uiconfs_array as $uiconf) {
             $merged_list[] = $uiconf;
         }
     }
     return $this->renderText(json_encode($merged_list));
 }
 public function execute()
 {
     $this->partner_id = $this->getP("partner_id");
     $this->ks = $this->getP("ks");
     $type = $this->getP("type");
     $this->partner = PartnerPeer::retrieveByPK($this->partner_id);
     if (!$this->partner) {
         die;
     }
     $this->templatePartnerId = $this->partner ? $this->partner->getTemplatePartnerId() : 0;
     $this->isKDP3 = $this->partner->getKmcVersion() != '1' ? true : false;
     // FIXME: validate the ks!
     $partnerUiconfs = kmcUtils::getPartnersUiconfs($this->partner_id, $type);
     $partner_uiconfs_array = array();
     foreach ($partnerUiconfs as $uiconf) {
         $uiconf_array = array();
         $uiconf_array["id"] = $uiconf->getId();
         $uiconf_array["name"] = $uiconf->getName();
         $uiconf_array["width"] = $uiconf->getWidth();
         $uiconf_array["height"] = $uiconf->getHeight();
         $uiconf_array["swfUrlVersion"] = $uiconf->getSwfUrlVersion();
         $uiconf_array["swf_version"] = "v" . $uiconf->getSwfUrlVersion();
         $partner_uiconfs_array[] = $uiconf_array;
     }
     // default uiconf array
     $this->kmc_content_version = kConf::get('kmc_content_version');
     $contentTemplateConfs = kmcUtils::getAllKMCUiconfs('content', $this->kmc_content_version, $this->templatePartnerId);
     $contentSystemConfs = kmcUtils::getAllKMCUiconfs('content', $this->kmc_content_version, 0);
     if ($type == 'player') {
         $silverLightTag = 'slp';
         $content_uiconfs_previewembed = kmcUtils::find_confs_by_usage_tag($contentTemplateConfs, "content_previewembed", true, $contentSystemConfs);
     } else {
         $silverLightTag = 'sll';
         $content_uiconfs_previewembed = kmcUtils::find_confs_by_usage_tag($contentTemplateConfs, "content_previewembed_list", true, $contentSystemConfs);
     }
     foreach ($content_uiconfs_previewembed as $uiconf) {
         $uiconf_array = array();
         $uiconf_array["id"] = $uiconf->getId();
         $uiconf_array["name"] = $uiconf->getName();
         $uiconf_array["width"] = $uiconf->getWidth();
         $uiconf_array["height"] = $uiconf->getHeight();
         $uiconf_array["swfUrlVersion"] = $uiconf->getSwfUrlVersion();
         $uiconf_array["swf_version"] = "v" . $uiconf->getSwfUrlVersion();
         $default_uiconfs_array[] = $uiconf_array;
     }
     $silverlight_uiconfs = array();
     if ($this->partner->getEnableSilverLight()) {
         $silverlight_uiconfs = kmcUtils::getSilverLightPlayerUiConfs($silverLightTag);
     }
     $kdp508_uiconfs = array();
     if ($type == 'player' && $this->partner->getEnable508Players()) {
         $kdp508_uiconfs = kmcUtils::getKdp508PlayerUiconfs();
     }
     $jw_confs = $type == 'player' ? kmcUtils::getJWPlayerUIConfs() : kmcUtils::getJWPlaylistUIConfs();
     $merged_list = array();
     if (count($default_uiconfs_array)) {
         foreach ($default_uiconfs_array as $uiconf) {
             $merged_list[] = $uiconf;
         }
     }
     if (count($kdp508_uiconfs)) {
         foreach ($kdp508_uiconfs as $uiconf) {
             $merged_list[] = $uiconf;
         }
     }
     if (count($silverlight_uiconfs)) {
         foreach ($silverlight_uiconfs as $uiconf) {
             $merged_list[] = $uiconf;
         }
     }
     if (count($partner_uiconfs_array)) {
         foreach ($partner_uiconfs_array as $uiconf) {
             $merged_list[] = $uiconf;
         }
     }
     if (count($jw_confs)) {
         foreach ($jw_confs as $uiconf) {
             $merged_list[] = $uiconf;
         }
     }
     return $this->renderText(json_encode($merged_list));
 }