nonAdminCannotDownload = false;
$obj->userCanAllowFilesDownload = false;
$obj->userCanAllowFilesShare = false;
$obj->userCanAllowFilesDownloadSelectPerVideo = false;
$obj->userCanAllowFilesShareSelectPerVideo = false;
$obj->blockEmbedFromSharedVideos = true;
$obj->userCanProtectVideosWithPassword = true;
$obj->userCanChangeVideoOwner = false;
$obj->usersCanCreateNewCategories = !isset($advancedCustom->usersCanCreateNewCategories) ? false : $advancedCustom->usersCanCreateNewCategories;
$obj->userCanNotChangeCategory = !isset($advancedCustom->userCanNotChangeCategory) ? false : $advancedCustom->userCanNotChangeCategory;
$obj->userCanNotChangeUserGroup = false;
$o = new stdClass();
$o->type = array_merge(array('Default'), UserGroups::getAllUsersGroupsArray());
$o->value = 0;
$obj->userDefaultUserGroup = $o;
$obj->userMustBeLoggedIn = !isset($advancedCustom->userMustBeLoggedIn) ? false : $advancedCustom->userMustBeLoggedIn;
$obj->userMustBeLoggedInCloseButtonURL = "";
$obj->onlyVerifiedEmailCanUpload = !isset($advancedCustom->onlyVerifiedEmailCanUpload) ? false : $advancedCustom->onlyVerifiedEmailCanUpload;
$obj->sendVerificationMailAutomatic = !isset($advancedCustom->sendVerificationMailAutomatic) ? false : $advancedCustom->sendVerificationMailAutomatic;
$obj->verificationMailTextLine1 = "Just a quick note to say a big welcome and an even bigger thank you for registering";
$obj->verificationMailTextLine2 = "Cheers, %s Team.";
$obj->verificationMailTextLine3 = "You are just one click away from starting your journey with %s!";
$obj->verificationMailTextLine4 = "All you need to do is to verify your e-mail by clicking the link below";
$obj->unverifiedEmailsCanNOTLogin = !isset($advancedCustom->unverifiedEmailsCanNOTLogin) ? false : $advancedCustom->unverifiedEmailsCanNOTLogin;
$obj->unverifiedEmailsCanNOTComment = false;
$obj->unverifiedEmailsCanNOTLiveStream = true;
$obj->newUsersCanStream = !isset($advancedCustom->newUsersCanStream) ? false : $advancedCustom->newUsersCanStream;
$obj->doNotIdentifyByName = !isset($advancedCustomUser->doNotIndentifyByName) ? false : $advancedCustomUser->doNotIndentifyByName;
self::addDataObjectHelper('doNotIdentifyByName', 'Do NOT identify user by Name', 'The identification order will be:
1. Name
2. email
3. Username
4. Channel Name');
$obj->doNotIdentifyByEmail = !isset($advancedCustomUser->doNotIndentifyByEmail) ? false : $advancedCustomUser->doNotIndentifyByEmail;
self::addDataObjectHelper('doNotIdentifyByEmail', 'Do NOT identify user by Email', 'The identification order will be:
1. Name
2. email
3. Username
4. Channel Name');
$obj->doNotIdentifyByUserName = !isset($advancedCustomUser->doNotIndentifyByUserName) ? false : $advancedCustomUser->doNotIndentifyByUserName;
self::addDataObjectHelper('doNotIdentifyByUserName', 'Do NOT identify user by Username', 'The identification order will be:
1. Name
2. email
3. Username
4. Channel Name');
$obj->hideRemoveChannelFromModeYoutube = !isset($advancedCustom->hideRemoveChannelFromModeYoutube) ? false : $advancedCustom->hideRemoveChannelFromModeYoutube;
$obj->showChannelBannerOnModeYoutube = !isset($advancedCustom->showChannelBannerOnModeYoutube) ? false : $advancedCustom->showChannelBannerOnModeYoutube;
$obj->showChannelLiveTab = true;
$obj->showChannelHomeTab = true;
$obj->showChannelVideosTab = true;
$obj->showArticlesTab = true;
$obj->showAudioTab = true;
$obj->showChannelProgramsTab = true;
$obj->showBigVideoOnChannelVideosTab = true;
$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->disableCompanySignUp = true;
self::addDataObjectHelper('disableCompanySignUp', 'Disable Company SignUp', 'Company SignUp will enable a form with sone extra fields specific for companies');
$obj->disableNativeSignIn = !isset($advancedCustom->disableNativeSignIn) ? false : $advancedCustom->disableNativeSignIn;
$obj->disablePersonalInfo = !isset($advancedCustom->disablePersonalInfo) ? true : $advancedCustom->disablePersonalInfo;
$o = new stdClass();
$o->type = [0 => '-- ' . __("None"), 1 => '-- ' . __("Random")] + self::getBGAnimationArray();
$o->value = 1;
$obj->loginBackgroundAnimation = $o;
$obj->userCanChangeUsername = true;
$obj->signInOnRight = false;
$obj->doNotShowRightProfile = false;
$obj->doNotShowLeftProfile = false;
$obj->forceLoginToBeTheEmail = false;
$obj->emailMustBeUnique = false;
$o = new stdClass();
$o->type = "textarea";
$o->value = "";
$obj->messageReplaceWelcomeBackLoginBox = $o;
// added on 2019-02-11
$o = new stdClass();
$o->type = "textarea";
$o->value = "";
$obj->messageToAppearBelowLoginBox = $o;
$o = new stdClass();
$o->type = "textarea";
$o->value = "";
$obj->messageToAppearAboveSignUpBox = $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->afterSignUpGoToURL = "";
$obj->signupWelcomeAlert = "You are welcome and an even bigger thank you for registering";
$obj->allowDonationLink = false;
$obj->donationButtonLabel = __('Donation');
$obj->allowWalletDirectTransferDonation = false;
$obj->UsersCanCustomizeWalletDirectTransferDonation = false;
$obj->donationWalletButtonLabel = __('Donate from your wallet');
$obj->disableCaptchaOnWalletDirectTransferDonation = false;
$obj->showEmailVerifiedMark = true;
$obj->Checkmark1Enabled = true;
$obj->Checkmark1HTML = '';
$obj->Checkmark2Enabled = true;
$obj->Checkmark2HTML = '';
$obj->Checkmark3Enabled = true;
$obj->Checkmark3HTML = '';
$obj->autoSaveUsersOnCategorySelectedGroups = false;
self::addDataObjectHelper('autoSaveUsersOnCategorySelectedGroups', 'Auto save new videos on category selected User Groups', 'Edit this plugin to select the user groups per category');
$obj->enableExtraInfo = false;
self::addDataObjectHelper('enableExtraInfo', 'Enable user extra info', 'You can add custom fields on user“s profile, Edit this plugin to tell what fields should be saved');
$obj->videosSearchAlsoSearchesOnChannelName = false;
self::addDataObjectHelper('videosSearchAlsoSearchesOnChannelName', 'Videos search also searches on ChannelName', 'With this checked when you searc a video we will also return the results that matches with the channel name');
$obj->doNotShowPhoneMyAccount = true;
$obj->doNotShowPhoneOnSignup = true;
$obj->enableAffiliation = false;
self::addDataObjectHelper('enableAffiliation', 'Enable user affiliation', 'Users that are marked as company can select other users to be afiliated to him');
$obj->enableChannelCalls = true;
self::addDataObjectHelper('enableChannelCalls', 'Enable Meeting Calls from channels', 'This feature requires the meet plugin enabled');
return $obj;
}
static function getCallerButton($users_id, $class = '') {
global $global;
$users_id = intval($users_id);
$varsArray = array('users_id' => $users_id, 'class' => $class);
$filePath = $global['systemRootPath'] . 'plugin/CustomizeUser/View/channelCall.php';
return getIncludeFileContent($filePath, $varsArray);
}
public static function isChannelCallEnabled() {
$obj = AVideoPlugin::getDataObjectIfEnabled('CustomizeUser');
if (!empty($obj->enableChannelCalls)) {
$objSocket = AVideoPlugin::getDataObjectIfEnabled('YPTSocket');
return $objSocket->enableCalls;
}
return false;
}
public static function autoIncludeBGAnimationFile() {
$baseName = basename($_SERVER["SCRIPT_FILENAME"]);
$obj = AVideoPlugin::getObjectData('CustomizeUser');
Layout::includeBGAnimationFile($obj->loginBackgroundAnimation->value);
//Layout::includeBGAnimationFile('Animated3');
}
public function getUserOptions() {
$obj = $this->getDataObject();
$userOptions = [];
if ($obj->Checkmark1Enabled) {
$userOptions["Checkmark 1"] = "checkmark1";
}
if ($obj->Checkmark2Enabled) {
$userOptions["Checkmark 2"] = "checkmark2";
}
if ($obj->Checkmark3Enabled) {
$userOptions["Checkmark 3"] = "checkmark3";
}
return $userOptions;
}
public static function getBGAnimationArray() {
if (!class_exists('Layout')) {
$avideoLayout = AVideoPlugin::getObjectData('Layout');
}
$files = Layout::getBGAnimationFiles();
$response = [];
foreach ($files as $key => $value) {
$response[$value['name']] = ucfirst($value['name']);
}
return $response;
}
public static function canDownloadVideosFromUser($users_id) {
global $config;
$obj = AVideoPlugin::getObjectDataIfEnabled("CustomizeUser");
if (!empty($obj->nonAdminCannotDownload) && !User::isAdmin()) {
return false;
}
if (empty($obj) || empty($obj->userCanAllowFilesDownload)) {
return self::canDownloadVideos();
}
$user = new User($users_id);
return !empty($user->getExternalOption('userCanAllowFilesDownload'));
}
public static function canDownloadVideos() {
global $config;
$obj = AVideoPlugin::getObjectDataIfEnabled("CustomizeUser");
if (!empty($obj->nonAdminCannotDownload) && !User::isAdmin()) {
return false;
}
return !empty($config->getAllow_download());
}
public 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);
}
public static function canShareVideosFromUser($users_id) {
global $advancedCustom;
if (!empty($advancedCustom->disableShareOnly)) {
_error_log("CustomizeUser::canShareVideosFromUser disableShareOnly");
return false;
}
if (!empty($advancedCustom->disableShareAndPlaylist)) {
_error_log("CustomizeUser::canShareVideosFromUser 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'));
}
public 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);
}
public static function getSwitchUserCanAllowFilesDownload($users_id) {
global $global;
include $global['systemRootPath'] . 'plugin/CustomizeUser/switchUserCanAllowFilesDownload.php';
}
public static function getSwitchUserCanAllowFilesShare($users_id) {
global $global;
include $global['systemRootPath'] . 'plugin/CustomizeUser/switchUserCanAllowFilesShare.php';
}
public function getMyAccount($users_id) {
global $global;
$objcu = AVideoPlugin::getObjectDataIfEnabled("CustomizeUser");
if (!empty($objcu) && !empty($objcu->userCanAllowFilesDownload)) {
echo '