示例#1
0
文件: vwls.php 项目: vazahat/dudex
 /**
  * Updates vwls clip
  *
  * @return boolean
  */
 public function process()
 {
     $values = $this->getValues();
     $clipService = VWLS_BOL_ClipService::getInstance();
     $language = OW::getLanguage();
     if ($values['id']) {
         $clip = $clipService->findClipById($values['id']);
         if ($clip) {
             $clip->title = htmlspecialchars($values['room_name']);
             $clip->roomLimit = $values['room_limit'];
             $clip->user_list = $values['user_list'];
             $clip->moderator_list = $values['moderator_list'];
             $clip->welcome = htmlspecialchars($values['welcome']);
             $cam = $values['resolution'];
             $camArr = explode("x", $cam);
             $clip->camWidth = $camArr[0];
             $clip->camHeight = $camArr[1];
             $clip->camFPS = $values['camera_fps'];
             $clip->micRate = $values['microphone_rate'];
             $clip->soundQuality = $values['soundQuality'];
             $clip->camBandwidth = $values['bandwidth'];
             $clip->floodProtection = $values['flood_protection'];
             $clip->labelColor = $values['label_color'];
             $clip->layoutCode = $values['layout_code'];
             $clip->welcome2 = htmlspecialchars($values['welcome2']);
             $clip->offlineMessage = htmlspecialchars($values['offline_message']);
             $clip->floodProtection2 = $values['flood_protection2'];
             $clip->layoutCode2 = htmlspecialchars($values['layout_code2']);
             $clip->filterRegex = $values['filter_regex'];
             $clip->filterReplace = $values['filter_replace'];
             $permission = $values['show_camera_settings'] . "|";
             $permission .= $values['advanced_camera_settings'] . "|";
             $permission .= $values['configure_source'] . "|";
             $permission .= $values['only_video'] . "|";
             $permission .= $values['no_video'] . "|";
             $permission .= $values['no_embeds'] . "|";
             $permission .= $values['show_timer'] . "|";
             $permission .= $values['write_text'] . "|";
             $permission .= $values['private_textchat'] . "|";
             $permission .= $values['fill_window'] . "|";
             $permission .= $values['write_text2'] . "|";
             $permission .= $values['enable_video'] . "|";
             $permission .= $values['enable_chat'] . "|";
             $permission .= $values['enable_users'] . "|";
             $permission .= $values['fill_window2'] . "|";
             $permission .= $values['verbose_level'] . "|";
             $clip->permission = $permission;
             $clip->online = "no";
             $clip->onlineCount = 0;
             $clip->onlineUser = "******";
             $clip->onlineUsers = "0";
             $description = UTIL_HtmlTag::stripJs($values['description']);
             $description = UTIL_HtmlTag::stripTags($description, array('frame', 'style'), array(), true);
             $clip->description = $description;
             $clip->modifDatetime = time();
             if ($clipService->updateClip($clip)) {
                 BOL_TagService::getInstance()->updateEntityTags($clip->id, 'vwls', TagsField::getTags($values['tags']));
                 return array('result' => true, 'id' => $clip->id);
             }
         }
     } else {
         return array('result' => false, 'id' => $clip->id);
     }
     return false;
 }
示例#2
0
文件: vwvc.php 项目: vazahat/dudex
 /**
  * Updates vwvc clip
  *
  * @return boolean
  */
 public function process()
 {
     $values = $this->getValues();
     $clipService = VWVC_BOL_ClipService::getInstance();
     $language = OW::getLanguage();
     if ($values['id']) {
         $clip = $clipService->findClipById($values['id']);
         if ($clip) {
             $clip->title = htmlspecialchars($values['room_name']);
             $clip->description = htmlspecialchars($values['description']);
             $clip->welcome = htmlspecialchars($values['welcome']);
             $cam = $values['resolution'];
             $camArr = explode("x", $cam);
             $clip->camWidth = $camArr[0];
             $clip->camHeight = $camArr[1];
             $clip->camFPS = $values['camera_fps'];
             $clip->micRate = $values['microphone_rate'];
             $clip->soundQuality = $values['soundQuality'];
             $clip->camBandwidth = $values['bandwidth'];
             $clip->background_url = $values['background_url'];
             $clip->layoutCode = htmlspecialchars($values['layout_code']);
             $permission = $values['fill_window'] . "|";
             $permission .= $values['show_camera_settings'] . "|";
             $permission .= $values['advanced_camera_settings'] . "|";
             $permission .= $values['configure_source'] . "|";
             $permission .= $values['disable_video'] . "|";
             $permission .= $values['disable_sound'] . "|";
             $permission .= $values['panel_rooms'] . "|";
             $permission .= $values['panel_users'] . "|";
             $permission .= $values['panel_files'] . "|";
             $permission .= $values['file_upload'] . "|";
             $permission .= $values['file_delete'] . "|";
             $permission .= $values['tutorial'] . "|";
             $permission .= $values['auto_view_cameras'] . "|";
             $permission .= $values['show_timer'] . "|";
             $permission .= $values['write_text'] . "|";
             $permission .= $values['regular_watch'] . "|";
             $permission .= $values['new_watch'] . "|";
             $permission .= $values['private_textchat'] . "|";
             $permission .= $values['administrator'] . "|";
             $permission .= $values['verbose_level'] . "|";
             $clip->permission = $permission;
             $clip->floodProtection = $values['flood_protection'];
             $clip->filterRegex = $values['filter_regex'];
             $clip->filterReplace = $values['filter_replace'];
             $clip->user_list = $values['user_list'];
             $clip->moderator_list = $values['moderator_list'];
             $clip->modifDatetime = time();
             $description = UTIL_HtmlTag::stripJs($values['description']);
             $description = UTIL_HtmlTag::stripTags($description, array('frame', 'style'), array(), true);
             $clip->description = $description;
             if ($clipService->updateClip($clip)) {
                 BOL_TagService::getInstance()->updateEntityTags($clip->id, 'vwvc', TagsField::getTags($values['tags']));
                 return array('result' => true, 'id' => $clip->id);
             }
         }
     } else {
         return array('result' => false, 'id' => $clip->id);
     }
     return false;
 }
示例#3
0
文件: action.php 项目: vazahat/dudex
 public function process()
 {
     $values = $this->getValues();
     $videoService = IVIDEO_BOL_Service::getInstance();
     $language = OW::getLanguage();
     if ($values['id']) {
         $video = $videoService->findVideoById($values['id']);
         if ($video) {
             $video->name = htmlspecialchars($values['name']);
             $description = UTIL_HtmlTag::stripJs($values['description']);
             $description = UTIL_HtmlTag::stripTags($description, array('frame', 'style'), array(), true);
             $video->description = $description;
             if ($videoService->updateVideo($video)) {
                 BOL_TagService::getInstance()->updateEntityTags($video->id, 'ivideo-video', TagsField::getTags($values['tags']));
                 return array('result' => true, 'id' => $video->id);
             }
         }
     } else {
         return array('result' => false, 'id' => $video->id);
     }
     return false;
 }
示例#4
0
文件: add.php 项目: vazahat/dudex
 /**
  * Adds vwvc clip
  *
  * @return boolean
  */
 public function process()
 {
     $values = $this->getValues();
     $clipService = VWVC_BOL_ClipService::getInstance();
     $clip = new VWVC_BOL_Clip();
     $clip->title = htmlspecialchars($values['room_name']);
     $clip->description = htmlspecialchars($values['description']);
     $clip->welcome = htmlspecialchars($values['welcome']);
     $cam = $values['resolution'];
     $camArr = explode("x", $cam);
     $clip->camWidth = $camArr[0];
     $clip->camHeight = $camArr[1];
     $clip->camFPS = $values['camera_fps'];
     $clip->micRate = $values['microphone_rate'];
     $clip->soundQuality = $values['soundQuality'];
     $clip->camBandwidth = $values['bandwidth'];
     $clip->background_url = $values['background_url'];
     $clip->layoutCode = htmlspecialchars($values['layout_code']);
     $permission = $values['fill_window'] . "|";
     $permission .= $values['show_camera_settings'] . "|";
     $permission .= $values['advanced_camera_settings'] . "|";
     $permission .= $values['configure_source'] . "|";
     $permission .= $values['disable_video'] . "|";
     $permission .= $values['disable_sound'] . "|";
     $permission .= $values['panel_rooms'] . "|";
     $permission .= $values['panel_users'] . "|";
     $permission .= $values['panel_files'] . "|";
     $permission .= $values['file_upload'] . "|";
     $permission .= $values['file_delete'] . "|";
     $permission .= $values['tutorial'] . "|";
     $permission .= $values['auto_view_cameras'] . "|";
     $permission .= $values['show_timer'] . "|";
     $permission .= $values['write_text'] . "|";
     $permission .= $values['regular_watch'] . "|";
     $permission .= $values['new_watch'] . "|";
     $permission .= $values['private_textchat'] . "|";
     $permission .= $values['administrator'] . "|";
     $permission .= $values['verbose_level'] . "|";
     $clip->permission = $permission;
     $clip->floodProtection = $values['flood_protection'];
     $clip->filterRegex = $values['filter_regex'];
     $clip->filterReplace = $values['filter_replace'];
     $clip->user_list = $values['user_list'];
     $clip->moderator_list = $values['moderator_list'];
     $clip->online = "no";
     $clip->onlineCount = 0;
     $clip->onlineUser = "******";
     $clip->onlineUsers = "0";
     $description = UTIL_HtmlTag::stripJs($values['description']);
     $description = UTIL_HtmlTag::stripTags($description, array('frame', 'style'), array(), true);
     $clip->description = $description;
     $clip->userId = OW::getUser()->getId();
     //        $clip->code = UTIL_HtmlTag::stripJs($values['code']);
     //        $prov = new VideoProviders($clip->code);
     $privacy = OW::getEventManager()->call('plugin.privacy.get_privacy', array('ownerId' => $clip->userId, 'action' => 'videoconference_view_video'));
     //        $clip->provider = $prov->detectProvider();
     $clip->addDatetime = time();
     $clip->modifDatetime = time();
     $config = OW::getConfig();
     $status = $config->getValue('vwvc', 'status');
     $clip->status = $status;
     $clip->privacy = mb_strlen($privacy) ? $privacy : 'everybody';
     $eventParams = array('pluginKey' => 'vwvc', 'action' => 'add_vwvc');
     if (OW::getEventManager()->call('usercredits.check_balance', $eventParams) === true) {
         OW::getEventManager()->call('usercredits.track_action', $eventParams);
     }
     if ($clipService->addClip($clip)) {
         BOL_TagService::getInstance()->updateEntityTags($clip->id, 'vwvc', TagsField::getTags($values['tags']));
         // Newsfeed
         $event = new OW_Event('feed.action', array('pluginKey' => 'vwvc', 'entityType' => 'vwvc_comments', 'entityId' => $clip->id, 'userId' => $clip->userId));
         OW::getEventManager()->trigger($event);
         return array('result' => true, 'id' => $clip->id);
     }
     return false;
 }
示例#5
0
文件: vwvr.php 项目: vazahat/dudex
 /**
  * Updates vwvr clip
  *
  * @return boolean
  */
 public function process()
 {
     $values = $this->getValues();
     $clipService = VWVR_BOL_ClipService::getInstance();
     $language = OW::getLanguage();
     if ($values['id']) {
         $clip = $clipService->findClipById($values['id']);
         if ($clip) {
             $clip->room_name = htmlspecialchars($values['room_name']);
             $description = UTIL_HtmlTag::stripJs($values['description']);
             $description = UTIL_HtmlTag::stripTags($description, array('frame', 'style'), array(), true);
             $clip->description = $description;
             if ($clipService->updateClip($clip)) {
                 BOL_TagService::getInstance()->updateEntityTags($clip->id, 'vwvr', TagsField::getTags($values['tags']));
                 return array('result' => true, 'id' => $clip->id);
             }
         }
     } else {
         return array('result' => false, 'id' => $clip->id);
     }
     return false;
 }
示例#6
0
文件: add.php 项目: vazahat/dudex
 /**
  * Adds vwvr clip
  *
  * @return boolean
  */
 public function process()
 {
     $values = $this->getValues();
     $clipService = VWVR_BOL_ClipService::getInstance();
     $clip = new VWVR_BOL_Clip();
     $clip->room_name = htmlspecialchars($values['room_name']);
     $description = UTIL_HtmlTag::stripJs($values['description']);
     $description = UTIL_HtmlTag::stripTags($description, array('frame', 'style'), array(), true);
     $clip->description = $description;
     $clip->userId = OW::getUser()->getId();
     $room_nameArr = explode("-", $_COOKIE["video_recorded"]);
     $room_namex = $room_nameArr[0];
     // title
     $recordingIdx = $room_nameArr[1];
     $clip->recordingId = "-" . $recordingIdx;
     $clip->title = $room_namex;
     //        $clip->code = UTIL_HtmlTag::stripJs($values['code']);
     //        $prov = new VideoProviders($clip->code);
     $privacy = OW::getEventManager()->call('plugin.privacy.get_privacy', array('ownerId' => $clip->userId, 'action' => 'videorecorder_view_video'));
     //        $clip->provider = $prov->detectProvider();
     $clip->addDatetime = time();
     $config = OW::getConfig();
     $status = $config->getValue('vwvr', 'status');
     $clip->status = $status;
     $clip->privacy = mb_strlen($privacy) ? $privacy : 'everybody';
     $eventParams = array('pluginKey' => 'vwvr', 'action' => 'add_vwvr');
     if (OW::getEventManager()->call('usercredits.check_balance', $eventParams) === true) {
         OW::getEventManager()->call('usercredits.track_action', $eventParams);
     }
     // add clip to video plugin
     $isVideoActive = OW::getPluginManager()->isPluginActive('video');
     if ($isVideoActive) {
         $clipServiceVideo = VIDEO_BOL_ClipService::getInstance();
         $clipVideo = new VIDEO_BOL_Clip();
         $clipVideo->title = htmlspecialchars($values['room_name']);
         $clipVideo->description = $description;
         $clipVideo->userId = OW::getUser()->getId();
         $clipVideo->code = '<iframe width="420" height="315" src="' . $config->getValue('vwvr', 'baseSwf_url') . 'streamplayer.swf?streamName=' . $room_namex . $clip->recordingId . '&serverRTMP=' . $config->getValue('vwvr', 'server') . '&templateURL=" frameborder="0" allowfullscreen="allowfullscreen"></iframe>';
         $prov = new VideoProviders($clipVideo->code);
         $clipVideo->provider = $prov->detectProvider();
         $privacy = OW::getEventManager()->call('plugin.privacy.get_privacy', array('ownerId' => $clipVideo->userId, 'action' => 'video_view_video'));
         $clipVideo->addDatetime = time();
         $clipVideo->status = 'approved';
         $clipVideo->privacy = mb_strlen($privacy) ? $privacy : 'everybody';
         $clipServiceVideo->addClip($clipVideo);
     }
     // videowhisper
     // get record path
     $recordPath = $config->getValue('vwvr', 'recordPath');
     $recordPathArr = explode('/', $recordPath);
     $recordPathArrCount = count($recordPathArr);
     for ($i = 1; $i < $recordPathArrCount; $i++) {
         $recorded .= "/" . $recordPathArr[$i];
         if (!is_dir($recorded)) {
             mkdir($recorded);
         }
     }
     // get streams directory
     $dirname = 'streams';
     if (file_exists('../../' . $dirname)) {
         $dir = '../../' . $dirname;
     } elseif (file_exists('../../../' . $dirname)) {
         $dir = '../../../' . $dirname;
     } elseif (file_exists('../../../../' . $dirname)) {
         $dir = '../../../../' . $dirname;
     } elseif (file_exists('../../../../../' . $dirname)) {
         $dir = '../../../../../' . $dirname;
     } elseif (file_exists('../../../../../../' . $dirname)) {
         $dir = '../../../../../../' . $dirname;
     }
     // $streamsPath = realpath($dir);
     $streamsPath = realpath("../" . $dir);
     // convert and copy, or just copy
     $filename = $_COOKIE["video_recorded"];
     $old = $streamsPath . "/streams/" . $filename;
     $new = $recordPath . "/" . $filename;
     $ffmpeg = trim(shell_exec('type -P ffmpeg'));
     if (empty($ffmpeg)) {
         copy($old . '.flv', $new . '.flv');
     } else {
         shell_exec($ffmpeg . ' -i ' . $old . '.flv -sameq -ar 22050 ' . $new . '.mp4');
     }
     if ($clipService->addClip($clip)) {
         BOL_TagService::getInstance()->updateEntityTags($clip->id, 'vwvr', TagsField::getTags($values['tags']));
         // Newsfeed
         $event = new OW_Event('feed.action', array('pluginKey' => 'vwvr', 'entityType' => 'vwvr_comments', 'entityId' => $clip->id, 'userId' => $clip->userId));
         OW::getEventManager()->trigger($event);
         return array('result' => true, 'id' => $clip->id);
     }
     return false;
 }