mirror of
https://github.com/DanielnetoDotCom/YouPHPTube
synced 2025-10-03 09:49:28 +02:00
Add a permission plugin that allow selected user accounts can become moderators, but without being named admin and thus giving them full control over all functions
some layouts improvements
This commit is contained in:
parent
73adc55b08
commit
a9925e44bc
69 changed files with 4149 additions and 1753 deletions
|
@ -161,7 +161,7 @@ class Comment {
|
|||
$sql .= " AND videos_id = ? ";
|
||||
$format .= "i";
|
||||
$values[] = $videoId;
|
||||
}else if(!User::isAdmin() && empty ($comments_id_pai)){
|
||||
}else if(!Permissions::canAdminComment() && empty ($comments_id_pai)){
|
||||
if(!User::isLogged()){
|
||||
die("can not see comments");
|
||||
}
|
||||
|
@ -217,7 +217,7 @@ class Comment {
|
|||
$sql .= " AND videos_id = ? ";
|
||||
$format .= "i";
|
||||
$values[] = $videoId;
|
||||
}else if(!User::isAdmin() && empty ($comments_id_pai)){
|
||||
}else if(!Permissions::canAdminComment() && empty ($comments_id_pai)){
|
||||
if(!User::isLogged()){
|
||||
die("can not see comments");
|
||||
}
|
||||
|
@ -262,7 +262,7 @@ class Comment {
|
|||
if(!User::isLogged()){
|
||||
return false;
|
||||
}
|
||||
if(User::isAdmin()){
|
||||
if(Permissions::canAdminComment()){
|
||||
return true;
|
||||
}
|
||||
$obj = new Comment("", 0, $comments_id);
|
||||
|
@ -280,7 +280,7 @@ class Comment {
|
|||
if(!User::isLogged()){
|
||||
return false;
|
||||
}
|
||||
if(User::isAdmin()){
|
||||
if(Permissions::canAdminComment()){
|
||||
return true;
|
||||
}
|
||||
$obj = new Comment("", 0, $comments_id);
|
||||
|
|
|
@ -10,7 +10,7 @@ $obj = new stdClass();
|
|||
$obj->error = true;
|
||||
$obj->msg = "";
|
||||
|
||||
if (!User::isAdmin()) {
|
||||
if (!Permissions::canClearCache()) {
|
||||
$obj->msg = __("Permission denied");
|
||||
die(json_encode($obj));
|
||||
}
|
||||
|
|
|
@ -13,7 +13,7 @@ $obj = new stdClass();
|
|||
$obj->error = true;
|
||||
$obj->msg = "";
|
||||
|
||||
if (!User::isAdmin()) {
|
||||
if (!Permissions::canGenerateSiteMap()) {
|
||||
$obj->msg = __("Permission denied");
|
||||
die(json_encode($obj));
|
||||
}
|
||||
|
|
29
objects/functiondiskUsageBars.php
Normal file
29
objects/functiondiskUsageBars.php
Normal file
|
@ -0,0 +1,29 @@
|
|||
<?php
|
||||
$getDiskUsage = getDiskUsage();
|
||||
?>
|
||||
<div class="clearfix" style="margin: 10px 12px;">
|
||||
<div class="progress" style="margin: 2px;">
|
||||
<div class="progress-bar progress-bar-success" role="progressbar" style="width:<?php echo $getDiskUsage->videos_dir_used_percentage; ?>%">
|
||||
<?php echo $getDiskUsage->videos_dir_used_percentage; ?>%
|
||||
</div>
|
||||
<div class="progress-bar progress-bar-warning" role="progressbar" style="width:<?php echo $getDiskUsage->disk_used_percentage - $getDiskUsage->videos_dir_used_percentage; ?>%">
|
||||
<?php echo $getDiskUsage->disk_used_percentage - $getDiskUsage->videos_dir_used_percentage; ?>%
|
||||
</div>
|
||||
<div class="progress-bar progress-bar-default" role="progressbar" style="width:<?php echo $getDiskUsage->disk_free_space_percentage; ?>%">
|
||||
<?php echo $getDiskUsage->disk_free_space_percentage; ?>%
|
||||
</div>
|
||||
</div>
|
||||
<div class="label label-success">
|
||||
<?php echo __("Videos Directory"); ?>: <?php echo $getDiskUsage->videos_dir_human; ?> (<?php echo $getDiskUsage->videos_dir_used_percentage; ?>%)
|
||||
</div>
|
||||
<div class="label label-warning">
|
||||
<?php echo __("Other Files"); ?>: <?php echo $getDiskUsage->disk_used_human; ?> (<?php echo $getDiskUsage->disk_used_percentage - $getDiskUsage->videos_dir_used_percentage; ?>%)
|
||||
</div>
|
||||
<div class="label label-primary">
|
||||
<?php echo __("Free Space"); ?>: <?php echo $getDiskUsage->disk_free_space_human; ?> (<?php echo $getDiskUsage->disk_free_space_percentage; ?>%)
|
||||
</div>
|
||||
</div>
|
||||
<?php
|
||||
if ($getDiskUsage->disk_free_space_percentage < 15) {
|
||||
echo "<script>$(document).ready(function () {avideoAlertHTMLText('Danger','Your Disk is almost Full, you have only <strong>{$getDiskUsage->disk_free_space_percentage}%</strong> free <br> ({$getDiskUsage->disk_free_space_human})', 'error');});</script>";
|
||||
}
|
106
objects/functiongetOpenGraph.php
Normal file
106
objects/functiongetOpenGraph.php
Normal file
|
@ -0,0 +1,106 @@
|
|||
<?php
|
||||
echo "<!-- OpenGraph -->";
|
||||
if (empty($videos_id)) {
|
||||
echo "<!-- OpenGraph no video id -->";
|
||||
if (!empty($_GET['videoName'])) {
|
||||
echo "<!-- OpenGraph videoName {$_GET['videoName']} -->";
|
||||
$video = Video::getVideoFromCleanTitle($_GET['videoName']);
|
||||
}
|
||||
} else {
|
||||
echo "<!-- OpenGraph videos_id {$videos_id} -->";
|
||||
$video = Video::getVideoLight($videos_id);
|
||||
}
|
||||
if (empty($video)) {
|
||||
echo "<!-- OpenGraph no video -->";
|
||||
return false;
|
||||
}
|
||||
$videos_id = $video['id'];
|
||||
$source = Video::getSourceFile($video['filename']);
|
||||
$imgw = 1024;
|
||||
$imgh = 768;
|
||||
if (($video['type'] !== "audio") && ($video['type'] !== "linkAudio") && !empty($source['url'])) {
|
||||
$img = $source['url'];
|
||||
$data = getimgsize($source['path']);
|
||||
$imgw = $data[0];
|
||||
$imgh = $data[1];
|
||||
} else if ($video['type'] == "audio") {
|
||||
$img = "{$global['webSiteRootURL']}view/img/audio_wave.jpg";
|
||||
}
|
||||
$type = 'video';
|
||||
if ($video['type'] === 'pdf') {
|
||||
$type = 'pdf';
|
||||
}
|
||||
if ($video['type'] === 'article') {
|
||||
$type = 'article';
|
||||
}
|
||||
$images = Video::getImageFromFilename($video['filename'], $type);
|
||||
if (!empty($images->posterPortrait) && basename($images->posterPortrait) !== 'notfound_portrait.jpg' && basename($images->posterPortrait) !== 'pdf_portrait.png' && basename($images->posterPortrait) !== 'article_portrait.png') {
|
||||
$img = $images->posterPortrait;
|
||||
$data = getimgsize($images->posterPortraitPath);
|
||||
$imgw = $data[0];
|
||||
$imgh = $data[1];
|
||||
} else {
|
||||
$img = $images->poster;
|
||||
}
|
||||
$twitter_site = $advancedCustom->twitter_site;
|
||||
?>
|
||||
<link rel="image_src" href="<?php echo $img; ?>" />
|
||||
<meta property="og:image" content="<?php echo $img; ?>" />
|
||||
<meta property="og:image:secure_url" content="<?php echo $img; ?>" />
|
||||
<meta property="og:image:type" content="image/jpeg" />
|
||||
<meta property="og:image:width" content="<?php echo $imgw; ?>" />
|
||||
<meta property="og:image:height" content="<?php echo $imgh; ?>" />
|
||||
|
||||
<meta property="fb:app_id" content="774958212660408" />
|
||||
<meta property="og:title" content="<?php echo html2plainText($video['title']); ?>" />
|
||||
<meta property="og:description" content="<?php echo html2plainText($video['description']); ?>" />
|
||||
<meta property="og:url" content="<?php echo Video::getLinkToVideo($videos_id); ?>" />
|
||||
<meta property="og:type" content="video.other" />
|
||||
|
||||
<?php
|
||||
$sourceMP4 = Video::getSourceFile($video['filename'], ".mp4");
|
||||
if (!AVideoPlugin::isEnabledByName("SecureVideosDirectory") && !empty($sourceMP4['url'])) {
|
||||
?>
|
||||
<meta property="og:video" content="<?php echo $sourceMP4['url']; ?>" />
|
||||
<meta property="og:video:secure_url" content="<?php echo $sourceMP4['url']; ?>" />
|
||||
<meta property="og:video:type" content="video/mp4" />
|
||||
<meta property="og:video:width" content="<?php echo $imgw; ?>" />
|
||||
<meta property="og:video:height" content="<?php echo $imgh; ?>" />
|
||||
<?php
|
||||
} else {
|
||||
?>
|
||||
<meta property="og:video" content="<?php echo Video::getLinkToVideo($videos_id); ?>" />
|
||||
<meta property="og:video:secure_url" content="<?php echo Video::getLinkToVideo($videos_id); ?>" />
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
<meta property="video:duration" content="<?php echo Video::getItemDurationSeconds($video['duration']); ?>" />
|
||||
<meta property="duration" content="<?php echo Video::getItemDurationSeconds($video['duration']); ?>" />
|
||||
|
||||
<!-- Twitter cards -->
|
||||
<?php
|
||||
if (!empty($advancedCustom->twitter_player)) {
|
||||
?>
|
||||
<meta name="twitter:card" content="player" />
|
||||
<meta name="twitter:player" content="<?php echo Video::getLinkToVideo($videos_id, $video['clean_title'], true); ?>" />
|
||||
<meta name="twitter:player:width" content="480" />
|
||||
<meta name="twitter:player:height" content="480" />
|
||||
<?php
|
||||
} else {
|
||||
if (!empty($advancedCustom->twitter_summary_large_image)) {
|
||||
?>
|
||||
<meta name="twitter:card" content="summary_large_image" />
|
||||
<?php
|
||||
} else {
|
||||
?>
|
||||
<meta name="twitter:card" content="summary" />
|
||||
<?php
|
||||
}
|
||||
}
|
||||
?>
|
||||
<meta name="twitter:site" content="<?php echo $twitter_site; ?>" />
|
||||
<meta name="twitter:url" content="<?php echo Video::getLinkToVideo($videos_id); ?>"/>
|
||||
<meta name="twitter:title" content="<?php echo html2plainText($video['title']); ?>"/>
|
||||
<meta name="twitter:description" content="<?php echo html2plainText($video['description']); ?>"/>
|
||||
<meta name="twitter:image" content="<?php echo $img; ?>"/>
|
||||
<?php
|
184
objects/functiongetShareMenu.php
Normal file
184
objects/functiongetShareMenu.php
Normal file
|
@ -0,0 +1,184 @@
|
|||
<?php
|
||||
$objSecure = AVideoPlugin::getObjectDataIfEnabled('SecureVideosDirectory');
|
||||
?>
|
||||
<div class="<?php echo $class; ?>" id="shareDiv">
|
||||
<div class="tabbable-panel">
|
||||
<div class="tabbable-line text-muted">
|
||||
<ul class="nav nav-tabs">
|
||||
<li class="nav-item">
|
||||
<a class="nav-link " href="#tabShare" data-toggle="tab">
|
||||
<span class="fa fa-share"></span>
|
||||
<?php echo __("Share"); ?>
|
||||
</a>
|
||||
</li>
|
||||
|
||||
<?php
|
||||
if (empty($objSecure->disableEmbedMode)) {
|
||||
?>
|
||||
<li class="nav-item">
|
||||
<a class="nav-link " href="#tabEmbed" data-toggle="tab">
|
||||
<span class="fa fa-code"></span>
|
||||
<?php echo __("Embed"); ?>
|
||||
</a>
|
||||
</li>
|
||||
<?php
|
||||
}
|
||||
if (empty($advancedCustom->disableEmailSharing)) {
|
||||
?>
|
||||
|
||||
<li class="nav-item">
|
||||
<a class="nav-link" href="#tabEmail" data-toggle="tab">
|
||||
<span class="fa fa-envelope"></span>
|
||||
<?php echo __("E-mail"); ?>
|
||||
</a>
|
||||
</li>
|
||||
<?php
|
||||
}
|
||||
if (!empty($permaLink) && $permaLink !== $URLFriendly) {
|
||||
?>
|
||||
<li class="nav-item">
|
||||
<a class="nav-link" href="#tabPermaLink" data-toggle="tab">
|
||||
<span class="fa fa-link"></span>
|
||||
<?php echo __("Permanent Link"); ?>
|
||||
</a>
|
||||
</li>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
</ul>
|
||||
<div class="tab-content clearfix">
|
||||
<div class="tab-pane active" id="tabShare">
|
||||
<?php
|
||||
$url = $permaLink;
|
||||
$title = urlencode($title);
|
||||
include $global['systemRootPath'] . 'view/include/social.php';
|
||||
?>
|
||||
</div>
|
||||
<div class="tab-pane" id="tabEmbed">
|
||||
<h4><span class="glyphicon glyphicon-share"></span> <?php echo __("Share Video"); ?> (Iframe): <?php echo getButtontCopyToClipboard('textAreaEmbed'); ?></h4>
|
||||
<textarea class="form-control" style="min-width: 100%" rows="5" id="textAreaEmbed" readonly="readonly"><?php
|
||||
$code = str_replace("{embedURL}", $embedURL, $advancedCustom->embedCodeTemplate);
|
||||
echo htmlentities($code);
|
||||
?>
|
||||
</textarea>
|
||||
<h4><span class="glyphicon glyphicon-share"></span> <?php echo __("Share Video"); ?> (Object): <?php echo getButtontCopyToClipboard('textAreaEmbedObject'); ?></h4>
|
||||
<textarea class="form-control" style="min-width: 100%" rows="5" id="textAreaEmbedObject" readonly="readonly"><?php
|
||||
$code = str_replace("{embedURL}", $embedURL, $advancedCustom->embedCodeTemplateObject);
|
||||
echo htmlentities($code);
|
||||
?>
|
||||
</textarea>
|
||||
</div>
|
||||
<?php
|
||||
if (empty($advancedCustom->disableEmailSharing)) {
|
||||
?>
|
||||
<div class="tab-pane" id="tabEmail">
|
||||
<?php if (!User::isLogged()) { ?>
|
||||
<strong>
|
||||
<a href="<?php echo $global['webSiteRootURL']; ?>user"><?php echo __("Sign in now!"); ?></a>
|
||||
</strong>
|
||||
<?php } else { ?>
|
||||
<form class="well form-horizontal" action="<?php echo $global['webSiteRootURL']; ?>sendEmail" method="post" id="contact_form">
|
||||
<fieldset>
|
||||
<!-- Text input-->
|
||||
<div class="form-group">
|
||||
<label class="col-md-4 control-label"><?php echo __("E-mail"); ?></label>
|
||||
<div class="col-md-8 inputGroupContainer">
|
||||
<div class="input-group">
|
||||
<span class="input-group-addon"><i class="glyphicon glyphicon-envelope"></i></span>
|
||||
<input name="email" placeholder="<?php echo __("E-mail Address"); ?>" class="form-control" type="text">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Text area -->
|
||||
|
||||
<div class="form-group">
|
||||
<label class="col-md-4 control-label"><?php echo __("Message"); ?></label>
|
||||
<div class="col-md-8 inputGroupContainer">
|
||||
<div class="input-group">
|
||||
<span class="input-group-addon"><i class="glyphicon glyphicon-pencil"></i></span>
|
||||
<textarea class="form-control" name="comment" placeholder="<?php echo __("Message"); ?>"><?php echo __("I would like to share this video with you:"); ?> <?php echo $URLFriendly; ?></textarea>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-md-4 control-label"><?php echo __("Type the code"); ?></label>
|
||||
<div class="col-md-8 inputGroupContainer">
|
||||
<div class="input-group">
|
||||
<span class="input-group-addon"><img src="<?php echo $global['webSiteRootURL']; ?>captcha?<?php echo time(); ?>" id="captcha"></span>
|
||||
<span class="input-group-addon"><span class="btn btn-xs btn-success" id="btnReloadCapcha"><span class="glyphicon glyphicon-refresh"></span></span></span>
|
||||
<input name="captcha" placeholder="<?php echo __("Type the code"); ?>" class="form-control" type="text" style="height: 60px;" maxlength="5" id="captchaText">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- Button -->
|
||||
<div class="form-group">
|
||||
<label class="col-md-4 control-label"></label>
|
||||
<div class="col-md-8">
|
||||
<button type="submit" class="btn btn-primary" ><?php echo __("Send"); ?> <span class="glyphicon glyphicon-send"></span></button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</fieldset>
|
||||
</form>
|
||||
<script>
|
||||
$(document).ready(function () {
|
||||
$('#btnReloadCapcha').click(function () {
|
||||
$('#captcha').attr('src', '<?php echo $global['webSiteRootURL']; ?>captcha?' + Math.random());
|
||||
$('#captchaText').val('');
|
||||
});
|
||||
$('#contact_form').submit(function (evt) {
|
||||
evt.preventDefault();
|
||||
modal.showPleaseWait();
|
||||
$.ajax({
|
||||
url: '<?php echo $global['webSiteRootURL']; ?>objects/sendEmail.json.php',
|
||||
data: $('#contact_form').serializeArray(),
|
||||
type: 'post',
|
||||
success: function (response) {
|
||||
modal.hidePleaseWait();
|
||||
if (!response.error) {
|
||||
avideoAlert("<?php echo __("Congratulations!"); ?>", "<?php echo __("Your message has been sent!"); ?>", "success");
|
||||
} else {
|
||||
avideoAlert("<?php echo __("Your message could not be sent!"); ?>", response.error, "error");
|
||||
}
|
||||
$('#btnReloadCapcha').trigger('click');
|
||||
}
|
||||
});
|
||||
return false;
|
||||
});
|
||||
});
|
||||
</script>
|
||||
<?php } ?>
|
||||
</div>
|
||||
|
||||
<?php
|
||||
}
|
||||
if (!empty($permaLink) && $permaLink !== $URLFriendly) {
|
||||
?>
|
||||
<div class="tab-pane" id="tabPermaLink">
|
||||
<div class="form-group">
|
||||
<label class="control-label"><?php echo __("Permanent Link") ?></label>
|
||||
<?php
|
||||
getInputCopyToClipboard('linkPermanent', $permaLink);
|
||||
?>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="control-label"><?php echo __("URL Friendly") ?> (SEO)</label>
|
||||
<?php
|
||||
getInputCopyToClipboard('linkFriendly', $URLFriendly);
|
||||
?>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="control-label"><?php echo __("Current Time") ?> (SEO)</label>
|
||||
<?php
|
||||
getInputCopyToClipboard('linkCurrentTime', $URLFriendly);
|
||||
?>
|
||||
</div>
|
||||
</div>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
54
objects/functionogSite.php
Normal file
54
objects/functionogSite.php
Normal file
|
@ -0,0 +1,54 @@
|
|||
<?php
|
||||
echo "<!-- OpenGraph for the Site -->";
|
||||
if ($users_id = isChannel()) {
|
||||
$imgw = 200;
|
||||
$imgh = 200;
|
||||
$img = User::getOGImage($users_id);
|
||||
$title = User::getNameIdentificationById($users_id);
|
||||
$url = User::getChannelLink($users_id);
|
||||
?>
|
||||
<meta property="og:type" content="profile" />
|
||||
<meta property="profile:username" content="<?php echo $title; ?>" />
|
||||
<?php
|
||||
} else if (!isVideo()) {
|
||||
$imgw = 200;
|
||||
$imgh = 200;
|
||||
$img = Configuration::getOGImage();
|
||||
$title = html2plainText($config->getWebSiteTitle());
|
||||
$url = $global['webSiteRootURL'];
|
||||
?>
|
||||
<meta property="og:type" content="website" />
|
||||
<meta property="og:site_name" content="<?php echo $title; ?>">
|
||||
<?php
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
?>
|
||||
<link rel="image_src" href="<?php echo $img; ?>" />
|
||||
<meta property="og:image" content="<?php echo $img; ?>" />
|
||||
<meta property="og:image:url" content="<?php echo $img; ?>" />
|
||||
<meta property="og:image:secure_url" content="<?php echo $img; ?>" />
|
||||
<meta property="og:image:type" content="image/jpeg" />
|
||||
<meta property="og:image:width" content="<?php echo $imgw; ?>" />
|
||||
<meta property="og:image:height" content="<?php echo $imgh; ?>" />
|
||||
|
||||
<meta property="fb:app_id" content="774958212660408" />
|
||||
<meta property="og:title" content="<?php echo $title; ?>" />
|
||||
<meta property="og:description" content="<?php echo $title; ?>" />
|
||||
<meta property="og:url" content="<?php echo $url; ?>" />
|
||||
|
||||
<?php
|
||||
if (!empty($advancedCustom->twitter_summary_large_image)) {
|
||||
?>
|
||||
<meta name="twitter:card" content="summary_large_image" />
|
||||
<?php
|
||||
} else {
|
||||
?>
|
||||
<meta name="twitter:card" content="summary" />
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
<meta name="twitter:url" content="<?php echo $global['webSiteRootURL']; ?>"/>
|
||||
<meta name="twitter:title" content="<?php echo $title; ?>"/>
|
||||
<meta name="twitter:description" content="<?php echo $title; ?>"/>
|
||||
<meta name="twitter:image" content="<?php echo $img; ?>"/>
|
File diff suppressed because it is too large
Load diff
|
@ -168,7 +168,7 @@ class Plugin extends ObjectYPT {
|
|||
static function isEnabledByName($name) {
|
||||
$row = static::getPluginByName($name);
|
||||
if ($row) {
|
||||
return $row['status'] == 'active';
|
||||
return $row['status'] == 'active' && AVideoPlugin::isPluginTablesInstalled($name, true);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
@ -176,7 +176,7 @@ class Plugin extends ObjectYPT {
|
|||
static function isEnabledByUUID($uuid) {
|
||||
$row = static::getPluginByUUID($uuid);
|
||||
if ($row) {
|
||||
return $row['status'] == 'active';
|
||||
return $row['status'] == 'active' && AVideoPlugin::isPluginTablesInstalled($row['name'], true);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
@ -220,6 +220,7 @@ class Plugin extends ObjectYPT {
|
|||
$obj->pluginversion = $p->getPluginVersion();
|
||||
$obj->pluginversionMarketPlace = (!empty($pluginsMarketplace->plugins->{$obj->uuid}) ? $pluginsMarketplace->plugins->{$obj->uuid}->pluginversion : 0);
|
||||
$obj->pluginversionCompare = (!empty($obj->pluginversionMarketPlace) ? version_compare($obj->pluginversion, $obj->pluginversionMarketPlace) : 0);
|
||||
$obj->permissions = $obj->enabled?Permissions::getPluginPermissions($obj->id):array();
|
||||
if ($obj->pluginversionCompare < 0) {
|
||||
$obj->tags[] = "update";
|
||||
}
|
||||
|
|
|
@ -282,7 +282,7 @@ if (typeof gtag !== \"function\") {
|
|||
$name = $parts[0];
|
||||
// do not exceed 36 chars to leave some room for the unique id;
|
||||
$name = substr($name, 0, 36);
|
||||
if (!User::isAdmin()) {
|
||||
if (!Permissions::canAdminUsers()) {
|
||||
$user = self::getUserFromChannelName($name);
|
||||
if ($user && $user['id'] !== User::getId()) {
|
||||
return self::_recommendChannelName($name . "_" . uniqid(), $try + 1);
|
||||
|
@ -695,7 +695,11 @@ if (typeof gtag !== \"function\") {
|
|||
if (empty($rows)) {
|
||||
// check if any plugin restrict access to this video
|
||||
if (!AVideoPlugin::userCanWatchVideo(User::getId(), $videos_id)) {
|
||||
_error_log("User::canWatchVideo there is no usergorup set for this video but A plugin said user [" . User::getId() . "] can not see ({$videos_id})");
|
||||
if(User::isLogged()){
|
||||
_error_log("User::canWatchVideo there is no usergorup set for this video but A plugin said user [" . User::getId() . "] can not see ({$videos_id})");
|
||||
}else{
|
||||
_error_log("User::canWatchVideo there is no usergorup set for this video but A plugin said user [not logged] can not see ({$videos_id})");
|
||||
}
|
||||
return false;
|
||||
} else {
|
||||
return true; // the video is public
|
||||
|
@ -1185,7 +1189,7 @@ if (typeof gtag !== \"function\") {
|
|||
}
|
||||
unset($user['password']);
|
||||
unset($user['recoverPass']);
|
||||
if (!User::isAdmin() && $user['id'] !== User::getId()) {
|
||||
if (!Permissions::canAdminUsers() && $user['id'] !== User::getId()) {
|
||||
unset($user['first_name']);
|
||||
unset($user['last_name']);
|
||||
unset($user['address']);
|
||||
|
@ -1273,7 +1277,7 @@ if (typeof gtag !== \"function\") {
|
|||
}
|
||||
|
||||
static function getAllUsers($ignoreAdmin = false, $searchFields = array('name', 'email', 'user', 'channelName', 'about'), $status = "") {
|
||||
if (!self::isAdmin() && !$ignoreAdmin) {
|
||||
if (!Permissions::canAdminUsers() && !$ignoreAdmin) {
|
||||
return false;
|
||||
}
|
||||
//will receive
|
||||
|
@ -1318,7 +1322,7 @@ if (typeof gtag !== \"function\") {
|
|||
}
|
||||
unset($row['password']);
|
||||
unset($row['recoverPass']);
|
||||
if (!User::isAdmin() && $row['id'] !== User::getId()) {
|
||||
if (!Permissions::canAdminUsers() && $row['id'] !== User::getId()) {
|
||||
unset($row['first_name']);
|
||||
unset($row['last_name']);
|
||||
unset($row['address']);
|
||||
|
@ -1362,7 +1366,7 @@ if (typeof gtag !== \"function\") {
|
|||
}
|
||||
|
||||
static function getTotalUsers($ignoreAdmin = false, $status = "") {
|
||||
if (!self::isAdmin() && !$ignoreAdmin) {
|
||||
if (!Permissions::canAdminUsers() && !$ignoreAdmin) {
|
||||
return false;
|
||||
}
|
||||
//will receive
|
||||
|
@ -1465,8 +1469,11 @@ if (typeof gtag !== \"function\") {
|
|||
|
||||
static function canUpload($doNotCheckPlugins = false) {
|
||||
global $global, $config, $advancedCustomUser;
|
||||
if(Permissions::canModerateVideos()){
|
||||
return true;
|
||||
}
|
||||
if (User::isAdmin()) {
|
||||
//return true;
|
||||
return true;
|
||||
}
|
||||
if (empty($doNotCheckPlugins) && !AVideoPlugin::userCanUpload(User::getId())) {
|
||||
return false;
|
||||
|
@ -1506,6 +1513,11 @@ if (typeof gtag !== \"function\") {
|
|||
if (self::isAdmin()) {
|
||||
return true;
|
||||
}
|
||||
|
||||
if(Permissions::canAdminComment()){
|
||||
return true;
|
||||
}
|
||||
|
||||
if ($config->getAuthCanComment()) {
|
||||
if (empty($advancedCustomUser->unverifiedEmailsCanNOTComment)) {
|
||||
return self::isLogged();
|
||||
|
|
|
@ -6,7 +6,7 @@ if (empty($global['systemRootPath'])) {
|
|||
$_REQUEST["do_not_login"]=1;
|
||||
require_once $global['systemRootPath'] . 'videos/configuration.php';
|
||||
require_once $global['systemRootPath'] . 'objects/user.php';
|
||||
if (!User::isAdmin()) {
|
||||
if (!Permissions::canAdminUsers()) {
|
||||
die('{"error":"'.__("Permission denied").'"}');
|
||||
}
|
||||
session_write_close();
|
||||
|
|
|
@ -63,7 +63,16 @@ class UserGroups {
|
|||
$formats = "s";
|
||||
$values = array($this->group_name);
|
||||
}
|
||||
return sqlDAL::writeSql($sql,$formats,$values);
|
||||
if(sqlDAL::writeSql($sql,$formats,$values)){
|
||||
if (empty($this->id)) {
|
||||
$id = $global['mysqli']->insert_id;
|
||||
} else {
|
||||
$id = $this->id;
|
||||
}
|
||||
return $id;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
function delete() {
|
||||
|
@ -191,7 +200,7 @@ class UserGroups {
|
|||
// for users
|
||||
|
||||
static function updateUserGroups($users_id, $array_groups_id, $byPassAdmin=false){
|
||||
if (!$byPassAdmin && !User::isAdmin()) {
|
||||
if (!$byPassAdmin && !Permissions::canAdminUsers()) {
|
||||
return false;
|
||||
}
|
||||
if (!is_array($array_groups_id)) {
|
||||
|
|
|
@ -1,15 +1,33 @@
|
|||
<?php
|
||||
|
||||
header('Content-Type: application/json');
|
||||
global $global, $config;
|
||||
if(!isset($global['systemRootPath'])){
|
||||
if (!isset($global['systemRootPath'])) {
|
||||
require_once '../videos/configuration.php';
|
||||
}
|
||||
require_once $global['systemRootPath'] . 'objects/user.php';
|
||||
if (!User::isAdmin()) {
|
||||
die('{"error":"'.__("Permission denied").'"}');
|
||||
if (!Permissions::canAdminUserGroups()) {
|
||||
die('{"error":"' . __("Permission denied") . '"}');
|
||||
}
|
||||
|
||||
require_once 'userGroups.php';
|
||||
$obj = new UserGroups(@$_POST['id']);
|
||||
$obj->setGroup_name($_POST['group_name']);
|
||||
echo '{"status":"'.$obj->save().'"}';
|
||||
|
||||
if ($groups_id = $obj->save()) {
|
||||
if(User::isAdmin()){
|
||||
Users_groups_permissions::deleteAllFromGroup($groups_id);
|
||||
if (!empty($_REQUEST['permissions']) && is_array($_REQUEST['permissions'])) {
|
||||
foreach ($_REQUEST['permissions'] as $key=>$value) {
|
||||
if(!is_array($value)){
|
||||
continue;
|
||||
}
|
||||
foreach ($value as $value2) {
|
||||
Users_groups_permissions::add($key, $groups_id, $value2);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
echo '{"status":"' . $groups_id . '"}';
|
||||
|
|
|
@ -284,7 +284,7 @@ if (!class_exists('Video')) {
|
|||
}
|
||||
|
||||
if (!empty($this->id)) {
|
||||
if (!$this->userCanManageVideo() && !$allowOfflineUser) {
|
||||
if (!$this->userCanManageVideo() && !$allowOfflineUser && !Permissions::canModerateVideos()) {
|
||||
header('Content-Type: application/json');
|
||||
die('{"error":"3 ' . __("Permission denied") . '"}');
|
||||
}
|
||||
|
@ -610,7 +610,7 @@ if (!class_exists('Video')) {
|
|||
static function getUserGroupsCanSeeSQL() {
|
||||
global $global;
|
||||
|
||||
if (User::isAdmin()) {
|
||||
if (Permissions::canModerateVideos()) {
|
||||
return "";
|
||||
}
|
||||
$sql = " (SELECT count(id) FROM videos_group_view as gv WHERE gv.videos_id = v.id ) = 0 ";
|
||||
|
@ -940,7 +940,7 @@ if (!class_exists('Video')) {
|
|||
$sql .= " AND v.users_id NOT IN ('" . implode("','", $blockedUsers) . "') ";
|
||||
}
|
||||
|
||||
if ($showOnlyLoggedUserVideos === true && !User::isAdmin()) {
|
||||
if ($showOnlyLoggedUserVideos === true && !Permissions::canModerateVideos()) {
|
||||
$uid = intval(User::getId());
|
||||
$sql .= " AND v.users_id = '{$uid}'";
|
||||
} elseif (!empty($showOnlyLoggedUserVideos)) {
|
||||
|
@ -1273,7 +1273,7 @@ if (!class_exists('Video')) {
|
|||
if (!empty($blockedUsers)) {
|
||||
$sql .= " AND v.users_id NOT IN ('" . implode("','", $blockedUsers) . "') ";
|
||||
}
|
||||
if ($showOnlyLoggedUserVideos === true && !User::isAdmin()) {
|
||||
if ($showOnlyLoggedUserVideos === true && !Permissions::canModerateVideos()) {
|
||||
$sql .= " AND v.users_id = '" . User::getId() . "'";
|
||||
} elseif (!empty($showOnlyLoggedUserVideos)) {
|
||||
$sql .= " AND v.users_id = '{$showOnlyLoggedUserVideos}'";
|
||||
|
@ -1388,7 +1388,7 @@ if (!class_exists('Video')) {
|
|||
$sql .= " AND v.status = '{$status}'";
|
||||
}
|
||||
|
||||
if ($showOnlyLoggedUserVideos === true && !User::isAdmin()) {
|
||||
if ($showOnlyLoggedUserVideos === true && !Permissions::canModerateVideos()) {
|
||||
$sql .= " AND v.users_id = '" . User::getId() . "'";
|
||||
} elseif (is_int($showOnlyLoggedUserVideos)) {
|
||||
$sql .= " AND v.users_id = '{$showOnlyLoggedUserVideos}'";
|
||||
|
@ -1515,7 +1515,7 @@ if (!class_exists('Video')) {
|
|||
$viewable[] = "u";
|
||||
} else if (!empty($_GET['videoName'])) {
|
||||
$post = $_POST;
|
||||
if (self::isOwnerFromCleanTitle($_GET['videoName']) || User::isAdmin()) {
|
||||
if (self::isOwnerFromCleanTitle($_GET['videoName']) || Permissions::canModerateVideos()) {
|
||||
$viewable[] = "u";
|
||||
}
|
||||
$_POST = $post;
|
||||
|
@ -1854,6 +1854,18 @@ if (!class_exists('Video')) {
|
|||
return static::getCleanDuration(@$ThisFileInfo['playtime_string']);
|
||||
}
|
||||
|
||||
static function getResolution($file) {
|
||||
global $global;
|
||||
require_once($global['systemRootPath'] . 'objects/getid3/getid3.php');
|
||||
if (!file_exists($file)) {
|
||||
_error_log('{"status":"error", "msg":"getResolution ERROR, File (' . $file . ') Not Found"}');
|
||||
return 0;
|
||||
}
|
||||
$getID3 = new getID3;
|
||||
$ThisFileInfo = $getID3->analyze($file);
|
||||
return intval(@$ThisFileInfo['video']['resolution_y']);
|
||||
}
|
||||
|
||||
static function getHLSDurationFromFile($file) {
|
||||
$plugin = AVideoPlugin::loadPluginIfEnabled("VideoHLS");
|
||||
if (empty($plugin)) {
|
||||
|
@ -1956,7 +1968,7 @@ if (!class_exists('Video')) {
|
|||
|
||||
function userCanManageVideo() {
|
||||
global $advancedCustomUser;
|
||||
if (User::isAdmin()) {
|
||||
if (Permissions::canAdminVideos()) {
|
||||
return true;
|
||||
}
|
||||
if (empty($this->users_id) || !User::canUpload()) {
|
||||
|
@ -2376,6 +2388,10 @@ if (!class_exists('Video')) {
|
|||
if ($user->getIsAdmin()) {
|
||||
return true;
|
||||
}
|
||||
|
||||
if(Permissions::canAdminVideos()){
|
||||
return true;
|
||||
}
|
||||
|
||||
return self::isOwner($videos_id, $users_id);
|
||||
}
|
||||
|
@ -2723,6 +2739,34 @@ if (!class_exists('Video')) {
|
|||
return $path_parts['filename'];
|
||||
}
|
||||
}
|
||||
|
||||
static function getHigestResolution($filename) {
|
||||
$cacheName = "getHigestResolution($filename)";
|
||||
$return = ObjectYPT::getCache($cacheName, 0);
|
||||
if(!empty($return)){
|
||||
return object_to_array($return);
|
||||
}
|
||||
$sources = getVideosURL_V2($filename);
|
||||
$return = array();
|
||||
foreach ($sources as $key => $value) {
|
||||
if($value['type']==='video'){
|
||||
$parts = explode("_", $key);
|
||||
$resolution = intval(@$parts[1]);
|
||||
if(empty($resolution)){
|
||||
$resolution = self::getResolution($value["path"]);
|
||||
}
|
||||
if(!isset($return['resolution']) || $resolution > $return['resolution']){
|
||||
$return = $value;
|
||||
$return['resolution'] = $resolution;
|
||||
$return['resolution_text'] = getResolutionText($return['resolution']);
|
||||
$return['resolution_label'] = getResolutionLabel($return['resolution']);
|
||||
$return['resolution_string'] = trim($resolution."p {$return['resolution_label']}");
|
||||
}
|
||||
}
|
||||
}
|
||||
ObjectYPT::setCache($cacheName, $return);
|
||||
return $return;
|
||||
}
|
||||
|
||||
static function getHigestResolutionVideoMP4Source($filename, $includeS3 = false) {
|
||||
$types = array('', '_HD', '_SD', '_Low');
|
||||
|
|
|
@ -16,7 +16,7 @@ $info = $infoObj = "";
|
|||
require_once 'video.php';
|
||||
|
||||
if (!empty($_POST['id'])) {
|
||||
if (!Video::canEdit($_POST['id'])) {
|
||||
if (!Video::canEdit($_POST['id']) && !Permissions::canModerateVideos()) {
|
||||
die('{"error":"2 ' . __("Permission denied") . '"}');
|
||||
}
|
||||
}
|
||||
|
@ -96,14 +96,14 @@ $obj->setNext_videos_id($_POST['next_videos_id']);
|
|||
if (!empty($_POST['description'])) {
|
||||
$obj->setDescription($_POST['description']);
|
||||
}
|
||||
if (empty($advancedCustomUser->userCanNotChangeCategory) || User::isAdmin()) {
|
||||
if (empty($advancedCustomUser->userCanNotChangeCategory) || Permissions::canModerateVideos()) {
|
||||
$obj->setCategories_id($_POST['categories_id']);
|
||||
}
|
||||
|
||||
if (empty($advancedCustomUser->userCanNotChangeUserGroup) || User::isAdmin()) {
|
||||
if (empty($advancedCustomUser->userCanNotChangeUserGroup) || Permissions::canModerateVideos()) {
|
||||
$obj->setVideoGroups(empty($_POST['videoGroups']) ? array() : $_POST['videoGroups']);
|
||||
}
|
||||
if ($advancedCustomUser->userCanChangeVideoOwner || User::isAdmin()) {
|
||||
if ($advancedCustomUser->userCanChangeVideoOwner || Permissions::canModerateVideos()) {
|
||||
$obj->setUsers_id($_POST['users_id']);
|
||||
}
|
||||
|
||||
|
|
|
@ -8,7 +8,7 @@ require_once $global['systemRootPath'] . 'objects/user.php';
|
|||
if(!empty($_GET['id'])){
|
||||
$_POST['id'] = $_GET['id'];
|
||||
}
|
||||
if (!User::isAdmin() || empty($_POST['id'])) {
|
||||
if (!Permissions::canModerateVideos() || empty($_POST['id'])) {
|
||||
die('{"error":"'.__("Permission denied").'"}');
|
||||
}
|
||||
|
||||
|
|
|
@ -21,7 +21,7 @@ foreach ($_POST['id'] as $value) {
|
|||
if (empty($obj)) {
|
||||
die("Object not found");
|
||||
}
|
||||
if (!$obj->userCanManageVideo()) {
|
||||
if (!$obj->userCanManageVideo() && !Permissions::canModerateVideos()) {
|
||||
$obj->msg = __("You can not Manage This Video");
|
||||
die(json_encode($obj));
|
||||
}
|
||||
|
|
|
@ -5,7 +5,7 @@ if(!isset($global['systemRootPath'])){
|
|||
require_once '../videos/configuration.php';
|
||||
}
|
||||
require_once $global['systemRootPath'] . 'objects/user.php';
|
||||
if (!User::isAdmin()) {
|
||||
if (!Permissions::canModerateVideos()) {
|
||||
die('{"error":"'.__("Permission denied").'"}');
|
||||
}
|
||||
require_once $global['systemRootPath'] . 'objects/video.php';
|
||||
|
|
|
@ -10,7 +10,7 @@ $obj = new stdClass();
|
|||
$obj->msg = "";
|
||||
$obj->error = true;
|
||||
|
||||
if (($advancedCustom->disableVideoSwap) || ($advancedCustom->makeSwapVideosOnlyForAdmin && !User::isAdmin())) {
|
||||
if (($advancedCustom->disableVideoSwap) || ($advancedCustom->makeSwapVideosOnlyForAdmin && !Permissions::canModerateVideos())) {
|
||||
$obj->msg = __("Swap Disabled");
|
||||
die(json_encode($obj));
|
||||
}
|
||||
|
|
|
@ -12,7 +12,7 @@ $obj->msg = "";
|
|||
$obj->error = true;
|
||||
|
||||
|
||||
if (!User::isAdmin()) {
|
||||
if (!Permissions::canModerateVideos()) {
|
||||
$obj->msg = __("Permission denied");
|
||||
die(json_encode($obj));
|
||||
}
|
||||
|
|
|
@ -314,7 +314,7 @@ class VideoStatistic extends ObjectYPT {
|
|||
. " LEFT JOIN videos v ON v.id = videos_id "
|
||||
. " WHERE DATE(s.created) >= DATE_SUB(DATE(NOW()), INTERVAL {$daysLimit} DAY) ";
|
||||
|
||||
if ($showOnlyLoggedUserVideos === true && !User::isAdmin()) {
|
||||
if ($showOnlyLoggedUserVideos === true && !Permissions::canModerateVideos()) {
|
||||
$sql .= " AND v.users_id = '" . User::getId() . "'";
|
||||
} elseif (!empty($showOnlyLoggedUserVideos)) {
|
||||
$sql .= " AND v.users_id = '{$showOnlyLoggedUserVideos}'";
|
||||
|
|
|
@ -8,14 +8,14 @@ require_once $global['systemRootPath'] . 'objects/video.php';
|
|||
require_once $global['systemRootPath'] . 'objects/functions.php';
|
||||
header('Content-Type: application/json');
|
||||
$showOnlyLoggedUserVideos = true;
|
||||
if (User::isAdmin()) {
|
||||
if (Permissions::canModerateVideos()) {
|
||||
$showOnlyLoggedUserVideos = false;
|
||||
}
|
||||
$showUnlisted = false;
|
||||
$activeUsersOnly = true;
|
||||
if(!empty($_REQUEST['showAll'])){
|
||||
$showUnlisted = true;
|
||||
if(User::isAdmin()){
|
||||
if(Permissions::canModerateVideos()){
|
||||
$activeUsersOnly = false;
|
||||
}
|
||||
}
|
||||
|
@ -37,6 +37,7 @@ foreach ($videos as $key => $value) {
|
|||
$videos[$key]['title'] = preg_replace('/[\x00-\x1F\x7F]/u', '', $videos[$key]['title']);
|
||||
$videos[$key]['clean_title'] = preg_replace('/[\x00-\x1F\x7F]/u', '', $videos[$key]['clean_title']);
|
||||
$videos[$key]['typeLabels'] = Video::getVideoTypeLabels($videos[$key]['filename']);
|
||||
$videos[$key]['maxResolution'] = Video::getHigestResolution($videos[$key]['filename']);
|
||||
if(!empty($videos[$key]['next_videos_id'])){
|
||||
unset($_POST['searchPhrase']);
|
||||
$videos[$key]['next_video'] = Video::getVideo($videos[$key]['next_videos_id']);
|
||||
|
|
|
@ -8,7 +8,7 @@ require_once $global['systemRootPath'] . 'objects/video.php';
|
|||
require_once $global['systemRootPath'] . 'objects/functions.php';
|
||||
header('Content-type: text/plain');
|
||||
$showOnlyLoggedUserVideos = true;
|
||||
if (User::isAdmin()) {
|
||||
if (Permissions::canModerateVideos()) {
|
||||
$showOnlyLoggedUserVideos = false;
|
||||
}
|
||||
$videos = Video::getAllVideosLight('', $showOnlyLoggedUserVideos, false);
|
||||
|
|
File diff suppressed because it is too large
Load diff
|
@ -227,7 +227,7 @@ function createGallerySection($videos, $crc = "", $get = array(), $ignoreAds = f
|
|||
</a>
|
||||
|
||||
<div class="text-muted galeryDetails" style="overflow: hidden;">
|
||||
<div>
|
||||
<div class="galleryTags">
|
||||
<?php if (empty($_GET['catName'])) { ?>
|
||||
<a class="label label-default" href="<?php echo $global['webSiteRootURL']; ?>cat/<?php echo $value['clean_category']; ?>">
|
||||
<?php
|
||||
|
|
|
@ -200,4 +200,10 @@ a.h6{
|
|||
-webkit-box-pack:center;
|
||||
display:-webkit-box;
|
||||
font-weight: bold;
|
||||
}
|
||||
.galleryTags .label{
|
||||
display: table-cell;
|
||||
}
|
||||
.galleryTags{
|
||||
margin: 1px;
|
||||
}
|
271
plugin/Permissions/Objects/Users_groups_permissions.php
Normal file
271
plugin/Permissions/Objects/Users_groups_permissions.php
Normal file
|
@ -0,0 +1,271 @@
|
|||
<?php
|
||||
|
||||
require_once dirname(__FILE__) . '/../../../videos/configuration.php';
|
||||
|
||||
class Users_groups_permissions extends ObjectYPT {
|
||||
|
||||
protected $id, $name, $users_groups_id, $plugins_id, $type, $status;
|
||||
|
||||
static function getSearchFieldsNames() {
|
||||
return array('name');
|
||||
}
|
||||
|
||||
static function getTableName() {
|
||||
return 'users_groups_permissions';
|
||||
}
|
||||
|
||||
static function getAllUsers_groups() {
|
||||
global $global;
|
||||
$table = "users_groups";
|
||||
$sql = "SELECT * FROM {$table} WHERE 1=1 ";
|
||||
|
||||
$sql .= self::getSqlFromPost();
|
||||
$res = sqlDAL::readSql($sql);
|
||||
$fullData = sqlDAL::fetchAllAssoc($res);
|
||||
sqlDAL::close($res);
|
||||
$rows = array();
|
||||
if ($res != false) {
|
||||
foreach ($fullData as $row) {
|
||||
$rows[] = $row;
|
||||
}
|
||||
} else {
|
||||
_error_log($sql . ' Error : (' . $global['mysqli']->errno . ') ' . $global['mysqli']->error);
|
||||
}
|
||||
return $rows;
|
||||
}
|
||||
|
||||
static function getAllPlugins() {
|
||||
global $global;
|
||||
$table = "plugins";
|
||||
$sql = "SELECT * FROM {$table} WHERE 1=1 ";
|
||||
|
||||
$sql .= self::getSqlFromPost();
|
||||
$res = sqlDAL::readSql($sql);
|
||||
$fullData = sqlDAL::fetchAllAssoc($res);
|
||||
sqlDAL::close($res);
|
||||
$rows = array();
|
||||
if ($res != false) {
|
||||
foreach ($fullData as $row) {
|
||||
$rows[] = $row;
|
||||
}
|
||||
} else {
|
||||
_error_log($sql . ' Error : (' . $global['mysqli']->errno . ') ' . $global['mysqli']->error);
|
||||
}
|
||||
return $rows;
|
||||
}
|
||||
|
||||
function setId($id) {
|
||||
$this->id = intval($id);
|
||||
}
|
||||
|
||||
function setName($name) {
|
||||
$this->name = $name;
|
||||
}
|
||||
|
||||
function setusers_groups_id($users_groups_id) {
|
||||
$this->users_groups_id = intval($users_groups_id);
|
||||
}
|
||||
|
||||
function setPlugins_id($plugins_id) {
|
||||
$this->plugins_id = intval($plugins_id);
|
||||
}
|
||||
|
||||
function setType($type) {
|
||||
$this->type = intval($type);
|
||||
}
|
||||
|
||||
function setStatus($status) {
|
||||
$this->status = $status;
|
||||
}
|
||||
|
||||
function getId() {
|
||||
return intval($this->id);
|
||||
}
|
||||
|
||||
function getName() {
|
||||
return $this->name;
|
||||
}
|
||||
|
||||
function getusers_groups_id() {
|
||||
return intval($this->users_groups_id);
|
||||
}
|
||||
|
||||
function getPlugins_id() {
|
||||
return intval($this->plugins_id);
|
||||
}
|
||||
|
||||
function getType() {
|
||||
return $this->type;
|
||||
}
|
||||
|
||||
function getStatus() {
|
||||
return $this->status;
|
||||
}
|
||||
|
||||
static function deleteAllFromGroup($groups_id){
|
||||
global $global;
|
||||
$groups_id = intval($groups_id);
|
||||
if (!empty($groups_id)) {
|
||||
$sql = "DELETE FROM " . static::getTableName() . " ";
|
||||
$sql .= " WHERE users_groups_id = ?";
|
||||
$global['lastQuery'] = $sql;
|
||||
//_error_log("Delete Query: ".$sql);
|
||||
return sqlDAL::writeSql($sql, "i", array($groups_id));
|
||||
}
|
||||
_error_log("Id for table " . static::getTableName() . " not defined for deletion", AVideoLog::$ERROR);
|
||||
return false;
|
||||
}
|
||||
|
||||
static function add($pluginName, $users_groups_id, $type){
|
||||
$row = Plugin::getPluginByName($pluginName);
|
||||
if(!empty($row['id'])){
|
||||
$o = new Users_groups_permissions(0);
|
||||
$o->setusers_groups_id($users_groups_id);
|
||||
$o->setPlugins_id($row['id']);
|
||||
$o->setType($type);
|
||||
return $o->save();
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
static function getAllFromUserGorup($users_groups_id, $activeOnly = true) {
|
||||
global $global, $getAllPermissionsFromUserGorup;
|
||||
$users_groups_id = intval($users_groups_id);
|
||||
if(empty($users_groups_id)){
|
||||
return array();
|
||||
}
|
||||
if(empty($getAllPermissionsFromUserGorup)){
|
||||
$getAllPermissionsFromUserGorup = array();
|
||||
}
|
||||
if(isset($getAllPermissionsFromUserGorup[$users_groups_id])){
|
||||
return $getAllPermissionsFromUserGorup[$users_groups_id];
|
||||
}
|
||||
$sql = "SELECT * FROM " . static::getTableName() . " ";
|
||||
$sql .= " WHERE users_groups_id = ?";
|
||||
if($activeOnly){
|
||||
$sql .= " and status = 'a' ";
|
||||
}
|
||||
$res = sqlDAL::readSql($sql, "i", array($users_groups_id));
|
||||
$fullData = sqlDAL::fetchAllAssoc($res);
|
||||
sqlDAL::close($res);
|
||||
$rows = array();
|
||||
if ($res != false) {
|
||||
foreach ($fullData as $row) {
|
||||
$plugin = new Plugin($row['plugins_id']);
|
||||
if(empty($rows[$plugin->getName()])){
|
||||
$rows[$plugin->getName()] = array();
|
||||
}
|
||||
$rows[$plugin->getName()][] = $row['type'];
|
||||
}
|
||||
} else {
|
||||
_error_log($sql . ' Error : (' . $global['mysqli']->errno . ') ' . $global['mysqli']->error);
|
||||
}
|
||||
$getAllPermissionsFromUserGorup[$users_groups_id] = $rows;
|
||||
return $rows;
|
||||
}
|
||||
|
||||
|
||||
static function getAllFromPluginAndType($plugins_id, $type, $activeOnly = true) {
|
||||
global $global, $getAllPermissionsFromPlugin;
|
||||
$plugins_id = intval($plugins_id);
|
||||
if(empty($plugins_id)){
|
||||
return array();
|
||||
}
|
||||
if(empty($getAllPermissionsFromUserGorup)){
|
||||
$getAllPermissionsFromUserGorup = array();
|
||||
}
|
||||
if(isset($getAllPermissionsFromUserGorup[$plugins_id])){
|
||||
return $getAllPermissionsFromUserGorup[$plugins_id];
|
||||
}
|
||||
$sql = "SELECT * FROM " . static::getTableName() . " ";
|
||||
$sql .= " WHERE plugins_id = ? AND `type` = ?";
|
||||
if($activeOnly){
|
||||
$sql .= " and status = 'a' ";
|
||||
}
|
||||
$res = sqlDAL::readSql($sql, "ii", array($plugins_id, $type));
|
||||
$fullData = sqlDAL::fetchAllAssoc($res);
|
||||
sqlDAL::close($res);
|
||||
$rows = array();
|
||||
if ($res != false) {
|
||||
foreach ($fullData as $row) {
|
||||
$rows[] = $row;
|
||||
}
|
||||
} else {
|
||||
_error_log($sql . ' Error : (' . $global['mysqli']->errno . ') ' . $global['mysqli']->error);
|
||||
}
|
||||
$getAllPermissionsFromUserGorup[$plugins_id] = $rows;
|
||||
return $rows;
|
||||
}
|
||||
|
||||
static function getAllFromPlugin($plugins_id, $activeOnly = true) {
|
||||
global $global, $getAllPermissionsFromPlugin;
|
||||
$plugins_id = intval($plugins_id);
|
||||
if(empty($plugins_id)){
|
||||
return array();
|
||||
}
|
||||
if(empty($getAllPermissionsFromUserGorup)){
|
||||
$getAllPermissionsFromUserGorup = array();
|
||||
}
|
||||
if(isset($getAllPermissionsFromUserGorup[$plugins_id])){
|
||||
return $getAllPermissionsFromUserGorup[$plugins_id];
|
||||
}
|
||||
$sql = "SELECT * FROM " . static::getTableName() . " ";
|
||||
$sql .= " WHERE plugins_id = ?";
|
||||
if($activeOnly){
|
||||
$sql .= " and status = 'a' ";
|
||||
}
|
||||
$res = sqlDAL::readSql($sql, "i", array($plugins_id));
|
||||
$fullData = sqlDAL::fetchAllAssoc($res);
|
||||
sqlDAL::close($res);
|
||||
$rows = array();
|
||||
if ($res != false) {
|
||||
foreach ($fullData as $row) {
|
||||
$rows[] = $row;
|
||||
}
|
||||
} else {
|
||||
_error_log($sql . ' Error : (' . $global['mysqli']->errno . ') ' . $global['mysqli']->error);
|
||||
}
|
||||
$getAllPermissionsFromUserGorup[$plugins_id] = $rows;
|
||||
return $rows;
|
||||
}
|
||||
|
||||
static function getFromUserGroupAndPluginAndType($users_groups_id, $plugins_id, $type, $activeOnly = true) {
|
||||
global $global, $getFromUserGroupAndPluginAndType;
|
||||
$plugins_id = intval($plugins_id);
|
||||
if(empty($plugins_id)){
|
||||
return array();
|
||||
}
|
||||
$name = "$users_groups_id, $plugins_id, $type";
|
||||
if(empty($getFromUserGroupAndPluginAndType)){
|
||||
$getAllPermissionsFromUserGorup = array();
|
||||
}
|
||||
if(isset($getFromUserGroupAndPluginAndType[$name])){
|
||||
return $getFromUserGroupAndPluginAndType[$name];
|
||||
}
|
||||
$sql = "SELECT * FROM " . static::getTableName() . " ";
|
||||
$sql .= " WHERE users_groups_id = ? AND plugins_id = ? AND `type` = ? LIMIT 1";
|
||||
if($activeOnly){
|
||||
$sql .= " and status = 'a' ";
|
||||
}
|
||||
//echo $sql;var_dump($users_groups_id, $plugins_id, $type);
|
||||
$res = sqlDAL::readSql($sql, "iii", array($users_groups_id, $plugins_id, $type), true);
|
||||
$data = sqlDAL::fetchAssoc($res);
|
||||
sqlDAL::close($res);
|
||||
if ($res) {
|
||||
$row = $data;
|
||||
} else {
|
||||
$row = false;
|
||||
}
|
||||
$getFromUserGroupAndPluginAndType[$name] = $row;
|
||||
return $row;
|
||||
}
|
||||
|
||||
public function save() {
|
||||
if(empty($this->status)){
|
||||
$this->status = 'a';
|
||||
}
|
||||
return parent::save();
|
||||
}
|
||||
|
||||
}
|
248
plugin/Permissions/Permissions.php
Normal file
248
plugin/Permissions/Permissions.php
Normal file
|
@ -0,0 +1,248 @@
|
|||
<?php
|
||||
|
||||
global $global;
|
||||
require_once $global['systemRootPath'] . 'plugin/Plugin.abstract.php';
|
||||
|
||||
require_once $global['systemRootPath'] . 'plugin/Permissions/Objects/Users_groups_permissions.php';
|
||||
|
||||
class Permissions extends PluginAbstract {
|
||||
|
||||
const PERMISSION_COMMENTS = 1;
|
||||
const PERMISSION_FULLACCESSVIDEOS = 10;
|
||||
const PERMISSION_INACTIVATEVIDEOS = 11;
|
||||
const PERMISSION_USERS = 20;
|
||||
const PERMISSION_USERGROUPS = 30;
|
||||
const PERMISSION_CACHE = 40;
|
||||
const PERMISSION_SITEMAP = 50;
|
||||
const PERMISSION_LOG = 60;
|
||||
|
||||
public function getDescription() {
|
||||
$desc = "Permissions will allow you to add intermediate permisson to usergroups without need to make them Admin, "
|
||||
. " each plugin will have his own permission rules";
|
||||
//$desc .= $this->isReadyLabel(array('YPTWallet'));
|
||||
return $desc;
|
||||
}
|
||||
|
||||
public function getName() {
|
||||
return "Permissions";
|
||||
}
|
||||
|
||||
public function getUUID() {
|
||||
return "Permissions-5ee8405eaaa16";
|
||||
}
|
||||
|
||||
public function getPluginVersion() {
|
||||
return "1.0";
|
||||
}
|
||||
|
||||
public function updateScript() {
|
||||
global $global;
|
||||
/*
|
||||
if (AVideoPlugin::compareVersion($this->getName(), "2.0") < 0) {
|
||||
sqlDal::executeFile($global['systemRootPath'] . 'plugin/PayPerView/install/updateV2.0.sql');
|
||||
}
|
||||
*
|
||||
*/
|
||||
return true;
|
||||
}
|
||||
|
||||
public function getEmptyDataObject() {
|
||||
$obj = new stdClass();
|
||||
/*
|
||||
$obj->textSample = "text";
|
||||
$obj->checkboxSample = true;
|
||||
$obj->numberSample = 5;
|
||||
|
||||
$o = new stdClass();
|
||||
$o->type = array(0=>__("Default"))+array(1,2,3);
|
||||
$o->value = 0;
|
||||
$obj->selectBoxSample = $o;
|
||||
|
||||
$o = new stdClass();
|
||||
$o->type = "textarea";
|
||||
$o->value = "";
|
||||
$obj->textareaSample = $o;
|
||||
*/
|
||||
return $obj;
|
||||
}
|
||||
|
||||
public function getPluginMenu() {
|
||||
global $global;
|
||||
return '<a href="plugin/Permissions/View/editor.php" class="btn btn-primary btn-sm btn-xs btn-block"><i class="fa fa-edit"></i> Edit</a>';
|
||||
}
|
||||
|
||||
static function getForm() {
|
||||
global $global;
|
||||
$plugins = Plugin::getAllEnabled();
|
||||
foreach ($plugins as $value) {
|
||||
$row = Plugin::getPluginByName($value['dirName']);
|
||||
$p = AVideoPlugin::loadPlugin($value['dirName']);
|
||||
if (is_object($p) && method_exists($p, 'getPermissionsOptions')) {
|
||||
$array = $p->getPermissionsOptions();
|
||||
foreach ($array as $value) {
|
||||
if (!is_object($value)) {
|
||||
continue;
|
||||
}
|
||||
echo "<div class=\"checkbox\">"
|
||||
. "<label data-toggle=\"tooltip\" title=\"" . addcslashes($value->getDescription(), '"') . "\">"
|
||||
. "<input type=\"checkbox\" name=\"permissions[" . $value->getClassName() . "][]\" value=\"" . $value->getType() . "\" class=\"permissions " . $value->getClassName() . "\">" . $value->getName() . " "
|
||||
. "</label>"
|
||||
. " <button type='button' class='btn btn-xs pull-right' data-toggle=\"tooltip\" title=\"" . $value->getClassName() . " Plugin\" onclick=\"pluginPermissionsBtn({$row['id']})\">(" . $value->getClassName() . ")</button>"
|
||||
. "</div>";
|
||||
}
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
static function hasPermission($type, $pluginName) {
|
||||
global $hasPermission;
|
||||
if (!User::isLogged()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (User::isAdmin()) {
|
||||
return true;
|
||||
}
|
||||
|
||||
if (empty($hasPermission)) {
|
||||
$hasPermission = array();
|
||||
}
|
||||
if (empty($hasPermission[$pluginName])) {
|
||||
$hasPermission[$pluginName] = array();
|
||||
}
|
||||
if (isset($hasPermission[$pluginName][$type])) {
|
||||
return $hasPermission[$pluginName][$type];
|
||||
}
|
||||
$hasPermission[$pluginName][$type] = false;
|
||||
$groups = UserGroups::getUserGroups(User::getId());
|
||||
foreach ($groups as $value) {
|
||||
$permissions = Users_groups_permissions::getAllFromUserGorup($value['id']);
|
||||
if (!empty($permissions[$pluginName]) && in_array($type, $permissions[$pluginName])) {
|
||||
$hasPermission[$pluginName][$type] = true;
|
||||
return $hasPermission[$pluginName][$type];
|
||||
}
|
||||
}
|
||||
return $hasPermission[$pluginName][$type];
|
||||
}
|
||||
|
||||
static function canAdminComment() {
|
||||
return self::hasPermission(Permissions::PERMISSION_COMMENTS, 'Permissions');
|
||||
}
|
||||
|
||||
static function canAdminVideos() {
|
||||
return self::hasPermission(Permissions::PERMISSION_FULLACCESSVIDEOS, 'Permissions');
|
||||
}
|
||||
|
||||
static function canModerateVideos() {
|
||||
return self::hasPermission(Permissions::PERMISSION_INACTIVATEVIDEOS, 'Permissions') || self::canAdminVideos();
|
||||
}
|
||||
|
||||
static function canAdminUsers() {
|
||||
return self::hasPermission(Permissions::PERMISSION_USERS, 'Permissions');
|
||||
}
|
||||
|
||||
static function canAdminUserGroups() {
|
||||
return self::hasPermission(Permissions::PERMISSION_USERGROUPS, 'Permissions');
|
||||
}
|
||||
|
||||
static function canClearCache() {
|
||||
return self::hasPermission(Permissions::PERMISSION_CACHE, 'Permissions');
|
||||
}
|
||||
|
||||
static function canGenerateSiteMap() {
|
||||
return self::hasPermission(Permissions::PERMISSION_SITEMAP, 'Permissions');
|
||||
}
|
||||
|
||||
static function canSeeLogs() {
|
||||
return self::hasPermission(Permissions::PERMISSION_LOG, 'Permissions');
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
const COMMENTS = 1;
|
||||
const FULLACCESSVIDEOS = 10;
|
||||
const INACTIVATEVIDEOS = 11;
|
||||
const USERS = 20;
|
||||
const USERGROUPS = 30;
|
||||
const CACHE = 40;
|
||||
const SITEMAP = 50;
|
||||
const LOG = 60;
|
||||
*/
|
||||
function getPermissionsOptions() {
|
||||
$permissions = array();
|
||||
$permissions[] = new PluginPermissionOption(Permissions::PERMISSION_COMMENTS, __("Comments Admin"), __("Can edit and delete comments"), 'Permissions');
|
||||
$permissions[] = new PluginPermissionOption(Permissions::PERMISSION_FULLACCESSVIDEOS, __("Videos Admin"), __("Can edit and delete videos"), 'Permissions');
|
||||
$permissions[] = new PluginPermissionOption(Permissions::PERMISSION_INACTIVATEVIDEOS, __("Videos Moderator"), __("Can Change the video publicity"), 'Permissions');
|
||||
$permissions[] = new PluginPermissionOption(Permissions::PERMISSION_USERS, __("Users Admin"), __("Can edit users, but cannot make them admins"), 'Permissions');
|
||||
$permissions[] = new PluginPermissionOption(Permissions::PERMISSION_USERGROUPS, __("Users Groups Admin"), __("Can edit and delete user groups"), 'Permissions');
|
||||
$permissions[] = new PluginPermissionOption(Permissions::PERMISSION_CACHE, __("Cache Manager"), __("Can clear cache"), 'Permissions');
|
||||
$permissions[] = new PluginPermissionOption(Permissions::PERMISSION_SITEMAP, __("Sitemap"), __("Can generate SiteMap"), 'Permissions');
|
||||
$permissions[] = new PluginPermissionOption(Permissions::PERMISSION_LOG, __("Log"), __("Can see the log file menu"), 'Permissions');
|
||||
return $permissions;
|
||||
}
|
||||
|
||||
static function getPluginPermissions($plugins_id) {
|
||||
global $getPluginPermissions;
|
||||
if(empty($getPluginPermissions)){
|
||||
$getPluginPermissions = array();
|
||||
}
|
||||
if(isset($getPluginPermissions[$plugins_id])){
|
||||
return $getPluginPermissions[$plugins_id];
|
||||
}
|
||||
$plugin = new Plugin($plugins_id);
|
||||
if(empty($plugin)){
|
||||
$getPluginPermissions[$plugins_id] = array();
|
||||
return $getPluginPermissions[$plugins_id];
|
||||
}
|
||||
$p = AVideoPlugin::loadPlugin($plugin->getName());
|
||||
if(empty($p)){
|
||||
$getPluginPermissions[$plugins_id] = array();
|
||||
return $getPluginPermissions[$plugins_id];
|
||||
}
|
||||
$options = $p->getPermissionsOptions();
|
||||
if(empty($options)){
|
||||
$getPluginPermissions[$plugins_id] = array();
|
||||
return $getPluginPermissions[$plugins_id];
|
||||
}
|
||||
$permissions = array();
|
||||
foreach ($options as $key => $value) {
|
||||
$obj = new stdClass();
|
||||
$obj->name = $options[$key]->getName();
|
||||
$obj->type = $options[$key]->getType();
|
||||
$obj->description = $options[$key]->getDescription();
|
||||
$obj->className = $options[$key]->getClassName();
|
||||
$obj->groups = Users_groups_permissions::getAllFromPluginAndType($plugins_id, $value->getType());
|
||||
$permissions[] = $obj;
|
||||
}
|
||||
$getPluginPermissions[$plugins_id] = $permissions;
|
||||
return $getPluginPermissions[$plugins_id];
|
||||
}
|
||||
|
||||
|
||||
static function getPluginPermissionsFromName($pluginName) {
|
||||
$row = Plugin::getPluginByName($pluginName);
|
||||
if(empty($row['id'])){
|
||||
return array();
|
||||
}
|
||||
$plugins_id = $row['id'];
|
||||
return self::getPluginPermissions($plugins_id);
|
||||
}
|
||||
|
||||
static function setPermission($users_groups_id, $plugins_id, $type, $isEnabled) {
|
||||
//var_dump($users_groups_id, $plugins_id, $type, $isEnabled, $_POST);
|
||||
$row = Users_groups_permissions::getFromUserGroupAndPluginAndType($users_groups_id, $plugins_id, $type, false);
|
||||
//var_dump($users_groups_id, $plugins_id, $type, $isEnabled, $row);
|
||||
if(!empty($row['id'])){
|
||||
$ugp = new Users_groups_permissions($row['id']);
|
||||
}else{
|
||||
$ugp = new Users_groups_permissions();
|
||||
$ugp->setusers_groups_id($users_groups_id);
|
||||
$ugp->setPlugins_id($plugins_id);
|
||||
$ugp->setType($type);
|
||||
}
|
||||
$ugp->setStatus($isEnabled?'a':'i');
|
||||
return $ugp->save();
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,28 @@
|
|||
<?php
|
||||
header('Content-Type: application/json');
|
||||
require_once '../../../../videos/configuration.php';
|
||||
require_once $global['systemRootPath'] . 'plugin/Permissions/Objects/Users_groups_permissions.php';
|
||||
|
||||
$obj = new stdClass();
|
||||
$obj->error = true;
|
||||
$obj->msg = "";
|
||||
|
||||
$plugin = AVideoPlugin::loadPluginIfEnabled('Permissions');
|
||||
|
||||
if(!User::isAdmin()){
|
||||
$obj->msg = "You cant do this";
|
||||
die(json_encode($obj));
|
||||
}
|
||||
|
||||
$o = new Users_groups_permissions(@$_POST['id']);
|
||||
$o->setName($_POST['name']);
|
||||
$o->setusers_groups_id($_POST['users_groups_id']);
|
||||
$o->setPlugins_id($_POST['plugins_id']);
|
||||
$o->setType($_POST['type']);
|
||||
$o->setStatus($_POST['status']);
|
||||
|
||||
if($id = $o->save()){
|
||||
$obj->error = false;
|
||||
}
|
||||
|
||||
echo json_encode($obj);
|
|
@ -0,0 +1,20 @@
|
|||
<?php
|
||||
require_once '../../../../videos/configuration.php';
|
||||
require_once $global['systemRootPath'] . 'plugin/Permissions/Objects/Users_groups_permissions.php';
|
||||
header('Content-Type: application/json');
|
||||
|
||||
$obj = new stdClass();
|
||||
$obj->error = true;
|
||||
|
||||
$plugin = AVideoPlugin::loadPluginIfEnabled('Permissions');
|
||||
|
||||
if(!User::isAdmin()){
|
||||
$obj->msg = "You cant do this";
|
||||
die(json_encode($obj));
|
||||
}
|
||||
|
||||
$id = intval($_POST['id']);
|
||||
$row = new Users_groups_permissions($id);
|
||||
$obj->error = !$row->delete();
|
||||
die(json_encode($obj));
|
||||
?>
|
29
plugin/Permissions/View/Users_groups_permissions/index.php
Normal file
29
plugin/Permissions/View/Users_groups_permissions/index.php
Normal file
|
@ -0,0 +1,29 @@
|
|||
<?php
|
||||
global $global, $config;
|
||||
if (!isset($global['systemRootPath'])) {
|
||||
require_once '../../videos/configuration.php';
|
||||
}
|
||||
if (!User::isAdmin()) {
|
||||
header("Location: {$global['webSiteRootURL']}?error=" . __("You can not do this"));
|
||||
exit;
|
||||
}
|
||||
|
||||
?>
|
||||
<!DOCTYPE html>
|
||||
<html lang="<?php echo $_SESSION['language']; ?>">
|
||||
<head>
|
||||
<title><?php echo $config->getWebSiteTitle(); ?> :: Permissions</title>
|
||||
<?php
|
||||
include $global['systemRootPath'] . 'view/include/head.php';
|
||||
include $global['systemRootPath'] . 'plugin/Permissions/View/{$classname}/index_head.php';
|
||||
?>
|
||||
</head>
|
||||
<body class="<?php echo $global['bodyClass']; ?>">
|
||||
<?php
|
||||
include $global['systemRootPath'] . 'view/include/navbar.php';
|
||||
include $global['systemRootPath'] . 'plugin/Permissions/View/{$classname}/index_body.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>
|
226
plugin/Permissions/View/Users_groups_permissions/index_body.php
Normal file
226
plugin/Permissions/View/Users_groups_permissions/index_body.php
Normal file
|
@ -0,0 +1,226 @@
|
|||
<?php
|
||||
global $global, $config;
|
||||
if (!isset($global['systemRootPath'])) {
|
||||
require_once '../../videos/configuration.php';
|
||||
}
|
||||
if (!User::isAdmin()) {
|
||||
header("Location: {$global['webSiteRootURL']}?error=" . __("You can not do this"));
|
||||
exit;
|
||||
}
|
||||
?>
|
||||
|
||||
|
||||
<div class="panel panel-default">
|
||||
<div class="panel-heading">
|
||||
<i class="fas fa-cog"></i> <?php echo __("Configurations"); ?>
|
||||
</div>
|
||||
<div class="panel-body">
|
||||
<div class="row">
|
||||
<div class="col-sm-4">
|
||||
<div class="panel panel-default ">
|
||||
<div class="panel-heading"><i class="far fa-plus-square"></i> <?php echo __("Create"); ?></div>
|
||||
<div class="panel-body">
|
||||
<form id="panelUsers_groups_permissionsForm">
|
||||
<div class="row">
|
||||
<input type="hidden" name="id" id="Users_groups_permissionsid" value="" >
|
||||
<div class="form-group col-sm-12">
|
||||
<label for="Users_groups_permissionsname"><?php echo __("Name"); ?>:</label>
|
||||
<input type="text" id="Users_groups_permissionsname" name="name" class="form-control input-sm" placeholder="<?php echo __("Name"); ?>" required="true">
|
||||
</div>
|
||||
<div class="form-group col-sm-12">
|
||||
<label for="Users_groups_permissionsusers_groups_id"><?php echo __("Users Groups Id1"); ?>:</label>
|
||||
<select class="form-control input-sm" name="users_groups_id" id="Users_groups_permissionsusers_groups_id">
|
||||
<?php
|
||||
$options = Users_groups_permissions::getAllUsers_groups();
|
||||
foreach ($options as $value) {
|
||||
echo '<option value="' . $value['id'] . '">' . $value['id'] . '</option>';
|
||||
}
|
||||
?>
|
||||
</select>
|
||||
</div>
|
||||
<div class="form-group col-sm-12">
|
||||
<label for="Users_groups_permissionsplugins_id"><?php echo __("Plugins Id"); ?>:</label>
|
||||
<select class="form-control input-sm" name="plugins_id" id="Users_groups_permissionsplugins_id">
|
||||
<?php
|
||||
$options = Users_groups_permissions::getAllPlugins();
|
||||
foreach ($options as $value) {
|
||||
echo '<option value="' . $value['id'] . '">' . $value['id'] . '</option>';
|
||||
}
|
||||
?>
|
||||
</select>
|
||||
</div>
|
||||
<div class="form-group col-sm-12">
|
||||
<label for="Users_groups_permissionstype"><?php echo __("Type"); ?>:</label>
|
||||
<input type="number" step="1" id="Users_groups_permissionstype" name="type" class="form-control input-sm" placeholder="<?php echo __("Type"); ?>" required="true">
|
||||
</div>
|
||||
<div class="form-group col-sm-12">
|
||||
<label for="status"><?php echo __("Status"); ?>:</label>
|
||||
<select class="form-control input-sm" name="status" id="Users_groups_permissionsstatus">
|
||||
<option value="a"><?php echo __("Active"); ?></option>
|
||||
<option value="i"><?php echo __("Inactive"); ?></option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="form-group col-sm-12">
|
||||
<div class="btn-group pull-right">
|
||||
<span class="btn btn-success" id="newUsers_groups_permissionsLink" onclick="clearUsers_groups_permissionsForm()"><i class="fas fa-plus"></i> <?php echo __("New"); ?></span>
|
||||
<button class="btn btn-primary" type="submit"><i class="fas fa-save"></i> <?php echo __("Save"); ?></button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-sm-8">
|
||||
<div class="panel panel-default ">
|
||||
<div class="panel-heading"><i class="fas fa-edit"></i> <?php echo __("Edit"); ?></div>
|
||||
<div class="panel-body">
|
||||
<table id="Users_groups_permissionsTable" class="display table table-bordered table-responsive table-striped table-hover table-condensed" width="100%" cellspacing="0">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>#</th>
|
||||
<th><?php echo __("Name"); ?></th>
|
||||
<th><?php echo __("Type"); ?></th>
|
||||
<th><?php echo __("Status"); ?></th>
|
||||
<th></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tfoot>
|
||||
<tr>
|
||||
<th>#</th>
|
||||
<th><?php echo __("Name"); ?></th>
|
||||
<th><?php echo __("Type"); ?></th>
|
||||
<th><?php echo __("Status"); ?></th>
|
||||
<th></th>
|
||||
</tr>
|
||||
</tfoot>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div id="Users_groups_permissionsbtnModelLinks" style="display: none;">
|
||||
<div class="btn-group pull-right">
|
||||
<button href="" class="edit_Users_groups_permissions btn btn-default btn-xs">
|
||||
<i class="fa fa-edit"></i>
|
||||
</button>
|
||||
<button href="" class="delete_Users_groups_permissions btn btn-danger btn-xs">
|
||||
<i class="fa fa-trash"></i>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script type="text/javascript">
|
||||
function clearUsers_groups_permissionsForm() {
|
||||
$('#Users_groups_permissionsid').val('');
|
||||
$('#Users_groups_permissionsname').val('');
|
||||
$('#Users_groups_permissionsusers_groups_id').val('');
|
||||
$('#Users_groups_permissionsplugins_id').val('');
|
||||
$('#Users_groups_permissionstype').val('');
|
||||
$('#Users_groups_permissionsstatus').val('');
|
||||
}
|
||||
$(document).ready(function () {
|
||||
$('#addUsers_groups_permissionsBtn').click(function () {
|
||||
$.ajax({
|
||||
url: '<?php echo $global['webSiteRootURL']; ?>plugin/Permissions/View/addUsers_groups_permissionsVideo.php',
|
||||
data: $('#panelUsers_groups_permissionsForm').serialize(),
|
||||
type: 'post',
|
||||
success: function (response) {
|
||||
if (response.error) {
|
||||
swal("<?php echo __("Sorry!"); ?>", response.msg, "error");
|
||||
} else {
|
||||
swal("<?php echo __("Congratulations!"); ?>", "<?php echo __("Your register has been saved!"); ?>", "success");
|
||||
$("#panelUsers_groups_permissionsForm").trigger("reset");
|
||||
}
|
||||
clearUsers_groups_permissionsForm();
|
||||
tableVideos.ajax.reload();
|
||||
modal.hidePleaseWait();
|
||||
}
|
||||
});
|
||||
});
|
||||
var Users_groups_permissionstableVar = $('#Users_groups_permissionsTable').DataTable({
|
||||
"ajax": "<?php echo $global['webSiteRootURL']; ?>plugin/Permissions/View/Users_groups_permissions/list.json.php",
|
||||
"columns": [
|
||||
{"data": "id"},
|
||||
{"data": "name"},
|
||||
{"data": "type"},
|
||||
{"data": "status"},
|
||||
{
|
||||
sortable: false,
|
||||
data: null,
|
||||
defaultContent: $('#Users_groups_permissionsbtnModelLinks').html()
|
||||
}
|
||||
],
|
||||
select: true,
|
||||
});
|
||||
$('#newUsers_groups_permissions').on('click', function (e) {
|
||||
e.preventDefault();
|
||||
$('#panelUsers_groups_permissionsForm').trigger("reset");
|
||||
$('#Users_groups_permissionsid').val('');
|
||||
});
|
||||
$('#panelUsers_groups_permissionsForm').on('submit', function (e) {
|
||||
e.preventDefault();
|
||||
modal.showPleaseWait();
|
||||
$.ajax({
|
||||
url: '<?php echo $global['webSiteRootURL']; ?>plugin/Permissions/View/Users_groups_permissions/add.json.php',
|
||||
data: $('#panelUsers_groups_permissionsForm').serialize(),
|
||||
type: 'post',
|
||||
success: function (response) {
|
||||
if (response.error) {
|
||||
swal("<?php echo __("Sorry!"); ?>", response.msg, "error");
|
||||
} else {
|
||||
swal("<?php echo __("Congratulations!"); ?>", "<?php echo __("Your register has been saved!"); ?>", "success");
|
||||
$("#panelUsers_groups_permissionsForm").trigger("reset");
|
||||
}
|
||||
Users_groups_permissionstableVar.ajax.reload();
|
||||
$('#Users_groups_permissionsid').val('');
|
||||
modal.hidePleaseWait();
|
||||
}
|
||||
});
|
||||
});
|
||||
$('#Users_groups_permissionsTable').on('click', 'button.delete_Users_groups_permissions', function (e) {
|
||||
e.preventDefault();
|
||||
var tr = $(this).closest('tr')[0];
|
||||
var data = Users_groups_permissionstableVar.row(tr).data();
|
||||
swal({
|
||||
title: "<?php echo __("Are you sure?"); ?>",
|
||||
text: "<?php echo __("You will not be able to recover this action!"); ?>",
|
||||
icon: "warning",
|
||||
buttons: true,
|
||||
dangerMode: true,
|
||||
})
|
||||
.then((willDelete) => {
|
||||
if (willDelete) {
|
||||
modal.showPleaseWait();
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
url: "<?php echo $global['webSiteRootURL']; ?>plugin/Permissions/View/Users_groups_permissions/delete.json.php",
|
||||
data: data
|
||||
|
||||
}).done(function (resposta) {
|
||||
if (resposta.error) {
|
||||
swal("<?php echo __("Sorry!"); ?>", resposta.msg, "error");
|
||||
}
|
||||
Users_groups_permissionstableVar.ajax.reload();
|
||||
modal.hidePleaseWait();
|
||||
});
|
||||
} else {
|
||||
|
||||
}
|
||||
});
|
||||
});
|
||||
$('#Users_groups_permissionsTable').on('click', 'button.edit_Users_groups_permissions', function (e) {
|
||||
e.preventDefault();
|
||||
var tr = $(this).closest('tr')[0];
|
||||
var data = Users_groups_permissionstableVar.row(tr).data();
|
||||
$('#Users_groups_permissionsid').val(data.id);
|
||||
$('#Users_groups_permissionsname').val(data.name);
|
||||
$('#Users_groups_permissionsusers_groups_id').val(data.users_groups_id);
|
||||
$('#Users_groups_permissionsplugins_id').val(data.plugins_id);
|
||||
$('#Users_groups_permissionstype').val(data.type);
|
||||
$('#Users_groups_permissionsstatus').val(data.status);
|
||||
});
|
||||
});
|
||||
</script>
|
|
@ -0,0 +1,5 @@
|
|||
<?php
|
||||
$plugin = AVideoPlugin::loadPluginIfEnabled('Permissions');
|
||||
?>
|
||||
<link rel="stylesheet" type="text/css" href="<?php echo $global['webSiteRootURL']; ?>view/css/DataTables/datatables.min.css"/>
|
||||
<link href="<?php echo $global['webSiteRootURL']; ?>view/js/bootstrap-datetimepicker/css/bootstrap-datetimepicker.min.css" rel="stylesheet" type="text/css"/>
|
|
@ -0,0 +1,8 @@
|
|||
<?php
|
||||
require_once '../../../../videos/configuration.php';
|
||||
require_once $global['systemRootPath'] . 'plugin/Permissions/Objects/Users_groups_permissions.php';
|
||||
header('Content-Type: application/json');
|
||||
|
||||
$rows = Users_groups_permissions::getAll();
|
||||
?>
|
||||
{"data": <?php echo json_encode($rows); ?>}
|
46
plugin/Permissions/View/editor.php
Normal file
46
plugin/Permissions/View/editor.php
Normal file
|
@ -0,0 +1,46 @@
|
|||
<?php
|
||||
require_once '../../../videos/configuration.php';
|
||||
AVideoPlugin::loadPlugin("Permissions");
|
||||
?>
|
||||
<!DOCTYPE html>
|
||||
<html lang="<?php echo $_SESSION['language']; ?>">
|
||||
<head>
|
||||
<title><?php echo $config->getWebSiteTitle(); ?> :: Permissions</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"/>
|
||||
<link href="<?php echo $global['webSiteRootURL']; ?>view/js/bootstrap-datetimepicker/css/bootstrap-datetimepicker.min.css" rel="stylesheet" type="text/css"/>
|
||||
</head>
|
||||
<body class="<?php echo $global['bodyClass']; ?>">
|
||||
<?php
|
||||
include $global['systemRootPath'] . 'view/include/navbar.php';
|
||||
?>
|
||||
<div class="container-fluid">
|
||||
<div class="panel panel-default">
|
||||
<div class="panel-heading"><?php echo __('Permissions') ?>
|
||||
<div class="pull-right">
|
||||
<?php echo AVideoPlugin::getSwitchButton("Permissions"); ?>
|
||||
</div>
|
||||
</div>
|
||||
<div class="panel-body">
|
||||
<ul class="nav nav-tabs">
|
||||
<li class="active"><a data-toggle="tab" href="#Users_groups_permissions"><?php echo __("Users Groups Permissions"); ?></a></li>
|
||||
</ul>
|
||||
<div class="tab-content">
|
||||
<div id="Users_groups_permissions" class="tab-pane fade in active" style="padding: 10px;">
|
||||
<?php
|
||||
include $global['systemRootPath'] . 'plugin/Permissions/View/Users_groups_permissions/index_body.php';
|
||||
?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<script type="text/javascript" src="<?php echo $global['webSiteRootURL']; ?>view/css/DataTables/datatables.min.js"></script>
|
||||
<script src="<?php echo $global['webSiteRootURL']; ?>js/bootstrap-datetimepicker/js/bootstrap-datetimepicker.min.js" type="text/javascript"></script>
|
||||
<?php
|
||||
include $global['systemRootPath'] . 'view/include/footer.php';
|
||||
?>
|
||||
</body>
|
||||
</html>
|
18
plugin/Permissions/getPermissions.json.php
Normal file
18
plugin/Permissions/getPermissions.json.php
Normal file
|
@ -0,0 +1,18 @@
|
|||
<?php
|
||||
|
||||
header('Content-Type: application/json');
|
||||
if (!isset($global['systemRootPath'])) {
|
||||
$configFile = '../../videos/configuration.php';
|
||||
if (file_exists($configFile)) {
|
||||
require_once $configFile;
|
||||
}
|
||||
}
|
||||
$permissions = array();
|
||||
if(!User::isAdmin()){
|
||||
die(json_encode($permissions));
|
||||
}
|
||||
if($_REQUEST['users_groups_id']){
|
||||
$obj = AVideoPlugin::getObjectDataIfEnabled("Permissions");
|
||||
$permissions = Users_groups_permissions::getAllFromUserGorup($_REQUEST['users_groups_id']);
|
||||
}
|
||||
die(json_encode($permissions));
|
94
plugin/Permissions/getPermissionsFromPlugin.html.php
Normal file
94
plugin/Permissions/getPermissionsFromPlugin.html.php
Normal file
|
@ -0,0 +1,94 @@
|
|||
<?php
|
||||
if (!isset($global['systemRootPath'])) {
|
||||
$configFile = '../../videos/configuration.php';
|
||||
if (file_exists($configFile)) {
|
||||
require_once $configFile;
|
||||
}
|
||||
}
|
||||
|
||||
if (!User::isAdmin()) {
|
||||
forbiddenPage("Not admin");
|
||||
}
|
||||
|
||||
$permissions = array();
|
||||
if (empty($_REQUEST['plugins_id'])) {
|
||||
die("empty plugins_id");
|
||||
}
|
||||
|
||||
$obj = AVideoPlugin::getObjectDataIfEnabled("Permissions");
|
||||
$permissions = Permissions::getPluginPermissions($_REQUEST['plugins_id']);
|
||||
$userGroups = UserGroups::getAllUsersGroupsArray();
|
||||
$uid = uniqid();
|
||||
?>
|
||||
<div class="panel panel-default">
|
||||
<div class="panel-heading tabbable-line">
|
||||
<ul class="nav nav-tabs">
|
||||
<?php
|
||||
$count = 0;
|
||||
foreach ($permissions as $key => $value) {
|
||||
$active = "";
|
||||
if (empty($count)) {
|
||||
$active = "active";
|
||||
}
|
||||
$count++;
|
||||
echo "<li class=\"{$active}\"><a data-toggle=\"tab\" href=\"#ptab{$key}{$uid}\">{$value->name}</a></li>";
|
||||
}
|
||||
?>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="panel-body" style="padding: 15px; max-height: 80vh; overflow-y: auto;">
|
||||
<div class="tab-content">
|
||||
<?php
|
||||
$count = 0;
|
||||
foreach ($permissions as $key => $value) {
|
||||
$active = "";
|
||||
if (empty($count)) {
|
||||
$active = " in active";
|
||||
}
|
||||
$count++;
|
||||
?>
|
||||
<div id="ptab<?php echo $key, $uid; ?>" class="tab-pane fade<?php echo $active; ?>">
|
||||
<div class="alert alert-info"><strong><?php echo $value->name; ?>: </strong><?php echo $value->description; ?></div>
|
||||
<?php
|
||||
foreach ($userGroups as $key2 => $group) {
|
||||
$checked = "";
|
||||
foreach ($value->groups as $authorizedGroup) {
|
||||
if ($key2 == $authorizedGroup["users_groups_id"]) {
|
||||
$checked = "checked";
|
||||
break;
|
||||
}
|
||||
}
|
||||
?>
|
||||
<div class="material-small material-switch pull-left">
|
||||
<input name="pluginPermission<?php echo $key2; ?>"
|
||||
id="pluginPermission<?php echo $key2, $uid; ?>_<?php echo $value->type; ?>"
|
||||
type="checkbox" value="0" <?php echo $checked; ?>
|
||||
onchange="updatePluginPermission<?php echo $uid; ?>(<?php echo $key2; ?>, <?php echo $_REQUEST['plugins_id']; ?>, <?php echo $value->type; ?>)"
|
||||
/>
|
||||
<label for="pluginPermission<?php echo $key2, $uid; ?>_<?php echo $value->type; ?>" class="label-success"> </label>
|
||||
</div> <?php echo $group; ?><br>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
</div>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<script>
|
||||
function updatePluginPermission<?php echo $uid; ?>(users_groups_id, plugins_id, type) {
|
||||
console.log(users_groups_id, plugins_id, type);
|
||||
modal.showPleaseWait();
|
||||
$.ajax({
|
||||
url: '<?php echo $global['webSiteRootURL']; ?>plugin/Permissions/setPermission.json.php',
|
||||
data: {"users_groups_id": users_groups_id, "plugins_id": plugins_id, "type": type, "isEnabled": $('#pluginPermission'+users_groups_id+'<?php echo $uid; ?>_'+type).is(":checked")},
|
||||
type: 'post',
|
||||
success: function (response) {
|
||||
console.log(response);
|
||||
modal.hidePleaseWait();
|
||||
}
|
||||
});
|
||||
}
|
||||
</script>
|
18
plugin/Permissions/getPermissionsFromPlugin.json.php
Normal file
18
plugin/Permissions/getPermissionsFromPlugin.json.php
Normal file
|
@ -0,0 +1,18 @@
|
|||
<?php
|
||||
|
||||
header('Content-Type: application/json');
|
||||
if (!isset($global['systemRootPath'])) {
|
||||
$configFile = '../../videos/configuration.php';
|
||||
if (file_exists($configFile)) {
|
||||
require_once $configFile;
|
||||
}
|
||||
}
|
||||
if(!User::isAdmin()){
|
||||
forbiddenPage("Not admin");
|
||||
}
|
||||
$permissions = array();
|
||||
if($_REQUEST['plugins_id']){
|
||||
$obj = AVideoPlugin::getObjectDataIfEnabled("Permissions");
|
||||
$permissions = Users_groups_permissions::getAllFromPlugin($_REQUEST['plugins_id']);
|
||||
}
|
||||
die(json_encode($permissions));
|
23
plugin/Permissions/install/install.sql
Normal file
23
plugin/Permissions/install/install.sql
Normal file
|
@ -0,0 +1,23 @@
|
|||
CREATE TABLE IF NOT EXISTS `users_groups_permissions` (
|
||||
`id` INT NOT NULL AUTO_INCREMENT,
|
||||
`name` VARCHAR(45) NULL,
|
||||
`users_groups_id` INT(11) NOT NULL,
|
||||
`plugins_id` INT(11) NOT NULL,
|
||||
`type` INT(11) NULL,
|
||||
`status` CHAR(1) NULL,
|
||||
`created` DATETIME NULL,
|
||||
`modified` DATETIME NULL,
|
||||
PRIMARY KEY (`id`),
|
||||
INDEX `fk_permissions_users_groups2_idx` (`users_groups_id` ASC),
|
||||
INDEX `fk_permissions_plugins1_idx` (`plugins_id` ASC),
|
||||
CONSTRAINT `fk_permissions_users_groups2`
|
||||
FOREIGN KEY (`users_groups_id`)
|
||||
REFERENCES `users_groups` (`id`)
|
||||
ON DELETE CASCADE
|
||||
ON UPDATE CASCADE,
|
||||
CONSTRAINT `fk_permissions_plugins1`
|
||||
FOREIGN KEY (`plugins_id`)
|
||||
REFERENCES `plugins` (`id`)
|
||||
ON DELETE CASCADE
|
||||
ON UPDATE CASCADE)
|
||||
ENGINE = InnoDB;
|
30
plugin/Permissions/setPermission.json.php
Normal file
30
plugin/Permissions/setPermission.json.php
Normal file
|
@ -0,0 +1,30 @@
|
|||
<?php
|
||||
|
||||
header('Content-Type: application/json');
|
||||
if (!isset($global['systemRootPath'])) {
|
||||
$configFile = '../../videos/configuration.php';
|
||||
if (file_exists($configFile)) {
|
||||
require_once $configFile;
|
||||
}
|
||||
}
|
||||
if(!User::isAdmin()){
|
||||
forbiddenPage("Not admin");
|
||||
}
|
||||
|
||||
$intvalList = array('users_groups_id','plugins_id','type','isEnabled');
|
||||
foreach ($intvalList as $value) {
|
||||
if($_REQUEST[$value]==='true'){
|
||||
$_REQUEST[$value] = 1;
|
||||
}else{
|
||||
$_REQUEST[$value] = intval($_REQUEST[$value]);
|
||||
}
|
||||
}
|
||||
|
||||
$obj = new stdClass();
|
||||
$obj->id = Permissions::setPermission($_REQUEST['users_groups_id'], $_REQUEST['plugins_id'], $_REQUEST['type'], $_REQUEST['isEnabled']);
|
||||
|
||||
die(json_encode($obj));
|
||||
|
||||
|
||||
|
||||
|
|
@ -322,5 +322,28 @@ class PlayerSkins extends PluginAbstract {
|
|||
}
|
||||
return $config->getAutoplay();
|
||||
}
|
||||
|
||||
public static function getVideoTags($videos_id) {
|
||||
if (empty($videos_id)) {
|
||||
return array();
|
||||
}
|
||||
$name = "PlayeSkins_getVideoTags{$videos_id}";
|
||||
$tags = ObjectYPT::getCache($name,0);
|
||||
if (empty($tags)) {
|
||||
$video = new Video("", "", $videos_id);
|
||||
$fileName = $video->getFilename();
|
||||
$resolution = Video::getHigestResolution($fileName);
|
||||
if (empty($resolution) || empty($resolution['resolution_text'])) {
|
||||
return array();
|
||||
}
|
||||
$obj = new stdClass();
|
||||
$obj->label = 'Plugin';
|
||||
$obj->type = "danger";
|
||||
$obj->text = $resolution['resolution_text']; // closed caption
|
||||
$tags = $obj;
|
||||
ObjectYPT::setCache($name,$tags);
|
||||
}
|
||||
return array($tags);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -492,5 +492,38 @@ abstract class PluginAbstract {
|
|||
public function dataSetup() {
|
||||
return "";
|
||||
}
|
||||
|
||||
|
||||
function getPermissionsOptions(){
|
||||
return array();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
class PluginPermissionOption{
|
||||
private $type, $name, $description, $className;
|
||||
|
||||
function __construct($type, $name, $description, $className) {
|
||||
$this->type = $type;
|
||||
$this->name = $name;
|
||||
$this->description = $description;
|
||||
$this->className = $className;
|
||||
}
|
||||
|
||||
function getType() {
|
||||
return $this->type;
|
||||
}
|
||||
|
||||
function getName() {
|
||||
return $this->name;
|
||||
}
|
||||
|
||||
function getDescription() {
|
||||
return $this->description;
|
||||
}
|
||||
|
||||
function getClassName() {
|
||||
return $this->className;
|
||||
}
|
||||
|
||||
}
|
|
@ -8,6 +8,7 @@ class ShareSocialButtonsOnEmbed extends PluginAbstract {
|
|||
public function getTags() {
|
||||
return array(
|
||||
PluginTags::$FREE,
|
||||
PluginTags::$DEPRECATED,
|
||||
);
|
||||
}
|
||||
|
||||
|
|
|
@ -7,8 +7,9 @@ use Pecee\SimpleRouter\SimpleRouter; //required if we want to define routes on o
|
|||
|
||||
|
||||
class TopMenu extends PluginAbstract {
|
||||
const PERMISSION_CAN_EDIT = 0;
|
||||
|
||||
|
||||
|
||||
public function getTags() {
|
||||
return array(
|
||||
PluginTags::$FREE,
|
||||
|
@ -85,4 +86,14 @@ class TopMenu extends PluginAbstract {
|
|||
return false;
|
||||
return $menuId['id'];
|
||||
}
|
||||
|
||||
function getPermissionsOptions(){
|
||||
$permissions = array();
|
||||
$permissions[] = new PluginPermissionOption(TopMenu::PERMISSION_CAN_EDIT, __("TopMenu"), __("Can edit TopMenu plugin"), 'TopMenu');
|
||||
return $permissions;
|
||||
}
|
||||
|
||||
static function canAdminTopMenu(){
|
||||
return Permissions::hasPermission(TopMenu::PERMISSION_CAN_EDIT,'TopMenu');
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
<?php
|
||||
global $global, $config;
|
||||
if(!isset($global['systemRootPath'])){
|
||||
if (!isset($global['systemRootPath'])) {
|
||||
require_once '../videos/configuration.php';
|
||||
}
|
||||
$metaDescription = "About Page";
|
||||
|
@ -8,7 +8,7 @@ $metaDescription = "About Page";
|
|||
<!DOCTYPE html>
|
||||
<html lang="<?php echo $config->getLanguage(); ?>">
|
||||
<head>
|
||||
<title><?php echo $config->getWebSiteTitle(); ?> :: <?php echo __("About").getSEOComplement(); ?></title>
|
||||
<title><?php echo $config->getWebSiteTitle(); ?> :: <?php echo __("About") . getSEOComplement(); ?></title>
|
||||
<?php
|
||||
include $global['systemRootPath'] . 'view/include/head.php';
|
||||
?>
|
||||
|
@ -19,45 +19,46 @@ $metaDescription = "About Page";
|
|||
include $global['systemRootPath'] . 'view/include/navbar.php';
|
||||
?>
|
||||
|
||||
<div class="container">
|
||||
<div class="bgWhite">
|
||||
<?php
|
||||
$custom = "";
|
||||
if (AVideoPlugin::isEnabled("c4fe1b83-8f5a-4d1b-b912-172c608bf9e3")) {
|
||||
require_once $global['systemRootPath'] . 'plugin/Customize/Objects/ExtraConfig.php';
|
||||
$ec = new ExtraConfig();
|
||||
$custom = $ec->getAbout();
|
||||
}
|
||||
if(empty($custom)){
|
||||
?>
|
||||
<h1><?php echo __("I would humbly like to thank God for giving me the necessary knowledge, motivation, resources and idea to be able to execute this project. Without God's permission this would never be possible."); ?></h1>
|
||||
<blockquote class="blockquote">
|
||||
<h1><?php echo __("For of Him, and through Him, and to Him, are all things: to whom be glory for ever. Amen."); ?></h1>
|
||||
<footer class="blockquote-footer">Apostle Paul in <cite title="Source Title">Romans 11:36</cite></footer>
|
||||
</blockquote>
|
||||
<div class="btn-group btn-group-justified">
|
||||
<a href="https://www.avideo.com/" class="btn btn-success">Main Site</a>
|
||||
<a href="https://demo.avideo.com/" class="btn btn-danger">Demo Site</a>
|
||||
<a href="https://tutorials.avideo.com/" class="btn btn-primary">Tutorials Site</a>
|
||||
<a href="https://github.com/WWBN/AVideo/issues" class="btn btn-warning">Issues and requests Site</a>
|
||||
<div class="container-fluid">
|
||||
<div class="panel panel-default">
|
||||
<div class="panel-body">
|
||||
<?php
|
||||
$custom = "";
|
||||
if (AVideoPlugin::isEnabled("c4fe1b83-8f5a-4d1b-b912-172c608bf9e3")) {
|
||||
require_once $global['systemRootPath'] . 'plugin/Customize/Objects/ExtraConfig.php';
|
||||
$ec = new ExtraConfig();
|
||||
$custom = $ec->getAbout();
|
||||
}
|
||||
if (empty($custom)) {
|
||||
?>
|
||||
<h1><?php echo __("I would humbly like to thank God for giving me the necessary knowledge, motivation, resources and idea to be able to execute this project. Without God's permission this would never be possible."); ?></h1>
|
||||
<blockquote class="blockquote">
|
||||
<h1><?php echo __("For of Him, and through Him, and to Him, are all things: to whom be glory for ever. Amen."); ?></h1>
|
||||
<footer class="blockquote-footer">Apostle Paul in <cite title="Source Title">Romans 11:36</cite></footer>
|
||||
</blockquote>
|
||||
<div class="btn-group btn-group-justified">
|
||||
<a href="https://www.avideo.com/" class="btn btn-success">Main Site</a>
|
||||
<a href="https://demo.avideo.com/" class="btn btn-danger">Demo Site</a>
|
||||
<a href="https://tutorials.avideo.com/" class="btn btn-primary">Tutorials Site</a>
|
||||
<a href="https://github.com/WWBN/AVideo/issues" class="btn btn-warning">Issues and requests Site</a>
|
||||
</div>
|
||||
<span class="label label-success"><?php printf(__("You are running AVideo version %s!"), $config->getVersion()); ?></span>
|
||||
|
||||
<span class="label label-success">
|
||||
<?php printf(__("You can upload max of %s!"), get_max_file_size()); ?>
|
||||
</span>
|
||||
<span class="label label-success">
|
||||
<?php printf(__("You can storage %s minutes of videos!"), (empty($global['videoStorageLimitMinutes']) ? "unlimited" : $global['videoStorageLimitMinutes'])); ?>
|
||||
</span>
|
||||
<span class="label label-success">
|
||||
<?php printf(__("You have %s minutes of videos!"), number_format(getSecondsTotalVideosLength() / 6, 2)); ?>
|
||||
</span>
|
||||
<?php
|
||||
} else {
|
||||
echo $custom;
|
||||
}
|
||||
?>
|
||||
</div>
|
||||
<span class="label label-success"><?php printf(__("You are running AVideo version %s!"), $config->getVersion()); ?></span>
|
||||
|
||||
<span class="label label-success">
|
||||
<?php printf(__("You can upload max of %s!"), get_max_file_size()); ?>
|
||||
</span>
|
||||
<span class="label label-success">
|
||||
<?php printf(__("You can storage %s minutes of videos!"), (empty($global['videoStorageLimitMinutes']) ? "unlimited" : $global['videoStorageLimitMinutes'])); ?>
|
||||
</span>
|
||||
<span class="label label-success">
|
||||
<?php printf(__("You have %s minutes of videos!"), number_format(getSecondsTotalVideosLength() / 6, 2)); ?>
|
||||
</span>
|
||||
<?php
|
||||
}else{
|
||||
echo $custom;
|
||||
}
|
||||
?>
|
||||
|
||||
</div>
|
||||
|
||||
</div><!--/.container-->
|
||||
|
|
|
@ -38,197 +38,202 @@ $palyListsObj = AVideoPlugin::getObjectDataIfEnabled('PlayLists');
|
|||
TimeLogEnd($timeLog, __LINE__);
|
||||
?>
|
||||
<!-- <?php var_dump($uploadedTotalVideos, $user_id, !isToHidePrivateVideos()); ?> -->
|
||||
<div class="bgWhite list-group-item gallery clear clearfix" >
|
||||
<div class="row">
|
||||
<div class="col-lg-12 col-sm-12 col-xs-12">
|
||||
<center style="margin:5px;">
|
||||
<?php
|
||||
echo getAdsChannelLeaderBoardTop();
|
||||
?>
|
||||
</center>
|
||||
</div>
|
||||
</div>
|
||||
<?php
|
||||
if (empty($advancedCustomUser->doNotShowTopBannerOnChannel)) {
|
||||
?>
|
||||
<div class="row bg-info profileBg" style="margin: 20px -10px; background: url('<?php echo $global['webSiteRootURL'], $user->getBackgroundURL(), "?", @filectime($global['systemRootPath'] . $user->getBackgroundURL()); ?>') no-repeat 50% 50%;">
|
||||
<img src="<?php echo User::getPhoto($user_id); ?>" alt="<?php echo $user->_getName(); ?>" class="img img-responsive img-thumbnail" style="max-width: 100px;"/>
|
||||
</div>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
<div class="row"><div class="col-6 col-md-12">
|
||||
<h2 class="pull-left">
|
||||
<?php
|
||||
echo $user->getNameIdentificationBd();
|
||||
?>
|
||||
<?php
|
||||
echo User::getEmailVerifiedIcon($user_id)
|
||||
?></h2>
|
||||
<span class="pull-right">
|
||||
<?php
|
||||
echo User::getBlockUserButton($user_id);
|
||||
echo Subscribe::getButton($user_id);
|
||||
?>
|
||||
</span>
|
||||
</div></div>
|
||||
<div class="col-md-12">
|
||||
<?php echo nl2br($user->getAbout()); ?>
|
||||
</div>
|
||||
|
||||
|
||||
<?php
|
||||
if (!User::hasBLockedUser($user_id)) {
|
||||
?>
|
||||
<div class="tabbable-panel">
|
||||
<div class="tabbable-line">
|
||||
<ul class="nav nav-tabs">
|
||||
<?php
|
||||
$active = "active";
|
||||
if ($advancedCustomUser->showChannelHomeTab) {
|
||||
if (!empty($_GET['current'])) { // means you are paging the Videos tab
|
||||
$active = "";
|
||||
}
|
||||
?>
|
||||
<li class="nav-item <?php echo $active; ?>">
|
||||
<a class="nav-link " href="#channelHome" data-toggle="tab" aria-expanded="false">
|
||||
<?php echo strtoupper(__("Home")); ?>
|
||||
</a>
|
||||
</li>
|
||||
<div class="clearfix"></div>
|
||||
<div class="panel panel-default">
|
||||
<div class="panel-body">
|
||||
<div class="gallery" >
|
||||
<div class="row">
|
||||
<div class="col-lg-12 col-sm-12 col-xs-12">
|
||||
<center style="margin:5px;">
|
||||
<?php
|
||||
$active = "";
|
||||
}
|
||||
if ($advancedCustomUser->showChannelVideosTab) {
|
||||
if (!empty($_GET['current'])) { // means you are paging the Videos tab
|
||||
$active = "active";
|
||||
}
|
||||
echo getAdsChannelLeaderBoardTop();
|
||||
?>
|
||||
<li class="nav-item <?php echo $active; ?>">
|
||||
<a class="nav-link " href="#channelVideos" data-toggle="tab" aria-expanded="false">
|
||||
<?php echo strtoupper(__("Videos")); ?> <span class="badge"><?php echo $uploadedTotalVideos; ?></span>
|
||||
</a>
|
||||
</li>
|
||||
<?php
|
||||
$active = "";
|
||||
}
|
||||
if ($advancedCustomUser->showChannelProgramsTab && !empty($palyListsObj)) {
|
||||
?>
|
||||
<li class="nav-item <?php echo $active; ?>" id="channelPlayListsLi">
|
||||
<a class="nav-link " href="#channelPlayLists" data-toggle="tab" aria-expanded="true">
|
||||
<?php echo strtoupper(__("Playlists")); ?>
|
||||
</a>
|
||||
</li>
|
||||
<?php
|
||||
$active = "";
|
||||
}
|
||||
?>
|
||||
</ul>
|
||||
<div class="tab-content clearfix">
|
||||
<?php
|
||||
$active = "active fade in";
|
||||
if ($advancedCustomUser->showChannelHomeTab) {
|
||||
if (!empty($_GET['current'])) { // means you are paging the Videos tab
|
||||
$active = "";
|
||||
}
|
||||
$obj = AVideoPlugin::getObjectData("YouPHPFlix2");
|
||||
?>
|
||||
<style>#bigVideo{top: 0 !important;}</style>
|
||||
<div class="tab-pane <?php echo $active; ?>" id="channelHome" style="min-height: 800px; background-color: rgb(<?php echo $obj->backgroundRGB; ?>);position: relative; overflow: hidden;">
|
||||
<?php
|
||||
$obj->BigVideo = true;
|
||||
$obj->Trending = true;
|
||||
$obj->pageDots = false;
|
||||
$obj->TrendingAutoPlay = true;
|
||||
$obj->maxVideos = 12;
|
||||
$obj->Suggested = false;
|
||||
$obj->paidOnlyLabelOverPoster = false;
|
||||
$obj->DateAdded = false;
|
||||
$obj->MostPopular = false;
|
||||
$obj->MostWatched = false;
|
||||
$obj->SortByName = false;
|
||||
$obj->Categories = false;
|
||||
$obj->playVideoOnFullscreen = false;
|
||||
$obj->titleLabel = true;
|
||||
$obj->RemoveBigVideoDescription = true;
|
||||
|
||||
include $global['systemRootPath'] . 'plugin/YouPHPFlix2/view/modeFlixBody.php';
|
||||
?>
|
||||
</div>
|
||||
<?php
|
||||
$active = "fade";
|
||||
}
|
||||
if ($advancedCustomUser->showChannelVideosTab) {
|
||||
if (!empty($_GET['current'])) { // means you are paging the Videos tab
|
||||
$active = "active fade in";
|
||||
}
|
||||
?>
|
||||
|
||||
<div class="tab-pane <?php echo $active; ?>" id="channelVideos">
|
||||
|
||||
<div class="panel panel-default">
|
||||
<div class="panel-heading">
|
||||
<?php
|
||||
if ($isMyChannel) {
|
||||
?>
|
||||
<a href="<?php echo $global['webSiteRootURL']; ?>mvideos" class="btn btn-success ">
|
||||
<span class="glyphicon glyphicon-film"></span>
|
||||
<span class="glyphicon glyphicon-headphones"></span>
|
||||
<?php echo __("My videos"); ?>
|
||||
</a>
|
||||
<?php
|
||||
} else {
|
||||
echo __("My videos");
|
||||
}
|
||||
echo AVideoPlugin::getChannelButton();
|
||||
?>
|
||||
</div>
|
||||
<div class="panel-body">
|
||||
<?php
|
||||
if ($advancedCustomUser->showBigVideoOnChannelVideosTab && !empty($uploadedVideos[0])) {
|
||||
$video = $uploadedVideos[0];
|
||||
$obj = new stdClass();
|
||||
$obj->BigVideo = true;
|
||||
$obj->Description = false;
|
||||
include $global['systemRootPath'] . 'plugin/Gallery/view/BigVideo.php';
|
||||
unset($uploadedVideos[0]);
|
||||
}
|
||||
?>
|
||||
<div class="row">
|
||||
<?php
|
||||
TimeLogEnd($timeLog, __LINE__);
|
||||
createGallerySection($uploadedVideos, "", $get);
|
||||
TimeLogEnd($timeLog, __LINE__);
|
||||
?>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="panel-footer">
|
||||
<?php
|
||||
echo getPagination($totalPages, $current, "{$global['webSiteRootURL']}channel/{$_GET['channelName']}?current={page}");
|
||||
?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<?php
|
||||
$active = "fade";
|
||||
}
|
||||
if ($advancedCustomUser->showChannelProgramsTab && !empty($palyListsObj)) {
|
||||
?>
|
||||
<div class="tab-pane <?php echo $active; ?>" id="channelPlayLists" style="min-height: 800px;">
|
||||
<?php
|
||||
include $global['systemRootPath'] . 'view/channelPlaylist.php';
|
||||
?>
|
||||
</div>
|
||||
<?php
|
||||
$active = "fade";
|
||||
}
|
||||
?>
|
||||
</center>
|
||||
</div>
|
||||
</div>
|
||||
<?php
|
||||
if (empty($advancedCustomUser->doNotShowTopBannerOnChannel)) {
|
||||
?>
|
||||
<div class="row bg-info profileBg" style="margin: 20px -10px; background: url('<?php echo $global['webSiteRootURL'], $user->getBackgroundURL(), "?", @filectime($global['systemRootPath'] . $user->getBackgroundURL()); ?>') no-repeat 50% 50%;">
|
||||
<img src="<?php echo User::getPhoto($user_id); ?>" alt="<?php echo $user->_getName(); ?>" class="img img-responsive img-thumbnail" style="max-width: 100px;"/>
|
||||
</div>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
<div class="row"><div class="col-6 col-md-12">
|
||||
<h2 class="pull-left">
|
||||
<?php
|
||||
echo $user->getNameIdentificationBd();
|
||||
?>
|
||||
<?php
|
||||
echo User::getEmailVerifiedIcon($user_id)
|
||||
?></h2>
|
||||
<span class="pull-right">
|
||||
<?php
|
||||
echo User::getBlockUserButton($user_id);
|
||||
echo Subscribe::getButton($user_id);
|
||||
?>
|
||||
</span>
|
||||
</div></div>
|
||||
<div class="col-md-12">
|
||||
<?php echo nl2br($user->getAbout()); ?>
|
||||
</div>
|
||||
|
||||
|
||||
<?php
|
||||
if (!User::hasBLockedUser($user_id)) {
|
||||
?>
|
||||
<div class="tabbable-panel">
|
||||
<div class="tabbable-line">
|
||||
<ul class="nav nav-tabs">
|
||||
<?php
|
||||
$active = "active";
|
||||
if ($advancedCustomUser->showChannelHomeTab) {
|
||||
if (!empty($_GET['current'])) { // means you are paging the Videos tab
|
||||
$active = "";
|
||||
}
|
||||
?>
|
||||
<li class="nav-item <?php echo $active; ?>">
|
||||
<a class="nav-link " href="#channelHome" data-toggle="tab" aria-expanded="false">
|
||||
<?php echo strtoupper(__("Home")); ?>
|
||||
</a>
|
||||
</li>
|
||||
<?php
|
||||
$active = "";
|
||||
}
|
||||
if ($advancedCustomUser->showChannelVideosTab) {
|
||||
if (!empty($_GET['current'])) { // means you are paging the Videos tab
|
||||
$active = "active";
|
||||
}
|
||||
?>
|
||||
<li class="nav-item <?php echo $active; ?>">
|
||||
<a class="nav-link " href="#channelVideos" data-toggle="tab" aria-expanded="false">
|
||||
<?php echo strtoupper(__("Videos")); ?> <span class="badge"><?php echo $uploadedTotalVideos; ?></span>
|
||||
</a>
|
||||
</li>
|
||||
<?php
|
||||
$active = "";
|
||||
}
|
||||
if ($advancedCustomUser->showChannelProgramsTab && !empty($palyListsObj)) {
|
||||
?>
|
||||
<li class="nav-item <?php echo $active; ?>" id="channelPlayListsLi">
|
||||
<a class="nav-link " href="#channelPlayLists" data-toggle="tab" aria-expanded="true">
|
||||
<?php echo strtoupper(__("Playlists")); ?>
|
||||
</a>
|
||||
</li>
|
||||
<?php
|
||||
$active = "";
|
||||
}
|
||||
?>
|
||||
</ul>
|
||||
<div class="tab-content clearfix">
|
||||
<?php
|
||||
$active = "active fade in";
|
||||
if ($advancedCustomUser->showChannelHomeTab) {
|
||||
if (!empty($_GET['current'])) { // means you are paging the Videos tab
|
||||
$active = "";
|
||||
}
|
||||
$obj = AVideoPlugin::getObjectData("YouPHPFlix2");
|
||||
?>
|
||||
<style>#bigVideo{top: 0 !important;}</style>
|
||||
<div class="tab-pane <?php echo $active; ?>" id="channelHome" style="min-height: 800px; background-color: rgb(<?php echo $obj->backgroundRGB; ?>);position: relative; overflow: hidden;">
|
||||
<?php
|
||||
$obj->BigVideo = true;
|
||||
$obj->Trending = true;
|
||||
$obj->pageDots = false;
|
||||
$obj->TrendingAutoPlay = true;
|
||||
$obj->maxVideos = 12;
|
||||
$obj->Suggested = false;
|
||||
$obj->paidOnlyLabelOverPoster = false;
|
||||
$obj->DateAdded = false;
|
||||
$obj->MostPopular = false;
|
||||
$obj->MostWatched = false;
|
||||
$obj->SortByName = false;
|
||||
$obj->Categories = false;
|
||||
$obj->playVideoOnFullscreen = false;
|
||||
$obj->titleLabel = true;
|
||||
$obj->RemoveBigVideoDescription = true;
|
||||
|
||||
include $global['systemRootPath'] . 'plugin/YouPHPFlix2/view/modeFlixBody.php';
|
||||
?>
|
||||
</div>
|
||||
<?php
|
||||
$active = "fade";
|
||||
}
|
||||
if ($advancedCustomUser->showChannelVideosTab) {
|
||||
if (!empty($_GET['current'])) { // means you are paging the Videos tab
|
||||
$active = "active fade in";
|
||||
}
|
||||
?>
|
||||
|
||||
<div class="tab-pane <?php echo $active; ?>" id="channelVideos">
|
||||
|
||||
<div class="panel panel-default">
|
||||
<div class="panel-heading">
|
||||
<?php
|
||||
if ($isMyChannel) {
|
||||
?>
|
||||
<a href="<?php echo $global['webSiteRootURL']; ?>mvideos" class="btn btn-success ">
|
||||
<span class="glyphicon glyphicon-film"></span>
|
||||
<span class="glyphicon glyphicon-headphones"></span>
|
||||
<?php echo __("My videos"); ?>
|
||||
</a>
|
||||
<?php
|
||||
} else {
|
||||
echo __("My videos");
|
||||
}
|
||||
echo AVideoPlugin::getChannelButton();
|
||||
?>
|
||||
</div>
|
||||
<div class="panel-body">
|
||||
<?php
|
||||
if ($advancedCustomUser->showBigVideoOnChannelVideosTab && !empty($uploadedVideos[0])) {
|
||||
$video = $uploadedVideos[0];
|
||||
$obj = new stdClass();
|
||||
$obj->BigVideo = true;
|
||||
$obj->Description = false;
|
||||
include $global['systemRootPath'] . 'plugin/Gallery/view/BigVideo.php';
|
||||
unset($uploadedVideos[0]);
|
||||
}
|
||||
?>
|
||||
<div class="row">
|
||||
<?php
|
||||
TimeLogEnd($timeLog, __LINE__);
|
||||
createGallerySection($uploadedVideos, "", $get);
|
||||
TimeLogEnd($timeLog, __LINE__);
|
||||
?>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="panel-footer">
|
||||
<?php
|
||||
echo getPagination($totalPages, $current, "{$global['webSiteRootURL']}channel/{$_GET['channelName']}?current={page}");
|
||||
?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<?php
|
||||
$active = "fade";
|
||||
}
|
||||
if ($advancedCustomUser->showChannelProgramsTab && !empty($palyListsObj)) {
|
||||
?>
|
||||
<div class="tab-pane <?php echo $active; ?>" id="channelPlayLists" style="min-height: 800px;">
|
||||
<?php
|
||||
include $global['systemRootPath'] . 'view/channelPlaylist.php';
|
||||
?>
|
||||
</div>
|
||||
<?php
|
||||
$active = "fade";
|
||||
}
|
||||
?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
</div>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
</div>
|
||||
</div>
|
||||
<script src="<?php echo $global['webSiteRootURL']; ?>plugin/Gallery/script.js" type="text/javascript"></script>
|
||||
<script src="<?php echo $global['webSiteRootURL']; ?>view/js/infinite-scroll.pkgd.min.js" type="text/javascript"></script>
|
|
@ -25,7 +25,7 @@ $users_id_array = VideoStatistic::getUsersIDFromChannelsWithMoreViews();
|
|||
|
||||
$current = $_POST['current'];
|
||||
$_REQUEST['rowCount'] = 10;
|
||||
$channels = Channel::getChannels(true, "u.id, '". implode(",", $users_id_array)."'");
|
||||
$channels = Channel::getChannels(true, "u.id, '" . implode(",", $users_id_array) . "'");
|
||||
|
||||
$totalPages = ceil($totalChannels / $_REQUEST['rowCount']);
|
||||
$metaDescription = __("Channels");
|
||||
|
@ -33,7 +33,7 @@ $metaDescription = __("Channels");
|
|||
<!DOCTYPE html>
|
||||
<html lang="<?php echo $_SESSION['language']; ?>">
|
||||
<head>
|
||||
<title><?php echo $config->getWebSiteTitle(); ?> :: <?php echo __("Channels").getSEOComplement(); ?></title>
|
||||
<title><?php echo $config->getWebSiteTitle(); ?> :: <?php echo __("Channels") . getSEOComplement(); ?></title>
|
||||
<?php
|
||||
include $global['systemRootPath'] . 'view/include/head.php';
|
||||
?>
|
||||
|
@ -77,13 +77,16 @@ $metaDescription = __("Channels");
|
|||
include $global['systemRootPath'] . 'view/include/navbar.php';
|
||||
?>
|
||||
|
||||
<div class="container">
|
||||
<div class="panel" >
|
||||
<div class="container-fluid">
|
||||
<div class="panel panel-default" >
|
||||
<div class="panel-heading">
|
||||
<form id="search-form" name="search-form" action="<?php echo $global['webSiteRootURL']; ?>channels" method="get">
|
||||
<div id="custom-search-input">
|
||||
<div class="input-group col-md-12">
|
||||
<input type="search" name="searchPhrase" class="form-control input-lg" placeholder="<?php echo __("Search Channels"); ?>" value="<?php echo @$_GET['searchPhrase']; unsetSearch(); ?>" />
|
||||
<input type="search" name="searchPhrase" class="form-control input-lg" placeholder="<?php echo __("Search Channels"); ?>" value="<?php
|
||||
echo @$_GET['searchPhrase'];
|
||||
unsetSearch();
|
||||
?>" />
|
||||
<span class="input-group-btn">
|
||||
<button class="btn btn-info btn-lg" type="submit">
|
||||
<i class="glyphicon glyphicon-search"></i>
|
||||
|
@ -100,8 +103,8 @@ $metaDescription = __("Channels");
|
|||
foreach ($channels as $value) {
|
||||
$get = array('channelName' => $value['channelName']);
|
||||
?>
|
||||
<div class=" bgWhite clear clearfix" style="margin: 10px 0;">
|
||||
<div class="clear clearfix">
|
||||
<div class="panel panel-default">
|
||||
<div class="panel-heading" style="position: relative;">
|
||||
<img src="<?php echo User::getPhoto($value['id']); ?>"
|
||||
class="img img-thumbnail img-responsive pull-left" style="max-height: 100px; margin: 0 10px;" alt="User Photo" />
|
||||
<a href="<?php echo User::getChannelLink($value['id']); ?>" class="btn btn-default">
|
||||
|
@ -110,47 +113,51 @@ $metaDescription = __("Channels");
|
|||
echo User::getNameIdentificationById($value['id']);
|
||||
?>
|
||||
</a>
|
||||
<span class="pull-right">
|
||||
<?php
|
||||
<div style="position: absolute; right: 10px; top: 10px;">
|
||||
<?php
|
||||
echo User::getBlockUserButton($value['id']);
|
||||
?>
|
||||
<?php echo Subscribe::getButton($value['id']); ?>
|
||||
</span>
|
||||
<div>
|
||||
<?php echo stripslashes(str_replace('\\\\\\\n', '<br/>', $value['about'])); ?>
|
||||
<?php echo Subscribe::getButton($value['id']); ?>
|
||||
</div>
|
||||
</div>
|
||||
<div class="clear clearfix">
|
||||
<h2><?php echo __("Preview"); ?></h2>
|
||||
<?php
|
||||
$_POST['current'] = 1;
|
||||
$_REQUEST['rowCount'] = 6;
|
||||
$_POST['sort']['created'] = "DESC";
|
||||
$uploadedVideos = Video::getAllVideosAsync("viewable", $value['id']);
|
||||
foreach ($uploadedVideos as $value2) {
|
||||
$imgs = Video::getImageFromFilename($value2['filename'], "video", true);
|
||||
$poster = $imgs->thumbsJpg;
|
||||
?>
|
||||
<div class="col-lg-2 col-md-3 col-sm-4 col-xs-6 ">
|
||||
<a href="<?php echo Video::getLink($value2['id'], $value2['clean_title'], false, $get); ?>" title="<?php echo $value2['title']; ?>" >
|
||||
<img src="<?php echo $poster; ?>" alt="<?php echo $value2['title']; ?>" class="img img-responsive img-thumbnail" />
|
||||
</a>
|
||||
<div class="text-muted" style="font-size: 0.8em;"><?php echo $value2['title']; ?></div>
|
||||
|
||||
</div>
|
||||
<div class="panel-body">
|
||||
<div>
|
||||
<?php echo stripslashes(str_replace('\\\\\\\n', '<br/>', $value['about'])); ?>
|
||||
</div>
|
||||
|
||||
<div class="clearfix" style="margin-bottom: 10px;"></div>
|
||||
<div class="row">
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
$_POST['current'] = 1;
|
||||
$_REQUEST['rowCount'] = 6;
|
||||
$_POST['sort']['created'] = "DESC";
|
||||
$uploadedVideos = Video::getAllVideosAsync("viewable", $value['id']);
|
||||
foreach ($uploadedVideos as $value2) {
|
||||
$imgs = Video::getImageFromFilename($value2['filename'], "video", true);
|
||||
$poster = $imgs->thumbsJpg;
|
||||
?>
|
||||
<div class="col-lg-2 col-md-3 col-sm-4 col-xs-6 ">
|
||||
<a href="<?php echo Video::getLink($value2['id'], $value2['clean_title'], false, $get); ?>" title="<?php echo $value2['title']; ?>" >
|
||||
<img src="<?php echo $poster; ?>" alt="<?php echo $value2['title']; ?>" class="img img-responsive img-thumbnail" />
|
||||
</a>
|
||||
<div class="text-muted" style="font-size: 0.8em;"><?php echo $value2['title']; ?></div>
|
||||
|
||||
</div>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
</div>
|
||||
</div>
|
||||
<div class="text-muted pull-right" style="font-size: 0.8em">
|
||||
<?php echo VideoStatistic::getChannelsTotalViews($value['id'])," ",__("Views in the last 30 days"); ?>
|
||||
<div class="panel-footer " style="font-size: 0.8em">
|
||||
<div class=" text-muted align-right">
|
||||
<?php echo VideoStatistic::getChannelsTotalViews($value['id']), " ", __("Views in the last 30 days"); ?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<?php
|
||||
}
|
||||
|
||||
|
||||
echo getPagination($totalPages, $current, "{$global['webSiteRootURL']}channels?page={page}");
|
||||
|
||||
?>
|
||||
</div>
|
||||
</div>
|
||||
|
|
177
view/contact.php
177
view/contact.php
|
@ -1,6 +1,6 @@
|
|||
<?php
|
||||
global $global, $config;
|
||||
if(!isset($global['systemRootPath'])){
|
||||
if (!isset($global['systemRootPath'])) {
|
||||
require_once '../videos/configuration.php';
|
||||
}
|
||||
require_once $global['systemRootPath'] . 'objects/user.php';
|
||||
|
@ -23,95 +23,98 @@ $metaDescription = " Contact Form";
|
|||
<?php
|
||||
include $global['systemRootPath'] . 'view/include/navbar.php';
|
||||
?>
|
||||
<div class="container-fluid">
|
||||
<div class="panel panel-default">
|
||||
<div class="panel-body">
|
||||
<div style="display: none;" id="messageSuccess">
|
||||
<div class="alert alert-success clear clearfix">
|
||||
<div class="col-md-3">
|
||||
<i class="fa fa-5x fa-check-circle-o"></i>
|
||||
</div>
|
||||
<div class="col-md-9">
|
||||
<h1><?php echo __("Congratulations!"); ?></h1>
|
||||
<h2><?php echo __("Your message has been sent!"); ?></h2>
|
||||
</div>
|
||||
</div>
|
||||
<a class="btn btn-success btn-block" href="<?php echo $global['webSiteRootURL']; ?>"><?php echo __("Go back to the main page"); ?></a>
|
||||
</div>
|
||||
<form class="well form-horizontal" action=" " method="post" id="contact_form">
|
||||
<input type="hidden" name="contactForm" value="1"/>
|
||||
<fieldset>
|
||||
|
||||
<div class="container list-group-item">
|
||||
<div style="display: none;" id="messageSuccess">
|
||||
<div class="alert alert-success clear clearfix">
|
||||
<div class="col-md-3">
|
||||
<i class="fa fa-5x fa-check-circle-o"></i>
|
||||
</div>
|
||||
<div class="col-md-9">
|
||||
<h1><?php echo __("Congratulations!"); ?></h1>
|
||||
<h2><?php echo __("Your message has been sent!"); ?></h2>
|
||||
</div>
|
||||
<!-- Form Name -->
|
||||
<legend><?php echo __("Contact Us Today!"); ?></legend>
|
||||
|
||||
<!-- Text input-->
|
||||
|
||||
<div class="form-group">
|
||||
<label class="col-md-4 control-label"><?php echo __("Name"); ?></label>
|
||||
<div class="col-md-4 inputGroupContainer">
|
||||
<div class="input-group">
|
||||
<span class="input-group-addon"><i class="glyphicon glyphicon-user"></i></span>
|
||||
<input name="first_name" placeholder="<?php echo __("Name"); ?>" class="form-control" type="text" required="true">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<!-- Text input-->
|
||||
<div class="form-group">
|
||||
<label class="col-md-4 control-label"><?php echo __("E-mail"); ?></label>
|
||||
<div class="col-md-4 inputGroupContainer">
|
||||
<div class="input-group">
|
||||
<span class="input-group-addon"><i class="glyphicon glyphicon-envelope"></i></span>
|
||||
<input name="email" placeholder="<?php echo __("E-mail Address"); ?>" class="form-control" value="<?php echo $email; ?>" type="email" required="true">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<!-- Text input-->
|
||||
<div class="form-group <?php echo empty($advancedCustom->doNotShowWebsiteOnContactForm) ? "" : "hidden" ?>">
|
||||
<label class="col-md-4 control-label"><?php echo __("Website"); ?></label>
|
||||
<div class="col-md-4 inputGroupContainer">
|
||||
<div class="input-group">
|
||||
<span class="input-group-addon"><i class="glyphicon glyphicon-globe"></i></span>
|
||||
<input name="website" placeholder="<?php echo __("Website"); ?>" class="form-control" type="text">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- Text area -->
|
||||
|
||||
<div class="form-group">
|
||||
<label class="col-md-4 control-label"><?php echo __("Message"); ?></label>
|
||||
<div class="col-md-4 inputGroupContainer">
|
||||
<div class="input-group">
|
||||
<span class="input-group-addon"><i class="glyphicon glyphicon-pencil"></i></span>
|
||||
<textarea class="form-control" name="comment" placeholder="<?php echo __("Message"); ?>"></textarea>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="form-group">
|
||||
<label class="col-md-4 control-label"><?php echo __("Type the code"); ?></label>
|
||||
<div class="col-md-4 inputGroupContainer">
|
||||
<div class="input-group">
|
||||
<span class="input-group-addon"><img src="<?php echo $global['webSiteRootURL']; ?>captcha?<?php echo time(); ?>" id="captcha"></span>
|
||||
<span class="input-group-addon"><span class="btn btn-xs btn-success" id="btnReloadCapcha"><span class="glyphicon glyphicon-refresh"></span></span></span>
|
||||
<input name="captcha" placeholder="<?php echo __("Type the code"); ?>" class="form-control" type="text" style="height: 60px;" maxlength="5" id="captchaText">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- Button -->
|
||||
<div class="form-group">
|
||||
<label class="col-md-4 control-label"></label>
|
||||
<div class="col-md-4">
|
||||
<button type="submit" class="btn btn-primary" ><?php echo __("Send"); ?> <span class="glyphicon glyphicon-send"></span></button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</fieldset>
|
||||
</form>
|
||||
</div>
|
||||
<a class="btn btn-success btn-block" href="<?php echo $global['webSiteRootURL']; ?>"><?php echo __("Go back to the main page"); ?></a>
|
||||
</div>
|
||||
<form class="well form-horizontal" action=" " method="post" id="contact_form">
|
||||
<input type="hidden" name="contactForm" value="1"/>
|
||||
<fieldset>
|
||||
|
||||
<!-- Form Name -->
|
||||
<legend><?php echo __("Contact Us Today!"); ?></legend>
|
||||
|
||||
<!-- Text input-->
|
||||
|
||||
<div class="form-group">
|
||||
<label class="col-md-4 control-label"><?php echo __("Name"); ?></label>
|
||||
<div class="col-md-4 inputGroupContainer">
|
||||
<div class="input-group">
|
||||
<span class="input-group-addon"><i class="glyphicon glyphicon-user"></i></span>
|
||||
<input name="first_name" placeholder="<?php echo __("Name"); ?>" class="form-control" type="text" required="true">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<!-- Text input-->
|
||||
<div class="form-group">
|
||||
<label class="col-md-4 control-label"><?php echo __("E-mail"); ?></label>
|
||||
<div class="col-md-4 inputGroupContainer">
|
||||
<div class="input-group">
|
||||
<span class="input-group-addon"><i class="glyphicon glyphicon-envelope"></i></span>
|
||||
<input name="email" placeholder="<?php echo __("E-mail Address"); ?>" class="form-control" value="<?php echo $email; ?>" type="email" required="true">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<!-- Text input-->
|
||||
<div class="form-group <?php echo empty($advancedCustom->doNotShowWebsiteOnContactForm) ? "" : "hidden" ?>">
|
||||
<label class="col-md-4 control-label"><?php echo __("Website"); ?></label>
|
||||
<div class="col-md-4 inputGroupContainer">
|
||||
<div class="input-group">
|
||||
<span class="input-group-addon"><i class="glyphicon glyphicon-globe"></i></span>
|
||||
<input name="website" placeholder="<?php echo __("Website"); ?>" class="form-control" type="text">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- Text area -->
|
||||
|
||||
<div class="form-group">
|
||||
<label class="col-md-4 control-label"><?php echo __("Message"); ?></label>
|
||||
<div class="col-md-4 inputGroupContainer">
|
||||
<div class="input-group">
|
||||
<span class="input-group-addon"><i class="glyphicon glyphicon-pencil"></i></span>
|
||||
<textarea class="form-control" name="comment" placeholder="<?php echo __("Message"); ?>"></textarea>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="form-group">
|
||||
<label class="col-md-4 control-label"><?php echo __("Type the code"); ?></label>
|
||||
<div class="col-md-4 inputGroupContainer">
|
||||
<div class="input-group">
|
||||
<span class="input-group-addon"><img src="<?php echo $global['webSiteRootURL']; ?>captcha?<?php echo time(); ?>" id="captcha"></span>
|
||||
<span class="input-group-addon"><span class="btn btn-xs btn-success" id="btnReloadCapcha"><span class="glyphicon glyphicon-refresh"></span></span></span>
|
||||
<input name="captcha" placeholder="<?php echo __("Type the code"); ?>" class="form-control" type="text" style="height: 60px;" maxlength="5" id="captchaText">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- Button -->
|
||||
<div class="form-group">
|
||||
<label class="col-md-4 control-label"></label>
|
||||
<div class="col-md-4">
|
||||
<button type="submit" class="btn btn-primary" ><?php echo __("Send"); ?> <span class="glyphicon glyphicon-send"></span></button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</fieldset>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
</div><!--/.container-->
|
||||
|
|
|
@ -32,10 +32,6 @@ time.duration{
|
|||
color: rgba(255, 255, 255, 0.3)!important;
|
||||
font-size: 50px;
|
||||
}
|
||||
.videoLink div {
|
||||
transition: all 0.3s ease-in-out;
|
||||
font-size: 1em;
|
||||
}
|
||||
.videoLink div.details,
|
||||
.videoLink div.details div {
|
||||
font-size: 0.9em;
|
||||
|
@ -115,7 +111,7 @@ footer ul.list-inline li {
|
|||
background-color: #000;
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
.rightBar, .main-video{
|
||||
.main-video{
|
||||
-webkit-transition: ease 1s; /* Safari */
|
||||
transition: ease 1s;
|
||||
}
|
||||
|
@ -180,7 +176,6 @@ footer ul.list-inline li {
|
|||
}
|
||||
.commentDetails {
|
||||
margin: 0 0 0 60px;
|
||||
min-height: 50px;
|
||||
}
|
||||
/* End Comments */
|
||||
|
||||
|
@ -358,23 +353,6 @@ footer ul.list-inline li {
|
|||
|
||||
/* fancy checkbox end */
|
||||
|
||||
.label.fix-width {
|
||||
min-width: 130px !important;
|
||||
display: inline-block !important;
|
||||
text-align: left;
|
||||
border-top-left-radius: 0;
|
||||
border-bottom-left-radius: 0;
|
||||
}
|
||||
.label.fix-width.label-primary {
|
||||
min-width: 70px !important;
|
||||
text-align: right;
|
||||
border-top-right-radius: 0;
|
||||
border-bottom-right-radius: 0;
|
||||
border-top-left-radius: 0.25em;
|
||||
;
|
||||
border-bottom-left-radius: 0.25em;
|
||||
;
|
||||
}
|
||||
.videosDetails .label{
|
||||
border-radius: 0;
|
||||
}
|
||||
|
@ -674,10 +652,7 @@ nav ul.items-container li ul.right-menus li li {
|
|||
.navbar-collapse.in {
|
||||
overflow-y: visible; /* Bootstrap default is "auto" */
|
||||
}
|
||||
#videosList{
|
||||
-webkit-transition: ease 1s; /* Safari */
|
||||
transition: ease 1s;
|
||||
}
|
||||
|
||||
.transparent{
|
||||
opacity: 0.3;
|
||||
filter: alpha(opacity=30); /* For IE8 and earlier */
|
||||
|
@ -822,7 +797,7 @@ img.blur{
|
|||
body.youtube .col-lg-offset-1.addWidthOnMenuOpen {
|
||||
margin-left: 0px;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
.liveVideo .thumbsImage img{
|
||||
|
@ -856,3 +831,10 @@ img.blur{
|
|||
#navBarFlag li{
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.videoListItem{
|
||||
overflow: hidden;
|
||||
}
|
||||
.extraVideos:empty{
|
||||
display: none;
|
||||
}
|
145
view/help.php
145
view/help.php
|
@ -1,6 +1,6 @@
|
|||
<?php
|
||||
global $global, $config;
|
||||
if(!isset($global['systemRootPath'])){
|
||||
if (!isset($global['systemRootPath'])) {
|
||||
require_once '../videos/configuration.php';
|
||||
}
|
||||
require_once $global['systemRootPath'] . 'plugin/AVideoPlugin.php';
|
||||
|
@ -19,77 +19,84 @@ require_once $global['systemRootPath'] . 'plugin/AVideoPlugin.php';
|
|||
include $global['systemRootPath'] . 'view/include/navbar.php';
|
||||
?>
|
||||
|
||||
<div class="container">
|
||||
<h1><?php echo __("User-manual of"); echo " "; echo $config->getWebSiteTitle(); ?></h1>
|
||||
<p><?php echo AVideoPlugin::getHelpToc(); ?>
|
||||
<ul>
|
||||
<li><a href="#Videos help"><?php echo __('Videos'); ?></a></li>
|
||||
</ul>
|
||||
</p>
|
||||
<p><?php echo __('Here you can find help, how this plattform works.'); ?></p>
|
||||
<?php if(User::isAdmin()){ ?>
|
||||
<h2><?php echo __('Admin\'s manual'); ?></h2>
|
||||
<p><?php echo __('Only you can see this, because you are a admin.'); ?></p>
|
||||
<h3><?php echo __('Settings and plugins'); ?></h3>
|
||||
<p><?php echo __('The default'); ?> <a href='<?php echo $global['webSiteRootURL']; ?>siteConfigurations'><?php echo __('site config'); ?></a>, <?php echo __('you can find on the menu-point. But there are more settings avaible; go to the'); ?> <a href='<?php echo $global['webSiteRootURL']; ?>plugins'><?php echo __('plugins'); ?></a> <?php echo __('and check the'); ?> "CustomiseAdvanced"<?php echo __('-Plugin'); ?>.</p>
|
||||
<p><?php echo __('Like on a lot of plugins, on the right site, you will find a button'); ?> "<span class="glyphicon glyphicon-edit" aria-hidden="true"></span><?php echo __('Edit parameters'); ?>". <?php echo __('This button is always a click worth'); ?>.</p>
|
||||
<p><?php echo __('Also, when you activate a plugin and you see a button "Install Tables", press it at least once, if you never press it, this can cause bugs!'); ?></p>
|
||||
<hr />
|
||||
<h3><?php echo __('Update via git'); ?></h3>
|
||||
<p><?php echo __('This project is in a fast development. If you have done your setup via git (like in the howto\'s), you can update very easy!'); ?></p>
|
||||
<p><?php echo __('In the shell, go to the avideo-folder and type "git pull" there. Or, for copy-paste'); ?>: <code>cd <?php echo $global['systemRootPath']; ?>; git pull</code> . </p>
|
||||
<p><?php echo __('It can be, that you will need a database-update after. For this, go as admin to the menu-point'); ?> "<a href='<?php echo $global['webSiteRootURL']; ?>update'><?php echo __('Update version'); ?></a>".</p>
|
||||
<p><?php echo __('Done'); ?>!</p>
|
||||
<hr />
|
||||
<h3><?php echo __('Update via ftp/files'); ?></h3>
|
||||
<p><?php echo __('Download this file'); ?>: <a href="https://github.com/WWBN/AVideo/archive/master.zip">github.com/DanielnetoDotCom/AVideo/archive/master.zip</a> (<?php echo __('always the newest'); ?>).</p>
|
||||
<p><?php echo __('Unzip and upload/replace the'); ?> <b><?php echo __('all'); ?></b> <?php echo __('the files. Only the videos-folder should stay untouched.'); ?></p>
|
||||
<p><?php echo __('It can be, that you will need a database-update after. For this, go as admin to the menu-point'); ?> "<a href='<?php echo $global['webSiteRootURL']; ?>update'><?php echo __('Update version'); ?></a>".</p>
|
||||
<p><?php echo __('Done'); ?>!</p>
|
||||
<hr />
|
||||
<h3><?php echo __('Issues on github'); ?></h3>
|
||||
<p><?php echo __('If you want to tell us, what is not working for you, this is great and helps us, to make the software more stable.'); ?></p>
|
||||
<p><?php echo __('Some information can help us, to find your problem faster'); ?>:</p> <ul><li><?php echo __('Content of'); ?> <a href='<?php echo $global['webSiteRootURL']; ?>videos/avideo.log'>videos/avideo.log</a></li><li><?php echo __('Content of'); ?> <a href='<?php echo $global['webSiteRootURL']; ?>videos/avideo.js.log'>videos/avideo.js.log</a></li><li><?php echo __('If public: your domain, so we can see the error directly'); ?></li></ul>
|
||||
<p><?php echo __('If you can, clear the log-files, reproduce the error and send them. This helps to reduce old or repeating information.'); ?></p>
|
||||
<hr />
|
||||
<?php } ?>
|
||||
<h2 id='Videos help'><?php echo __('Videos'); ?></h2>
|
||||
<p><?php echo __('Here you find information about how to handle videos.'); ?></p>
|
||||
<h3><?php echo __('Add videos'); ?></h3>
|
||||
<p><?php echo __('There are various kinds of media you can integrate here. They are working diffrent'); ?>:</p>
|
||||
<table class='table'><thead><tr>
|
||||
<th><?php echo __('Mediatype'); ?></th><th><?php echo __('How to set'); ?></th><th><?php echo __('Notes'); ?></th>
|
||||
</tr>
|
||||
</thead><tbody>
|
||||
<tr><td><?php echo __('Audio'); ?></td><td><?php echo __('Via encoder or direct upload'); ?></td><td><?php echo __('Via encoder, most formats are possible, but you need to enable the Extract audio-option. With direct upload, only MP3 and OGG is allowed'); ?></td></tr>
|
||||
<tr><td><?php echo __('Video'); ?></td><td><?php echo __('Via encoder or direct upload'); ?></td><td><?php echo __('Via encoder, most formats are possible. With direct upload, only MP4 is allowed'); ?></td></tr>
|
||||
<tr><td><?php echo __('Embeded'); ?></td><td><?php echo __('My videos->Embed a video link->Embeded'); ?></td><td><?php echo __('Only direct mp3- or ogg-files - if you download it with the link, it should be a movie-file. No google-drive or stream-hoster. Also, do not mix https and http.'); ?></td></tr>
|
||||
<tr><td><?php echo __('Direct audio-link (mp3 or ogg)'); ?></td><td><?php echo __('My videos->Embed a video link->Choose Direct audio-link (mp3 or ogg)'); ?></td><td><?php echo __('Only direct mp3- or ogg-files - if you download it with the link, it should be a movie-file. No google-drive or stream-hoster. Also, do not mix https and http.'); ?></td></tr>
|
||||
<tr><td><?php echo __('Direct video-link (mp4)'); ?></td><td><?php echo __('My videos->Embed a video->Choose Direct video-link (mp4)'); ?></td><td><?php echo __('Only direct mp4-files - if you download it with the link, it should be a movie-file. No google-drive or stream-hoster. Also, do not mix https and http.'); ?></td></tr>
|
||||
</tbody></table>
|
||||
<hr />
|
||||
<h3><?php echo __('Edit videos'); ?></h3>
|
||||
<p><?php echo __('After you add any kind of video, you can find it in'); ?> <?php echo __('My videos'); ?></p>
|
||||
<p><?php echo __('On the right site, you find various symbols'); ?>, <span class="glyphicon glyphicon-edit" aria-hidden="true"></span> <?php echo __('means edit'); ?>.</p>
|
||||
<p><?php echo __('There, you can set'); ?></p>
|
||||
<ul>
|
||||
<li><?php echo __('Preview-picture and gif'); ?></li>
|
||||
<li><?php echo __('Title and description'); ?></li>
|
||||
<li><?php echo __('Category'); ?></li>
|
||||
<li><?php echo __('Next video'); ?></li>
|
||||
</ul>
|
||||
<p><?php echo __('With the other options, you can delete, rotate and promote a video'); ?></p>
|
||||
<hr />
|
||||
<h3><?php echo __('Use a video as a ad'); ?></h3>
|
||||
<p><?php echo __('To use a video as a ad, go to'); ?> <?php echo __('My videos'); ?> -> <span class="glyphicon glyphicon-edit" aria-hidden="true"></span><?php echo __('Edit-symbol and enable Create an Advertising'); ?>.</p>
|
||||
<p><?php echo __('After enabling this, you can directly set some options, like the name, link and active categorie for example.'); ?></p>
|
||||
<p><?php echo __('When the video is saved like this, it will show up under the menu-point'); ?> <?php echo __('Video Advertising'); ?><?php echo __(', where you can edit the ad-options'); ?>.</p>
|
||||
<div class="container-fluid">
|
||||
<div class="panel panel-default">
|
||||
<div class="panel-body">
|
||||
<h1><?php echo __("User-manual of");
|
||||
echo " ";
|
||||
echo $config->getWebSiteTitle(); ?></h1>
|
||||
<p><?php echo AVideoPlugin::getHelpToc(); ?>
|
||||
<ul>
|
||||
<li><a href="#Videos help"><?php echo __('Videos'); ?></a></li>
|
||||
</ul>
|
||||
</p>
|
||||
<p><?php echo __('Here you can find help, how this plattform works.'); ?></p>
|
||||
<?php if (User::isAdmin()) { ?>
|
||||
<h2><?php echo __('Admin\'s manual'); ?></h2>
|
||||
<p><?php echo __('Only you can see this, because you are a admin.'); ?></p>
|
||||
<h3><?php echo __('Settings and plugins'); ?></h3>
|
||||
<p><?php echo __('The default'); ?> <a href='<?php echo $global['webSiteRootURL']; ?>siteConfigurations'><?php echo __('site config'); ?></a>, <?php echo __('you can find on the menu-point. But there are more settings avaible; go to the'); ?> <a href='<?php echo $global['webSiteRootURL']; ?>plugins'><?php echo __('plugins'); ?></a> <?php echo __('and check the'); ?> "CustomiseAdvanced"<?php echo __('-Plugin'); ?>.</p>
|
||||
<p><?php echo __('Like on a lot of plugins, on the right site, you will find a button'); ?> "<span class="glyphicon glyphicon-edit" aria-hidden="true"></span><?php echo __('Edit parameters'); ?>". <?php echo __('This button is always a click worth'); ?>.</p>
|
||||
<p><?php echo __('Also, when you activate a plugin and you see a button "Install Tables", press it at least once, if you never press it, this can cause bugs!'); ?></p>
|
||||
<hr />
|
||||
<h3><?php echo __('Update via git'); ?></h3>
|
||||
<p><?php echo __('This project is in a fast development. If you have done your setup via git (like in the howto\'s), you can update very easy!'); ?></p>
|
||||
<p><?php echo __('In the shell, go to the avideo-folder and type "git pull" there. Or, for copy-paste'); ?>: <code>cd <?php echo $global['systemRootPath']; ?>; git pull</code> . </p>
|
||||
<p><?php echo __('It can be, that you will need a database-update after. For this, go as admin to the menu-point'); ?> "<a href='<?php echo $global['webSiteRootURL']; ?>update'><?php echo __('Update version'); ?></a>".</p>
|
||||
<p><?php echo __('Done'); ?>!</p>
|
||||
<hr />
|
||||
<h3><?php echo __('Update via ftp/files'); ?></h3>
|
||||
<p><?php echo __('Download this file'); ?>: <a href="https://github.com/WWBN/AVideo/archive/master.zip">github.com/DanielnetoDotCom/AVideo/archive/master.zip</a> (<?php echo __('always the newest'); ?>).</p>
|
||||
<p><?php echo __('Unzip and upload/replace the'); ?> <b><?php echo __('all'); ?></b> <?php echo __('the files. Only the videos-folder should stay untouched.'); ?></p>
|
||||
<p><?php echo __('It can be, that you will need a database-update after. For this, go as admin to the menu-point'); ?> "<a href='<?php echo $global['webSiteRootURL']; ?>update'><?php echo __('Update version'); ?></a>".</p>
|
||||
<p><?php echo __('Done'); ?>!</p>
|
||||
<hr />
|
||||
<h3><?php echo __('Issues on github'); ?></h3>
|
||||
<p><?php echo __('If you want to tell us, what is not working for you, this is great and helps us, to make the software more stable.'); ?></p>
|
||||
<p><?php echo __('Some information can help us, to find your problem faster'); ?>:</p> <ul><li><?php echo __('Content of'); ?> <a href='<?php echo $global['webSiteRootURL']; ?>videos/avideo.log'>videos/avideo.log</a></li><li><?php echo __('Content of'); ?> <a href='<?php echo $global['webSiteRootURL']; ?>videos/avideo.js.log'>videos/avideo.js.log</a></li><li><?php echo __('If public: your domain, so we can see the error directly'); ?></li></ul>
|
||||
<p><?php echo __('If you can, clear the log-files, reproduce the error and send them. This helps to reduce old or repeating information.'); ?></p>
|
||||
<hr />
|
||||
<?php } ?>
|
||||
<h2 id='Videos help'><?php echo __('Videos'); ?></h2>
|
||||
<p><?php echo __('Here you find information about how to handle videos.'); ?></p>
|
||||
<h3><?php echo __('Add videos'); ?></h3>
|
||||
<p><?php echo __('There are various kinds of media you can integrate here. They are working diffrent'); ?>:</p>
|
||||
<table class='table'><thead><tr>
|
||||
<th><?php echo __('Mediatype'); ?></th><th><?php echo __('How to set'); ?></th><th><?php echo __('Notes'); ?></th>
|
||||
</tr>
|
||||
</thead><tbody>
|
||||
<tr><td><?php echo __('Audio'); ?></td><td><?php echo __('Via encoder or direct upload'); ?></td><td><?php echo __('Via encoder, most formats are possible, but you need to enable the Extract audio-option. With direct upload, only MP3 and OGG is allowed'); ?></td></tr>
|
||||
<tr><td><?php echo __('Video'); ?></td><td><?php echo __('Via encoder or direct upload'); ?></td><td><?php echo __('Via encoder, most formats are possible. With direct upload, only MP4 is allowed'); ?></td></tr>
|
||||
<tr><td><?php echo __('Embeded'); ?></td><td><?php echo __('My videos->Embed a video link->Embeded'); ?></td><td><?php echo __('Only direct mp3- or ogg-files - if you download it with the link, it should be a movie-file. No google-drive or stream-hoster. Also, do not mix https and http.'); ?></td></tr>
|
||||
<tr><td><?php echo __('Direct audio-link (mp3 or ogg)'); ?></td><td><?php echo __('My videos->Embed a video link->Choose Direct audio-link (mp3 or ogg)'); ?></td><td><?php echo __('Only direct mp3- or ogg-files - if you download it with the link, it should be a movie-file. No google-drive or stream-hoster. Also, do not mix https and http.'); ?></td></tr>
|
||||
<tr><td><?php echo __('Direct video-link (mp4)'); ?></td><td><?php echo __('My videos->Embed a video->Choose Direct video-link (mp4)'); ?></td><td><?php echo __('Only direct mp4-files - if you download it with the link, it should be a movie-file. No google-drive or stream-hoster. Also, do not mix https and http.'); ?></td></tr>
|
||||
</tbody></table>
|
||||
<hr />
|
||||
<h3><?php echo __('Edit videos'); ?></h3>
|
||||
<p><?php echo __('After you add any kind of video, you can find it in'); ?> <?php echo __('My videos'); ?></p>
|
||||
<p><?php echo __('On the right site, you find various symbols'); ?>, <span class="glyphicon glyphicon-edit" aria-hidden="true"></span> <?php echo __('means edit'); ?>.</p>
|
||||
<p><?php echo __('There, you can set'); ?></p>
|
||||
<ul>
|
||||
<li><?php echo __('Preview-picture and gif'); ?></li>
|
||||
<li><?php echo __('Title and description'); ?></li>
|
||||
<li><?php echo __('Category'); ?></li>
|
||||
<li><?php echo __('Next video'); ?></li>
|
||||
</ul>
|
||||
<p><?php echo __('With the other options, you can delete, rotate and promote a video'); ?></p>
|
||||
<hr />
|
||||
<h3><?php echo __('Use a video as a ad'); ?></h3>
|
||||
<p><?php echo __('To use a video as a ad, go to'); ?> <?php echo __('My videos'); ?> -> <span class="glyphicon glyphicon-edit" aria-hidden="true"></span><?php echo __('Edit-symbol and enable Create an Advertising'); ?>.</p>
|
||||
<p><?php echo __('After enabling this, you can directly set some options, like the name, link and active categorie for example.'); ?></p>
|
||||
<p><?php echo __('When the video is saved like this, it will show up under the menu-point'); ?> <?php echo __('Video Advertising'); ?><?php echo __(', where you can edit the ad-options'); ?>.</p>
|
||||
|
||||
|
||||
<?php
|
||||
echo AVideoPlugin::getHelp();
|
||||
?>
|
||||
<?php
|
||||
echo AVideoPlugin::getHelp();
|
||||
?>
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div><!--/.container-->
|
||||
<?php
|
||||
include $global['systemRootPath'] . 'view/include/footer.php';
|
||||
|
|
|
@ -40,10 +40,11 @@ if(isAVideoEncoderOnSameDomain() || $tokenIsValid || !empty($advancedCustom->vid
|
|||
$newContent = str_replace('/index.m3u8', "/index.m3u8?globalToken={$_GET['globalToken']}", $newContent);
|
||||
}
|
||||
}else{
|
||||
$newContent = "Can not see video [{$video['id']}] ({$_GET['videoDirectory']}) ";
|
||||
$newContent = "HLS.php Can not see video [{$video['id']}] ({$_GET['videoDirectory']}) ";
|
||||
$newContent .= $tokenIsValid?"":" tokenInvalid";
|
||||
$newContent .= User::canWatchVideo($video['id'])?"":" cannot watch";
|
||||
$newContent .= " ".date("Y-m-d H:i:s");
|
||||
|
||||
}
|
||||
header("Content-Type: text/plain");
|
||||
echo $newContent;
|
|
@ -297,7 +297,7 @@ if (!User::isLogged() && !empty($advancedCustomUser->userMustBeLoggedIn) && !emp
|
|||
} else {
|
||||
YPTSidebarOpen();
|
||||
}
|
||||
|
||||
|
||||
$('#myNavbar').removeClass("in");
|
||||
$('#mysearch').removeClass("in");
|
||||
});
|
||||
|
@ -996,6 +996,77 @@ if (!User::isLogged() && !empty($advancedCustomUser->userMustBeLoggedIn) && !emp
|
|||
</ul>
|
||||
</li>
|
||||
<?php
|
||||
} else {
|
||||
$menus = array();
|
||||
if (Permissions::canAdminUsers()) {
|
||||
$menus[] = '
|
||||
?>
|
||||
<li>
|
||||
<a href="<?php echo $global[\'webSiteRootURL\']; ?>users">
|
||||
<span class="glyphicon glyphicon-user"></span>
|
||||
<?php echo __("Users"); ?>
|
||||
</a>
|
||||
</li>
|
||||
<?php
|
||||
';
|
||||
}
|
||||
if (Permissions::canAdminUserGroups()) {
|
||||
$menus[] = '?>
|
||||
<li>
|
||||
<a href="<?php echo $global[\'webSiteRootURL\']; ?>usersGroups">
|
||||
<span class="fa fa-users"></span>
|
||||
<?php echo __("Users Groups"); ?>
|
||||
</a>
|
||||
</li>
|
||||
<?php
|
||||
';
|
||||
}
|
||||
if (Permissions::canClearCache()) {
|
||||
$menus[] = '?>
|
||||
<li>
|
||||
<a href="#" class="clearCacheFirstPageButton">
|
||||
<i class="fa fa-trash"></i> <?php echo __("Clear First Page Cache"); ?>
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="#" class="clearCacheButton">
|
||||
<i class="fa fa-trash"></i> <?php echo __("Clear Cache Directory"); ?>
|
||||
</a>
|
||||
</li>
|
||||
<?php
|
||||
';
|
||||
}
|
||||
if (Permissions::canSeeLogs()) {
|
||||
$menus[] = ' ?>
|
||||
<li>
|
||||
<a href="<?php echo $global[\'webSiteRootURL\']; ?>i/log" class="">
|
||||
<i class="fas fa-clipboard-list"></i> <?php echo __("Log file"); ?>
|
||||
</a>
|
||||
</li>
|
||||
<?php
|
||||
';
|
||||
}
|
||||
if (Permissions::canGenerateSiteMap()) {
|
||||
$menus[] = '?>
|
||||
<li>
|
||||
<a href="#" class="generateSiteMapButton">
|
||||
<i class="fa fa-sitemap"></i> <?php echo __("Generate Sitemap"); ?>
|
||||
</a>
|
||||
</li>
|
||||
<?php
|
||||
';
|
||||
}
|
||||
if (count($menus)) {
|
||||
?>
|
||||
<hr>
|
||||
<h2 class="text-danger"><?php echo __("Extra Permissions"); ?></h2>
|
||||
<ul class="nav navbar" style="margin-bottom: 10px;">
|
||||
<?php
|
||||
eval(implode(" ", $menus));
|
||||
?>
|
||||
</ul>
|
||||
<?php
|
||||
}
|
||||
}
|
||||
?>
|
||||
|
||||
|
@ -1181,7 +1252,7 @@ if (!User::isLogged() && !empty($advancedCustomUser->userMustBeLoggedIn) && !emp
|
|||
var navsub_toggle_selected = $('.nav li.navsub-toggle a.selected');
|
||||
navsub_toggle_selected.next().show();
|
||||
navsub_toggle_selected = navsub_toggle_selected.parent();
|
||||
|
||||
|
||||
var navsub_toggle_selected_stop = 24;
|
||||
while (navsub_toggle_selected.length) {
|
||||
if ($.inArray(navsub_toggle_selected.prop('localName'), ['li', 'ul']) == -1)
|
||||
|
@ -1190,25 +1261,25 @@ if (!User::isLogged() && !empty($advancedCustomUser->userMustBeLoggedIn) && !emp
|
|||
navsub_toggle_selected.show().prev().addClass('selected');
|
||||
}
|
||||
navsub_toggle_selected = navsub_toggle_selected.parent();
|
||||
|
||||
|
||||
navsub_toggle_selected_stop--;
|
||||
if (navsub_toggle_selected_stop < 0)
|
||||
break;
|
||||
}
|
||||
}, 500);
|
||||
|
||||
|
||||
|
||||
|
||||
$('.nav').on('click', 'li.navsub-toggle a:not(.selected)', function (e) {
|
||||
var a = $(this),
|
||||
b = a.next();
|
||||
if (b.length) {
|
||||
e.preventDefault();
|
||||
|
||||
|
||||
a.addClass('selected');
|
||||
b.slideDown();
|
||||
|
||||
|
||||
var c = a.closest('.nav').find('li.navsub-toggle a.selected').not(a).removeClass('selected').next();
|
||||
|
||||
|
||||
if (c.length)
|
||||
c.slideUp();
|
||||
}
|
||||
|
|
|
@ -1229,8 +1229,8 @@
|
|||
dropDownMenu: "dropdown btn-group", // must be a unique class name or constellation of class names within the actionDropDown
|
||||
dropDownMenuItems: "dropdown-menu pull-right", // must be a unique class name or constellation of class names within the actionDropDown
|
||||
dropDownMenuText: "dropdown-text", // must be a unique class name or constellation of class names within the actionDropDown
|
||||
footer: "bootgrid-footer container-fluid",
|
||||
header: "bootgrid-header container-fluid",
|
||||
footer: "bootgrid-footer",
|
||||
header: "bootgrid-header",
|
||||
icon: "icon glyphicon",
|
||||
iconColumns: "glyphicon-th-list",
|
||||
iconDown: "glyphicon-chevron-down",
|
||||
|
|
864
view/js/three.js
Normal file
864
view/js/three.js
Normal file
File diff suppressed because one or more lines are too long
|
@ -4,7 +4,7 @@ if (!isset($global['systemRootPath'])) {
|
|||
require_once '../videos/configuration.php';
|
||||
}
|
||||
|
||||
if (!User::isAdmin()) {
|
||||
if (!Permissions::canSeeLogs()) {
|
||||
forbiddenPage("You cannot see the logs");
|
||||
}
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
<div class="container">
|
||||
<div class="container-fluid">
|
||||
<div class="panel panel-default">
|
||||
<div class="panel-heading">
|
||||
|
||||
|
@ -161,15 +161,15 @@
|
|||
},
|
||||
"commands": function (column, row)
|
||||
{
|
||||
var editBtn = '<button type="button" class="btn btn-xs btn-default command-edit" data-row-id="' + row.id + '" data-toggle="tooltip" data-placement="left" title="<?php echo __("Edit"); ?>"><span class="glyphicon glyphicon-edit" aria-hidden="true"></span></button>'
|
||||
var deleteBtn = '<button type="button" class="btn btn-default btn-xs command-delete" data-row-id="' + row.id + '" data-toggle="tooltip" data-placement="left" title="<?php echo __("Delete"); ?>"><span class="glyphicon glyphicon-erase" aria-hidden="true"></span></button>';
|
||||
var rssBtn = '<a class="btn btn-info btn-xs" target="_blank" href="<?php echo $global['webSiteRootURL']; ?>feed/?catName=' + row.clean_name + '" ><i class="fas fa-rss-square"></i></a>';
|
||||
var editBtn = '<button type="button" class="btn btn-xs btn-default command-edit" data-row-id="' + row.id + '" data-toggle="tooltip" title="<?php echo __("Edit"); ?>"><span class="glyphicon glyphicon-edit" aria-hidden="true"></span></button>'
|
||||
var deleteBtn = '<button type="button" class="btn btn-default btn-xs command-delete" data-row-id="' + row.id + '" data-toggle="tooltip" title="<?php echo __("Delete"); ?>"><i class="fa fa-trash" aria-hidden="true"></i></button>';
|
||||
var rssBtn = '<a class="btn btn-info btn-xs" data-toggle="tooltip" title="<?php echo __("RSS Feed"); ?>" target="_blank" href="<?php echo $global['webSiteRootURL']; ?>feed/?catName=' + row.clean_name + '" ><i class="fas fa-rss-square"></i></a>';
|
||||
|
||||
if (!row.canEdit) {
|
||||
editBtn = "";
|
||||
deleteBtn = "";
|
||||
}
|
||||
|
||||
|
||||
return editBtn + deleteBtn + rssBtn;
|
||||
}
|
||||
}
|
||||
|
@ -224,6 +224,7 @@
|
|||
}
|
||||
});
|
||||
});
|
||||
setTimeout(function(){$('[data-toggle="tooltip"]').tooltip();},1000);
|
||||
});
|
||||
|
||||
|
||||
|
|
|
@ -27,11 +27,14 @@ require_once $global['systemRootPath'] . 'objects/comment.php';
|
|||
include $global['systemRootPath'] . 'view/include/navbar.php';
|
||||
?>
|
||||
|
||||
<div class="container">
|
||||
<?php
|
||||
include $global['systemRootPath'] . 'view/videoComments.php';
|
||||
?>
|
||||
|
||||
<div class="container-fluid">
|
||||
<div class="panel panel-default">
|
||||
<div class="panel-body">
|
||||
<?php
|
||||
include $global['systemRootPath'] . 'view/videoComments.php';
|
||||
?>
|
||||
</div>
|
||||
</div>
|
||||
</div><!--/.container-->
|
||||
<?php
|
||||
include $global['systemRootPath'] . 'view/include/footer.php';
|
||||
|
|
|
@ -29,7 +29,7 @@ $uuidJSCondition = implode(" && ", $rowId);
|
|||
}
|
||||
</style>
|
||||
<div class="container-fluid">
|
||||
<div class="panel">
|
||||
<div class="panel panel-default">
|
||||
<div class="panel-heading tabbable-line">
|
||||
<ul class="nav nav-tabs">
|
||||
<li class="active"><a data-toggle="tab" href="#menu0"><i class="fa fa-plug"></i> <?php echo __('Installed Plugins'); ?></a></li>
|
||||
|
@ -37,7 +37,6 @@ $uuidJSCondition = implode(" && ", $rowId);
|
|||
</ul>
|
||||
</div>
|
||||
<div class="panel-body">
|
||||
|
||||
<div class="tab-content">
|
||||
<div id="menu0" class="tab-pane fade in active">
|
||||
<div class="list-group-item">
|
||||
|
@ -197,6 +196,13 @@ $uuidJSCondition = implode(" && ", $rowId);
|
|||
</div>
|
||||
</div><!--/.container-->
|
||||
|
||||
<div id="pluginsPermissionModal" class="modal fade" tabindex="-1" role="dialog">
|
||||
<div class="modal-dialog" role="document">
|
||||
<div id="pluginsPermissionModalContent">
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<script>
|
||||
function jsonToForm(json) {
|
||||
$('#jsonElements').empty();
|
||||
|
@ -339,7 +345,7 @@ $uuidJSCondition = implode(" && ", $rowId);
|
|||
return true;
|
||||
}
|
||||
|
||||
function processShowHideIfActive(tr){
|
||||
function processShowHideIfActive(tr) {
|
||||
if ($(tr).find(".pluginSwitch").is(":checked")) {
|
||||
if ($("#PluginTagsInstalled").hasClass('checked')) {
|
||||
$(tr).show();
|
||||
|
@ -460,7 +466,23 @@ $uuidJSCondition = implode(" && ", $rowId);
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
function pluginPermissionsBtn(plugins_id) {
|
||||
modal.showPleaseWait();
|
||||
$("#pluginsPermissionModalContent").html('');
|
||||
$.ajax({
|
||||
url: '<?php echo $global['webSiteRootURL']; ?>plugin/Permissions/getPermissionsFromPlugin.html.php?plugins_id=' + plugins_id,
|
||||
success: function (response) {
|
||||
modal.hidePleaseWait();
|
||||
$("#pluginsPermissionModalContent").html(response);
|
||||
$('#pluginsPermissionModal').modal();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
$(document).ready(function () {
|
||||
|
||||
|
||||
var myTextarea = document.getElementById("inputData");
|
||||
var grid = $("#grid").bootgrid({
|
||||
labels: {
|
||||
|
@ -523,6 +545,7 @@ $uuidJSCondition = implode(" && ", $rowId);
|
|||
}
|
||||
var switchBtn = '';
|
||||
}
|
||||
|
||||
//var txt = '<span id="plugin' + row.uuid + '" style="margin-top: -60px; position: absolute;"></span><a href="#plugin' + row.uuid + '">' + row.name + "</a> (" + row.dir + ")<br><small class='text-muted'>UUID: " + row.uuid + "</small>";
|
||||
var txt = '<span id="plugin' + row.uuid + '" style="margin-top: -60px; position: absolute;"></span><a href="#plugin' + row.uuid + '">' + row.name + "</a> <small class='text-muted'>(" + row.dir + ")</small>";
|
||||
|
||||
|
@ -539,6 +562,12 @@ $uuidJSCondition = implode(" && ", $rowId);
|
|||
txt += "<small class='text-success'>Version: @" + row.pluginversion + "</small>";
|
||||
}
|
||||
}
|
||||
if (row.hasOwnProperty("permissions") && row.permissions.length) {
|
||||
for (var i = 0; i < row.permissions.length; i++) {
|
||||
console.log(row.permissions[i]);
|
||||
}
|
||||
txt += '<button type="button" class="btn btn-xs btn-default btn-block" onclick="pluginPermissionsBtn(' + row.id + ')" data-toggle="tooltip" title="<?php echo __('User Groups Permissions'); ?>"><span class="fa fa-users" aria-hidden="true"></span> <?php echo __('User Groups Permissions'); ?></button>';
|
||||
}
|
||||
|
||||
return txt;
|
||||
},
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
<?php
|
||||
global $global, $config;
|
||||
if(!isset($global['systemRootPath'])){
|
||||
if (!isset($global['systemRootPath'])) {
|
||||
require_once '../videos/configuration.php';
|
||||
}
|
||||
require_once $global['systemRootPath'] . 'objects/user.php';
|
||||
|
@ -24,25 +24,31 @@ if (!User::canUpload()) {
|
|||
include $global['systemRootPath'] . 'view/include/navbar.php';
|
||||
?>
|
||||
|
||||
<div class="container">
|
||||
<div class="col-lg-9">
|
||||
<textarea id="emailMessage" placeholder="<?php echo __("Enter text"); ?> ..." style="width: 100%;"></textarea>
|
||||
<div class="container-fluid">
|
||||
<div class="panel panel-default">
|
||||
<div class="panel-heading">
|
||||
<?php echo __("Subscribes"); ?>
|
||||
</div>
|
||||
<div class="panel-body">
|
||||
<button type="button" class="btn btn-success pull-right" id="sendSubscribeBtn">
|
||||
<i class="fas fa-envelope-square"></i> <?php echo __("Notify Subscribers"); ?>
|
||||
</button>
|
||||
<div class="clearfix hidden-sm hidden-md hidden-lg"></div>
|
||||
<textarea id="emailMessage" placeholder="<?php echo __("Enter text"); ?> ..." style="width: 100%;"></textarea>
|
||||
</div>
|
||||
<div class="panel-footer">
|
||||
<table id="grid" class="table table-condensed table-hover table-striped">
|
||||
<thead>
|
||||
<tr>
|
||||
<th data-column-id="identification" ><?php echo __("My Subscribers"); ?></th>
|
||||
<th data-column-id="created" ><?php echo __("Created"); ?></th>
|
||||
<th data-column-id="modified" ><?php echo __("Modified"); ?></th>
|
||||
<th data-column-id="status" data-formatter="status" data-sortable="false"><?php echo __("Status"); ?></th>
|
||||
</tr>
|
||||
</thead>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-lg-3">
|
||||
<button type="button" class="btn btn-success" id="sendSubscribeBtn">
|
||||
<i class="fas fa-envelope-square"></i> <?php echo __("Notify Subscribers"); ?>
|
||||
</button>
|
||||
</div>
|
||||
<table id="grid" class="table table-condensed table-hover table-striped">
|
||||
<thead>
|
||||
<tr>
|
||||
<th data-column-id="identification" ><?php echo __("My Subscribers"); ?></th>
|
||||
<th data-column-id="created" ><?php echo __("Created"); ?></th>
|
||||
<th data-column-id="modified" ><?php echo __("Modified"); ?></th>
|
||||
<th data-column-id="status" data-formatter="status" data-sortable="false"><?php echo __("Status"); ?></th>
|
||||
</tr>
|
||||
</thead>
|
||||
</table>
|
||||
</div><!--/.container-->
|
||||
|
||||
<?php
|
||||
|
@ -50,13 +56,13 @@ if (!User::canUpload()) {
|
|||
?>
|
||||
<script src="<?php echo $global['webSiteRootURL']; ?>view/js/bootstrap3-wysiwyg/bootstrap3-wysihtml5.all.min.js" type="text/javascript"></script>
|
||||
<script>
|
||||
function _subscribe(email,user_id, id) {
|
||||
function _subscribe(email, user_id, id) {
|
||||
$('#subscribe' + id + ' span').addClass("fa-spinner");
|
||||
$('#subscribe' + id + ' span').addClass("fa-spin");
|
||||
$.ajax({
|
||||
url: '<?php echo $global['webSiteRootURL']; ?>objects/subscribe.json.php',
|
||||
method: 'POST',
|
||||
data: {'email': email, 'user_id':user_id},
|
||||
data: {'email': email, 'user_id': user_id},
|
||||
success: function (response) {
|
||||
console.log(response);
|
||||
$('#subscribe' + id + ' span').removeClass("fa-spinner");
|
||||
|
@ -76,7 +82,7 @@ if (!User::canUpload()) {
|
|||
});
|
||||
}
|
||||
|
||||
function notify(){
|
||||
function notify() {
|
||||
modal.showPleaseWait();
|
||||
$.ajax({
|
||||
url: '<?php echo $global['webSiteRootURL']; ?>objects/notifySubscribers.json.php',
|
||||
|
@ -121,10 +127,10 @@ if (!User::canUpload()) {
|
|||
var row_index = $(this).closest('tr').index();
|
||||
var row = $("#grid").bootgrid("getCurrentRows")[row_index];
|
||||
console.log(row);
|
||||
_subscribe(row.email,row.users_id, row.id);
|
||||
_subscribe(row.email, row.users_id, row.id);
|
||||
});
|
||||
});
|
||||
$("#sendSubscribeBtn").click(function (){
|
||||
$("#sendSubscribeBtn").click(function () {
|
||||
notify();
|
||||
});
|
||||
|
||||
|
|
|
@ -4,7 +4,7 @@ if (!isset($global['systemRootPath'])) {
|
|||
require_once '../videos/configuration.php';
|
||||
}
|
||||
require_once $global['systemRootPath'] . 'objects/user.php';
|
||||
if (!User::isAdmin()) {
|
||||
if (!Permissions::canAdminUsers()) {
|
||||
header("Location: {$global['webSiteRootURL']}?error=" . __("You can not manage users"));
|
||||
exit;
|
||||
}
|
||||
|
@ -22,7 +22,7 @@ if (!User::isAdmin()) {
|
|||
<?php
|
||||
include $global['systemRootPath'] . 'view/include/navbar.php';
|
||||
?>
|
||||
<div class="container">
|
||||
<div class="container-fluid">
|
||||
<?php
|
||||
include $global['systemRootPath'] . 'view/managerUsers_body.php';
|
||||
?>
|
||||
|
|
|
@ -4,9 +4,8 @@ if (!isset($global['systemRootPath'])) {
|
|||
require_once '../videos/configuration.php';
|
||||
}
|
||||
require_once $global['systemRootPath'] . 'objects/user.php';
|
||||
if (!User::isAdmin()) {
|
||||
header("Location: {$global['webSiteRootURL']}?error=" . __("You can not manage categories"));
|
||||
exit;
|
||||
if (!Permissions::canAdminUserGroups()) {
|
||||
forbiddenPage( __("You can not manage do this"));
|
||||
}
|
||||
?>
|
||||
<!DOCTYPE html>
|
||||
|
@ -24,7 +23,7 @@ if (!User::isAdmin()) {
|
|||
<?php
|
||||
include $global['systemRootPath'] . 'view/include/navbar.php';
|
||||
?>
|
||||
<div class="container">
|
||||
<div class="container-fluid">
|
||||
<?php
|
||||
include $global['systemRootPath'] . 'view/managerUsersGroups_body.php';
|
||||
?>
|
||||
|
|
|
@ -36,9 +36,28 @@
|
|||
</div>
|
||||
<div class="modal-body">
|
||||
<form class="form-compact" id="updateUserGroupsForm" onsubmit="">
|
||||
<input type="hidden" id="inputUserGroupsId" >
|
||||
<input type="hidden" id="inputUserGroupsId" name="id" >
|
||||
<label for="inputName" class="sr-only"><?php echo __("Name"); ?></label>
|
||||
<input type="text" id="inputName" class="form-control first" placeholder="<?php echo __("Name"); ?>" required autofocus>
|
||||
<input type="text" id="inputName" name="group_name" class="form-control" placeholder="<?php echo __("Name"); ?>" required autofocus>
|
||||
|
||||
<?php
|
||||
if(User::isAdmin()){
|
||||
?>
|
||||
<hr>
|
||||
|
||||
<div class="panel panel-default">
|
||||
<div class="panel-heading">
|
||||
<?php echo __("Group Permissions"); ?>
|
||||
</div>
|
||||
<div class="panel-body">
|
||||
<?php
|
||||
echo Permissions::getForm();
|
||||
?>
|
||||
</div>
|
||||
</div>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
</form>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
|
@ -49,7 +68,28 @@
|
|||
</div><!-- /.modal-dialog -->
|
||||
</div><!-- /.modal -->
|
||||
</div><!--/.container-->
|
||||
<div id="pluginsPermissionModal" class="modal fade" tabindex="-1" role="dialog">
|
||||
<div class="modal-dialog" role="document">
|
||||
<div id="pluginsPermissionModalContent">
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<script>
|
||||
|
||||
function pluginPermissionsBtn(plugins_id) {
|
||||
modal.showPleaseWait();
|
||||
$('#groupFormModal').modal('hide');
|
||||
$("#pluginsPermissionModalContent").html('');
|
||||
$.ajax({
|
||||
url: '<?php echo $global['webSiteRootURL']; ?>plugin/Permissions/getPermissionsFromPlugin.html.php?plugins_id=' + plugins_id,
|
||||
success: function (response) {
|
||||
modal.hidePleaseWait();
|
||||
$("#pluginsPermissionModalContent").html(response);
|
||||
$('#pluginsPermissionModal').modal();
|
||||
}
|
||||
});
|
||||
}
|
||||
$(document).ready(function () {
|
||||
var grid = $("#grid").bootgrid({
|
||||
labels: {
|
||||
|
@ -66,7 +106,7 @@
|
|||
"commands": function (column, row)
|
||||
{
|
||||
var editBtn = '<button type="button" class="btn btn-xs btn-default command-edit" data-row-id="' + row.id + '" data-toggle="tooltip" data-placement="left" title="<?php echo __('Edit'); ?>"><span class="glyphicon glyphicon-edit" aria-hidden="true"></span></button>'
|
||||
var deleteBtn = '<button type="button" class="btn btn-default btn-xs command-delete" data-row-id="' + row.id + ' data-toggle="tooltip" data-placement="left" title="<?php echo __('Delete'); ?>""><span class="glyphicon glyphicon-erase" aria-hidden="true"></span></button>';
|
||||
var deleteBtn = '<button type="button" class="btn btn-default btn-xs command-delete" data-row-id="' + row.id + ' data-toggle="tooltip" data-placement="left" title="<?php echo __('Delete'); ?>""><i class="fa fa-trash"></i></button>';
|
||||
return editBtn + deleteBtn;
|
||||
}
|
||||
}
|
||||
|
@ -80,7 +120,32 @@
|
|||
$('#inputUserGroupsId').val(row.id);
|
||||
$('#inputName').val(row.group_name);
|
||||
|
||||
$('#groupFormModal').modal();
|
||||
|
||||
modal.showPleaseWait();
|
||||
$.ajax({
|
||||
url: '<?php echo $global['webSiteRootURL']; ?>plugin/Permissions/getPermissions.json.php?users_groups_id=' + row.id,
|
||||
success: function (response) {
|
||||
console.log(response);
|
||||
$(".permissions").prop("checked", false);
|
||||
for (var key in response) {
|
||||
if(typeof key !== 'string'){
|
||||
continue;
|
||||
}
|
||||
for (var subkey in response[key]) {
|
||||
if(typeof subkey !== 'string' || isNaN(subkey)){
|
||||
continue;
|
||||
}
|
||||
var selector = "."+key+"[value=\""+response[key][subkey]+"\"]";
|
||||
console.log(selector, $(selector));
|
||||
$(selector).prop("checked", true);
|
||||
}
|
||||
}
|
||||
$('#groupFormModal').modal();
|
||||
modal.hidePleaseWait();
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
}).end().find(".command-delete").on("click", function (e) {
|
||||
var row_index = $(this).closest('tr').index();
|
||||
var row = $("#grid").bootgrid("getCurrentRows")[row_index];
|
||||
|
@ -119,8 +184,10 @@
|
|||
$('#inputUserGroupsId').val('');
|
||||
$('#inputName').val('');
|
||||
$('#inputCleanName').val('');
|
||||
|
||||
$("#updateUserGroupsForm").trigger("reset");
|
||||
$(".permissions").prop("checked", false);
|
||||
$('#groupFormModal').modal();
|
||||
|
||||
});
|
||||
|
||||
$('#saveUserGroupsBtn').click(function (evt) {
|
||||
|
@ -132,10 +199,10 @@
|
|||
modal.showPleaseWait();
|
||||
$.ajax({
|
||||
url: '<?php echo $global['webSiteRootURL'] . "objects/userGroupsAddNew.json.php"; ?>',
|
||||
data: {"id": $('#inputUserGroupsId').val(), "group_name": $('#inputName').val()},
|
||||
data: $(this).serialize(),
|
||||
type: 'post',
|
||||
success: function (response) {
|
||||
if (response.status === "1") {
|
||||
if (response.status) {
|
||||
$('#groupFormModal').modal('hide');
|
||||
$("#grid").bootgrid("reload");
|
||||
avideoAlert("<?php echo __("Congratulations!"); ?>", "<?php echo __("Your group has been saved!"); ?>", "success");
|
||||
|
@ -147,6 +214,7 @@
|
|||
});
|
||||
return false;
|
||||
});
|
||||
$('[data-toggle="tooltip"]').tooltip();
|
||||
});
|
||||
|
||||
</script>
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
<div class="panel panel-default">
|
||||
<div class="panel-heading">
|
||||
<div class="btn-group" >
|
||||
<div class="panel-heading tabbable-line">
|
||||
<div class="btn-group pull-right" >
|
||||
<button type="button" class="btn btn-default" id="addUserBtn">
|
||||
<span class="glyphicon glyphicon-plus" aria-hidden="true"></span> <?php echo __("New User"); ?>
|
||||
</button>
|
||||
|
@ -14,12 +14,13 @@
|
|||
<i class="fas fa-file-csv"></i> <?php echo __("CSV File"); ?>
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
<div class="panel-body">
|
||||
|
||||
<ul class="nav nav-tabs">
|
||||
<li class="active"><a data-toggle="tab" href="#usersTab"><?php echo __('Users'); ?></a></li>
|
||||
<li><a data-toggle="tab" href="#inactiveUsersTab"><?php echo __('Inactive Users'); ?></a></li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="panel-body">
|
||||
<div class="tab-content">
|
||||
<div id="usersTab" class="tab-pane fade in active">
|
||||
<table id="grid" class="table table-condensed table-hover table-striped">
|
||||
|
@ -81,7 +82,7 @@
|
|||
<input type="text" id="inputAnalyticsCode" class="form-control last" placeholder="Google Analytics Code: UA-123456789-1" >
|
||||
<small>Do not paste the full javascript code, paste only the gtag id</small>
|
||||
<ul class="list-group">
|
||||
<li class="list-group-item">
|
||||
<li class="list-group-item <?php echo User::isAdmin()?"":"hidden"; ?>">
|
||||
<?php echo __("is Admin"); ?>
|
||||
<div class="material-switch pull-right">
|
||||
<input type="checkbox" value="isAdmin" id="isAdmin"/>
|
||||
|
|
|
@ -34,6 +34,27 @@
|
|||
#actionButtonsVideoManager button{
|
||||
font-size: 12px;
|
||||
}
|
||||
.controls .btn{
|
||||
margin: 5px 0;
|
||||
}
|
||||
#grid .tagsInfo span.label:not(.tagTitle){
|
||||
display: inline-block;
|
||||
width: 60%;
|
||||
text-align: left;
|
||||
border-top-left-radius: 0;
|
||||
border-bottom-left-radius: 0;
|
||||
}
|
||||
#grid .tagsInfo span.label.tagTitle{
|
||||
display: inline-grid;
|
||||
width: 30%;
|
||||
overflow: hidden;
|
||||
text-align: right;
|
||||
border-top-right-radius: 0;
|
||||
border-bottom-right-radius: 0;
|
||||
border-top-left-radius: 0.25em;
|
||||
border-bottom-left-radius: 0.25em;
|
||||
}
|
||||
|
||||
</style>
|
||||
<div class="container-fluid">
|
||||
<?php
|
||||
|
@ -253,11 +274,12 @@
|
|||
<tr>
|
||||
<th data-formatter="checkbox" data-width="25px" ></th>
|
||||
<th data-column-id="title" data-formatter="titleTag" ><?php echo __("Title"); ?></th>
|
||||
<th data-column-id="tags" data-formatter="tags" data-sortable="false" data-width="210px" data-header-css-class='hidden-xs' data-css-class='hidden-xs'><?php echo __("Tags"); ?></th>
|
||||
<th data-column-id="tags" data-formatter="tags" data-sortable="false" data-width="300px" data-header-css-class='hidden-xs' data-css-class='hidden-xs tagsInfo'><?php echo __("Tags"); ?></th>
|
||||
<th data-column-id="duration" data-width="80px" data-header-css-class='hidden-md hidden-sm hidden-xs' data-css-class='hidden-md hidden-sm hidden-xs'><?php echo __("Duration"); ?></th>
|
||||
<th data-column-id="views_count" data-width="80px" data-header-css-class='hidden-md hidden-sm hidden-xs' data-css-class='hidden-md hidden-sm hidden-xs'><?php echo __("Views"); ?></th>
|
||||
<th data-column-id="filesize" data-formatter="filesize" data-width="100px" data-header-css-class='hidden-sm hidden-xs' data-css-class='hidden-sm hidden-xs'><?php echo __("Size"); ?></th>
|
||||
<th data-column-id="created" data-order="desc" data-width="100px" data-header-css-class='hidden-sm hidden-xs' data-css-class='hidden-sm hidden-xs'><?php echo __("Created"); ?></th>
|
||||
<th data-column-id="commands" data-formatter="commands" data-sortable="false" data-width="200px"></th>
|
||||
<th data-column-id="commands" data-formatter="commands" data-sortable="false" data-css-class='controls' data-width="200px"></th>
|
||||
</tr>
|
||||
</thead>
|
||||
</table>
|
||||
|
@ -659,45 +681,45 @@ if (empty($advancedCustom->disableHTMLDescription)) {
|
|||
?>
|
||||
<script type="text/javascript" src="<?php echo $global['webSiteRootURL']; ?>view/js/tinymce/tinymce.min.js"></script>
|
||||
<script>
|
||||
tinymce.init({
|
||||
selector: '#inputDescription', // change this value according to your HTML
|
||||
plugins: 'code print preview fullpage searchreplace autolink directionality visualblocks visualchars fullscreen image link media codesample table charmap hr pagebreak nonbreaking anchor toc insertdatetime advlist lists wordcount imagetools textpattern help ',
|
||||
//toolbar: 'fullscreen | formatselect | bold italic strikethrough forecolor backcolor permanentpen formatpainter | link image media pageembed | alignleft aligncenter alignright alignjustify | numlist bullist outdent indent | removeformat | addcomment',
|
||||
toolbar: 'fullscreen | formatselect | bold italic strikethrough | link image media pageembed | numlist bullist | removeformat | addcomment',
|
||||
height: 400,
|
||||
convert_urls: false,
|
||||
images_upload_handler: function (blobInfo, success, failure) {
|
||||
var xhr, formData;
|
||||
if (!videos_id) {
|
||||
$('#inputTitle').val("Article automatically booked");
|
||||
saveVideo(false);
|
||||
tinymce.init({
|
||||
selector: '#inputDescription', // change this value according to your HTML
|
||||
plugins: 'code print preview fullpage searchreplace autolink directionality visualblocks visualchars fullscreen image link media codesample table charmap hr pagebreak nonbreaking anchor toc insertdatetime advlist lists wordcount imagetools textpattern help ',
|
||||
//toolbar: 'fullscreen | formatselect | bold italic strikethrough forecolor backcolor permanentpen formatpainter | link image media pageembed | alignleft aligncenter alignright alignjustify | numlist bullist outdent indent | removeformat | addcomment',
|
||||
toolbar: 'fullscreen | formatselect | bold italic strikethrough | link image media pageembed | numlist bullist | removeformat | addcomment',
|
||||
height: 400,
|
||||
convert_urls: false,
|
||||
images_upload_handler: function (blobInfo, success, failure) {
|
||||
var xhr, formData;
|
||||
if (!videos_id) {
|
||||
$('#inputTitle').val("Article automatically booked");
|
||||
saveVideo(false);
|
||||
}
|
||||
xhr = new XMLHttpRequest();
|
||||
xhr.withCredentials = false;
|
||||
xhr.open('POST', '<?php echo $global['webSiteRootURL']; ?>objects/uploadArticleImage.php?video_id=' + videos_id);
|
||||
xhr.onload = function () {
|
||||
var json;
|
||||
if (xhr.status != 200) {
|
||||
failure('HTTP Error: ' + xhr.status);
|
||||
return;
|
||||
}
|
||||
|
||||
json = xhr.responseText;
|
||||
json = JSON.parse(json);
|
||||
if (json.error === false && json.url) {
|
||||
success(json.url);
|
||||
} else if (json.msg) {
|
||||
avideoAlert("<?php echo __("Sorry!"); ?>", json.msg, "error");
|
||||
} else {
|
||||
avideoAlert("<?php echo __("Error!"); ?>", "<?php echo __("Unknown Error!"); ?>", "error");
|
||||
}
|
||||
|
||||
};
|
||||
formData = new FormData();
|
||||
formData.append('file_data', blobInfo.blob(), blobInfo.filename());
|
||||
xhr.send(formData);
|
||||
}
|
||||
xhr = new XMLHttpRequest();
|
||||
xhr.withCredentials = false;
|
||||
xhr.open('POST', '<?php echo $global['webSiteRootURL']; ?>objects/uploadArticleImage.php?video_id=' + videos_id);
|
||||
xhr.onload = function () {
|
||||
var json;
|
||||
if (xhr.status != 200) {
|
||||
failure('HTTP Error: ' + xhr.status);
|
||||
return;
|
||||
}
|
||||
|
||||
json = xhr.responseText;
|
||||
json = JSON.parse(json);
|
||||
if (json.error === false && json.url) {
|
||||
success(json.url);
|
||||
} else if (json.msg) {
|
||||
avideoAlert("<?php echo __("Sorry!"); ?>", json.msg, "error");
|
||||
} else {
|
||||
avideoAlert("<?php echo __("Error!"); ?>", "<?php echo __("Unknown Error!"); ?>", "error");
|
||||
}
|
||||
|
||||
};
|
||||
formData = new FormData();
|
||||
formData.append('file_data', blobInfo.blob(), blobInfo.filename());
|
||||
xhr.send(formData);
|
||||
}
|
||||
});
|
||||
});
|
||||
</script>
|
||||
<?php
|
||||
}
|
||||
|
@ -797,14 +819,14 @@ if (empty($advancedCustomUser->userCanNotChangeUserGroup) || User::isAdmin()) {
|
|||
?>
|
||||
function checkProgress(encoderURL) {
|
||||
$.ajax({
|
||||
url: encoderURL+'status',
|
||||
url: encoderURL + 'status',
|
||||
success: function (response) {
|
||||
if (response.queue_list.length) {
|
||||
for (i = 0; i < response.queue_list.length; i++) {
|
||||
if (webSiteRootURL !== response.queue_list[i].streamer_site) {
|
||||
continue;
|
||||
}
|
||||
if(response.queue_list[i].return_vars && response.queue_list[i].return_vars.videos_id){
|
||||
if (response.queue_list[i].return_vars && response.queue_list[i].return_vars.videos_id) {
|
||||
createQueueItem(response.queue_list[i], i);
|
||||
}
|
||||
}
|
||||
|
@ -817,15 +839,15 @@ if (empty($advancedCustomUser->userCanNotChangeUserGroup) || User::isAdmin()) {
|
|||
if (response.download_status && !response.encoding_status.progress) {
|
||||
$("#encodingProgress" + id).find('.progress-completed').html("<strong>" + response.encoding.name + " [Downloading ...] </strong> " + response.download_status.progress + '%');
|
||||
} else {
|
||||
var encodingProgressCounter = $("#encodingProgressCounter"+id).text();
|
||||
if(isNaN(encodingProgressCounter)){
|
||||
var encodingProgressCounter = $("#encodingProgressCounter" + id).text();
|
||||
if (isNaN(encodingProgressCounter)) {
|
||||
encodingProgressCounter = 0;
|
||||
}else{
|
||||
} else {
|
||||
encodingProgressCounter = parseInt(encodingProgressCounter);
|
||||
}
|
||||
|
||||
|
||||
$("#encodingProgress" + id).find('.progress-completed').html("<strong>" + response.encoding.name + "[" + response.encoding_status.from + " to " + response.encoding_status.to + "] </strong> <span id='encodingProgressCounter" + id +"'>"+encodingProgressCounter+"</span>%");
|
||||
|
||||
|
||||
$("#encodingProgress" + id).find('.progress-completed').html("<strong>" + response.encoding.name + "[" + response.encoding_status.from + " to " + response.encoding_status.to + "] </strong> <span id='encodingProgressCounter" + id + "'>" + encodingProgressCounter + "</span>%");
|
||||
$("#encodingProgress" + id).find('.progress-bar').css({'width': response.encoding_status.progress + '%'});
|
||||
//$("#encodingProgressComplete" + id).text(response.encoding_status.progress + '%');
|
||||
countTo("#encodingProgressComplete" + id, response.encoding_status.progress);
|
||||
|
@ -834,7 +856,7 @@ if (empty($advancedCustomUser->userCanNotChangeUserGroup) || User::isAdmin()) {
|
|||
if (response.download_status) {
|
||||
$("#downloadProgress" + id).find('.progress-bar').css({'width': response.download_status.progress + '%'});
|
||||
}
|
||||
if (response.encoding_status.progress >= 100) {
|
||||
if (response.encoding_status.progress >= 100 && $("#encodingProgress" + id).length) {
|
||||
$("#encodingProgress" + id).find('.progress-bar').css({'width': '100%'});
|
||||
$("#encodingProgressComplete" + id).text('100%');
|
||||
clearTimeout(timeOut);
|
||||
|
@ -1592,7 +1614,7 @@ echo AVideoPlugin::getManagerVideosReset();
|
|||
buttons: true,
|
||||
dangerMode: true,
|
||||
})
|
||||
.then(function(willDelete) {
|
||||
.then(function (willDelete) {
|
||||
if (willDelete) {
|
||||
avideoAlert("Deleted!", "", "success");
|
||||
modal.showPleaseWait();
|
||||
|
@ -1697,27 +1719,27 @@ if (User::isAdmin()) {
|
|||
<?php
|
||||
if (empty($advancedCustom->disableCopyEmbed)) {
|
||||
?>
|
||||
embedBtn += '<button type="button" class="btn btn-xs btn-default command-embed" id="embedBtn' + row.id + '" onclick="getEmbedCode(' + row.id + ')" data-toggle="tooltip" data-placement="left" title="<?php echo str_replace("'", "\\'", __("Copy embed code")); ?>"><span class="fa fa-copy" aria-hidden="true"></span> <span id="copied' + row.id + '" style="display:none;"><?php echo str_replace("'", "\\'", __("Copied")); ?></span></button>'
|
||||
embedBtn += '<button type="button" class="btn btn-xs btn-default command-embed" id="embedBtn' + row.id + '" onclick="getEmbedCode(' + row.id + ')" data-toggle="tooltip" title="<?php echo str_replace("'", "\\'", __("Copy embed code")); ?>"><span class="fa fa-copy" aria-hidden="true"></span> <span id="copied' + row.id + '" style="display:none;"><?php echo str_replace("'", "\\'", __("Copied")); ?></span></button>'
|
||||
embedBtn += '<input type="hidden" id="embedInput' + row.id + '" value=\'<?php echo str_replace("{embedURL}", "{$global['webSiteRootURL']}vEmbed/' + row.id + '", str_replace("'", "\"", $advancedCustom->embedCodeTemplate)); ?>\'/>';
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
|
||||
var editBtn = '<button type="button" class="btn btn-xs btn-default command-edit" data-row-id="' + row.id + '" data-toggle="tooltip" data-placement="left" title="<?php echo str_replace("'", "\\'", __("Edit")); ?>"><span class="glyphicon glyphicon-edit" aria-hidden="true"></span></button>'
|
||||
var deleteBtn = '<button type="button" class="btn btn-default btn-xs command-delete" data-row-id="' + row.id + '" data-toggle="tooltip" data-placement="left" title="<?php echo str_replace("'", "\\'", __("Delete")); ?>"><span class="glyphicon glyphicon-remove" aria-hidden="true"></span></button>';
|
||||
var activeBtn = '<button style="color: #090" type="button" class="btn btn-default btn-xs command-active" data-row-id="' + row.id + '" data-toggle="tooltip" data-placement="left" title="<?php echo str_replace("'", "\\'", __("Inactivate")); ?>"><span class="glyphicon glyphicon-eye-open" aria-hidden="true"></span></button>';
|
||||
var inactiveBtn = '<button style="color: #A00" type="button" class="btn btn-default btn-xs command-inactive" data-row-id="' + row.id + '" data-toggle="tooltip" data-placement="left" title="<?php echo str_replace("'", "\\'", __("Activate")); ?>"><span class="glyphicon glyphicon-eye-close" aria-hidden="true"></span></button>';
|
||||
var unlistedBtn = '<button style="color: #BBB" type="button" class="btn btn-default btn-xs command-unlisted" data-row-id="' + row.id + '" data-toggle="tooltip" data-placement="left" title="<?php echo str_replace("'", "\\'", __("Unlisted")); ?>"><span class="glyphicon glyphicon-eye-open" aria-hidden="true"></span></button>';
|
||||
var rotateLeft = '<button type="button" class="btn btn-default btn-xs command-rotate" data-row-id="left" data-toggle="tooltip" data-placement="left" title="<?php echo str_replace("'", "\\'", __("Rotate LEFT")); ?>"><span class="fa fa-undo" aria-hidden="true"></span></button>';
|
||||
var rotateRight = '<button type="button" class="btn btn-default btn-xs command-rotate" data-row-id="right" data-toggle="tooltip" data-placement="left" title="<?php echo str_replace("'", "\\'", __("Rotate RIGHT")); ?>"><span class="fas fa-redo " aria-hidden="true"></span></button>';
|
||||
var editBtn = '<button type="button" class="btn btn-xs btn-default command-edit" data-row-id="' + row.id + '" data-toggle="tooltip" title="<?php echo str_replace("'", "\\'", __("Edit")); ?>"><span class="glyphicon glyphicon-edit" aria-hidden="true"></span></button>'
|
||||
var deleteBtn = '<button type="button" class="btn btn-default btn-xs command-delete" data-row-id="' + row.id + '" data-toggle="tooltip" title="<?php echo str_replace("'", "\\'", __("Delete")); ?>"><i class="fa fa-trash"></i></button>';
|
||||
var activeBtn = '<button style="color: #090" type="button" class="btn btn-default btn-xs command-active" data-row-id="' + row.id + '" data-toggle="tooltip" title="<?php echo str_replace("'", "\\'", __("Unlist this video")); ?>"><span class="glyphicon glyphicon-eye-open" aria-hidden="true"></span></button>';
|
||||
var inactiveBtn = '<button style="color: #A00" type="button" class="btn btn-default btn-xs command-inactive" data-row-id="' + row.id + '" data-toggle="tooltip" title="<?php echo str_replace("'", "\\'", __("Activate this video")); ?>"><span class="glyphicon glyphicon-eye-close" aria-hidden="true"></span></button>';
|
||||
var unlistedBtn = '<button style="color: #BBB" type="button" class="btn btn-default btn-xs command-unlisted" data-row-id="' + row.id + '" data-toggle="tooltip" title="<?php echo str_replace("'", "\\'", __("Inactivate this video")); ?>"><span class="glyphicon glyphicon-eye-open" aria-hidden="true"></span></button>';
|
||||
var rotateLeft = '<button type="button" class="btn btn-default btn-xs command-rotate" data-row-id="left" data-toggle="tooltip" title="<?php echo str_replace("'", "\\'", __("Rotate LEFT")); ?>"><span class="fa fa-undo" aria-hidden="true"></span></button>';
|
||||
var rotateRight = '<button type="button" class="btn btn-default btn-xs command-rotate" data-row-id="right" data-toggle="tooltip" title="<?php echo str_replace("'", "\\'", __("Rotate RIGHT")); ?>"><span class="fas fa-redo " aria-hidden="true"></span></button>';
|
||||
//var rotateBtn = "<br>" + rotateLeft + rotateRight;
|
||||
var rotateBtn = "<br>";
|
||||
var suggestBtn = "";
|
||||
<?php
|
||||
if (User::isAdmin()) {
|
||||
?>
|
||||
var suggest = '<button style="color: #C60" type="button" class="btn btn-default btn-xs command-suggest" data-toggle="tooltip" data-placement="left" title="<?php echo str_replace("'", "\\'", __("Unsuggest")); ?>"><i class="fas fa-star" aria-hidden="true"></i></button>';
|
||||
var unsuggest = '<button style="" type="button" class="btn btn-default btn-xs command-suggest unsuggest" data-toggle="tooltip" data-placement="left" title="<?php echo str_replace("'", "\\'", __("Suggest")); ?>"><i class="far fa-star" aria-hidden="true"></i></button>';
|
||||
var suggest = '<button style="color: #C60" type="button" class="btn btn-default btn-xs command-suggest" data-toggle="tooltip" title="<?php echo str_replace("'", "\\'", __("Unsuggest")); ?>"><i class="fas fa-star" aria-hidden="true"></i></button>';
|
||||
var unsuggest = '<button style="" type="button" class="btn btn-default btn-xs command-suggest unsuggest" data-toggle="tooltip" title="<?php echo str_replace("'", "\\'", __("Suggest")); ?>"><i class="far fa-star" aria-hidden="true"></i></button>';
|
||||
suggestBtn = unsuggest;
|
||||
if (row.isSuggested == "1") {
|
||||
suggestBtn = suggest;
|
||||
|
@ -1778,24 +1800,26 @@ if (User::isAdmin()) {
|
|||
},
|
||||
"tags": function (column, row) {
|
||||
var tags = "";
|
||||
if (row.maxResolution && row.maxResolution.resolution_string) {
|
||||
tags += "<span class='label label-primary tagTitle'><?php echo __("Resolution") . ":"; ?> </span><span class=\"label label-default \">" + row.maxResolution.resolution_string + "</span><br>";
|
||||
}
|
||||
for (var i in row.tags) {
|
||||
if (typeof row.tags[i].type == "undefined") {
|
||||
continue;
|
||||
}
|
||||
tags += "<span class='label label-primary fix-width'>" + row.tags[i].label + ": </span><span class=\"label label-" + row.tags[i].type + " fix-width\">" + row.tags[i].text + "</span><br>";
|
||||
tags += "<span class='label label-primary tagTitle'>" + row.tags[i].label + ": </span><span class=\"label label-" + row.tags[i].type + " \">" + row.tags[i].text + "</span><br>";
|
||||
}
|
||||
tags += "<span class='label label-primary fix-width'><?php echo __("Type") . ":"; ?> </span><span class=\"label label-default fix-width\">" + row.type + "</span><br>";
|
||||
tags += "<span class='label label-primary fix-width'><?php echo __("Views") . ":"; ?> </span><span class=\"label label-default fix-width\">" + row.views_count + " <a href='#' class='viewsDetails' onclick='viewsDetails(" + row.views_count + ", " + row.views_count_25 + "," + row.views_count_50 + "," + row.views_count_75 + "," + row.views_count_100 + ");'>[<i class='fas fa-info-circle'></i> Details]</a></span><br>";
|
||||
tags += "<span class='label label-primary fix-width'><?php echo __("Format") . ":"; ?> </span>" + row.typeLabels;
|
||||
tags += "<span class='label label-primary tagTitle'><?php echo __("Type") . ":"; ?> </span><span class=\"label label-default \">" + row.type + "</span><br>";
|
||||
tags += "<span class='label label-primary tagTitle'><?php echo __("Views") . ":"; ?> </span><span class=\"label label-default \">" + row.views_count + " <a href='#' class='viewsDetails' onclick='viewsDetails(" + row.views_count + ", " + row.views_count_25 + "," + row.views_count_50 + "," + row.views_count_75 + "," + row.views_count_100 + ");'>[<i class='fas fa-info-circle'></i> Details]</a></span><br>";
|
||||
tags += "<span class='label label-primary tagTitle'><?php echo __("Format") . ":"; ?> </span>" + row.typeLabels + "<br>";
|
||||
if (row.encoderURL) {
|
||||
tags += "<br><span class='label label-primary fix-width'><?php echo __("Encoder") . ":"; ?> </span><span class=\"label label-default fix-width\">" + row.encoderURL + "</span><br>";
|
||||
tags += "<span class='label label-primary tagTitle'><?php echo __("Encoder") . ":"; ?> </span><span class=\"label label-default \">" + row.encoderURL + "</span><br>";
|
||||
clearTimeout(checkProgressTimeout[row.encoderURL]);
|
||||
checkProgressTimeout[row.encoderURL] = setTimeout(function(){
|
||||
checkProgressTimeout[row.encoderURL] = setTimeout(function () {
|
||||
checkProgress(row.encoderURL);
|
||||
},1000);
|
||||
}, 1000);
|
||||
}
|
||||
|
||||
|
||||
|
||||
return tags;
|
||||
},
|
||||
"filesize": function (column, row) {
|
||||
|
@ -1809,9 +1833,9 @@ if (User::isAdmin()) {
|
|||
var tags = "";
|
||||
var youTubeLink = "", youTubeUpload = "";
|
||||
<?php if (!$config->getDisable_youtubeupload()) { ?>
|
||||
youTubeUpload = '<button type="button" class="btn btn-danger btn-xs command-uploadYoutube" data-toggle="tooltip" data-placement="left" title="<?php echo str_replace("'", "\\'", __("Upload to YouTube")); ?>"><span class="fa fa-upload " aria-hidden="true"></span></button>';
|
||||
youTubeUpload = '<button type="button" class="btn btn-danger btn-xs command-uploadYoutube" data-toggle="tooltip" title="<?php echo str_replace("'", "\\'", __("Upload to YouTube")); ?>"><span class="fa fa-upload " aria-hidden="true"></span></button>';
|
||||
if (row.youtubeId) {
|
||||
//youTubeLink += '<a href=\'https://youtu.be/' + row.youtubeId + '\' target=\'_blank\' class="btn btn-primary" data-toggle="tooltip" data-placement="left" title="<?php echo str_replace("'", "\\'", __("Watch on YouTube")); ?>"><span class="fas fa-external-link-alt " aria-hidden="true"></span></a>';
|
||||
//youTubeLink += '<a href=\'https://youtu.be/' + row.youtubeId + '\' target=\'_blank\' class="btn btn-primary" data-toggle="tooltip" title="<?php echo str_replace("'", "\\'", __("Watch on YouTube")); ?>"><span class="fas fa-external-link-alt " aria-hidden="true"></span></a>';
|
||||
}
|
||||
var yt = '<br><div class="btn-group" role="group" ><a class="btn btn-default btn-xs" disabled><span class="fas fa-play-circle" aria-hidden="true"></span> YouTube</a> ' + youTubeUpload + youTubeLink + ' </div>';
|
||||
if (row.status == "d" || row.status == "e") {
|
||||
|
@ -1881,6 +1905,9 @@ if (AVideoPlugin::isEnabledByName('PlayLists')) {
|
|||
page = 1;
|
||||
}
|
||||
var ret = {current: page};
|
||||
setTimeout(function () {
|
||||
$('[data-toggle="tooltip"]').tooltip();
|
||||
}, 1000);
|
||||
return ret;
|
||||
},
|
||||
}).on("loaded.rs.jquery.bootgrid", function () {
|
||||
|
@ -1923,7 +1950,7 @@ if (AVideoPlugin::isEnabledByName('PlayLists')) {
|
|||
buttons: true,
|
||||
dangerMode: true,
|
||||
})
|
||||
.then(function(willDelete) {
|
||||
.then(function (willDelete) {
|
||||
if (willDelete) {
|
||||
deleteVideo(row.id);
|
||||
}
|
||||
|
|
|
@ -17,36 +17,36 @@ if (!empty($playlist_id)) {
|
|||
</script>
|
||||
<?php } else if (empty($autoPlayVideo)) {
|
||||
?>
|
||||
<div class="col-lg-12 col-sm-12 col-xs-12 autoplay text-muted" >
|
||||
<div class="col-lg-12 col-sm-12 col-xs-12 autoplay text-muted" style="margin: 10px 0;" >
|
||||
<strong><?php echo __("Autoplay ended"); ?></strong>
|
||||
<span class="pull-right">
|
||||
<span><?php echo __("Autoplay"); ?></span>
|
||||
<span>
|
||||
<i class="fa fa-info-circle" data-toggle="tooltip" data-placement="bottom" title="<?php echo __("When autoplay is enabled, a suggested video will automatically play next."); ?>"></i>
|
||||
</span>
|
||||
<div class="material-switch pull-right">
|
||||
<input type="checkbox" class="saveCookie" name="autoplay" id="autoplay">
|
||||
<div class="material-switch pull-right" style="margin-left: 10px;">
|
||||
<input type="checkbox" class="saveCookie" name="autoplay" id="autoplay" <?php echo PlayerSkins::isAutoplayEnabled() ? "checked" : ""; ?>>
|
||||
<label for="autoplay" class="label-primary"></label>
|
||||
</div>
|
||||
</span>
|
||||
</div>
|
||||
<?php } else if (!empty($autoPlayVideo)) { ?>
|
||||
<div class="row">
|
||||
<div class="col-lg-12 col-sm-12 col-xs-12 autoplay text-muted">
|
||||
<div class="col-lg-12 col-sm-12 col-xs-12 autoplay text-muted" style="margin: 10px 0;" >
|
||||
<strong><?php echo __("Up Next"); ?></strong>
|
||||
<span class="pull-right">
|
||||
<span><?php echo __("Autoplay"); ?></span>
|
||||
<span>
|
||||
<i class="fa fa-info-circle" data-toggle="tooltip" data-placement="bottom" title="<?php echo __("When autoplay is enabled, a suggested video will automatically play next."); ?>"></i>
|
||||
<i class="fa fa-info-circle" data-toggle="tooltip" data-placement="top" title="<?php echo __("When autoplay is enabled, a suggested video will automatically play next."); ?>"></i>
|
||||
</span>
|
||||
<div class="material-switch pull-right">
|
||||
<input type="checkbox" class="saveCookie" name="autoplay" id="autoplay">
|
||||
<div class="material-switch pull-right" style="margin-left: 10px;">
|
||||
<input type="checkbox" class="saveCookie" name="autoplay" id="autoplay" <?php echo PlayerSkins::isAutoplayEnabled() ? "checked" : ""; ?>>
|
||||
<label for="autoplay" class="label-primary"></label>
|
||||
</div>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-lg-12 col-sm-12 col-xs-12 bottom-border autoPlayVideo" id="autoPlayVideoDiv" >
|
||||
<div class="col-lg-12 col-sm-12 col-xs-12 bottom-border autoPlayVideo" id="autoPlayVideoDiv" style="margin: 10px 0; padding: 15px 5px; <?php echo PlayerSkins::isAutoplayEnabled() ? "" : "display: none;"; ?>" >
|
||||
<a href="<?php echo Video::getLink($autoPlayVideo['id'], $autoPlayVideo['clean_title'], "", $get); ?>" title="<?php echo str_replace('"', '', $autoPlayVideo['title']); ?>" class="videoLink h6">
|
||||
<div class="col-lg-5 col-sm-5 col-xs-5 nopadding thumbsImage">
|
||||
<?php
|
||||
|
@ -119,9 +119,7 @@ $modeYouTubeTimeLog['After autoplay and playlist '] = microtime(true) - $modeYou
|
|||
$modeYouTubeTime = microtime(true);
|
||||
?>
|
||||
<div class="clearfix"></div>
|
||||
<div class="row" style="margin: 15px 0;">
|
||||
<div class="col-lg-12 col-sm-12 col-xs-12 extraVideos nopadding"></div>
|
||||
</div>
|
||||
<div class="extraVideos nopadding" style="margin: 15px 0;"></div>
|
||||
<div class="clearfix"></div>
|
||||
<!-- videos List -->
|
||||
<!--googleoff: all-->
|
||||
|
|
|
@ -35,7 +35,7 @@ if (!$isCompressed) {
|
|||
$modeYouTubeTime = microtime(true);
|
||||
?>
|
||||
</div>
|
||||
<div class="col-sm-5 col-md-5 col-lg-4 rightBar" id="yptRightBar">
|
||||
<div class="col-sm-5 col-md-5 col-lg-4 rightBar" id="yptRightBar" >
|
||||
<div class="list-group-item ">
|
||||
<?php
|
||||
require "{$global['systemRootPath']}view/modeYoutubeBottomRight.php";
|
||||
|
|
251
view/update.php
251
view/update.php
|
@ -10,7 +10,7 @@ session_write_close();
|
|||
require_once $global['systemRootPath'] . 'objects/user.php';
|
||||
//check if there is a update
|
||||
if (!User::isAdmin()) {
|
||||
header("location: {$global['webSiteRootURL']}user");
|
||||
forbiddenPage("");
|
||||
exit;
|
||||
}
|
||||
// remove cache dir before the script starts to let the script recreate the javascript and css files
|
||||
|
@ -26,135 +26,150 @@ if (!empty($_POST['updateFile'])) {
|
|||
<?php
|
||||
include $global['systemRootPath'] . 'view/include/head.php';
|
||||
?>
|
||||
<style>
|
||||
body {
|
||||
background-color: #193c6d;
|
||||
filter: progid: DXImageTransform.Microsoft.gradient(gradientType=1, startColorstr='#003073', endColorstr='#029797');
|
||||
background-image: url(//img.alicdn.com/tps/TB1d.u8MXXXXXXuXFXXXXXXXXXX-1900-790.jpg);
|
||||
background-size: 100%;
|
||||
background-image: -webkit-gradient(linear, 0 0, 100% 100%, color-stop(0, #003073), color-stop(100%, #029797));
|
||||
background-image: -webkit-linear-gradient(135deg, #003073, #029797);
|
||||
background-image: -moz-linear-gradient(45deg, #003073, #029797);
|
||||
background-image: -ms-linear-gradient(45deg, #003073 0, #029797 100%);
|
||||
background-image: -o-linear-gradient(45deg, #003073, #029797);
|
||||
background-image: linear-gradient(135deg, #003073, #029797);
|
||||
text-align: center;
|
||||
margin: 0px;
|
||||
overflow: hidden;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body class="<?php echo $global['bodyClass']; ?>">
|
||||
<?php
|
||||
include $global['systemRootPath'] . 'view/include/navbar.php';
|
||||
?>
|
||||
<div class="container">
|
||||
<div class="panel panel-default">
|
||||
<div class="panel-body">
|
||||
|
||||
<div class="alert alert-success"><?php printf(__("You are running AVideo version %s!"), $config->getVersion()); ?></div>
|
||||
<?php
|
||||
if (empty($_POST['updateFile'])) {
|
||||
$updateFiles = getUpdatesFilesArray();
|
||||
if (!empty($updateFiles)) {
|
||||
?>
|
||||
<div class="alert alert-warning">
|
||||
<form method="post" class="form-compact well form-horizontal" >
|
||||
<fieldset>
|
||||
<legend><?php echo __("Update AVideo System"); ?></legend>
|
||||
<label for="updateFile" class="sr-only"><?php echo __("Select the update"); ?></label>
|
||||
<select class="selectpicker" data-width="fit" name="updateFile" id="updateFile" required autofocus>
|
||||
<?php
|
||||
$disabled = "";
|
||||
foreach ($updateFiles as $value) {
|
||||
echo "<option value=\"{$value['filename']}\" {$disabled}>Version {$value['version']}</option>";
|
||||
$disabled = "disabled";
|
||||
}
|
||||
?>
|
||||
</select>
|
||||
<?php printf(__("We detected a total of %s pending updates, if you want to do it now click (Update Now) button"), "<strong class='badge'>" . count($updateFiles) . "</strong>"); ?>
|
||||
<hr>
|
||||
<button type="submit" class="btn btn-warning btn-lg center-block " href="?update=1" > <span class="glyphicon glyphicon-refresh"></span> <?php echo __("Update Now"); ?> </button>
|
||||
</fieldset>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
$(document).ready(function () {
|
||||
$('#updateFile').selectpicker();
|
||||
});
|
||||
</script>
|
||||
<?php
|
||||
} else
|
||||
if ($version = thereIsAnyRemoteUpdate()) {
|
||||
?>
|
||||
<div class="alert alert-warning">
|
||||
Our repository is now running at version <?php echo $version->version; ?>.
|
||||
You can follow this <a target="_blank" href="https://github.com/WWBN/AVideo/wiki/How-to-Update-your-AVideo-Platform" class="btn btn-warning btn-xs" rel="noopener noreferrer">Update Tutorial</a>
|
||||
to update your files and get the latest version.
|
||||
</div>
|
||||
<?php
|
||||
} else {
|
||||
?>
|
||||
<div class="alert alert-success">
|
||||
<h2><?php echo __("Your system is up to date"); ?></h2>
|
||||
</div>
|
||||
<?php
|
||||
}
|
||||
} else {
|
||||
$obj = new stdClass();
|
||||
$templine = '';
|
||||
$logfile = "{$global['systemRootPath']}videos/avideo.";
|
||||
if (file_exists($logfile . "log")) {
|
||||
unlink($logfile . "log");
|
||||
_error_log("avideo.log deleted by update");
|
||||
}
|
||||
if (file_exists($logfile . "js.log")) {
|
||||
unlink($logfile . "js.log");
|
||||
_error_log("avideo.js.log deleted by update");
|
||||
}
|
||||
$lines = file("{$global['systemRootPath']}updatedb/{$_POST['updateFile']}");
|
||||
$obj->error = "";
|
||||
foreach ($lines as $line) {
|
||||
if (substr($line, 0, 2) == '--' || $line == '')
|
||||
continue;
|
||||
$templine .= $line;
|
||||
if (substr(trim($line), -1, 1) == ';') {
|
||||
if (!$global['mysqli']->query($templine)) {
|
||||
$obj->error = ('Error performing query \'<strong>' . $templine . '\': ' . $global['mysqli']->error . '<br /><br />');
|
||||
echo json_encode($obj);
|
||||
//exit;
|
||||
}
|
||||
$templine = '';
|
||||
}
|
||||
}
|
||||
|
||||
// insert configuration if is version 1.0
|
||||
if ($config->currentVersionLowerThen('1.0')) {
|
||||
$sql = "DELETE FROM configurations WHERE id = 1 ";
|
||||
if ($global['mysqli']->query($sql) !== TRUE) {
|
||||
$obj->error = "Error deleting configuration: " . $global['mysqli']->error;
|
||||
echo json_encode($obj);
|
||||
exit;
|
||||
}
|
||||
|
||||
$sql = "INSERT INTO configurations (id, video_resolution, users_id, version, created, modified) VALUES (1, '426:240', " . User::getId() . ",'1.0', now(), now())";
|
||||
if ($global['mysqli']->query($sql) !== TRUE) {
|
||||
$obj->error = "Error creating configuration: " . $global['mysqli']->error;
|
||||
echo json_encode($obj);
|
||||
exit;
|
||||
}
|
||||
}
|
||||
|
||||
if ($config->currentVersionEqual('1.0')) {
|
||||
$sql = "UPDATE configurations SET users_id = " . User::getId() . ", version = '1.1', webSiteTitle = '{$global['webSiteTitle']}', language = '{$global['language']}', contactEmail = '{$global['contactEmail']}', modified = now() WHERE id = 1";
|
||||
if ($global['mysqli']->query($sql) !== TRUE) {
|
||||
$obj->error = "Error creating configuration: " . $global['mysqli']->error;
|
||||
echo json_encode($obj);
|
||||
exit;
|
||||
}
|
||||
}
|
||||
|
||||
//$renamed = rename("{$global['systemRootPath']}updateDb.sql", "{$global['systemRootPath']}updateDb.sql.old");
|
||||
?>
|
||||
<div class="alert alert-success">
|
||||
<?php
|
||||
printf(__("Your update from file %s is done, click continue"), $_POST['updateFile']);
|
||||
?><hr>
|
||||
<a class="btn btn-success" href="?done=1" > <span class="glyphicon glyphicon-ok"></span> <?php echo __("Continue"); ?> </a>
|
||||
</div>
|
||||
<?php
|
||||
}
|
||||
<br>
|
||||
<br>
|
||||
<div class="alert alert-success"><?php printf(__("You are running AVideo version %s!"), $config->getVersion()); ?></div>
|
||||
<?php
|
||||
if (empty($_POST['updateFile'])) {
|
||||
$updateFiles = getUpdatesFilesArray();
|
||||
if (!empty($updateFiles)) {
|
||||
?>
|
||||
<div class="alert alert-warning">
|
||||
<form method="post" class="form-compact well form-horizontal" >
|
||||
<fieldset>
|
||||
<legend><?php echo __("Update AVideo System"); ?></legend>
|
||||
<label for="updateFile" class="sr-only"><?php echo __("Select the update"); ?></label>
|
||||
<select class="selectpicker" data-width="fit" name="updateFile" id="updateFile" required autofocus>
|
||||
<?php
|
||||
$disabled = "";
|
||||
foreach ($updateFiles as $value) {
|
||||
echo "<option value=\"{$value['filename']}\" {$disabled}>Version {$value['version']}</option>";
|
||||
$disabled = "disabled";
|
||||
}
|
||||
?>
|
||||
</select>
|
||||
<?php printf(__("We detected a total of %s pending updates, if you want to do it now click (Update Now) button"), "<strong class='badge'>" . count($updateFiles) . "</strong>"); ?>
|
||||
<hr>
|
||||
<button type="submit" class="btn btn-warning btn-lg center-block " href="?update=1" > <span class="glyphicon glyphicon-refresh"></span> <?php echo __("Update Now"); ?> </button>
|
||||
</fieldset>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
$(document).ready(function () {
|
||||
$('#updateFile').selectpicker();
|
||||
});
|
||||
</script>
|
||||
<?php
|
||||
} else
|
||||
if ($version = thereIsAnyRemoteUpdate()) {
|
||||
?>
|
||||
<div class="alert alert-warning">
|
||||
Our repository is now running at version <?php echo $version->version; ?>.
|
||||
You can follow this <a target="_blank" href="https://github.com/WWBN/AVideo/wiki/How-to-Update-your-AVideo-Platform" class="btn btn-warning btn-xs" rel="noopener noreferrer">Update Tutorial</a>
|
||||
to update your files and get the latest version.
|
||||
</div>
|
||||
<?php
|
||||
} else {
|
||||
?>
|
||||
<div class="alert alert-success">
|
||||
<h2><?php echo __("Your system is up to date"); ?></h2>
|
||||
</div>
|
||||
<?php
|
||||
}
|
||||
} else {
|
||||
$obj = new stdClass();
|
||||
$templine = '';
|
||||
$logfile = "{$global['systemRootPath']}videos/avideo.";
|
||||
if (file_exists($logfile . "log")) {
|
||||
unlink($logfile . "log");
|
||||
_error_log("avideo.log deleted by update");
|
||||
}
|
||||
if (file_exists($logfile . "js.log")) {
|
||||
unlink($logfile . "js.log");
|
||||
_error_log("avideo.js.log deleted by update");
|
||||
}
|
||||
$lines = file("{$global['systemRootPath']}updatedb/{$_POST['updateFile']}");
|
||||
$obj->error = "";
|
||||
foreach ($lines as $line) {
|
||||
if (substr($line, 0, 2) == '--' || $line == '')
|
||||
continue;
|
||||
$templine .= $line;
|
||||
if (substr(trim($line), -1, 1) == ';') {
|
||||
if (!$global['mysqli']->query($templine)) {
|
||||
$obj->error = ('Error performing query \'<strong>' . $templine . '\': ' . $global['mysqli']->error . '<br /><br />');
|
||||
echo json_encode($obj);
|
||||
//exit;
|
||||
}
|
||||
$templine = '';
|
||||
}
|
||||
}
|
||||
|
||||
// insert configuration if is version 1.0
|
||||
if ($config->currentVersionLowerThen('1.0')) {
|
||||
$sql = "DELETE FROM configurations WHERE id = 1 ";
|
||||
if ($global['mysqli']->query($sql) !== TRUE) {
|
||||
$obj->error = "Error deleting configuration: " . $global['mysqli']->error;
|
||||
echo json_encode($obj);
|
||||
exit;
|
||||
}
|
||||
|
||||
$sql = "INSERT INTO configurations (id, video_resolution, users_id, version, created, modified) VALUES (1, '426:240', " . User::getId() . ",'1.0', now(), now())";
|
||||
if ($global['mysqli']->query($sql) !== TRUE) {
|
||||
$obj->error = "Error creating configuration: " . $global['mysqli']->error;
|
||||
echo json_encode($obj);
|
||||
exit;
|
||||
}
|
||||
}
|
||||
|
||||
if ($config->currentVersionEqual('1.0')) {
|
||||
$sql = "UPDATE configurations SET users_id = " . User::getId() . ", version = '1.1', webSiteTitle = '{$global['webSiteTitle']}', language = '{$global['language']}', contactEmail = '{$global['contactEmail']}', modified = now() WHERE id = 1";
|
||||
if ($global['mysqli']->query($sql) !== TRUE) {
|
||||
$obj->error = "Error creating configuration: " . $global['mysqli']->error;
|
||||
echo json_encode($obj);
|
||||
exit;
|
||||
}
|
||||
}
|
||||
|
||||
//$renamed = rename("{$global['systemRootPath']}updateDb.sql", "{$global['systemRootPath']}updateDb.sql.old");
|
||||
?>
|
||||
<div class="alert alert-success">
|
||||
<?php
|
||||
printf(__("Your update from file %s is done, click continue"), $_POST['updateFile']);
|
||||
?><hr>
|
||||
<a class="btn btn-success" href="?done=1" > <span class="glyphicon glyphicon-ok"></span> <?php echo __("Continue"); ?> </a>
|
||||
</div>
|
||||
</div>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
</div>
|
||||
<?php
|
||||
include $global['systemRootPath'] . 'view/include/footer.php';
|
||||
?>
|
||||
<script src="<?php echo $global['webSiteRootURL']; ?>js/three.js" type="text/javascript"></script>
|
||||
</body>
|
||||
</html>
|
||||
<?php
|
||||
|
|
|
@ -41,48 +41,49 @@ foreach ($tags as $value) {
|
|||
<div class="row">
|
||||
<div>
|
||||
<form class="form-compact well form-horizontal" id="updateUserForm" onsubmit="">
|
||||
<?php echo $tagsStr; ?>
|
||||
<fieldset>
|
||||
<legend>
|
||||
<?php echo __("Update your user") ?>
|
||||
|
||||
</legend>
|
||||
<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($advancedCustomUser->disablePersonalInfo)) { ?>
|
||||
<li><a data-toggle="tab" href="#personalInfo" id="aPersonalInfo"><?php echo __("Personal Info") ?></a></li>
|
||||
<?php } ?>
|
||||
<?php echo AVideoPlugin::profileTabName($user->getId()); ?>
|
||||
</ul>
|
||||
|
||||
<div class="tab-content">
|
||||
<div id="basicInfo" class="tab-pane fade in active" style="padding: 10px 0;">
|
||||
<?php
|
||||
include $global['systemRootPath'] . './view/userBasicInfo.php';
|
||||
?>
|
||||
<div class="panel panel-default">
|
||||
<div class="panel-heading tabbable-line">
|
||||
<div class="pull-right">
|
||||
<?php echo $tagsStr; ?>
|
||||
</div>
|
||||
<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($advancedCustomUser->disablePersonalInfo)) { ?>
|
||||
<div id="personalInfo" class="tab-pane fade" style="padding: 10px 0;">
|
||||
<?php if (empty($advancedCustomUser->disablePersonalInfo)) { ?>
|
||||
<li><a data-toggle="tab" href="#personalInfo" id="aPersonalInfo"><?php echo __("Personal Info") ?></a></li>
|
||||
<?php } ?>
|
||||
<?php echo AVideoPlugin::profileTabName($user->getId()); ?>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="panel-body">
|
||||
<div class="tab-content">
|
||||
<div id="basicInfo" class="tab-pane fade in active" style="padding: 10px 0;">
|
||||
<?php
|
||||
include $global['systemRootPath'] . './view/userPersonalInfo.php';
|
||||
include $global['systemRootPath'] . './view/userBasicInfo.php';
|
||||
?>
|
||||
</div>
|
||||
<?php } ?>
|
||||
<?php echo AVideoPlugin::profileTabContent($user->getId()); ?>
|
||||
</div>
|
||||
|
||||
<!-- Button -->
|
||||
<div class="form-group">
|
||||
<hr>
|
||||
<div class="col-md-12">
|
||||
<center>
|
||||
<button type="submit" class="btn btn-primary btn-block btn-lg" ><?php echo __("Save"); ?> <span class="fa fa-save"></span></button>
|
||||
</center>
|
||||
<?php if (empty($advancedCustomUser->disablePersonalInfo)) { ?>
|
||||
<div id="personalInfo" class="tab-pane fade" style="padding: 10px 0;">
|
||||
<?php
|
||||
include $global['systemRootPath'] . './view/userPersonalInfo.php';
|
||||
?>
|
||||
</div>
|
||||
<?php } ?>
|
||||
<?php echo AVideoPlugin::profileTabContent($user->getId()); ?>
|
||||
</div>
|
||||
|
||||
<!-- Button -->
|
||||
<div class="form-group">
|
||||
<hr>
|
||||
<div class="col-md-12">
|
||||
<center>
|
||||
<button type="submit" class="btn btn-primary btn-block btn-lg" ><?php echo __("Save"); ?> <span class="fa fa-save"></span></button>
|
||||
</center>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</fieldset>
|
||||
</div>
|
||||
</form>
|
||||
|
||||
</div>
|
||||
|
@ -90,7 +91,7 @@ foreach ($tags as $value) {
|
|||
|
||||
<?php
|
||||
} else {
|
||||
include $global['systemRootPath'] .'./view/userLogin.php';
|
||||
include $global['systemRootPath'] . './view/userLogin.php';
|
||||
}
|
||||
?>
|
||||
|
||||
|
|
|
@ -71,7 +71,7 @@ if (!empty($_GET['channelName']) && empty($advancedCustomUser->hideRemoveChannel
|
|||
$user = User::getChannelOwner($_GET['channelName']);
|
||||
//var_dump($user);exit;
|
||||
?>
|
||||
<div class="col-md-12" >
|
||||
<div class="col-md-12" style="padding: 15px; margin: 5px 0; background-image: url(<?php echo $global['webSiteRootURL'], User::getBackgroundURLFromUserID($user['id']); ?>); background-size: cover;" >
|
||||
<img src="<?php echo User::getPhoto($user['id']); ?>" class="img img-responsive img-circle" style="max-width: 60px;" alt="User Photo"/>
|
||||
<div style="position: absolute; right: 5px; top: 5px;">
|
||||
<button class="btn btn-default btn-xs btn-sm" onclick="loadPage(<?php echo $_GET['page']; ?>, true);"><?php echo User::getNameIdentificationById($user['id']); ?> <i class="fa fa-times"></i></button>
|
||||
|
@ -127,9 +127,9 @@ foreach ($videos as $key => $value) {
|
|||
$name = User::getNameIdentificationById($value['users_id']) . ' ' . User::getEmailVerifiedIcon($value['users_id']);
|
||||
$value['creator'] = '<div class="pull-left">'
|
||||
. '<a href="' . User::getChannelLink($value['users_id']) . '"><img src="' . User::getPhoto($value['users_id']) . '" alt="User Photo" class="img img-responsive img-circle zoom" style="max-width: 20px;"/></div><div class="commentDetails" style="margin-left:25px;"><div class="commenterName text-muted"><strong>' . $name . '</strong> <small>'
|
||||
. '</a>' . humanTiming(strtotime($value['videoCreation'])) . '</small></div></div>';
|
||||
. '</a>' . humanTimingAgo(strtotime($value['videoCreation'])) . '</small></div></div>';
|
||||
?>
|
||||
<div class="col-lg-12 col-sm-12 col-xs-12 bottom-border" id="divVideo-<?php echo $value['id']; ?>" >
|
||||
<div class="col-lg-12 col-sm-12 col-xs-12 bottom-border videoListItem" id="divVideo-<?php echo $value['id']; ?>" >
|
||||
<?php
|
||||
$link = Video::getLink($value['id'], $value['clean_title'], "", $get);
|
||||
$connection = "?";
|
||||
|
@ -225,7 +225,7 @@ foreach ($videos as $key => $value) {
|
|||
<div class="text-uppercase row"><strong class="title"><?php echo $value['title']; ?></strong></div>
|
||||
</a>
|
||||
<div class="details row">
|
||||
<div class="col-sm-6 nopadding">
|
||||
<div class="pull-left" style="display: inline-table;">
|
||||
<a class="label label-default" href="<?php echo $global['webSiteRootURL']; ?>cat/<?php echo $value['clean_category']; ?>">
|
||||
<span class="<?php echo $value['iconClass']; ?>"></span>
|
||||
<span class="hidden-sm"><?php echo $value['category']; ?></span>
|
||||
|
@ -251,11 +251,12 @@ foreach ($videos as $key => $value) {
|
|||
<?php
|
||||
if (empty($advancedCustom->doNotDisplayViews)) {
|
||||
?>
|
||||
<div class="col-sm-6 nopadding text-muted">
|
||||
<div class="text-muted pull-right">
|
||||
<strong class="view-count<?php echo $value['id']; ?>"> <i class="fas fa-eye"></i> <?php echo number_format($value['views_count'], 0); ?></strong>
|
||||
</div>
|
||||
<?php } ?>
|
||||
<div class="col-sm-12 nopadding" style="margin-top: 5px !important;"><?php echo $value['creator']; ?></div>
|
||||
<div class="clearfix"></div>
|
||||
<div class="nopadding" style="margin-top: 5px !important;"><?php echo $value['creator']; ?></div>
|
||||
|
||||
|
||||
</div>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue