protected function executeImpl(kshow $kshow, entry &$entry)
 {
     if ($entry->getMediaType() == entry::ENTRY_MEDIA_TYPE_SHOW) {
         $this->show_versions = array_reverse($entry->getAllversions());
     } else {
         $this->show_versions = array();
     }
     $this->producer = kuser::getKuserById($kshow->getProducerId());
     $this->editor = $entry->getKuser();
     $this->thumbnail = $entry ? $entry->getThumbnailPath() : "";
     // is the logged-in-user is an admin or the producer or the show can always be published...
     $likuser_id = $this->getLoggedInUserId();
     $viewer_type = myKshowUtils::getViewerType($kshow, $likuser_id);
     $this->entry = $entry ? $entry : new entry();
     // create a dummy entry for the GUI
     $this->can_publish = $viewer_type == KshowKuser::KSHOWKUSER_VIEWER_PRODUCER || $kshow->getCanPublish();
 }
 private function forcePermissionsImpl($kshow, $kshow_id, $verification_mode, $allow_redirect = true, $full_window = false)
 {
     if ($kshow == NULL) {
         $kshow = kshowPeer::retrieveByPK($kshow_id);
     }
     if (!$kshow) {
         $this->playDead("This Kaltura is no longer available. (Message No." . $kshow_id . ")");
         //throw new Exception ( "Cannot force permission for show $kshow_id");
     }
     $likuser_id = $this->getLoggedInUserId();
     // if the user is eother the producer or an admin - return true
     $viewer_type = myKshowUtils::getViewerType($kshow, $likuser_id);
     if ($viewer_type == KshowKuser::KSHOWKUSER_VIEWER_PRODUCER) {
         return true;
     }
     $this->setCredentialByName("requestKshow", $kshow_id);
     $this->setCredentialByName("verificationMode", $verification_mode);
     //		echo ("verificationMode: " .  $this->getCredentialByName ( "verificationMode" ) );
     if ($full_window) {
         // check if all's well - if not - forward
         $result = $this->forcePermissionsDoCheckOrRedirect($kshow, $kshow_id, $verification_mode, false);
         if ($result) {
             return true;
         }
         // ALL IS OK !
         $this->setFlash('vm', $verification_mode);
         $this->setFlash('kshow_id', $kshow_id);
         return $this->forward('login', 'openAuthenticate');
     } else {
         return $this->forcePermissionsDoCheckOrRedirect($kshow, $kshow_id, $verification_mode, $allow_redirect);
     }
 }