mirror of
https://github.com/DanielnetoDotCom/YouPHPTube
synced 2025-10-03 09:49:28 +02:00
There is a option now so admin can allow each user to chose if wants to
let other users download or share his videos
This commit is contained in:
parent
9fcf188e73
commit
ac26179b0c
34 changed files with 581 additions and 61 deletions
|
@ -11,4 +11,4 @@
|
|||
'onlyVerifiedEmailCanUpload'=>'Users must verify their emails before upload/submit videos',
|
||||
'sendVerificationMailAutomaic'=>'After sign up we will automatic send a verification email',
|
||||
'userMustBeLoggedIn'=>'Hide the website to non logged users');
|
||||
createTable("CustomizeAdvanced", $filter);
|
||||
createTable("CustomizeUser", $filter);
|
|
@ -8,7 +8,7 @@
|
|||
'disableNativeSignUp' => 'The form to signup will not exists',
|
||||
'disableNativeSignIn' => 'The regular form to signin will not exist, if you check this will only have social login or LDAP option',
|
||||
'userMustBeLoggedIn' => 'The site will display only a login form to un authenticated users');
|
||||
createTable("CustomizeAdvanced", $filter);
|
||||
createTable("CustomizeUser", $filter);
|
||||
?>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
@ -360,11 +360,11 @@ class Category {
|
|||
}
|
||||
|
||||
static function canCreateCategory() {
|
||||
global $advancedCustom;
|
||||
global $advancedCustomUser;
|
||||
if (User::isAdmin()) {
|
||||
return true;
|
||||
}
|
||||
if ($advancedCustom->usersCanCreateNewCategories && User::canUpload()) {
|
||||
if ($advancedCustomUser->usersCanCreateNewCategories && User::canUpload()) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
|
|
|
@ -1235,8 +1235,8 @@ function tail($filepath, $lines = 1, $adaptive = true, $returnArray = false)
|
|||
|
||||
function encryptPassword($password, $noSalt = false)
|
||||
{
|
||||
global $advancedCustom, $global;
|
||||
if (!empty($advancedCustom->encryptPasswordsWithSalt) && !empty($global['salt']) && empty($noSalt)) {
|
||||
global $advancedCustom, $global, $advancedCustomUser;
|
||||
if (!empty($advancedCustomUser->encryptPasswordsWithSalt) && !empty($global['salt']) && empty($noSalt)) {
|
||||
$password .= $global['salt'];
|
||||
}
|
||||
|
||||
|
|
|
@ -54,4 +54,5 @@ if(class_exists("Plugin")){YouPHPTubePlugin::getStart();}
|
|||
else{error_log("Class Plugin Not found: {$_SERVER['REQUEST_URI']}");}
|
||||
$global['allowedExtension'] = array('gif', 'jpg', 'mp4', 'webm', 'mp3', 'ogg');
|
||||
$advancedCustom = YouPHPTubePlugin::getObjectDataIfEnabled("CustomizeAdvanced");
|
||||
$advancedCustomUser = YouPHPTubePlugin::getObjectDataIfEnabled("CustomizeUser");
|
||||
$sitemapFile = "{$global['systemRootPath']}sitemap.xml";
|
|
@ -138,7 +138,7 @@ $object->isLogged = User::isLogged();
|
|||
$object->isAdmin = User::isAdmin();
|
||||
$object->canUpload = User::canUpload();
|
||||
$object->canComment = User::canComment();
|
||||
if (empty($advancedCustom->userCanNotChangeCategory) || User::isAdmin()) {
|
||||
if (empty($advancedCustomUser->userCanNotChangeCategory) || User::isAdmin()) {
|
||||
$object->categories = Category::getAllCategories(true);
|
||||
}else{
|
||||
$object->categories = array();
|
||||
|
|
|
@ -134,12 +134,14 @@ if (typeof gtag !== \"function\") {
|
|||
$eo = unserialize(base64_decode($this->externalOptions));
|
||||
$eo[$id] = $value;
|
||||
$this->setExternalOptions($eo);
|
||||
return $this->save();
|
||||
}
|
||||
|
||||
function removeExternalOptions($id) {
|
||||
$eo = unserialize(base64_decode($this->externalOptions));
|
||||
unset($eo[$id]);
|
||||
$this->setExternalOptions($eo);
|
||||
return $this->save();
|
||||
}
|
||||
|
||||
function setExternalOptions($options) {
|
||||
|
@ -149,6 +151,9 @@ if (typeof gtag !== \"function\") {
|
|||
|
||||
function getExternalOption($id) {
|
||||
$eo = unserialize(base64_decode($this->externalOptions));
|
||||
if(empty($eo[$id])){
|
||||
return NULL;
|
||||
}
|
||||
return $eo[$id];
|
||||
}
|
||||
|
||||
|
@ -242,13 +247,13 @@ if (typeof gtag !== \"function\") {
|
|||
static function getNameIdentification() {
|
||||
global $advancedCustom;
|
||||
if (self::isLogged()) {
|
||||
if (!empty(self::getName()) && empty($advancedCustom->doNotIndentifyByName)) {
|
||||
if (!empty(self::getName()) && empty($advancedCustomUser->doNotIndentifyByName)) {
|
||||
return self::getName();
|
||||
}
|
||||
if (!empty(self::getMail()) && empty($advancedCustom->doNotIndentifyByEmail)) {
|
||||
if (!empty(self::getMail()) && empty($advancedCustomUser->doNotIndentifyByEmail)) {
|
||||
return self::getMail();
|
||||
}
|
||||
if (!empty(self::getUserName()) && empty($advancedCustom->doNotIndentifyByUserName)) {
|
||||
if (!empty(self::getUserName()) && empty($advancedCustomUser->doNotIndentifyByUserName)) {
|
||||
return self::getUserName();
|
||||
}
|
||||
}
|
||||
|
@ -366,7 +371,7 @@ if (typeof gtag !== \"function\") {
|
|||
}
|
||||
if (empty($this->canStream)) {
|
||||
if (empty($this->id)) { // it is a new user
|
||||
if (empty($advancedCustom->newUsersCanStream)) {
|
||||
if (empty($advancedCustomUser->newUsersCanStream)) {
|
||||
$this->canStream = "0";
|
||||
} else {
|
||||
$this->canStream = "1";
|
||||
|
@ -451,7 +456,7 @@ if (typeof gtag !== \"function\") {
|
|||
if ($insert_row) {
|
||||
if (empty($this->id)) {
|
||||
$id = $global['mysqli']->insert_id;
|
||||
if (!empty($advancedCustom->unverifiedEmailsCanNOTLogin)) {
|
||||
if (!empty($advancedCustomUser->unverifiedEmailsCanNOTLogin)) {
|
||||
self::sendVerificationLink($id);
|
||||
}
|
||||
} else {
|
||||
|
@ -538,7 +543,7 @@ if (typeof gtag !== \"function\") {
|
|||
const CAPTCHA_ERROR = 3;
|
||||
|
||||
function login($noPass = false, $encodedPass = false) {
|
||||
global $global,$advancedCustom;
|
||||
global $global,$advancedCustom, $advancedCustomUser;
|
||||
if ($noPass) {
|
||||
$user = $this->find($this->user, false, true);
|
||||
} else {
|
||||
|
@ -551,9 +556,9 @@ if (typeof gtag !== \"function\") {
|
|||
if(empty($_SESSION['loginAttempts'])){
|
||||
$_SESSION['loginAttempts'] = 0;
|
||||
}
|
||||
if(!empty($advancedCustom->requestCaptchaAfterLoginsAttempts)){
|
||||
if(!empty($advancedCustomUser->requestCaptchaAfterLoginsAttempts)){
|
||||
$_SESSION['loginAttempts']++;
|
||||
if($_SESSION['loginAttempts']>$advancedCustom->requestCaptchaAfterLoginsAttempts){
|
||||
if($_SESSION['loginAttempts']>$advancedCustomUser->requestCaptchaAfterLoginsAttempts){
|
||||
if(empty($_POST['captcha'])){
|
||||
return self::CAPTCHA_ERROR;
|
||||
}
|
||||
|
@ -565,7 +570,7 @@ if (typeof gtag !== \"function\") {
|
|||
}
|
||||
// check for multiple logins attempts to prevent hacking end
|
||||
// if user is not verified
|
||||
if (!empty($user) && empty($user['isAdmin']) && empty($user['emailVerified']) && !empty($advancedCustom->unverifiedEmailsCanNOTLogin)) {
|
||||
if (!empty($user) && empty($user['isAdmin']) && empty($user['emailVerified']) && !empty($advancedCustomUser->unverifiedEmailsCanNOTLogin)) {
|
||||
unset($_SESSION['user']);
|
||||
self::sendVerificationLink($user['id']);
|
||||
return self::USER_NOT_VERIFIED;
|
||||
|
@ -590,10 +595,10 @@ if (typeof gtag !== \"function\") {
|
|||
}
|
||||
|
||||
static function isCaptchaNeed(){
|
||||
global $advancedCustom;
|
||||
global $advancedCustomUser;
|
||||
// check for multiple logins attempts to prevent hacking
|
||||
if(!empty($_SESSION['loginAttempts']) && !empty($advancedCustom->requestCaptchaAfterLoginsAttempts)){
|
||||
if($_SESSION['loginAttempts']>$advancedCustom->requestCaptchaAfterLoginsAttempts){
|
||||
if(!empty($_SESSION['loginAttempts']) && !empty($advancedCustomUser->requestCaptchaAfterLoginsAttempts)){
|
||||
if($_SESSION['loginAttempts']>$advancedCustomUser->requestCaptchaAfterLoginsAttempts){
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -41,7 +41,7 @@ $status=$user->save();
|
|||
|
||||
$json_file = url_get_contents("{$global['webSiteRootURL']}plugin/CustomizeAdvanced/advancedCustom.json.php");
|
||||
$advancedCustom = json_decode($json_file);
|
||||
if($advancedCustom->sendVerificationMailAutomaic && $status!=0)
|
||||
if($advancedCustomUser->sendVerificationMailAutomaic && $status!=0)
|
||||
{
|
||||
url_get_contents("{$global['webSiteRootURL']}objects/userVerifyEmail.php?users_id=$status");
|
||||
}
|
||||
|
|
82
plugin/CreateUserManager/CreateUserManager.php
Normal file
82
plugin/CreateUserManager/CreateUserManager.php
Normal file
|
@ -0,0 +1,82 @@
|
|||
<?php
|
||||
|
||||
global $global;
|
||||
require_once $global['systemRootPath'] . 'plugin/Plugin.abstract.php';
|
||||
require_once $global['systemRootPath'] . 'plugin/CreateUserManager/Objects/UserManager.php';
|
||||
|
||||
class CreateUserManager extends PluginAbstract {
|
||||
|
||||
public function getDescription() {
|
||||
return "Select some users to be able to add and remove other users from user groups";
|
||||
}
|
||||
|
||||
public function getName() {
|
||||
return "CreateUserManager";
|
||||
}
|
||||
|
||||
public function getUUID() {
|
||||
return "cc570956-dc62-46e3-ace9-86c6e8f9c81b";
|
||||
}
|
||||
|
||||
public function getPluginVersion() {
|
||||
return "1.0";
|
||||
}
|
||||
|
||||
public function getPluginMenu(){
|
||||
global $global;
|
||||
$filename = $global['systemRootPath'] . 'plugin/CreateUserManager/pluginMenu.html';
|
||||
return file_get_contents($filename);
|
||||
}
|
||||
|
||||
public function getHTMLMenuRight() {
|
||||
global $global;
|
||||
include $global['systemRootPath'] . 'plugin/CreateUserManager/menuRight.php';
|
||||
}
|
||||
|
||||
static function deleteGroupsFromUser($users_id){
|
||||
if (!self::isManager()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
global $global;
|
||||
if (!empty($users_id)) {
|
||||
$sql = "DELETE FROM users_has_users_groups WHERE users_id = ?";
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
return sqlDAL::writeSql($sql,"i",array($users_id));
|
||||
}
|
||||
|
||||
static function updateUserGroups($users_id, $array_groups_id){
|
||||
if (!self::isManager()) {
|
||||
return false;
|
||||
}
|
||||
if (!is_array($array_groups_id)) {
|
||||
return false;
|
||||
}
|
||||
self::deleteGroupsFromUser($users_id);
|
||||
global $global;
|
||||
$sql = "INSERT INTO users_has_users_groups ( users_id, users_groups_id) VALUES (?,?)";
|
||||
foreach ($array_groups_id as $value) {
|
||||
$value = intval($value);
|
||||
sqlDAL::writeSql($sql,"ii",array($users_id,$value));
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
static function isManager(){
|
||||
if (!User::isLogged()) {
|
||||
return false;
|
||||
}
|
||||
if (User::isAdmin()) {
|
||||
return true;
|
||||
}
|
||||
|
||||
if(UserManager::getFromUsersId(User::getId())){
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
}
|
120
plugin/CreateUserManager/Objects/UserManager.php
Normal file
120
plugin/CreateUserManager/Objects/UserManager.php
Normal file
|
@ -0,0 +1,120 @@
|
|||
<?php
|
||||
|
||||
require_once dirname(__FILE__) . '/../../../videos/configuration.php';
|
||||
require_once dirname(__FILE__) . '/../../../objects/bootGrid.php';
|
||||
require_once dirname(__FILE__) . '/../../../objects/user.php';
|
||||
|
||||
class UserManager extends ObjectYPT {
|
||||
|
||||
protected $id, $users_id, $status;
|
||||
|
||||
static function getSearchFieldsNames() {
|
||||
return array('name', 'user', 'email');
|
||||
}
|
||||
|
||||
static function getTableName() {
|
||||
return 'userManagers';
|
||||
}
|
||||
|
||||
static function getTotalUsers() {
|
||||
//will receive
|
||||
//current=1&rowCount=10&sort[sender]=asc&searchPhrase=
|
||||
global $global;
|
||||
$sql = "SELECT a.id FROM users u LEFT JOIN " . static::getTableName() . " a ON u.id = users_id WHERE u.status = 'a' ";
|
||||
$sql .= self::getSqlSearchFromPost();
|
||||
//echo $sql;
|
||||
$res = sqlDAL::readSql($sql);
|
||||
$countRow = sqlDAL::num_rows($res);
|
||||
sqlDAL::close($res);
|
||||
return $countRow;
|
||||
}
|
||||
|
||||
static function getAllUsers() {
|
||||
global $global;
|
||||
$sql = "SELECT u.*, u.id as real_users_id, a.* FROM users u LEFT JOIN " . static::getTableName() . " a ON u.id = users_id WHERE u.status = 'a' ";
|
||||
$sql .= self::getSqlFromPost("u.");
|
||||
//echo $sql;
|
||||
$res = sqlDAL::readSql($sql);
|
||||
$fullData = sqlDAL::fetchAllAssoc($res);
|
||||
sqlDAL::close($res);
|
||||
$rows = array();
|
||||
if ($res!=false) {
|
||||
foreach ($fullData as $row) {
|
||||
$row['groups'] = UserGroups::getUserGroups($row['real_users_id']);
|
||||
$row['switch'] = '
|
||||
<div class="material-switch pull-right">
|
||||
<input onchange="switchManager('.$row['real_users_id'].');" data-toggle="toggle" type="checkbox" value="'.$row['real_users_id'].'" id="themeSwitch'.$row['real_users_id'].'" '.(($row['status']==='a')?"checked":"").'>
|
||||
<label for="themeSwitch'.$row['real_users_id'].'" class="label-primary"></label>
|
||||
</div>';
|
||||
$rows[] = $row;
|
||||
}
|
||||
} else {
|
||||
die($sql . '\nError : (' . $global['mysqli']->errno . ') ' . $global['mysqli']->error);
|
||||
}
|
||||
return $rows;
|
||||
}
|
||||
|
||||
static function getFromUsersId($users_id) {
|
||||
global $global;
|
||||
$users_id = intval($users_id);
|
||||
$sql = "SELECT * FROM " . static::getTableName() . " WHERE users_id = ? LIMIT 1";
|
||||
// I had to add this because the about from customize plugin was not loading on the about page http://127.0.0.1/YouPHPTube/about
|
||||
$res = sqlDAL::readSql($sql,"i",array($users_id));
|
||||
$data = sqlDAL::fetchAssoc($res);
|
||||
sqlDAL::close($res);
|
||||
if ($res) {
|
||||
$row = $data;
|
||||
} else {
|
||||
$row = false;
|
||||
}
|
||||
return $row;
|
||||
}
|
||||
|
||||
function loadFromUsersId($users_id) {
|
||||
$row = self::getFromUsersId($users_id);
|
||||
if (empty($row))
|
||||
return false;
|
||||
foreach ($row as $key => $value) {
|
||||
$this->$key = $value;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
function switchUsers($users_id) {
|
||||
$loaded = $this->loadFromUsersId($users_id);
|
||||
$status = 'a';
|
||||
if(empty($loaded)){
|
||||
$this->setUsers_id($users_id);
|
||||
}else{
|
||||
if($this->getStatus()==='a'){
|
||||
$status = 'i';
|
||||
$this->setStatus('i');
|
||||
}else{
|
||||
$this->setStatus('a');
|
||||
}
|
||||
}
|
||||
$obj = new stdClass();
|
||||
$obj->id = $this->save();
|
||||
$obj->status = $status;
|
||||
return $obj;
|
||||
}
|
||||
|
||||
function getUsers_id() {
|
||||
return $this->users_id;
|
||||
}
|
||||
|
||||
function getStatus() {
|
||||
return $this->status;
|
||||
}
|
||||
|
||||
function setUsers_id($users_id) {
|
||||
$this->users_id = $users_id;
|
||||
}
|
||||
|
||||
function setStatus($status) {
|
||||
$this->status = $status;
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
BIN
plugin/CreateUserManager/install/CreateUserManager.mwb
Normal file
BIN
plugin/CreateUserManager/install/CreateUserManager.mwb
Normal file
Binary file not shown.
14
plugin/CreateUserManager/install/install.sql
Normal file
14
plugin/CreateUserManager/install/install.sql
Normal file
|
@ -0,0 +1,14 @@
|
|||
CREATE TABLE IF NOT EXISTS `userManagers` (
|
||||
`id` INT NOT NULL AUTO_INCREMENT,
|
||||
`created` DATETIME NULL,
|
||||
`modified` DATETIME NULL,
|
||||
`users_id` INT NOT NULL,
|
||||
`status` CHAR(1) NULL DEFAULT 'a',
|
||||
PRIMARY KEY (`id`),
|
||||
INDEX `fk_userManagers_users_idx` (`users_id` ASC),
|
||||
CONSTRAINT `fk_userManagers_users`
|
||||
FOREIGN KEY (`users_id`)
|
||||
REFERENCES `users` (`id`)
|
||||
ON DELETE NO ACTION
|
||||
ON UPDATE NO ACTION)
|
||||
ENGINE = InnoDB;
|
60
plugin/CreateUserManager/page/editor.php
Normal file
60
plugin/CreateUserManager/page/editor.php
Normal file
|
@ -0,0 +1,60 @@
|
|||
<?php
|
||||
require_once '../../../videos/configuration.php';
|
||||
require_once $global['systemRootPath'] . 'objects/user.php';
|
||||
if (!CreateUserManager::isManager()) {
|
||||
header("Location: {$global['webSiteRootURL']}?error=" . __("You can not manager"));
|
||||
exit;
|
||||
}
|
||||
?>
|
||||
<!DOCTYPE html>
|
||||
<html lang="<?php echo $_SESSION['language']; ?>">
|
||||
<head>
|
||||
<title><?php echo $config->getWebSiteTitle(); ?> :: Managers</title>
|
||||
<?php
|
||||
include $global['systemRootPath'] . 'view/include/head.php';
|
||||
?>
|
||||
<link rel="stylesheet" type="text/css" href="<?php echo $global['webSiteRootURL']; ?>view/css/DataTables/datatables.min.css"/>
|
||||
<style>
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<?php
|
||||
include $global['systemRootPath'] . 'view/include/navbar.php';
|
||||
?>
|
||||
<div class="container">
|
||||
<ul class="nav nav-tabs">
|
||||
<li class="active"><a data-toggle="tab" href="#ug">Users Groups</a></li>
|
||||
<?php
|
||||
if(User::isAdmin()){
|
||||
?>
|
||||
<li><a data-toggle="tab" href="#mn">Managers</a></li>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
</ul>
|
||||
|
||||
<div class="tab-content">
|
||||
<div id="ug" class="tab-pane fade in active">
|
||||
<?php
|
||||
include_once './editorGroups.php';
|
||||
?>
|
||||
</div>
|
||||
<?php
|
||||
if(User::isAdmin()){
|
||||
?>
|
||||
<div id="mn" class="tab-pane fade">
|
||||
<?php
|
||||
include_once './editorManagers.php';
|
||||
?>
|
||||
</div>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
</div>
|
||||
</div>
|
||||
<?php
|
||||
include $global['systemRootPath'] . 'view/include/footer.php';
|
||||
?>
|
||||
<script type="text/javascript" src="<?php echo $global['webSiteRootURL']; ?>view/css/DataTables/datatables.min.js"></script>
|
||||
</body>
|
||||
</html>
|
18
plugin/CreateUserManager/page/users.json.php
Normal file
18
plugin/CreateUserManager/page/users.json.php
Normal file
|
@ -0,0 +1,18 @@
|
|||
<?php
|
||||
require_once '../../../videos/configuration.php';
|
||||
if (!CreateUserManager::isManager()) {
|
||||
header("Location: {$global['webSiteRootURL']}?error=" . __("You can not manager"));
|
||||
exit;
|
||||
}
|
||||
header('Content-Type: application/json');
|
||||
require_once $global['systemRootPath'] . 'plugin/CreateUserManager/Objects/UserManager.php';
|
||||
|
||||
$rows = UserManager::getAllUsers();
|
||||
$rowsTotal = UserManager::getTotalUsers();
|
||||
?>
|
||||
{
|
||||
"draw": <?php echo $_GET['draw']; ?>,
|
||||
"recordsTotal": <?php echo $rowsTotal; ?>,
|
||||
"recordsFiltered": <?php echo $rowsTotal; ?>,
|
||||
"data": <?php echo json_encode($rows); ?>
|
||||
}
|
1
plugin/CreateUserManager/pluginMenu.html
Normal file
1
plugin/CreateUserManager/pluginMenu.html
Normal file
|
@ -0,0 +1 @@
|
|||
<a href="plugin/CreateUserManager/page/editor.php" class="btn btn-primary btn-sm btn-xs"><i class="fa fa-edit"></i> Create Managers</a>
|
|
@ -38,21 +38,13 @@ class CustomizeAdvanced extends PluginAbstract {
|
|||
$obj->doNotShowEncoderResolutionSD = false;
|
||||
$obj->doNotShowEncoderResolutionHD = false;
|
||||
$obj->doNotShowLeftMenuAudioAndVideoButtons = false;
|
||||
$obj->disableNativeSignUp = false;
|
||||
$obj->disableNativeSignIn = false;
|
||||
$obj->disablePersonalInfo = true;
|
||||
$obj->doNotShowWebsiteOnContactForm = false;
|
||||
$obj->newUsersCanStream = false;
|
||||
$obj->doNotIndentifyByEmail = false;
|
||||
$obj->doNotIndentifyByName = false;
|
||||
$obj->doNotIndentifyByUserName = false;
|
||||
$obj->doNotUseXsendFile = false;
|
||||
$obj->makeVideosInactiveAfterEncode = false;
|
||||
$obj->usePermalinks = false;
|
||||
$obj->showAdsenseBannerOnTop = false;
|
||||
$obj->showAdsenseBannerOnLeft = true;
|
||||
$obj->disableAnimatedGif = false;
|
||||
$obj->unverifiedEmailsCanNOTLogin = false;
|
||||
$obj->removeBrowserChannelLinkFromMenu = false;
|
||||
$obj->uploadButtonDropdownIcon = "fas fa-video";
|
||||
$obj->uploadButtonDropdownText = "";
|
||||
|
@ -64,9 +56,6 @@ class CustomizeAdvanced extends PluginAbstract {
|
|||
$obj->utf8Encode = false;
|
||||
$obj->utf8Decode = false;
|
||||
$obj->embedBackgroundColor = "white";
|
||||
$obj->userMustBeLoggedIn = false;
|
||||
$obj->onlyVerifiedEmailCanUpload= false;
|
||||
$obj->sendVerificationMailAutomaic=false;
|
||||
$o = new stdClass();
|
||||
$o->type = "textarea";
|
||||
$o->value = "";
|
||||
|
@ -93,17 +82,10 @@ class CustomizeAdvanced extends PluginAbstract {
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
$obj->disableHelpLeftMenu= false;
|
||||
$obj->disableAboutLeftMenu= false;
|
||||
$obj->disableContactLeftMenu= false;
|
||||
$obj->disableNavbar= false;
|
||||
$obj->userCanNotChangeCategory = false;
|
||||
$obj->hideRemoveChannelFromModeYoutube = false;
|
||||
$obj->showChannelBannerOnModeYoutube = false;
|
||||
$obj->usersCanCreateNewCategories = false;
|
||||
$obj->encryptPasswordsWithSalt = false;
|
||||
$obj->requestCaptchaAfterLoginsAttempts = 0;
|
||||
$obj->videosCDN = "";
|
||||
$obj->useFFMPEGToGenerateThumbs = false;
|
||||
|
||||
|
|
130
plugin/CustomizeUser/CustomizeUser.php
Normal file
130
plugin/CustomizeUser/CustomizeUser.php
Normal file
|
@ -0,0 +1,130 @@
|
|||
<?php
|
||||
|
||||
global $global;
|
||||
require_once $global['systemRootPath'] . 'plugin/Plugin.abstract.php';
|
||||
|
||||
class CustomizeUser extends PluginAbstract {
|
||||
|
||||
public function getDescription() {
|
||||
$txt = "Fine Tuning User Profile";
|
||||
return $txt;
|
||||
}
|
||||
|
||||
public function getName() {
|
||||
return "CustomizeUser";
|
||||
}
|
||||
|
||||
public function getUUID() {
|
||||
return "55a4fa56-8a30-48d4-a0fb-8aa6b3fuser3";
|
||||
}
|
||||
|
||||
public function getPluginVersion() {
|
||||
return "1.0";
|
||||
}
|
||||
|
||||
public function getEmptyDataObject() {
|
||||
global $advancedCustom;
|
||||
$obj = new stdClass();
|
||||
$obj->userCanAllowFilesDownload = false;
|
||||
$obj->userCanAllowFilesShare = false;
|
||||
|
||||
|
||||
$obj->usersCanCreateNewCategories = !isset($advancedCustom->usersCanCreateNewCategories) ? false : $advancedCustom->usersCanCreateNewCategories;
|
||||
$obj->userCanNotChangeCategory = !isset($advancedCustom->userCanNotChangeCategory) ? false : $advancedCustom->userCanNotChangeCategory;
|
||||
$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->disableNativeSignUp = !isset($advancedCustom->disableNativeSignUp) ? false : $advancedCustom->disableNativeSignUp;
|
||||
$obj->disableNativeSignIn = !isset($advancedCustom->disableNativeSignIn) ? false : $advancedCustom->disableNativeSignIn;
|
||||
$obj->disablePersonalInfo = !isset($advancedCustom->disablePersonalInfo) ? true : $advancedCustom->disablePersonalInfo;
|
||||
|
||||
return $obj;
|
||||
}
|
||||
|
||||
static function canDownloadVideosFromUser($users_id) {
|
||||
global $config;
|
||||
$obj = YouPHPTubePlugin::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 = YouPHPTubePlugin::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 = YouPHPTubePlugin::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 = YouPHPTubePlugin::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 = YouPHPTubePlugin::getObjectDataIfEnabled("CustomizeUser");
|
||||
|
||||
if (!empty($objcu) && !empty($objcu->userCanAllowFilesDownload)) {
|
||||
echo '<div class="form-group">
|
||||
<label class="col-md-4 control-label">' . __("Allow Download My Videos") . '</label>
|
||||
<div class="col-md-8 inputGroupContainer">';
|
||||
self::getSwitchUserCanAllowFilesDownload($users_id);
|
||||
echo '</div></div>';
|
||||
}
|
||||
if (!empty($objcu) && !empty($objcu->userCanAllowFilesShare)) {
|
||||
echo '<div class="form-group">
|
||||
<label class="col-md-4 control-label">' . __("Allow Share My Videos") . '</label>
|
||||
<div class="col-md-8 inputGroupContainer">';
|
||||
self::getSwitchUserCanAllowFilesShare($users_id);
|
||||
echo '</div></div>';
|
||||
}
|
||||
}
|
||||
|
||||
public function getTags() {
|
||||
return array('free', 'customization', 'users');
|
||||
}
|
||||
|
||||
}
|
38
plugin/CustomizeUser/set.json.php
Normal file
38
plugin/CustomizeUser/set.json.php
Normal file
|
@ -0,0 +1,38 @@
|
|||
<?php
|
||||
require_once '../../videos/configuration.php';
|
||||
session_write_close();
|
||||
header('Content-Type: application/json');
|
||||
$obj = new stdClass();
|
||||
$obj->error = true;
|
||||
$obj->msg = "";
|
||||
if(!User::isLogged()){
|
||||
$obj->msg = "Not logged";
|
||||
die(json_encode($obj));
|
||||
}
|
||||
if(empty($_POST['type'])){
|
||||
$obj->msg = "Type is empty";
|
||||
die(json_encode($obj));
|
||||
}
|
||||
if(!isset($_POST['value'])){
|
||||
$obj->msg = "value is empty";
|
||||
die(json_encode($obj));
|
||||
}
|
||||
|
||||
$cu = YouPHPTubePlugin::loadPluginIfEnabled('CustomizeUser');
|
||||
|
||||
if(empty($cu)){
|
||||
$obj->msg = "Plugin not enabled";
|
||||
die(json_encode($obj));
|
||||
}
|
||||
|
||||
$obj->error = false;
|
||||
switch ($_POST['type']) {
|
||||
case 'userCanAllowFilesDownload':
|
||||
CustomizeUser::setCanDownloadVideosFromUser(User::getId(), $_POST['value']=="true"?true:false);
|
||||
break;
|
||||
case 'userCanAllowFilesShare':
|
||||
CustomizeUser::setCanShareVideosFromUser(User::getId(), $_POST['value']=="true"?true:false);
|
||||
break;
|
||||
}
|
||||
|
||||
die(json_encode($obj));
|
22
plugin/CustomizeUser/switchUserCanAllowFilesDownload.php
Normal file
22
plugin/CustomizeUser/switchUserCanAllowFilesDownload.php
Normal file
|
@ -0,0 +1,22 @@
|
|||
<?php
|
||||
$uid = uniqid();
|
||||
?>
|
||||
<div class="material-switch">
|
||||
<input class="playerSwitchDefault" data-toggle="toggle" type="checkbox" value="" id="switch<?php echo $uid; ?>" <?php echo (CustomizeUser::canDownloadVideosFromUser($users_id)) ? "checked" : ""; ?>>
|
||||
<label for="switch<?php echo $uid; ?>" class="label-primary"></label>
|
||||
</div>
|
||||
<script>
|
||||
$(document).ready(function () {
|
||||
$('#switch<?php echo $uid; ?>').change(function (e) {
|
||||
modal.showPleaseWait();
|
||||
$.ajax({
|
||||
url: '<?php echo $global['webSiteRootURL']; ?>plugin/CustomizeUser/set.json.php',
|
||||
data: {"type": "userCanAllowFilesDownload", "value": $('#switch<?php echo $uid; ?>').is(":checked")},
|
||||
type: 'post',
|
||||
success: function (response) {
|
||||
modal.hidePleaseWait();
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
</script>
|
22
plugin/CustomizeUser/switchUserCanAllowFilesShare.php
Normal file
22
plugin/CustomizeUser/switchUserCanAllowFilesShare.php
Normal file
|
@ -0,0 +1,22 @@
|
|||
<?php
|
||||
$uid = uniqid();
|
||||
?>
|
||||
<div class="material-switch">
|
||||
<input class="playerSwitchDefault" data-toggle="toggle" type="checkbox" value="" id="switch<?php echo $uid; ?>" <?php echo (CustomizeUser::canShareVideosFromUser($users_id)) ? "checked" : ""; ?>>
|
||||
<label for="switch<?php echo $uid; ?>" class="label-primary"></label>
|
||||
</div>
|
||||
<script>
|
||||
$(document).ready(function () {
|
||||
$('#switch<?php echo $uid; ?>').change(function (e) {
|
||||
modal.showPleaseWait();
|
||||
$.ajax({
|
||||
url: '<?php echo $global['webSiteRootURL']; ?>plugin/CustomizeUser/set.json.php',
|
||||
data: {"type": "userCanAllowFilesShare", "value": $('#switch<?php echo $uid; ?>').is(":checked")},
|
||||
type: 'post',
|
||||
success: function (response) {
|
||||
modal.hidePleaseWait();
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
</script>
|
|
@ -278,7 +278,7 @@ function createGallerySection($videos, $crc = "", $get = array()) {
|
|||
</div>
|
||||
</div>
|
||||
<?php
|
||||
if ($config->getAllow_download()) {
|
||||
if (CustomizeUser::canDownloadVideosFromUser($value['users_id'])) {
|
||||
?>
|
||||
|
||||
<div style="position: relative; overflow: visible; z-index: 3;" class="dropup">
|
||||
|
|
|
@ -222,7 +222,7 @@ if ($obj->BigVideo && empty($_GET['showOnly'])) {
|
|||
</div>
|
||||
|
||||
<?php
|
||||
if ($config->getAllow_download()) {
|
||||
if (CustomizeUser::canDownloadVideosFromUser($video['users_id'])) {
|
||||
?>
|
||||
<div style="position: relative; overflow: visible;">
|
||||
<button type="button" class="btn btn-default btn-sm btn-xs" data-toggle="dropdown">
|
||||
|
|
|
@ -209,6 +209,10 @@ abstract class PluginAbstract {
|
|||
public function getPlayListButtons($playlist_id) {
|
||||
return "";
|
||||
}
|
||||
|
||||
public function getMyAccount($users_id) {
|
||||
return "";
|
||||
}
|
||||
/**
|
||||
*
|
||||
* @return type array(array("key"=>'live key', "users"=>false, "name"=>$userName, "user"=>$user, "photo"=>$photo, "UserPhoto"=>$UserPhoto, "title"=>''));
|
||||
|
|
|
@ -480,6 +480,20 @@ class YouPHPTubePlugin {
|
|||
return $str;
|
||||
}
|
||||
|
||||
public static function getMyAccount($users_id = "") {
|
||||
if (empty($users_id))
|
||||
return "";
|
||||
$plugins = Plugin::getAllEnabled();
|
||||
$str = "";
|
||||
foreach ($plugins as $value) {
|
||||
$p = static::loadPlugin($value['dirName']);
|
||||
if (is_object($p)) {
|
||||
$str .= $p->getMyAccount($users_id);
|
||||
}
|
||||
}
|
||||
return $str;
|
||||
}
|
||||
|
||||
public static function getPluginUserOptions() {
|
||||
$plugins = Plugin::getAllEnabled();
|
||||
$userOptions = array();
|
||||
|
|
|
@ -78,7 +78,7 @@
|
|||
<script>
|
||||
var player;
|
||||
var mediaId = <?php echo $video['id']; ?>;
|
||||
<?php if (!$config->getAllow_download()) { ?>
|
||||
<?php if (!CustomizeUser::canDownloadVideosFromUser($video['users_id'])) { ?>
|
||||
// Prevent HTML5 video from being downloaded (right-click saved)?
|
||||
$('#mainVideo').bind('contextmenu', function () {
|
||||
return false;
|
||||
|
|
|
@ -86,7 +86,7 @@ $json_file = url_get_contents("{$global['webSiteRootURL']}plugin/CustomizeAdvanc
|
|||
// convert the string to a json object
|
||||
$advancedCustom = json_decode($json_file);
|
||||
$thisScriptFile = pathinfo($_SERVER["SCRIPT_FILENAME"]);
|
||||
if (((empty($advancedCustom->userMustBeLoggedIn) && empty($advancedCustom->disableNavbar)) || $thisScriptFile["basename"] === "signUp.php") || User::isLogged()) {
|
||||
if (((empty($advancedCustomUser->userMustBeLoggedIn) && empty($advancedCustom->disableNavbar)) || $thisScriptFile["basename"] === "signUp.php") || User::isLogged()) {
|
||||
$updateFiles = getUpdatesFilesArray();
|
||||
?>
|
||||
<nav class="navbar navbar-default navbar-fixed-top ">
|
||||
|
@ -197,7 +197,7 @@ if (((empty($advancedCustom->userMustBeLoggedIn) && empty($advancedCustom->disab
|
|||
<i class="<?php echo isset($advancedCustom->uploadButtonDropdownIcon) ? $advancedCustom->uploadButtonDropdownIcon : "fas fa-video"; ?>"></i> <?php echo!empty($advancedCustom->uploadButtonDropdownText) ? $advancedCustom->uploadButtonDropdownText : ""; ?> <span class="caret"></span>
|
||||
</button>
|
||||
<?php
|
||||
if ((isset($advancedCustom->onlyVerifiedEmailCanUpload) && $advancedCustom->onlyVerifiedEmailCanUpload && User::isVerified()) || (isset($advancedCustom->onlyVerifiedEmailCanUpload) && !$advancedCustom->onlyVerifiedEmailCanUpload) || !isset($advancedCustom->onlyVerifiedEmailCanUpload)
|
||||
if ((isset($advancedCustomUser->onlyVerifiedEmailCanUpload) && $advancedCustomUser->onlyVerifiedEmailCanUpload && User::isVerified()) || (isset($advancedCustomUser->onlyVerifiedEmailCanUpload) && !$advancedCustomUser->onlyVerifiedEmailCanUpload) || !isset($advancedCustomUser->onlyVerifiedEmailCanUpload)
|
||||
) {
|
||||
?>
|
||||
<ul class="dropdown-menu dropdown-menu-right" role="menu" style="">
|
||||
|
|
|
@ -96,7 +96,7 @@ if ($playNowVideo['type'] == "linkVideo") {
|
|||
copyToClipboard($('#textAreaEmbed').val());
|
||||
}, iconClass: 'fas fa-code'
|
||||
}
|
||||
<?php if ($config->getAllow_download()) { ?>
|
||||
<?php if (CustomizeUser::canDownloadVideosFromUser($playNowVideo['users_id'])) { ?>
|
||||
<?php
|
||||
if ($playNowVideo['type'] == "video") {
|
||||
$files = getVideosURL($playNowVideo['filename']);
|
||||
|
|
|
@ -210,7 +210,7 @@ YouPHPTubePlugin::getModeYouTube($v['id']);
|
|||
<body>
|
||||
<?php include $global['systemRootPath'] . 'view/include/navbar.php'; ?>
|
||||
<?php
|
||||
if (!empty($advancedCustom->showChannelBannerOnModeYoutube)) {
|
||||
if (!empty($advancedCustomUser->showChannelBannerOnModeYoutube)) {
|
||||
?>
|
||||
<div class="container" style="margin-bottom: 10px;">
|
||||
<img src="<?php echo User::getBackground($video['users_id']); ?>" class="img img-responsive" />
|
||||
|
@ -299,7 +299,7 @@ YouPHPTubePlugin::getModeYouTube($v['id']);
|
|||
|
||||
<div class="row">
|
||||
<div class="col-md-12 watch8-action-buttons text-muted">
|
||||
<?php if ((($advancedCustom != false) && ($advancedCustom->disableShareAndPlaylist == false)) || ($advancedCustom == false)) { ?>
|
||||
<?php if (empty($advancedCustom->disableShareAndPlaylist)) { ?>
|
||||
<button class="btn btn-default no-outline" id="addBtn" data-placement="bottom">
|
||||
<span class="fa fa-plus"></span> <?php echo __("Add to"); ?>
|
||||
</button>
|
||||
|
@ -418,9 +418,11 @@ YouPHPTubePlugin::getModeYouTube($v['id']);
|
|||
|
||||
});
|
||||
</script>
|
||||
<?php if (CustomizeUser::canShareVideosFromUser($video['users_id'])) { ?>
|
||||
<a href="#" class="btn btn-default no-outline" id="shareBtn">
|
||||
<span class="fa fa-share"></span> <?php echo __("Share"); ?>
|
||||
</a>
|
||||
<?php } ?>
|
||||
<?php } echo YouPHPTubePlugin::getWatchActionButton(); ?>
|
||||
<a href="#" class="btn btn-default no-outline pull-right <?php echo ($video['myVote'] == - 1) ? "myVote" : "" ?>" id="dislikeBtn" <?php if (!User::isLogged()) { ?> data-toggle="tooltip" title="<?php echo __("Don´t like this video? Sign in to make your opinion count."); ?>" <?php } ?>>
|
||||
<span class="fa fa-thumbs-down"></span> <small><?php echo $video['dislikes']; ?></small>
|
||||
|
@ -461,7 +463,7 @@ YouPHPTubePlugin::getModeYouTube($v['id']);
|
|||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<?php if ((($advancedCustom != false) && ($advancedCustom->disableShareAndPlaylist == false)) || ($advancedCustom == false)) { ?>
|
||||
<?php if (CustomizeUser::canShareVideosFromUser($video['users_id'])) { ?>
|
||||
<div class="row bgWhite list-group-item" id="shareDiv">
|
||||
<div class="tabbable-panel">
|
||||
<div class="tabbable-line text-muted">
|
||||
|
|
|
@ -5,10 +5,10 @@ if(!isset($global['systemRootPath'])){
|
|||
}
|
||||
require_once $global['systemRootPath'] . 'objects/user.php';
|
||||
|
||||
$json_file = url_get_contents("{$global['webSiteRootURL']}plugin/CustomizeAdvanced/advancedCustom.json.php");
|
||||
//$json_file = url_get_contents("{$global['webSiteRootURL']}plugin/CustomizeAdvanced/advancedCustom.json.php");
|
||||
// convert the string to a json object
|
||||
$advancedCustom = json_decode($json_file);
|
||||
if(!empty($advancedCustom->disableNativeSignUp)){
|
||||
//$advancedCustom = json_decode($json_file);
|
||||
if(!empty($advancedCustomUser->disableNativeSignUp)){
|
||||
die(__("Sign Up Disabled"));
|
||||
}
|
||||
|
||||
|
|
|
@ -10,9 +10,9 @@ $tagsStr = "";
|
|||
foreach ($tags as $value) {
|
||||
$tagsStr .= "<span class=\"label label-{$value->type} fix-width\">{$value->text}</span>";
|
||||
}
|
||||
$json_file = url_get_contents("{$global['webSiteRootURL']}plugin/CustomizeAdvanced/advancedCustom.json.php");
|
||||
//$json_file = url_get_contents("{$global['webSiteRootURL']}plugin/CustomizeAdvanced/advancedCustom.json.php");
|
||||
// convert the string to a json object
|
||||
$advancedCustom = json_decode($json_file);
|
||||
//$advancedCustom = json_decode($json_file);
|
||||
?>
|
||||
<!DOCTYPE html>
|
||||
<html lang="<?php echo $_SESSION['language']; ?>">
|
||||
|
@ -46,7 +46,7 @@ $advancedCustom = json_decode($json_file);
|
|||
<ul class="nav nav-tabs">
|
||||
<li class="active"><a data-toggle="tab" href="#basicInfo" id="aBasicInfo"><?php echo __("Basic Info") ?></a></li>
|
||||
|
||||
<?php if (empty($advancedCustom->disablePersonalInfo)) { ?>
|
||||
<?php if (empty($advancedCustomUser->disablePersonalInfo)) { ?>
|
||||
<li><a data-toggle="tab" href="#personalInfo" id="aPersonalInfo"><?php echo __("Personal Info") ?></a></li>
|
||||
<?php } ?>
|
||||
</ul>
|
||||
|
@ -58,7 +58,7 @@ $advancedCustom = json_decode($json_file);
|
|||
?>
|
||||
</div>
|
||||
|
||||
<?php if (empty($advancedCustom->disablePersonalInfo)) { ?>
|
||||
<?php if (empty($advancedCustomUser->disablePersonalInfo)) { ?>
|
||||
<div id="personalInfo" class="tab-pane fade" style="padding: 10px 0;">
|
||||
<?php
|
||||
include $global['systemRootPath'] . './view/userPersonalInfo.php';
|
||||
|
|
|
@ -110,6 +110,11 @@
|
|||
<textarea id="textAbout" placeholder="<?php echo __("About"); ?>" class="form-control" ><?php echo $user->getAbout(); ?></textarea>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<?php
|
||||
YouPHPTubePlugin::getMyAccount(User::getId());
|
||||
?>
|
||||
|
||||
<div class="form-group">
|
||||
<div class="col-md-12 ">
|
||||
<div id="croppie"></div>
|
||||
|
@ -199,7 +204,7 @@
|
|||
}, success: function (response) {
|
||||
console.log("SavePersonal");
|
||||
modal.hidePleaseWait();
|
||||
<?php if(empty($advancedCustom->disablePersonalInfo)){ ?>
|
||||
<?php if(empty($advancedCustomUser->disablePersonalInfo)){ ?>
|
||||
savePersonalInfo();
|
||||
<?php } ?>
|
||||
}
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
|
||||
|
||||
<?php
|
||||
if (empty($advancedCustom->disableNativeSignIn)) {
|
||||
if (empty($advancedCustomUser->disableNativeSignIn)) {
|
||||
?>
|
||||
<form class="form-compact well form-horizontal" id="loginForm">
|
||||
|
||||
|
@ -50,7 +50,7 @@
|
|||
<label class="col-md-4 control-label"></label>
|
||||
<div class="col-md-8 inputGroupContainer">
|
||||
<?php
|
||||
if (empty($advancedCustom->disableNativeSignUp)) {
|
||||
if (empty($advancedCustomUser->disableNativeSignUp)) {
|
||||
?>
|
||||
<small><a href="#" class="btn" id="forgotPassword"><?php echo __("I forgot my password"); ?></a></small>
|
||||
<?php
|
||||
|
@ -67,7 +67,7 @@
|
|||
|
||||
</form>
|
||||
<?php
|
||||
if (empty($advancedCustom->disableNativeSignUp)) {
|
||||
if (empty($advancedCustomUser->disableNativeSignUp)) {
|
||||
?>
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
<?php
|
||||
if(!empty($advancedCustom->disablePersonalInfo)){
|
||||
if(!empty($advancedCustomUser->disablePersonalInfo)){
|
||||
return false;
|
||||
}
|
||||
require_once $global['systemRootPath'] . 'plugin/User_Location/Objects/IP2Location.php';
|
||||
|
|
|
@ -56,7 +56,7 @@ if (!empty($video['clean_title'])) {
|
|||
$get = array();
|
||||
|
||||
$get = array('channelName' => @$_GET['channelName'], 'catName' => @$_GET['catName']);
|
||||
if (!empty($_GET['channelName']) && empty($advancedCustom->hideRemoveChannelFromModeYoutube)) {
|
||||
if (!empty($_GET['channelName']) && empty($advancedCustomUser->hideRemoveChannelFromModeYoutube)) {
|
||||
$user = User::getChannelOwner($_GET['channelName']);
|
||||
//var_dump($user);exit;
|
||||
?>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue