mirror of
https://github.com/DanielnetoDotCom/YouPHPTube
synced 2025-10-03 01:39:24 +02:00
You can select the option CustomizeUser->userCanChangeVideoOwner to allow regular users to change their video owners
This commit is contained in:
parent
83cf2c7fd6
commit
a598c36cd1
6 changed files with 10 additions and 5 deletions
|
@ -132,7 +132,8 @@ $content = "<?php
|
|||
\$global['videoStorageLimitMinutes'] = 0;
|
||||
if(!empty(\$_SERVER['SERVER_NAME']) && \$_SERVER['SERVER_NAME']!=='localhost' && !filter_var(\$_SERVER['SERVER_NAME'], FILTER_VALIDATE_IP)) {
|
||||
// get the subdirectory, if exists
|
||||
\$subDir = str_replace(array(\$_SERVER[\"DOCUMENT_ROOT\"], 'videos/configuration.php'), array('',''), __FILE__);
|
||||
\$file = str_replace(\"\\\\\", \"/\", __FILE__);
|
||||
\$subDir = str_replace(array(\$_SERVER[\"DOCUMENT_ROOT\"], 'videos/configuration.php'), array('',''), \$file);
|
||||
\$global['webSiteRootURL'] = \"http\".(!empty(\$_SERVER['HTTPS'])?\"s\":\"\").\"://\".\$_SERVER['SERVER_NAME'].\$subDir;
|
||||
}else{
|
||||
\$global['webSiteRootURL'] = '{$_POST['webSiteRootURL']}';
|
||||
|
|
|
@ -325,7 +325,8 @@ class Configuration {
|
|||
\$global['videoStorageLimitMinutes'] = {$global['videoStorageLimitMinutes']};
|
||||
if(!empty(\$_SERVER['SERVER_NAME']) && \$_SERVER['SERVER_NAME']!=='localhost' && !filter_var(\$_SERVER['SERVER_NAME'], FILTER_VALIDATE_IP)) {
|
||||
// get the subdirectory, if exists
|
||||
\$subDir = str_replace(array(\$_SERVER[\"DOCUMENT_ROOT\"], 'videos/configuration.php'), array('',''), __FILE__);
|
||||
\$file = str_replace(\"\\\\\", \"/\", __FILE__);
|
||||
\$subDir = str_replace(array(\$_SERVER[\"DOCUMENT_ROOT\"], 'videos/configuration.php'), array('',''), \$file);
|
||||
\$global['webSiteRootURL'] = \"http\".(!empty(\$_SERVER['HTTPS'])?\"s\":\"\").\"://\".\$_SERVER['SERVER_NAME'].\$subDir;
|
||||
}else{
|
||||
\$global['webSiteRootURL'] = '{$global['webSiteRootURL']}';
|
||||
|
|
|
@ -103,7 +103,7 @@ if (empty($advancedCustomUser->userCanNotChangeCategory) || User::isAdmin()) {
|
|||
if (empty($advancedCustomUser->userCanNotChangeUserGroup) || User::isAdmin()) {
|
||||
$obj->setVideoGroups(empty($_POST['videoGroups']) ? array() : $_POST['videoGroups']);
|
||||
}
|
||||
if (User::isAdmin()) {
|
||||
if ($advancedCustomUser->userCanChangeVideoOwner || User::isAdmin()) {
|
||||
$obj->setUsers_id($_POST['users_id']);
|
||||
}
|
||||
|
||||
|
|
|
@ -374,6 +374,7 @@ class API extends PluginAbstract {
|
|||
$obj->photo = User::getPhoto($value['id']);
|
||||
$obj->channelLink = User::getChannelLink($value['id']);
|
||||
$obj->name = User::getNameIdentificationById($value['id']);
|
||||
|
||||
$list[] = $obj;
|
||||
}
|
||||
return new ApiObject("", false, $list);
|
||||
|
@ -387,8 +388,9 @@ class API extends PluginAbstract {
|
|||
*/
|
||||
public function get_api_programs($parameters) {
|
||||
global $global;
|
||||
require_once $global['systemRootPath'] . 'objects/category.php';
|
||||
require_once $global['systemRootPath'] . 'objects/playlist.php';
|
||||
$playlists = PlayList::getAll();
|
||||
$list = array();
|
||||
foreach ($playlists as $value) {
|
||||
$videosArrayId = PlayList::getVideosIdFromPlaylist($value['id']);
|
||||
if (empty($videosArrayId) || $value['status'] == "favorite" || $value['status'] == "watch_later") {
|
||||
|
|
|
@ -31,6 +31,7 @@ class CustomizeUser extends PluginAbstract {
|
|||
$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;
|
||||
|
|
|
@ -368,7 +368,7 @@
|
|||
?>
|
||||
</select>
|
||||
|
||||
<div class="row" <?php if (!User::isAdmin()) { ?> style="display: none;" <?php } ?>>
|
||||
<div class="row" <?php if ($advancedCustomUser->userCanChangeVideoOwner || !User::isAdmin()) { ?> style="display: none;" <?php } ?>>
|
||||
<h3><?php echo __("Media Owner"); ?></h3>
|
||||
<div class="col-md-2">
|
||||
<img id="inputUserOwner-img" src="view/img/userSilhouette.jpg" class="img img-responsive img-circle" style="max-height: 60px;">
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue