diff --git a/objects/videoAddNew.json.php b/objects/videoAddNew.json.php index be7958e1f..6558434e8 100644 --- a/objects/videoAddNew.json.php +++ b/objects/videoAddNew.json.php @@ -1,131 +1,133 @@ setClean_Title($_POST['clean_title']); $audioLinks = array('mp3', 'ogg'); $videoLinks = array('mp4', 'webm'); TimeLogEnd(__FILE__, __LINE__); if (!empty($_POST['videoLink'])) { //var_dump($config->getEncoderURL()."getLinkInfo/". base64_encode($_POST['videoLink']));exit; $path_parts = pathinfo($_POST['videoLink']); $extension = strtolower(@$path_parts["extension"]); if (empty($_POST['id']) && !(in_array($extension, $audioLinks) || in_array($extension, $videoLinks))) { $info = url_get_contents($config->getEncoderURL() . "getLinkInfo/" . base64_encode($_POST['videoLink'])); $infoObj = json_decode($info); $filename = uniqid("_YPTuniqid_", true); $filename = $obj->setFilename($filename); $obj->setTitle($infoObj->title); $obj->setClean_title($infoObj->title); $obj->setDuration($infoObj->duration); $obj->setDescription($infoObj->description); file_put_contents($global['systemRootPath'] . "videos/{$filename}.jpg", base64_decode($infoObj->thumbs64)); } else if (empty($_POST['id'])) { $filename = uniqid("_YPTuniqid_", true); $filename = $obj->setFilename($filename); $obj->setTitle($path_parts["filename"]); $obj->setClean_title($path_parts["filename"]); $obj->setDuration(""); $obj->setDescription(@$_POST['description']); } $obj->setVideoLink($_POST['videoLink']); if (in_array($extension, $audioLinks) || in_array($extension, $videoLinks)) { if (in_array($extension, $audioLinks)) { $obj->setType('linkAudio'); } else { $obj->setType('linkVideo'); } } else if(!empty($obj->getType())){ $obj->setType('embed'); } if (!empty($_POST['videoLinkType'])) { $obj->setType($_POST['videoLinkType']); } if (empty($_POST['id'])) { $obj->setStatus('a'); } }else if(!empty($obj->getType()) && ($obj->getType() == 'video' || $obj->getType() == 'serie' || $obj->getType() == 'audio')){ $obj->setVideoLink(""); } TimeLogEnd(__FILE__, __LINE__); if (!empty($_POST['isArticle'])) { $obj->setType("article"); if (empty($_POST['id'])) { $obj->setStatus('a'); } $filename = uniqid("_YPTuniqid_", true); $filename = $obj->setFilename($filename); } TimeLogEnd(__FILE__, __LINE__); $obj->setNext_videos_id($_POST['next_videos_id']); if (!empty($_POST['description'])) { $obj->setDescription($_POST['description']); } if (empty($advancedCustomUser->userCanNotChangeCategory) || User::isAdmin()) { $obj->setCategories_id($_POST['categories_id']); } -$obj->setVideoGroups(empty($_POST['videoGroups']) ? array() : $_POST['videoGroups']); +if (empty($advancedCustomUser->userCanNotChangeUserGroup) || User::isAdmin()) { + $obj->setVideoGroups(empty($_POST['videoGroups']) ? array() : $_POST['videoGroups']); +} if (User::isAdmin()) { $obj->setUsers_id($_POST['users_id']); } TimeLogEnd(__FILE__, __LINE__); $obj->setCan_download(@$_POST['can_download']); $obj->setCan_share(@$_POST['can_share']); $obj->setOnly_for_paid(@$_POST['only_for_paid']); $obj->setTrailer1(@$_POST['trailer1']); $obj->setRrating(@$_POST['rrating']); $obj->setExternalOptions(@$_POST['externalOptions']); TimeLogEnd(__FILE__, __LINE__); $resp = $obj->save(true); // if is a new embed video if (empty($_POST['id']) && $obj->getType() == 'embed') { AVideoPlugin::afterNewVideo($resp); } AVideoPlugin::saveVideosAddNew($_POST, $resp); TimeLogEnd(__FILE__, __LINE__); $obj = new stdClass(); $obj->status = !empty($resp); $obj->msg = $msg; $obj->info = json_encode($info); $obj->infoObj = json_encode($infoObj); $obj->videos_id = intval($resp); -$obj->video = Video::getVideo($obj->videos_id, false); +$obj->video = Video::getVideo($obj->videos_id, false, true); TimeLogEnd(__FILE__, __LINE__); echo json_encode($obj); diff --git a/plugin/CustomizeUser/CustomizeUser.php b/plugin/CustomizeUser/CustomizeUser.php index 0bc3242b7..e86de0ea7 100644 --- a/plugin/CustomizeUser/CustomizeUser.php +++ b/plugin/CustomizeUser/CustomizeUser.php @@ -1,313 +1,314 @@ userCanAllowFilesDownload = false; $obj->userCanAllowFilesShare = false; $obj->userCanAllowFilesDownloadSelectPerVideo = false; $obj->userCanAllowFilesShareSelectPerVideo = false; $obj->usersCanCreateNewCategories = !isset($advancedCustom->usersCanCreateNewCategories) ? false : $advancedCustom->usersCanCreateNewCategories; $obj->userCanNotChangeCategory = !isset($advancedCustom->userCanNotChangeCategory) ? false : $advancedCustom->userCanNotChangeCategory; + $obj->userCanNotChangeUserGroup = false; $obj->userMustBeLoggedIn = !isset($advancedCustom->userMustBeLoggedIn) ? false : $advancedCustom->userMustBeLoggedIn; $obj->onlyVerifiedEmailCanUpload = !isset($advancedCustom->onlyVerifiedEmailCanUpload) ? false : $advancedCustom->onlyVerifiedEmailCanUpload; $obj->sendVerificationMailAutomaic = !isset($advancedCustom->sendVerificationMailAutomaic) ? false : $advancedCustom->sendVerificationMailAutomaic; $obj->unverifiedEmailsCanNOTLogin = !isset($advancedCustom->unverifiedEmailsCanNOTLogin) ? false : $advancedCustom->unverifiedEmailsCanNOTLogin; $obj->newUsersCanStream = !isset($advancedCustom->newUsersCanStream) ? false : $advancedCustom->newUsersCanStream; $obj->doNotIndentifyByEmail = !isset($advancedCustom->doNotIndentifyByEmail) ? false : $advancedCustom->doNotIndentifyByEmail; $obj->doNotIndentifyByName = !isset($advancedCustom->doNotIndentifyByName) ? false : $advancedCustom->doNotIndentifyByName; $obj->doNotIndentifyByUserName = !isset($advancedCustom->doNotIndentifyByUserName) ? false : $advancedCustom->doNotIndentifyByUserName; $obj->hideRemoveChannelFromModeYoutube = !isset($advancedCustom->hideRemoveChannelFromModeYoutube) ? false : $advancedCustom->hideRemoveChannelFromModeYoutube; $obj->showChannelBannerOnModeYoutube = !isset($advancedCustom->showChannelBannerOnModeYoutube) ? false : $advancedCustom->showChannelBannerOnModeYoutube; $obj->encryptPasswordsWithSalt = !isset($advancedCustom->encryptPasswordsWithSalt) ? false : $advancedCustom->encryptPasswordsWithSalt; $obj->requestCaptchaAfterLoginsAttempts = !isset($advancedCustom->requestCaptchaAfterLoginsAttempts) ? 0 : $advancedCustom->requestCaptchaAfterLoginsAttempts; $obj->disableSignOutButton = false; $obj->disableNativeSignUp = !isset($advancedCustom->disableNativeSignUp) ? false : $advancedCustom->disableNativeSignUp; $obj->disableNativeSignIn = !isset($advancedCustom->disableNativeSignIn) ? false : $advancedCustom->disableNativeSignIn; $obj->disablePersonalInfo = !isset($advancedCustom->disablePersonalInfo) ? true : $advancedCustom->disablePersonalInfo; $obj->userCanChangeUsername = true; $obj->signInOnRight = false; $obj->doNotShowRightProfile = false; $obj->doNotShowLeftProfile = false; $obj->forceLoginToBeTheEmail = false; // added on 2019-02-11 $o = new stdClass(); $o->type = "textarea"; $o->value = ""; $obj->messageToAppearBelowLoginBox = $o; $obj->keepViewerOnChannel = false; $obj->showLeaveChannelButton = false; $obj->addChannelNameOnLinks = true; $obj->doNotShowTopBannerOnChannel = false; $obj->doNotShowMyChannelNameOnBasicInfo = false; $obj->doNotShowMyAnalyticsCodeOnBasicInfo = false; $obj->doNotShowMyAboutOnBasicInfo = false; $obj->MyChannelLabel = "My Channel"; $obj->afterLoginGoToMyChannel = false; $obj->afterLoginGoToURL = ""; $obj->afterLogoffGoToMyChannel = false; $obj->afterLogoffGoToURL = ""; $obj->allowDonationLink = false; $obj->donationButtonLabel = __('Donation'); ; $obj->showEmailVerifiedMark = true; $obj->Checkmark1Enabled = true; $obj->Checkmark1HTML = ''; $obj->Checkmark2Enabled = true; $obj->Checkmark2HTML = ''; $obj->Checkmark3Enabled = true; $obj->Checkmark3HTML = ''; return $obj; } public function getUserOptions() { $obj = $this->getDataObject(); if ($obj->Checkmark1Enabled) { $userOptions["Checkmark 1"] = "checkmark1"; } if ($obj->Checkmark2Enabled) { $userOptions["Checkmark 2"] = "checkmark2"; } if ($obj->Checkmark3Enabled) { $userOptions["Checkmark 3"] = "checkmark3"; } return $userOptions; } static function canDownloadVideosFromUser($users_id) { global $config; $obj = AVideoPlugin::getObjectDataIfEnabled("CustomizeUser"); if (empty($obj) || empty($obj->userCanAllowFilesDownload)) { return $config->getAllow_download(); } $user = new User($users_id); return !empty($user->getExternalOption('userCanAllowFilesDownload')); } static function setCanDownloadVideosFromUser($users_id, $value = true) { $obj = AVideoPlugin::getObjectDataIfEnabled("CustomizeUser"); if (empty($obj) || empty($obj->userCanAllowFilesDownload)) { return false; } $user = new User($users_id); return $user->addExternalOptions('userCanAllowFilesDownload', $value); } static function canShareVideosFromUser($users_id) { global $advancedCustom; if (!empty($advancedCustom->disableShareAndPlaylist)) { return false; } $obj = AVideoPlugin::getObjectDataIfEnabled("CustomizeUser"); if (empty($obj) || empty($obj->userCanAllowFilesShare)) { return true; } $user = new User($users_id); return !empty($user->getExternalOption('userCanAllowFilesShare')); } static function setCanShareVideosFromUser($users_id, $value = true) { $obj = AVideoPlugin::getObjectDataIfEnabled("CustomizeUser"); if (empty($obj) || empty($obj->userCanAllowFilesShare)) { return false; } $user = new User($users_id); return $user->addExternalOptions('userCanAllowFilesShare', $value); } static function getSwitchUserCanAllowFilesDownload($users_id) { global $global; include $global['systemRootPath'] . 'plugin/CustomizeUser/switchUserCanAllowFilesDownload.php'; } static function getSwitchUserCanAllowFilesShare($users_id) { global $global; include $global['systemRootPath'] . 'plugin/CustomizeUser/switchUserCanAllowFilesShare.php'; } public function getMyAccount($users_id) { $objcu = AVideoPlugin::getObjectDataIfEnabled("CustomizeUser"); if (!empty($objcu) && !empty($objcu->userCanAllowFilesDownload)) { echo '
objects/youtubeUpload.json.php