1
0
Fork 0
mirror of https://github.com/DanielnetoDotCom/YouPHPTube synced 2025-10-02 17:29:20 +02:00
Also check the lang in case insensitive
This commit is contained in:
Daniel 2022-03-14 14:28:38 -03:00
parent 33e7f7384e
commit 2a9630258f
22658 changed files with 3562773 additions and 3562767 deletions

View file

@ -1,35 +1,35 @@
name: Docker Image CI
on:
push:
branches:
- "master"
pull_request:
branches:
- "master"
# schedule:
# - cron: '35 2 * * 1'
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Set up QEMU
uses: docker/setup-qemu-action@v1
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
- name: Login to DockerHub
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Build and push
id: docker_build
uses: docker/build-push-action@v2
with:
push: true
tags: ${{ secrets.DOCKERHUB_IMAGE }}
name: Docker Image CI
on:
push:
branches:
- "master"
pull_request:
branches:
- "master"
# schedule:
# - cron: '35 2 * * 1'
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Set up QEMU
uses: docker/setup-qemu-action@v1
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
- name: Login to DockerHub
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Build and push
id: docker_build
uses: docker/build-push-action@v2
with:
push: true
tags: ${{ secrets.DOCKERHUB_IMAGE }}

158
.gitignore vendored
View file

@ -1,79 +1,79 @@
/.scannerwork/
/YouPHPTube.code-workspace
/git.php
/iptvsource_one_one.csv
/nbproject/
/nbproject/private/
/plugin/AD_Server_Promote_Videos/
/plugin/AWS_S3/
/plugin/AudioTrackSwitcher/
/plugin/AudioVisualizer/
/plugin/AutoShare/
/plugin/Backup/
/plugin/Blackblaze_B2/
/plugin/Bookmark/
/plugin/Chat2/
/plugin/CountryRedirect/
/plugin/CreateUserManager/
/plugin/Customize/
/plugin/DIY/
/plugin/DiskUploadQuota/
/plugin/FTPAutoImport/
/plugin/FTP_Storage/
/plugin/FlixHouse/
/plugin/GoogleAds_IMA/
/plugin/IPDirectConnect/
/plugin/IPTV/
/plugin/ImportFromOtherVideoPlatform/
/plugin/Layout/hamburguerMenu.php
/plugin/Layout/navBarLateral.php
/plugin/Layout/navbar.php
/plugin/Layout/timer.php
/plugin/LifeStreamLayout/
/plugin/LiveCountdownEvent/
/plugin/LiveOnlineUsers/
/plugin/LiveUsers/
/plugin/Livesearch/
/plugin/LoginLDAP/
/plugin/LoginLDAP_DYNA/
/plugin/MP4ThumbsAndGif/
/plugin/MP4ThumbsAndGifLocal/
/plugin/Notifications/
/plugin/PayPalToWatch/
/plugin/PayPerView/
/plugin/PayPerViewLive/
/plugin/PointsSystem/
/plugin/PromoteVideos/
/plugin/ReturnToLastPosition/
/plugin/SecondLife/
/plugin/SecondWatch/
/plugin/SecureVideosDirectory/
/plugin/SendRecordedToEncoder/
/plugin/SignUpAgreement/
/plugin/Subscription/
/plugin/SubtitleSwitcher/
/plugin/SupportAuthor/
/plugin/Tecorio/
/plugin/User_Controll/
/plugin/VideoDocuments/
/plugin/VideoHLS/
/plugin/VideoResolutionSwitcher/
/plugin/VideoSpeed/
/plugin/VideoThumbnails/
/plugin/Video_Location_Block/
/plugin/YPTStorage/
/plugin/YouPHPTV/
/plugin/ZoomMeetingRecorder/
/plugin/oncologytube/
/plugin/predefinedCategory/
/plugin/FansSubscriptions/
/videos/
*.zip
sitemap.xml
/plugin/WebRTCLiveCam/
/plugin/Wix/
/plugin/Live/standAloneFiles/WebRTCServer/configuration.php
/plugin/Fishr/
/plugin/JoshWho/
.DS_Store
/.project
/.scannerwork/
/YouPHPTube.code-workspace
/git.php
/iptvsource_one_one.csv
/nbproject/
/nbproject/private/
/plugin/AD_Server_Promote_Videos/
/plugin/AWS_S3/
/plugin/AudioTrackSwitcher/
/plugin/AudioVisualizer/
/plugin/AutoShare/
/plugin/Backup/
/plugin/Blackblaze_B2/
/plugin/Bookmark/
/plugin/Chat2/
/plugin/CountryRedirect/
/plugin/CreateUserManager/
/plugin/Customize/
/plugin/DIY/
/plugin/DiskUploadQuota/
/plugin/FTPAutoImport/
/plugin/FTP_Storage/
/plugin/FlixHouse/
/plugin/GoogleAds_IMA/
/plugin/IPDirectConnect/
/plugin/IPTV/
/plugin/ImportFromOtherVideoPlatform/
/plugin/Layout/hamburguerMenu.php
/plugin/Layout/navBarLateral.php
/plugin/Layout/navbar.php
/plugin/Layout/timer.php
/plugin/LifeStreamLayout/
/plugin/LiveCountdownEvent/
/plugin/LiveOnlineUsers/
/plugin/LiveUsers/
/plugin/Livesearch/
/plugin/LoginLDAP/
/plugin/LoginLDAP_DYNA/
/plugin/MP4ThumbsAndGif/
/plugin/MP4ThumbsAndGifLocal/
/plugin/Notifications/
/plugin/PayPalToWatch/
/plugin/PayPerView/
/plugin/PayPerViewLive/
/plugin/PointsSystem/
/plugin/PromoteVideos/
/plugin/ReturnToLastPosition/
/plugin/SecondLife/
/plugin/SecondWatch/
/plugin/SecureVideosDirectory/
/plugin/SendRecordedToEncoder/
/plugin/SignUpAgreement/
/plugin/Subscription/
/plugin/SubtitleSwitcher/
/plugin/SupportAuthor/
/plugin/Tecorio/
/plugin/User_Controll/
/plugin/VideoDocuments/
/plugin/VideoHLS/
/plugin/VideoResolutionSwitcher/
/plugin/VideoSpeed/
/plugin/VideoThumbnails/
/plugin/Video_Location_Block/
/plugin/YPTStorage/
/plugin/YouPHPTV/
/plugin/ZoomMeetingRecorder/
/plugin/oncologytube/
/plugin/predefinedCategory/
/plugin/FansSubscriptions/
/videos/
*.zip
sitemap.xml
/plugin/WebRTCLiveCam/
/plugin/Wix/
/plugin/Live/standAloneFiles/WebRTCServer/configuration.php
/plugin/Fishr/
/plugin/JoshWho/
.DS_Store
/.project

438
README.md
View file

@ -1,219 +1,219 @@
<img src="https://avideo.tube/website/assets/151/images/avideo_platform.png"/>
[![Minimum PHP Version](https://img.shields.io/badge/php-%3E%3D%207.3-8892BF.svg?style=flat-square)](https://php.net/)
[![GitHub release](https://img.shields.io/github/v/release/WWBN/AVideo)](https://github.com/WWBN/AVideo/releases)
## Audio Video Platform
AVideo is a term that means absolutely nothing, or anything video. Since it doesn't mean anything the brand simply is identifiable with audio video. AVideo Platform is an Audio and Video Platform or simply "A Video Platform".
* AVideo - Audio Video
* AVideo Platform - Audio Video Platform
* OAVP - Online Audio Video Platform
* OVP - Online Video Platform
AVideo Platform is distributed as SaaS at <a href="https://avideo.com">AVideo.com</a>, as an <a href="https://avideo.tube/AVideo_Enterprise">Enterprise Version</a>, and as an <a href="https://avideo.tube/AVideo_OpenSource">Open-Source Project</a>.
## AN AVideo Platform Instance
When we say a clone or copy of AVideo we mean an instance of AVideo Platform Enterprise or Open-Source and every instance of the AVideo Platform can be indexed as a network in the World Wide Broadcast Network Platform System.
### AVideo trademark is FREE to use
AVideo is a registered trademark owned by WWBN/PeachWiz (World Wide Broadcast Network) the media division of PeachWiz, Inc. and is freely distributable with any Enterprise or Open-Source AVideo Platform products provided by WWBN, and its permitted use is granted with GNU-GPL, CDDL open source licenses. <a href="https://avideo.tube/AVideo_OpenSource#OSAV">Open-Source License can be viewed in this link.</a>
* Word Mark: AVIDEO
* Translations: "AVideo" has no meaning in any foreign language.
* Description: "AVideo" constitutes Audio Video.
* Goods and Services: IC 009. US 021 023 026 036 038. G & S: Computer search engine software for searching online video content. FIRST USE: 20030602. FIRST USE IN COMMERCE: 20040112
* Standard Characters: Claimed
* Mark Drawing Code: (4) STANDARD CHARACTER MARK
* Trademark Search Facility Classification Code: LETS-1 A A single letter, multiples of a single letter or in combination with a design
* Serial Number: 77450549
* Registration Number: 3625659
#### About the project re-brand.
Originally the open-source version was offered as YouPHPTube, and marketed as a YouTube Clone (after the popular video sharing site), we decided to rebrand our open-source audio video platform project from YouPHPTube to <strong>AVideo Platform</strong> which constitutes <strong>Audio Video Platform</strong>. In some plugins, forks, versions, modules, APIs, documentation, file names, there may be or have been reference to <a href="https://youphp.tube/" target="_blank">youphptube</a>, <a href="https://youphp.tube/marketplace/" target="_blank">youphp.tube</a>, youtube clone, clone script, searchtube, adtube, showtube, searchmercials. WWBN owns <a href="//searchmercials.com">Searchmercials</a>, <a href="//searchtube.com">SearchTube</a>, AdTube, ShowTube, <a href="//avideo.com">AVideo</a>, <a href="//wwbn.com">WWBN</a> among other trademarks. All other trademarks and similarity to any referred to in any files, documents, wikis, plugins, code, modules, apis, integrations, technologies, links belong to their respective owners. Follow us on <a href="https://www.facebook.com/avideo/">Facebook</a>
#
# AVideo Platform Open-Source Project
## AVideo Platform Open-Source Consist of THREE main Areas:
<img src="https://avideo.tube/website/assets/151/images/svg/balancing.svg"/>
#### (Management/Encoding/Storage)
1. Management Project(s): <a href="http://git.avideo.tube/" class="" target="_blank">AVideo Platform</a>
1. Encoding Project(s): <a href="http://git-encoder.avideo.tube/" class="" target="_blank">AVideo Encoder</a> & <a href="http://git-encoder-network.avideo.tube/" class="" target="_blank">AVideo Encoder Network</a> (Optional)
1. Storage Project(s): <a href="http://git-storage.avideo.tube/" class="" target="_blank">AVideo Storage</a>
Management life cycle is as follows; media is managed at the platform at 1, media is then uploaded to a temporary storage to be encoded at 2, then stored for broadcast at 3, then distributed to devices at 1 to be consumed.
#### About AVideo Platform Open-Source
Some of the largest brands in the world use the AVideo Platform to manage and distribute their media assets. AVideo Platform open-source project has over 900 developers, and over 4000 AVideo Platform instances throughout the world. Because of the remarkable flexibility of the platform, each of our customers uses our platform in a slightly different way, to address their particular needs and deliver solid targeted value to their organization.
The AVideo Platform Plugin Design allows you to get exactly the solution that addresses your needs today, while ensuring that your Broadcast Network implementation can grow and expand with you as your needs evolve.
<div align="center"><img src="https://avideo.tube/website/assets/151/images/open_source_banner.png"/></div>
# Create Your Own Broadcast Network With AVideo Platform
## AVideo Platform Open-Source Solution enables you to create your own video sharing site. Join the AVideo Developer Community and get platform innovation details, bug fixes, and contribute the continued evolution of AVideo Platform.
## Along with this re-brand come a slew of value added benefits for all AVideo Platform instances.
* Each AVideo Platform clone is considered a broadcast network
* Each broadcast network is indexed in our World Wide Broadcast Network Platform System
* Each broadcast network can use our ad network
* Each broadcast network can use our Open Systems TV platform (Coming Soon)
* Each broadcast network has channels and each channel has programs <a href="https://github.com/WWBN/AVideo/wiki/AVideo-Platform-Channel-Programming-Documentation">Learn more</a>
And more to come in 2020. Our mission is to take your video sharing site to "The Next Level" Internet TV.
WWBN offers relevant and practical solutions, as well as valuable innovative technology, designed to increase the efficiency of advertising and broadcasting operations and maximize revenue opportunities for our customers and partners.
### WHERE WE DELIVER
PROFITABLE STRATEGIES - We provide companies with new business models that evolve around the delivery of video and other digital assets complementing their existing business offerings and adding to their revenues. These new ways of doing business include Turnkey application-integration with capabilities for managing, auditing, and disseminating digital content.
### To learn more about AVideo Platform visit the <a href="https://avideo.tube/" target="_blank">AVideo Platform Official Site</a>.
### To learn more about the history of the AVideo Paroject <a href="https://wwbn.com/AVideo_Platform" target="_blank">WWBN Project Page</a>
### To see a demo select one below.
* <a href="https://flix.avideo.com/" target="_blank">AVideo Platform Flix Demo</a>
- We provide you a AVideo Flix Style site sample. On this site you can subscribe (with real money on PayPal). this subscription will allow you to watch our private videos. There is an user that you can use to see how it works. user: test and pass: test.
* <a href="https://tutorials.wwbn.net/" target="_blank">AVideo Platform Gallery Demo</a>
- We've provided a sample Video Gallery site, which is also our tutorials site. On this sample you can login, subscribe, like, dislike and comment. but you can not upload videos.
* <a href="http://demo.avideo.com/" target="_blank">AVideo Platform Full-Access Demo</a>
- We provide you a Demo site sample with full access to the admin account. You will need an admin password to upload and manage videos, it is by default. user: admin and pass: 123. Also there is a non admin user and password (Only for comments). user: test and pass: test.
# Notice:
### We highly recommend you keep your instance of AVideo Platform updated to the latest release. If you have updated your instance to version 8.0, your old plugins will not work, just download them again and you should be fine.
# First thing...
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.
**For of Him, and through Him, and to Him, are all things: to whom be glory for ever. Amen.**
`Apostle Paul in Romans 11:36`
## This Software must be used for Good, never Evil. It is expressly forbidden to use AVideo Platform Open-Source to build porn sites, violence, racism, terrorism, or anything else that affects human integrity or denigrates the image of anyone.
## Now you can read the rest...
## Important Information
> Streamer can be installed on any Server, including Windows, but the encoder and Livestream should work fine on any Linux distribution. However we recommend Ubuntu 20.04 without any kind of control panel.
> The problem with cPanel, Plesk, Webmin, VestaCP, etc. It's because we need full root access to install some libs, and maybe compile them. Another important point is that to make Livestream work, we need to compile Nginx and the control panels often prevent us from running the commands forcing the installation available only on your panel.
I don´t want to read I just want you to show me how to install!!
Ok, <a href="https://tutorials.wwbn.net/video/streamer-and-encoder">check this out!</a>
For text-based tutorials and the manual, <a href="https://github.com/WWBN/AVideo/wiki/Admin-manual"> look here</a>.
There, you can find some hints for troubleshooting as well.
### AVideo Platform Mobile APP
<a href="https://play.google.com/store/apps/details?id=platform.avideo.com">Android</a>
## AVideo Platform Certified
#### Need Help With Installation or Plugins? Feel free to ask us for help from the AVideo Platform Certified developers.
<a href="https://youphp.tube/marketplace/">Daniel Neto</a>
# AVideo - Streamer
AVideo! is an video-sharing website, It is an open source solution that is freely available to everyone. With AVideo you can create your own video sharing site, AVideo will help you import and encode videos from other sites like Youtube, Vimeo, etc. and you can share directly on your website. In addition, you can use Facebook or Google login to register users on your site. The service was created in march 2017.
<div align="center">
<img src="https://avideo.tube/website/assets/151/images/who-we-are.jpg">
<a href="http://demo.avideo.com/" target="_blank">View Demo</a>
</div>
# AVideo - Encoder
Go get it <a href="https://github.com/WWBN/AVideo-Encoder" target="_blank">here</a>
<div align="center">
<img src="https://avideo.tube/website/assets/151/images/encoder_img.png">
<a href="https://encoder2.avideo.com/" target="_blank">View Public Encoder</a>
</div>
# Why do I need the Encoder?
You may want to install the encoder for a few reasons, such as, if you have a faster server than the public encoder server (which is likely to be the case), or if you'd like a private way of encoding your videos.
But, the installation is mandatory if you are using a private network. The public encoder will not have access to send the videos to your streamer site.
If your server does not have a public IP or uses an IP on some of these bands:
- 10.0.0.0/8
- 127.0.0.0/8 (Localhost)
- 172.16.0.0/12
- 192.168.0.0/16
Surely you need to install an encoder
# Server Requirements
In order for you to be able to run AVideo Platform, there are certain tools that need to be installed on your server. Don't worry, they are all FREE. To have a look at complete list of required tools, click the link below. https://github.com/WWBN/AVideo/wiki/AVideo-Platform-Hardware-Requirements
- PHP 7.3+
- MySQL 5.0+
- Apache web server 2.x (with mod_rewrite enabled)
## Docker
We've created a docker compose environment for easy development and production.
### Development
Either just build the current branch by cloning the repository and run
```bash
doker build -t avideo .
```
And run the image. It contains an Apache2 webserver exposing ports 80 and 443.
We recommend using HTTPS on port 443 and ignore the HTTP port 80. The container
will create a self-signed certificate on startup. There are some environment
variables, that could be used to configure the environment
- `DB_MYSQL_HOST` - defines the database host name - default is `database`
- `DB_MYSQL_PORT` - defines the database port - default is `3306`
- `DB_MYSQL_NAME` - defines the database name - default is `avideo`
- `DB_MYSQL_USER` - defines the database user - default is `avideo`
- `DB_MYSQL_PASSWORD` - defines the database password - default is `avideo`
- `SERVER_NAME` - defines the virtualhost name for Apache - default is ` avideo.localhost`
- `ENABLE_PHPMYADMIN` - defines, if PHPMyAdmin should be exposed - default is `yes`
- `CREATE_TLS_CERTIFICATE` - defines, if the container should generate a self-signed certificate - default is `yes`
- `TLS_CERTIFICATE_FILE` - defines the location of the TLS certificate - default is `/etc/apache2/ssl/localhost.crt`
- `TLS_CERTIFICATE_KEY` - defines the location of the TLS private key - default is `/etc/apache2/ssl/localhost.key`
- `CONTACT_EMAIL` - defines the contact mail address - default is `admin@localhost`
- `SYSTEM_ADMIN_PASSWORD` - defines the system administrator passwort - default is `password`
- `WEBSITE_TITLE` - defines the website title - default is `AVideo`
- `MAIN_LANGUAGE` - defines the main language - default is `en_US`
If you don't want to rebuild the image during development, mount the git repository to
the path `/var/www/html/AVideo`. Then it using your local copy.
### Compose
We've also a simple docker compose environment to define the complete necessary
environment. You can just use and customize the local `docker-compose.yml` file.
Beside the above defined docker image that can be build locally, the environment
contains a MariaDB database and a PhpMyAdmin to have an easy look into the
database content.
```bash
docker-compose up --build -d
```
In production you should remove the phpmyadmin image by setting `ENABLE_PHPMYADMIN=no`.
Also we're working on a prebuild image. So you can use the image from [Docker hub](https://hub.docker.com/r/trickert76/avideo-platform/tags).
# Roadmap
## Version 8.9
## Version 8.10
## Version 8.11
## git clone
After a git clone command run this
composer update --prefer-dist --ignore-platform-reqs
<img src="https://avideo.tube/website/assets/151/images/avideo_platform.png"/>
[![Minimum PHP Version](https://img.shields.io/badge/php-%3E%3D%207.3-8892BF.svg?style=flat-square)](https://php.net/)
[![GitHub release](https://img.shields.io/github/v/release/WWBN/AVideo)](https://github.com/WWBN/AVideo/releases)
## Audio Video Platform
AVideo is a term that means absolutely nothing, or anything video. Since it doesn't mean anything the brand simply is identifiable with audio video. AVideo Platform is an Audio and Video Platform or simply "A Video Platform".
* AVideo - Audio Video
* AVideo Platform - Audio Video Platform
* OAVP - Online Audio Video Platform
* OVP - Online Video Platform
AVideo Platform is distributed as SaaS at <a href="https://avideo.com">AVideo.com</a>, as an <a href="https://avideo.tube/AVideo_Enterprise">Enterprise Version</a>, and as an <a href="https://avideo.tube/AVideo_OpenSource">Open-Source Project</a>.
## AN AVideo Platform Instance
When we say a clone or copy of AVideo we mean an instance of AVideo Platform Enterprise or Open-Source and every instance of the AVideo Platform can be indexed as a network in the World Wide Broadcast Network Platform System.
### AVideo trademark is FREE to use
AVideo is a registered trademark owned by WWBN/PeachWiz (World Wide Broadcast Network) the media division of PeachWiz, Inc. and is freely distributable with any Enterprise or Open-Source AVideo Platform products provided by WWBN, and its permitted use is granted with GNU-GPL, CDDL open source licenses. <a href="https://avideo.tube/AVideo_OpenSource#OSAV">Open-Source License can be viewed in this link.</a>
* Word Mark: AVIDEO
* Translations: "AVideo" has no meaning in any foreign language.
* Description: "AVideo" constitutes Audio Video.
* Goods and Services: IC 009. US 021 023 026 036 038. G & S: Computer search engine software for searching online video content. FIRST USE: 20030602. FIRST USE IN COMMERCE: 20040112
* Standard Characters: Claimed
* Mark Drawing Code: (4) STANDARD CHARACTER MARK
* Trademark Search Facility Classification Code: LETS-1 A A single letter, multiples of a single letter or in combination with a design
* Serial Number: 77450549
* Registration Number: 3625659
#### About the project re-brand.
Originally the open-source version was offered as YouPHPTube, and marketed as a YouTube Clone (after the popular video sharing site), we decided to rebrand our open-source audio video platform project from YouPHPTube to <strong>AVideo Platform</strong> which constitutes <strong>Audio Video Platform</strong>. In some plugins, forks, versions, modules, APIs, documentation, file names, there may be or have been reference to <a href="https://youphp.tube/" target="_blank">youphptube</a>, <a href="https://youphp.tube/marketplace/" target="_blank">youphp.tube</a>, youtube clone, clone script, searchtube, adtube, showtube, searchmercials. WWBN owns <a href="//searchmercials.com">Searchmercials</a>, <a href="//searchtube.com">SearchTube</a>, AdTube, ShowTube, <a href="//avideo.com">AVideo</a>, <a href="//wwbn.com">WWBN</a> among other trademarks. All other trademarks and similarity to any referred to in any files, documents, wikis, plugins, code, modules, apis, integrations, technologies, links belong to their respective owners. Follow us on <a href="https://www.facebook.com/avideo/">Facebook</a>
#
# AVideo Platform Open-Source Project
## AVideo Platform Open-Source Consist of THREE main Areas:
<img src="https://avideo.tube/website/assets/151/images/svg/balancing.svg"/>
#### (Management/Encoding/Storage)
1. Management Project(s): <a href="http://git.avideo.tube/" class="" target="_blank">AVideo Platform</a>
1. Encoding Project(s): <a href="http://git-encoder.avideo.tube/" class="" target="_blank">AVideo Encoder</a> & <a href="http://git-encoder-network.avideo.tube/" class="" target="_blank">AVideo Encoder Network</a> (Optional)
1. Storage Project(s): <a href="http://git-storage.avideo.tube/" class="" target="_blank">AVideo Storage</a>
Management life cycle is as follows; media is managed at the platform at 1, media is then uploaded to a temporary storage to be encoded at 2, then stored for broadcast at 3, then distributed to devices at 1 to be consumed.
#### About AVideo Platform Open-Source
Some of the largest brands in the world use the AVideo Platform to manage and distribute their media assets. AVideo Platform open-source project has over 900 developers, and over 4000 AVideo Platform instances throughout the world. Because of the remarkable flexibility of the platform, each of our customers uses our platform in a slightly different way, to address their particular needs and deliver solid targeted value to their organization.
The AVideo Platform Plugin Design allows you to get exactly the solution that addresses your needs today, while ensuring that your Broadcast Network implementation can grow and expand with you as your needs evolve.
<div align="center"><img src="https://avideo.tube/website/assets/151/images/open_source_banner.png"/></div>
# Create Your Own Broadcast Network With AVideo Platform
## AVideo Platform Open-Source Solution enables you to create your own video sharing site. Join the AVideo Developer Community and get platform innovation details, bug fixes, and contribute the continued evolution of AVideo Platform.
## Along with this re-brand come a slew of value added benefits for all AVideo Platform instances.
* Each AVideo Platform clone is considered a broadcast network
* Each broadcast network is indexed in our World Wide Broadcast Network Platform System
* Each broadcast network can use our ad network
* Each broadcast network can use our Open Systems TV platform (Coming Soon)
* Each broadcast network has channels and each channel has programs <a href="https://github.com/WWBN/AVideo/wiki/AVideo-Platform-Channel-Programming-Documentation">Learn more</a>
And more to come in 2020. Our mission is to take your video sharing site to "The Next Level" Internet TV.
WWBN offers relevant and practical solutions, as well as valuable innovative technology, designed to increase the efficiency of advertising and broadcasting operations and maximize revenue opportunities for our customers and partners.
### WHERE WE DELIVER
PROFITABLE STRATEGIES - We provide companies with new business models that evolve around the delivery of video and other digital assets complementing their existing business offerings and adding to their revenues. These new ways of doing business include Turnkey application-integration with capabilities for managing, auditing, and disseminating digital content.
### To learn more about AVideo Platform visit the <a href="https://avideo.tube/" target="_blank">AVideo Platform Official Site</a>.
### To learn more about the history of the AVideo Paroject <a href="https://wwbn.com/AVideo_Platform" target="_blank">WWBN Project Page</a>
### To see a demo select one below.
* <a href="https://flix.avideo.com/" target="_blank">AVideo Platform Flix Demo</a>
- We provide you a AVideo Flix Style site sample. On this site you can subscribe (with real money on PayPal). this subscription will allow you to watch our private videos. There is an user that you can use to see how it works. user: test and pass: test.
* <a href="https://tutorials.wwbn.net/" target="_blank">AVideo Platform Gallery Demo</a>
- We've provided a sample Video Gallery site, which is also our tutorials site. On this sample you can login, subscribe, like, dislike and comment. but you can not upload videos.
* <a href="http://demo.avideo.com/" target="_blank">AVideo Platform Full-Access Demo</a>
- We provide you a Demo site sample with full access to the admin account. You will need an admin password to upload and manage videos, it is by default. user: admin and pass: 123. Also there is a non admin user and password (Only for comments). user: test and pass: test.
# Notice:
### We highly recommend you keep your instance of AVideo Platform updated to the latest release. If you have updated your instance to version 8.0, your old plugins will not work, just download them again and you should be fine.
# First thing...
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.
**For of Him, and through Him, and to Him, are all things: to whom be glory for ever. Amen.**
`Apostle Paul in Romans 11:36`
## This Software must be used for Good, never Evil. It is expressly forbidden to use AVideo Platform Open-Source to build porn sites, violence, racism, terrorism, or anything else that affects human integrity or denigrates the image of anyone.
## Now you can read the rest...
## Important Information
> Streamer can be installed on any Server, including Windows, but the encoder and Livestream should work fine on any Linux distribution. However we recommend Ubuntu 20.04 without any kind of control panel.
> The problem with cPanel, Plesk, Webmin, VestaCP, etc. It's because we need full root access to install some libs, and maybe compile them. Another important point is that to make Livestream work, we need to compile Nginx and the control panels often prevent us from running the commands forcing the installation available only on your panel.
I don´t want to read I just want you to show me how to install!!
Ok, <a href="https://tutorials.wwbn.net/video/streamer-and-encoder">check this out!</a>
For text-based tutorials and the manual, <a href="https://github.com/WWBN/AVideo/wiki/Admin-manual"> look here</a>.
There, you can find some hints for troubleshooting as well.
### AVideo Platform Mobile APP
<a href="https://play.google.com/store/apps/details?id=platform.avideo.com">Android</a>
## AVideo Platform Certified
#### Need Help With Installation or Plugins? Feel free to ask us for help from the AVideo Platform Certified developers.
<a href="https://youphp.tube/marketplace/">Daniel Neto</a>
# AVideo - Streamer
AVideo! is an video-sharing website, It is an open source solution that is freely available to everyone. With AVideo you can create your own video sharing site, AVideo will help you import and encode videos from other sites like Youtube, Vimeo, etc. and you can share directly on your website. In addition, you can use Facebook or Google login to register users on your site. The service was created in march 2017.
<div align="center">
<img src="https://avideo.tube/website/assets/151/images/who-we-are.jpg">
<a href="http://demo.avideo.com/" target="_blank">View Demo</a>
</div>
# AVideo - Encoder
Go get it <a href="https://github.com/WWBN/AVideo-Encoder" target="_blank">here</a>
<div align="center">
<img src="https://avideo.tube/website/assets/151/images/encoder_img.png">
<a href="https://encoder2.avideo.com/" target="_blank">View Public Encoder</a>
</div>
# Why do I need the Encoder?
You may want to install the encoder for a few reasons, such as, if you have a faster server than the public encoder server (which is likely to be the case), or if you'd like a private way of encoding your videos.
But, the installation is mandatory if you are using a private network. The public encoder will not have access to send the videos to your streamer site.
If your server does not have a public IP or uses an IP on some of these bands:
- 10.0.0.0/8
- 127.0.0.0/8 (Localhost)
- 172.16.0.0/12
- 192.168.0.0/16
Surely you need to install an encoder
# Server Requirements
In order for you to be able to run AVideo Platform, there are certain tools that need to be installed on your server. Don't worry, they are all FREE. To have a look at complete list of required tools, click the link below. https://github.com/WWBN/AVideo/wiki/AVideo-Platform-Hardware-Requirements
- PHP 7.3+
- MySQL 5.0+
- Apache web server 2.x (with mod_rewrite enabled)
## Docker
We've created a docker compose environment for easy development and production.
### Development
Either just build the current branch by cloning the repository and run
```bash
doker build -t avideo .
```
And run the image. It contains an Apache2 webserver exposing ports 80 and 443.
We recommend using HTTPS on port 443 and ignore the HTTP port 80. The container
will create a self-signed certificate on startup. There are some environment
variables, that could be used to configure the environment
- `DB_MYSQL_HOST` - defines the database host name - default is `database`
- `DB_MYSQL_PORT` - defines the database port - default is `3306`
- `DB_MYSQL_NAME` - defines the database name - default is `avideo`
- `DB_MYSQL_USER` - defines the database user - default is `avideo`
- `DB_MYSQL_PASSWORD` - defines the database password - default is `avideo`
- `SERVER_NAME` - defines the virtualhost name for Apache - default is ` avideo.localhost`
- `ENABLE_PHPMYADMIN` - defines, if PHPMyAdmin should be exposed - default is `yes`
- `CREATE_TLS_CERTIFICATE` - defines, if the container should generate a self-signed certificate - default is `yes`
- `TLS_CERTIFICATE_FILE` - defines the location of the TLS certificate - default is `/etc/apache2/ssl/localhost.crt`
- `TLS_CERTIFICATE_KEY` - defines the location of the TLS private key - default is `/etc/apache2/ssl/localhost.key`
- `CONTACT_EMAIL` - defines the contact mail address - default is `admin@localhost`
- `SYSTEM_ADMIN_PASSWORD` - defines the system administrator passwort - default is `password`
- `WEBSITE_TITLE` - defines the website title - default is `AVideo`
- `MAIN_LANGUAGE` - defines the main language - default is `en_US`
If you don't want to rebuild the image during development, mount the git repository to
the path `/var/www/html/AVideo`. Then it using your local copy.
### Compose
We've also a simple docker compose environment to define the complete necessary
environment. You can just use and customize the local `docker-compose.yml` file.
Beside the above defined docker image that can be build locally, the environment
contains a MariaDB database and a PhpMyAdmin to have an easy look into the
database content.
```bash
docker-compose up --build -d
```
In production you should remove the phpmyadmin image by setting `ENABLE_PHPMYADMIN=no`.
Also we're working on a prebuild image. So you can use the image from [Docker hub](https://hub.docker.com/r/trickert76/avideo-platform/tags).
# Roadmap
## Version 8.9
## Version 8.10
## Version 8.11
## git clone
After a git clone command run this
composer update --prefer-dist --ignore-platform-reqs

View file

@ -1,47 +1,47 @@
<div class="row">
<div class="col-lg-9">
<div class="panel panel-default">
<div class="panel-heading"><i class="fas fa-undo"></i> <?php echo __('Backup Files and Database'); ?> <div class="pull-right"><?php echo getPluginSwitch('Backup'); ?></div></div>
<div class="panel-body" style="overflow: hidden;">
<?php
if (AVideoPlugin::exists('Backup')) {
include $global['systemRootPath'] . 'plugin/Backup/backupEditor_head.php';
include $global['systemRootPath'] . 'plugin/Backup/backupEditor_body.php'; ?>
<hr>
<div class="alert alert-info">
<i class="fas fa-info-circle"></i> <?php echo __('As a database increases in size full database backups take more time to complete, and require more storage space. Please be patient'); ?>
</div>
<?php
} else {
?>
<div class="alert alert-info">
<h2><i class="fas fa-undo"></i> <?php echo __('Prevent Data Loss'); ?></h2>
<?php echo __('Backing up your video files and databases, running test restores procedures on your backups, and storing copies of backups in a safe, off-site location protects you from potentially catastrophic data loss. Backing up is the only way to protect your data.'); ?>
<br> <?php echo __('We can help you with this task,'); ?>
<a class="btn btn-info btn-sm btn-xs" href="https://youphp.tube/marketplace/"><?php echo __('Buy our Backup Plugin Now'); ?></a>
</div>
<?php
}
?>
</div>
</div>
</div>
<div class="col-lg-3">
<div class="panel panel-default">
<div class="panel-heading"><i class="fa fa-clone"></i> Clone Site <div class="pull-right"><?php echo getPluginSwitch('CloneSite'); ?></div></div>
<div class="panel-body" style="overflow: hidden;">
<div class="alert alert-info">
<i class="fas fa-info-circle"></i> <?php echo __('This Plugin helps you to clone your video site, it is really helpful for backup routines, load balance, etc.'); ?><br>
<?php echo __('You May find some help how to use Clone Plugin'); ?> <a target="_blank" href="https://github.com/WWBN/AVideo/wiki/Clone-Site-Plugin" rel="noopener noreferrer"><?php echo __('here'); ?></a>
</div>
<?php
$filter = [
'cloneSiteURL' => __('Place here the URL of the site you want to clone'), ];
echo createTable("CloneSite", $filter);
include $global['systemRootPath'] . 'plugin/CloneSite/pluginMenu.html';
?>
</div>
</div>
</div>
</div>
<div class="row">
<div class="col-lg-9">
<div class="panel panel-default">
<div class="panel-heading"><i class="fas fa-undo"></i> <?php echo __('Backup Files and Database'); ?> <div class="pull-right"><?php echo getPluginSwitch('Backup'); ?></div></div>
<div class="panel-body" style="overflow: hidden;">
<?php
if (AVideoPlugin::exists('Backup')) {
include $global['systemRootPath'] . 'plugin/Backup/backupEditor_head.php';
include $global['systemRootPath'] . 'plugin/Backup/backupEditor_body.php'; ?>
<hr>
<div class="alert alert-info">
<i class="fas fa-info-circle"></i> <?php echo __('As a database increases in size full database backups take more time to complete, and require more storage space. Please be patient'); ?>
</div>
<?php
} else {
?>
<div class="alert alert-info">
<h2><i class="fas fa-undo"></i> <?php echo __('Prevent Data Loss'); ?></h2>
<?php echo __('Backing up your video files and databases, running test restores procedures on your backups, and storing copies of backups in a safe, off-site location protects you from potentially catastrophic data loss. Backing up is the only way to protect your data.'); ?>
<br> <?php echo __('We can help you with this task,'); ?>
<a class="btn btn-info btn-sm btn-xs" href="https://youphp.tube/marketplace/"><?php echo __('Buy our Backup Plugin Now'); ?></a>
</div>
<?php
}
?>
</div>
</div>
</div>
<div class="col-lg-3">
<div class="panel panel-default">
<div class="panel-heading"><i class="fa fa-clone"></i> Clone Site <div class="pull-right"><?php echo getPluginSwitch('CloneSite'); ?></div></div>
<div class="panel-body" style="overflow: hidden;">
<div class="alert alert-info">
<i class="fas fa-info-circle"></i> <?php echo __('This Plugin helps you to clone your video site, it is really helpful for backup routines, load balance, etc.'); ?><br>
<?php echo __('You May find some help how to use Clone Plugin'); ?> <a target="_blank" href="https://github.com/WWBN/AVideo/wiki/Clone-Site-Plugin" rel="noopener noreferrer"><?php echo __('here'); ?></a>
</div>
<?php
$filter = [
'cloneSiteURL' => __('Place here the URL of the site you want to clone'), ];
echo createTable("CloneSite", $filter);
include $global['systemRootPath'] . 'plugin/CloneSite/pluginMenu.html';
?>
</div>
</div>
</div>
</div>

View file

@ -1,3 +1,3 @@
<?php
include './customize_settings_native.php';
include './customize_settings_plugin.php';
<?php
include './customize_settings_native.php';
include './customize_settings_plugin.php';

View file

@ -1,129 +1,129 @@
<link href="<?php echo getCDN(); ?>node_modules/croppie/croppie.css" rel="stylesheet" type="text/css"/>
<script src="<?php echo getCDN(); ?>node_modules/croppie/croppie.min.js" type="text/javascript"></script>
<div class="panel panel-default">
<div class="panel-heading"><?php echo __('Title and Logo'); ?> </div>
<div class="panel-body">
<form id="updateConfigForm">
<div class="row">
<div class="col-md-6">
<label class="col-md-4 control-label"><?php echo __("Web site title"); ?></label>
<div class="col-md-8 inputGroupContainer">
<div class="input-group">
<span class="input-group-addon"><i class="glyphicon glyphicon-globe"></i></span>
<input id="inputWebSiteTitle" placeholder="<?php echo __("Web site title"); ?>" class="form-control" type="text" value="<?php echo $config->getWebSiteTitle(); ?>" maxlength="45" >
</div>
</div>
</div>
<div class="col-md-6">
<label class="col-md-4 control-label">
<?php echo __("Your Logo"); ?> (250x70)
</label>
<div class="col-md-8 ">
<div id="croppieLogo"></div>
<a id="logo-btn" class="btn btn-default btn-xs btn-block"><?php echo __("Upload a logo"); ?></a>
</div>
<input type="file" id="logo" value="Choose a Logo" accept="image/*" style="display: none;" />
</div>
</div>
<hr>
<div class="row">
<div class="col-md-12">
<button type="submit" class="btn btn-block btn-primary btn-lg" ><?php echo __("Save"); ?> <span class="fa fa-save"></span></button>
</div>
</div>
</form>
</div>
</div>
<script>
var logoCrop;
var logoSmallCrop;
var theme;
function readFile(input, c) {
console.log("read file");
if ($(input)[0].files && $(input)[0].files[0]) {
var reader = new FileReader();
reader.onload = function (e) {
c.croppie('bind', {
url: e.target.result
}).then(function () {
console.log('jQuery bind complete');
});
}
reader.readAsDataURL($(input)[0].files[0]);
} else {
avideoAlert("Sorry - you're browser doesn't support the FileReader API");
}
}
var logoImgBase64;
$(document).ready(function () {
// start croppie logo
$('#logo').on('change', function () {
readFile(this, logoCrop);
});
$('#logo-btn').on('click', function (ev) {
$('#logo').trigger("click");
});
$('#logo-result-btn').on('click', function (ev) {
logoCrop.croppie('result', {
type: 'canvas',
size: 'viewport'
}).then(function (resp) {
});
});
logoCrop = $('#croppieLogo').croppie({
url: '<?php echo $global['webSiteRootURL'], $config->getLogo(); ?>?'+Math.random(),
enableExif: true,
enforceBoundary: false,
mouseWheelZoom: false,
viewport: {
width: 250,
height: 70
},
boundary: {
width: 250,
height: 70
}
});
setTimeout(function () {
logoCrop.croppie('setZoom', 1);
}, 1000);
$('#updateConfigForm').submit(function (evt) {
evt.preventDefault();
modal.showPleaseWait();
$('#tabRegularLink').tab('show');
logoCrop.croppie('result', {
type: 'canvas',
size: 'viewport'
}).then(function (resp) {
logoImgBase64 = resp;
$.ajax({
url: '<?php echo $global['webSiteRootURL']; ?>admin/customize_settings_nativeUpdate.json.php',
data: {
"logoImgBase64": logoImgBase64,
"webSiteTitle": $('#inputWebSiteTitle').val(),
},
type: 'post',
success: function (response) {
if (response.status === "1") {
avideoAlert("<?php echo __("Congratulations!"); ?>", "<?php echo __("Your configurations has been updated!"); ?>", "success");
} else {
avideoAlert("<?php echo __("Sorry!"); ?>", "<?php echo __("Your configurations has NOT been updated!"); ?>", "error");
}
modal.hidePleaseWait();
}
});
});
});
});
</script>
<link href="<?php echo getCDN(); ?>node_modules/croppie/croppie.css" rel="stylesheet" type="text/css"/>
<script src="<?php echo getCDN(); ?>node_modules/croppie/croppie.min.js" type="text/javascript"></script>
<div class="panel panel-default">
<div class="panel-heading"><?php echo __('Title and Logo'); ?> </div>
<div class="panel-body">
<form id="updateConfigForm">
<div class="row">
<div class="col-md-6">
<label class="col-md-4 control-label"><?php echo __("Web site title"); ?></label>
<div class="col-md-8 inputGroupContainer">
<div class="input-group">
<span class="input-group-addon"><i class="glyphicon glyphicon-globe"></i></span>
<input id="inputWebSiteTitle" placeholder="<?php echo __("Web site title"); ?>" class="form-control" type="text" value="<?php echo $config->getWebSiteTitle(); ?>" maxlength="45" >
</div>
</div>
</div>
<div class="col-md-6">
<label class="col-md-4 control-label">
<?php echo __("Your Logo"); ?> (250x70)
</label>
<div class="col-md-8 ">
<div id="croppieLogo"></div>
<a id="logo-btn" class="btn btn-default btn-xs btn-block"><?php echo __("Upload a logo"); ?></a>
</div>
<input type="file" id="logo" value="Choose a Logo" accept="image/*" style="display: none;" />
</div>
</div>
<hr>
<div class="row">
<div class="col-md-12">
<button type="submit" class="btn btn-block btn-primary btn-lg" ><?php echo __("Save"); ?> <span class="fa fa-save"></span></button>
</div>
</div>
</form>
</div>
</div>
<script>
var logoCrop;
var logoSmallCrop;
var theme;
function readFile(input, c) {
console.log("read file");
if ($(input)[0].files && $(input)[0].files[0]) {
var reader = new FileReader();
reader.onload = function (e) {
c.croppie('bind', {
url: e.target.result
}).then(function () {
console.log('jQuery bind complete');
});
}
reader.readAsDataURL($(input)[0].files[0]);
} else {
avideoAlert("Sorry - you're browser doesn't support the FileReader API");
}
}
var logoImgBase64;
$(document).ready(function () {
// start croppie logo
$('#logo').on('change', function () {
readFile(this, logoCrop);
});
$('#logo-btn').on('click', function (ev) {
$('#logo').trigger("click");
});
$('#logo-result-btn').on('click', function (ev) {
logoCrop.croppie('result', {
type: 'canvas',
size: 'viewport'
}).then(function (resp) {
});
});
logoCrop = $('#croppieLogo').croppie({
url: '<?php echo $global['webSiteRootURL'], $config->getLogo(); ?>?'+Math.random(),
enableExif: true,
enforceBoundary: false,
mouseWheelZoom: false,
viewport: {
width: 250,
height: 70
},
boundary: {
width: 250,
height: 70
}
});
setTimeout(function () {
logoCrop.croppie('setZoom', 1);
}, 1000);
$('#updateConfigForm').submit(function (evt) {
evt.preventDefault();
modal.showPleaseWait();
$('#tabRegularLink').tab('show');
logoCrop.croppie('result', {
type: 'canvas',
size: 'viewport'
}).then(function (resp) {
logoImgBase64 = resp;
$.ajax({
url: '<?php echo $global['webSiteRootURL']; ?>admin/customize_settings_nativeUpdate.json.php',
data: {
"logoImgBase64": logoImgBase64,
"webSiteTitle": $('#inputWebSiteTitle').val(),
},
type: 'post',
success: function (response) {
if (response.status === "1") {
avideoAlert("<?php echo __("Congratulations!"); ?>", "<?php echo __("Your configurations has been updated!"); ?>", "success");
} else {
avideoAlert("<?php echo __("Sorry!"); ?>", "<?php echo __("Your configurations has NOT been updated!"); ?>", "error");
}
modal.hidePleaseWait();
}
});
});
});
});
</script>

View file

@ -1,53 +1,53 @@
<?php
header('Content-Type: application/json');
global $global, $config;
if (!isset($global['systemRootPath'])) {
require_once '../videos/configuration.php';
}
require_once $global['systemRootPath'] . 'objects/user.php';
if (!User::isAdmin()) {
die('{"error":"' . __("Permission denied") . '"}');
}
require_once $global['systemRootPath'] . 'videos/configuration.php';
require_once $global['systemRootPath'] . 'objects/configuration.php';
require_once $global['systemRootPath'] . 'objects/functions.php';
$config = new Configuration();
$config->setWebSiteTitle($_POST['webSiteTitle']);
$imagePath = "videos/userPhoto/";
//Check write Access to Directory
if (!file_exists($global['systemRootPath'] . $imagePath)) {
mkdir($global['systemRootPath'] . $imagePath, 0755, true);
}
if (!is_writable($global['systemRootPath'] . $imagePath)) {
$response = [
"status" => 'error',
"message" => 'No write Access',
];
print json_encode($response);
return;
}
$response = [];
if (!empty($_POST['logoImgBase64'])) {
$fileData = base64DataToImage($_POST['logoImgBase64']);
$fileName = 'logo.png';
$photoURL = $imagePath . $fileName;
$bytes = file_put_contents($global['systemRootPath'] . $photoURL, $fileData);
if ($bytes > 10) {
$response = [
"status" => 'success',
"url" => $global['systemRootPath'] . $photoURL,
];
$config->setLogo($photoURL);
} else {
$response = [
"status" => 'error',
"msg" => 'We could not save logo',
"url" => $global['systemRootPath'] . $photoURL,
];
}
}
echo '{"status":"' . $config->save() . '", "respnseLogo": ' . json_encode($response) . '}';
<?php
header('Content-Type: application/json');
global $global, $config;
if (!isset($global['systemRootPath'])) {
require_once '../videos/configuration.php';
}
require_once $global['systemRootPath'] . 'objects/user.php';
if (!User::isAdmin()) {
die('{"error":"' . __("Permission denied") . '"}');
}
require_once $global['systemRootPath'] . 'videos/configuration.php';
require_once $global['systemRootPath'] . 'objects/configuration.php';
require_once $global['systemRootPath'] . 'objects/functions.php';
$config = new Configuration();
$config->setWebSiteTitle($_POST['webSiteTitle']);
$imagePath = "videos/userPhoto/";
//Check write Access to Directory
if (!file_exists($global['systemRootPath'] . $imagePath)) {
mkdir($global['systemRootPath'] . $imagePath, 0755, true);
}
if (!is_writable($global['systemRootPath'] . $imagePath)) {
$response = [
"status" => 'error',
"message" => 'No write Access',
];
print json_encode($response);
return;
}
$response = [];
if (!empty($_POST['logoImgBase64'])) {
$fileData = base64DataToImage($_POST['logoImgBase64']);
$fileName = 'logo.png';
$photoURL = $imagePath . $fileName;
$bytes = file_put_contents($global['systemRootPath'] . $photoURL, $fileData);
if ($bytes > 10) {
$response = [
"status" => 'success',
"url" => $global['systemRootPath'] . $photoURL,
];
$config->setLogo($photoURL);
} else {
$response = [
"status" => 'error',
"msg" => 'We could not save logo',
"url" => $global['systemRootPath'] . $photoURL,
];
}
}
echo '{"status":"' . $config->save() . '", "respnseLogo": ' . json_encode($response) . '}';

View file

@ -1,73 +1,73 @@
<link href="<?php echo getCDN(); ?>js/bootstrap3-wysiwyg/bootstrap3-wysihtml5.min.css" rel="stylesheet" type="text/css"/>
<div class="panel panel-default">
<div class="panel-heading"><?php echo __('Customize Footer, About and Meta Description'); ?> <div class="pull-right"><?php echo getPluginSwitch('Customize'); ?></div></div>
<div class="panel-body">
<?php
if (!AVideoPlugin::exists('Customize')) {
?>
<div class="alert alert-info">
<?php echo __('Truly customize your AVideo and create a more professional video sharing site experience for your visitors by removing or replacing the footer, about page and Meta Description with your own.'); ?>
<a class="btn btn-info btn-sm btn-xs" href="https://youphp.tube/marketplace/"><?php echo __('Buy the Customize plugin now'); ?></a>
</div>
<?php
return false;
} else {
require_once $global['systemRootPath'] . 'plugin/Customize/Objects/ExtraConfig.php';
$ec = new ExtraConfig(); ?>
<div class="row">
<div class="col-md-12">
<form id="customizeForm">
<div class="form-group">
<label for="about" class="col-2 col-form-label">Text for About Page</label>
<div class="col-10">
<textarea id="about" placeholder="Enter the About text" style="width: 100%;"><?php echo $ec->getAbout(); ?></textarea>
</div>
</div>
<div class="form-group">
<label for="footer" class="col-2 col-form-label">Text for Footer</label>
<div class="col-10">
<textarea id="footer" placeholder="Enter the footer text" style="width: 100%;"><?php echo $ec->getFooter(); ?></textarea>
</div>
</div>
<div class="form-group">
<label for="description" class="col-2 col-form-label">MetaTag Description</label>
<div class="col-10">
<input class="form-control" type="text" placeholder="Description" id="description" value="<?php echo $ec->getDescription(); ?>">
</div>
</div>
<button type="submit" class="btn btn-success btn-block">Save</button>
</form>
</div>
</div>
<?php
}
?>
</div>
</div>
<script src="<?php echo getCDN(); ?>js/bootstrap3-wysiwyg/bootstrap3-wysihtml5.all.js" type="text/javascript"></script>
<script>
$(document).ready(function () {
$('#about, #footer').wysihtml5({toolbar: {
"html": true,
"color": true
}
});
$("#customizeForm").submit(function (event) {
event.preventDefault();
modal.showPleaseWait();
$.ajax({
url: '<?php echo $global['webSiteRootURL']; ?>plugin/Customize/page/editorSave.php',
data: {"about": $('#about').val(), "footer": $('#footer').val(), "description": $('#description').val()},
type: 'post',
success: function (response) {
modal.hidePleaseWait();
console.log(response);
}
});
});
});
</script>
<link href="<?php echo getCDN(); ?>js/bootstrap3-wysiwyg/bootstrap3-wysihtml5.min.css" rel="stylesheet" type="text/css"/>
<div class="panel panel-default">
<div class="panel-heading"><?php echo __('Customize Footer, About and Meta Description'); ?> <div class="pull-right"><?php echo getPluginSwitch('Customize'); ?></div></div>
<div class="panel-body">
<?php
if (!AVideoPlugin::exists('Customize')) {
?>
<div class="alert alert-info">
<?php echo __('Truly customize your AVideo and create a more professional video sharing site experience for your visitors by removing or replacing the footer, about page and Meta Description with your own.'); ?>
<a class="btn btn-info btn-sm btn-xs" href="https://youphp.tube/marketplace/"><?php echo __('Buy the Customize plugin now'); ?></a>
</div>
<?php
return false;
} else {
require_once $global['systemRootPath'] . 'plugin/Customize/Objects/ExtraConfig.php';
$ec = new ExtraConfig(); ?>
<div class="row">
<div class="col-md-12">
<form id="customizeForm">
<div class="form-group">
<label for="about" class="col-2 col-form-label">Text for About Page</label>
<div class="col-10">
<textarea id="about" placeholder="Enter the About text" style="width: 100%;"><?php echo $ec->getAbout(); ?></textarea>
</div>
</div>
<div class="form-group">
<label for="footer" class="col-2 col-form-label">Text for Footer</label>
<div class="col-10">
<textarea id="footer" placeholder="Enter the footer text" style="width: 100%;"><?php echo $ec->getFooter(); ?></textarea>
</div>
</div>
<div class="form-group">
<label for="description" class="col-2 col-form-label">MetaTag Description</label>
<div class="col-10">
<input class="form-control" type="text" placeholder="Description" id="description" value="<?php echo $ec->getDescription(); ?>">
</div>
</div>
<button type="submit" class="btn btn-success btn-block">Save</button>
</form>
</div>
</div>
<?php
}
?>
</div>
</div>
<script src="<?php echo getCDN(); ?>js/bootstrap3-wysiwyg/bootstrap3-wysihtml5.all.js" type="text/javascript"></script>
<script>
$(document).ready(function () {
$('#about, #footer').wysihtml5({toolbar: {
"html": true,
"color": true
}
});
$("#customizeForm").submit(function (event) {
event.preventDefault();
modal.showPleaseWait();
$.ajax({
url: '<?php echo $global['webSiteRootURL']; ?>plugin/Customize/page/editorSave.php',
data: {"about": $('#about').val(), "footer": $('#footer').val(), "description": $('#description').val()},
type: 'post',
success: function (response) {
modal.hidePleaseWait();
console.log(response);
}
});
});
});
</script>

View file

@ -1,20 +1,20 @@
<div class="panel panel-default">
<div class="panel-heading"><?php echo __('Customize Your site colors'); ?> <div class="pull-right"><?php echo getPluginSwitch('Customize'); ?></div></div>
<div class="panel-body" style="padding: 15px 30px;">
<?php
if (!AVideoPlugin::exists('Customize')) {
?>
<center>
<img src="<?php echo $global['webSiteRootURL'], "view/css/custom/customize.png"; ?>" class="img-responsive">
</center>
<div class="alert alert-info">
<?php echo __('Truly customize your AVideo and create a more professional video sharing site experience for your visitors by removing or replacing the footer, about page and Meta Description with your own.'); ?>
<a class="btn btn-info btn-sm btn-xs" href="https://youphp.tube/marketplace/"><?php echo __('Buy the Customize plugin now'); ?></a>
</div>
<?php
} else {
include '../plugin/Customize/page/colors.php';
}
?>
</div>
</div>
<div class="panel panel-default">
<div class="panel-heading"><?php echo __('Customize Your site colors'); ?> <div class="pull-right"><?php echo getPluginSwitch('Customize'); ?></div></div>
<div class="panel-body" style="padding: 15px 30px;">
<?php
if (!AVideoPlugin::exists('Customize')) {
?>
<center>
<img src="<?php echo $global['webSiteRootURL'], "view/css/custom/customize.png"; ?>" class="img-responsive">
</center>
<div class="alert alert-info">
<?php echo __('Truly customize your AVideo and create a more professional video sharing site experience for your visitors by removing or replacing the footer, about page and Meta Description with your own.'); ?>
<a class="btn btn-info btn-sm btn-xs" href="https://youphp.tube/marketplace/"><?php echo __('Buy the Customize plugin now'); ?></a>
</div>
<?php
} else {
include '../plugin/Customize/page/colors.php';
}
?>
</div>
</div>

View file

@ -1,327 +1,327 @@
<?php
$defaultSwitch = false;
$youtubeSwitch = Plugin::isEnabledByName('YouTube');
$gallerySwitch = Plugin::isEnabledByName('Gallery');
$netflixSwitch = Plugin::isEnabledByName('YouPHPFlix2');
$channelListSwitch = Plugin::isEnabledByName('FirstPageChannelList');
if (empty($netflixSwitch) && empty($gallerySwitch) && empty($youtubeSwitch) && empty($channelListSwitch)) {
$defaultSwitch = true;
}
$delay = 0.5;
?>
<div class="row">
<div class="col-sm-6 col-md-3 col-lg-3 <?php echo getCSSAnimationClassAndStyle('animate__flipInY', 'layout', $delay); ?>">
<div class="panel panel-default">
<div class="panel-heading">
Default
<div class="material-switch pull-right">
<input class="" data-toggle="toggle" type="checkbox" id="defaultSwitch" <?php echo $defaultSwitch ? "checked" : ""; ?>>
<label for="defaultSwitch" class="label-primary"></label>
</div>
</div>
<div class="panel-body">
<img src="<?php echo $global['webSiteRootURL']; ?>admin/img/default.jpg" class="img-responsive">
</div>
</div>
</div>
<div class="col-sm-6 col-md-3 col-lg-3 <?php echo getCSSAnimationClassAndStyle('animate__flipInY', 'layout', $delay); ?>">
<div class="panel panel-default">
<div class="panel-heading">
Netflix
<div class="material-switch pull-right">
<input class="" data-toggle="toggle" type="checkbox" id="netflixSwitch" <?php echo $netflixSwitch ? "checked" : ""; ?>>
<label for="netflixSwitch" class="label-primary"></label>
</div>
</div>
<div class="panel-body">
<img src="<?php echo $global['webSiteRootURL']; ?>admin/img/netflix.jpg" class="img-responsive img-radio">
</div>
</div>
</div>
<div class="clearfix hidden-md hidden-lg"></div>
<div class="col-sm-6 col-md-3 col-lg-3 <?php echo getCSSAnimationClassAndStyle('animate__flipInY', 'layout', $delay); ?>">
<div class="panel panel-default">
<div class="panel-heading">
Channel
<div class="material-switch pull-right">
<input class="" data-toggle="toggle" type="checkbox" id="channelListSwitch" <?php echo $channelListSwitch ? "checked" : ""; ?>>
<label for="channelListSwitch" class="label-primary"></label>
</div>
</div>
<div class="panel-body">
<img src="<?php echo $global['webSiteRootURL']; ?>admin/img/channel.png" class="img-responsive img-radio">
</div>
</div>
</div>
<div class="col-sm-6 col-md-3 col-lg-3 <?php echo getCSSAnimationClassAndStyle('animate__flipInY', 'layout', $delay); ?>">
<div class="panel panel-default">
<div class="panel-heading">
Gallery
<div class="material-switch pull-right">
<input class="" data-toggle="toggle" type="checkbox" id="gallerySwitch" <?php echo $gallerySwitch ? "checked" : ""; ?>>
<label for="gallerySwitch" class="label-primary"></label>
</div>
</div>
<div class="panel-body">
<img src="<?php echo $global['webSiteRootURL']; ?>admin/img/gallery.jpg" class="img-responsive">
</div>
</div>
</div>
</div>
<script>
function checkSwitch() {
var defaultSwitch = $('#defaultSwitch').is(":checked");
var netflixSwitch = $('#netflixSwitch').is(":checked");
var gallerySwitch = $('#gallerySwitch').is(":checked");
var youtubeSwitch = $('#youtubeSwitch').is(":checked");
var channelListSwitch = $('#channelListSwitch').is(":checked");
if (!defaultSwitch && !netflixSwitch && !gallerySwitch && !youtubeSwitch && !channelListSwitch) {
$('#netflixSwitch').prop('checked', false);
$('#gallerySwitch').prop('checked', false);
$('#youtubeSwitch').prop('checked', false);
$('#channelListSwitch').prop('checked', false);
$('#defaultSwitch').prop('checked', true);
}
}
$(document).ready(function () {
$('#defaultSwitch').change(function (e) {
if ($(this).is(":checked")) {
$('#netflixSwitch').prop('checked', false);
$('#gallerySwitch').prop('checked', false);
$('#youtubeSwitch').prop('checked', false);
$('#channelListSwitch').prop('checked', false);
}
checkSwitch();
modal.showPleaseWait();
$.ajax({
url: '<?php echo $global['webSiteRootURL']; ?>objects/pluginSwitch.json.php',
data: {"uuid": "a06505bf-3570-4b1f-977a-fd0e5cab205d", "name": "Gallery", "dir": "Gallery", "enable": false},
type: 'post',
success: function (response) {
$.ajax({
url: '<?php echo $global['webSiteRootURL']; ?>objects/pluginSwitch.json.php',
data: {"uuid": "e3a568e6-ef61-4dcc-aad0-0109e9be8e36", "name": "YouPHPFlix2", "dir": "YouPHPFlix2", "enable": false},
type: 'post',
success: function (response) {
$.ajax({
url: '<?php echo $global['webSiteRootURL']; ?>objects/pluginSwitch.json.php',
data: {"uuid": "youu05bf-3570-4b1f-977a-fd0e5cabtube", "name": "YouTube", "dir": "YouTube", "enable": false},
type: 'post',
success: function (response) {
$.ajax({
url: '<?php echo $global['webSiteRootURL']; ?>objects/pluginSwitch.json.php',
data: {"uuid": "channel-first-page-977a-fd0e5cab205d", "name": "FirstPageChannelList", "dir": "FirstPageChannelList", "enable": false},
type: 'post',
success: function (response) {
$.ajax({
url: '<?php echo $global['webSiteRootURL']; ?>admin/themeUpdate.json.php',
data: {"theme": 'default'},
type: 'post',
success: function (response) {
modal.hidePleaseWait();
}
});
}
});
}
});
}
});
}
});
});
$('#netflixSwitch').change(function (e) {
if ($(this).is(":checked")) {
$('#gallerySwitch').prop('checked', false);
$('#defaultSwitch').prop('checked', false);
$('#youtubeSwitch').prop('checked', false);
$('#channelListSwitch').prop('checked', false);
}
checkSwitch();
modal.showPleaseWait();
$.ajax({
url: '<?php echo $global['webSiteRootURL']; ?>objects/pluginSwitch.json.php',
data: {"uuid": "a06505bf-3570-4b1f-977a-fd0e5cab205d", "name": "Gallery", "dir": "Gallery", "enable": false},
type: 'post',
success: function (response) {
$.ajax({
url: '<?php echo $global['webSiteRootURL']; ?>objects/pluginSwitch.json.php',
data: {"uuid": "youu05bf-3570-4b1f-977a-fd0e5cabtube", "name": "YouTube", "dir": "YouTube", "enable": false},
type: 'post',
success: function (response) {
$.ajax({
url: '<?php echo $global['webSiteRootURL']; ?>objects/pluginSwitch.json.php',
data: {"uuid": "e3a568e6-ef61-4dcc-aad0-0109e9be8e36", "name": "YouPHPFlix2", "dir": "YouPHPFlix2", "enable": true},
type: 'post',
success: function (response) {
$.ajax({
url: '<?php echo $global['webSiteRootURL']; ?>objects/pluginSwitch.json.php',
data: {"uuid": "channel-first-page-977a-fd0e5cab205d", "name": "FirstPageChannelList", "dir": "FirstPageChannelList", "enable": false},
type: 'post',
success: function (response) {
$.ajax({
url: '<?php echo $global['webSiteRootURL']; ?>admin/themeUpdate.json.php',
data: {"theme": 'netflix'},
type: 'post',
success: function (response) {
modal.hidePleaseWait();
}
});
}
});
}
});
}
});
}
});
});
$('#gallerySwitch').change(function (e) {
if ($(this).is(":checked")) {
$('#netflixSwitch').prop('checked', false);
$('#defaultSwitch').prop('checked', false);
$('#youtubeSwitch').prop('checked', false);
$('#channelListSwitch').prop('checked', false);
}
checkSwitch();
modal.showPleaseWait();
$.ajax({
url: '<?php echo $global['webSiteRootURL']; ?>objects/pluginSwitch.json.php',
data: {"uuid": "a06505bf-3570-4b1f-977a-fd0e5cab205d", "name": "Gallery", "dir": "Gallery", "enable": true},
type: 'post',
success: function (response) {
$.ajax({
url: '<?php echo $global['webSiteRootURL']; ?>objects/pluginSwitch.json.php',
data: {"uuid": "youu05bf-3570-4b1f-977a-fd0e5cabtube", "name": "YouTube", "dir": "YouTube", "enable": false},
type: 'post',
success: function (response) {
$.ajax({
url: '<?php echo $global['webSiteRootURL']; ?>objects/pluginSwitch.json.php',
data: {"uuid": "e3a568e6-ef61-4dcc-aad0-0109e9be8e36", "name": "YouPHPFlix2", "dir": "YouPHPFlix2", "enable": false},
type: 'post',
success: function (response) {
$.ajax({
url: '<?php echo $global['webSiteRootURL']; ?>objects/pluginSwitch.json.php',
data: {"uuid": "channel-first-page-977a-fd0e5cab205d", "name": "FirstPageChannelList", "dir": "FirstPageChannelList", "enable": false},
type: 'post',
success: function (response) {
$.ajax({
url: '<?php echo $global['webSiteRootURL']; ?>admin/themeUpdate.json.php',
data: {"theme": 'default'},
type: 'post',
success: function (response) {
modal.hidePleaseWait();
}
});
}
});
}
});
}
});
}
});
});
$('#youtubeSwitch').change(function (e) {
if ($(this).is(":checked")) {
$('#gallerySwitch').prop('checked', false);
$('#defaultSwitch').prop('checked', false);
$('#netflixSwitch').prop('checked', false);
$('#channelListSwitch').prop('checked', false);
}
checkSwitch();
modal.showPleaseWait();
$.ajax({
url: '<?php echo $global['webSiteRootURL']; ?>objects/pluginSwitch.json.php',
data: {"uuid": "a06505bf-3570-4b1f-977a-fd0e5cab205d", "name": "Gallery", "dir": "Gallery", "enable": false},
type: 'post',
success: function (response) {
$.ajax({
url: '<?php echo $global['webSiteRootURL']; ?>objects/pluginSwitch.json.php',
data: {"uuid": "e3a568e6-ef61-4dcc-aad0-0109e9be8e36", "name": "YouPHPFlix2", "dir": "YouPHPFlix2", "enable": false},
type: 'post',
success: function (response) {
$.ajax({
url: '<?php echo $global['webSiteRootURL']; ?>objects/pluginSwitch.json.php',
data: {"uuid": "youu05bf-3570-4b1f-977a-fd0e5cabtube", "name": "YouTube", "dir": "YouTube", "enable": true},
type: 'post',
success: function (response) {
$.ajax({
url: '<?php echo $global['webSiteRootURL']; ?>objects/pluginSwitch.json.php',
data: {"uuid": "channel-first-page-977a-fd0e5cab205d", "name": "FirstPageChannelList", "dir": "FirstPageChannelList", "enable": false},
type: 'post',
success: function (response) {
$.ajax({
url: '<?php echo $global['webSiteRootURL']; ?>admin/themeUpdate.json.php',
data: {"theme": 'default'},
type: 'post',
success: function (response) {
modal.hidePleaseWait();
}
});
}
});
}
});
}
});
}
});
});
$('#channelListSwitch').change(function (e) {
if ($(this).is(":checked")) {
$('#gallerySwitch').prop('checked', false);
$('#defaultSwitch').prop('checked', false);
$('#netflixSwitch').prop('checked', false);
$('#youtubeSwitch').prop('checked', false);
}
checkSwitch();
modal.showPleaseWait();
$.ajax({
url: '<?php echo $global['webSiteRootURL']; ?>objects/pluginSwitch.json.php',
data: {"uuid": "a06505bf-3570-4b1f-977a-fd0e5cab205d", "name": "Gallery", "dir": "Gallery", "enable": false},
type: 'post',
success: function (response) {
$.ajax({
url: '<?php echo $global['webSiteRootURL']; ?>objects/pluginSwitch.json.php',
data: {"uuid": "e3a568e6-ef61-4dcc-aad0-0109e9be8e36", "name": "YouPHPFlix2", "dir": "YouPHPFlix2", "enable": false},
type: 'post',
success: function (response) {
$.ajax({
url: '<?php echo $global['webSiteRootURL']; ?>objects/pluginSwitch.json.php',
data: {"uuid": "youu05bf-3570-4b1f-977a-fd0e5cabtube", "name": "YouTube", "dir": "YouTube", "enable": false},
type: 'post',
success: function (response) {
$.ajax({
url: '<?php echo $global['webSiteRootURL']; ?>objects/pluginSwitch.json.php',
data: {"uuid": "channel-first-page-977a-fd0e5cab205d", "name": "FirstPageChannelList", "dir": "FirstPageChannelList", "enable": true},
type: 'post',
success: function (response) {
$.ajax({
url: '<?php echo $global['webSiteRootURL']; ?>admin/themeUpdate.json.php',
data: {"theme": 'default'},
type: 'post',
success: function (response) {
modal.hidePleaseWait();
}
});
}
});
}
});
}
});
}
});
});
});
</script>
<?php
$defaultSwitch = false;
$youtubeSwitch = Plugin::isEnabledByName('YouTube');
$gallerySwitch = Plugin::isEnabledByName('Gallery');
$netflixSwitch = Plugin::isEnabledByName('YouPHPFlix2');
$channelListSwitch = Plugin::isEnabledByName('FirstPageChannelList');
if (empty($netflixSwitch) && empty($gallerySwitch) && empty($youtubeSwitch) && empty($channelListSwitch)) {
$defaultSwitch = true;
}
$delay = 0.5;
?>
<div class="row">
<div class="col-sm-6 col-md-3 col-lg-3 <?php echo getCSSAnimationClassAndStyle('animate__flipInY', 'layout', $delay); ?>">
<div class="panel panel-default">
<div class="panel-heading">
Default
<div class="material-switch pull-right">
<input class="" data-toggle="toggle" type="checkbox" id="defaultSwitch" <?php echo $defaultSwitch ? "checked" : ""; ?>>
<label for="defaultSwitch" class="label-primary"></label>
</div>
</div>
<div class="panel-body">
<img src="<?php echo $global['webSiteRootURL']; ?>admin/img/default.jpg" class="img-responsive">
</div>
</div>
</div>
<div class="col-sm-6 col-md-3 col-lg-3 <?php echo getCSSAnimationClassAndStyle('animate__flipInY', 'layout', $delay); ?>">
<div class="panel panel-default">
<div class="panel-heading">
Netflix
<div class="material-switch pull-right">
<input class="" data-toggle="toggle" type="checkbox" id="netflixSwitch" <?php echo $netflixSwitch ? "checked" : ""; ?>>
<label for="netflixSwitch" class="label-primary"></label>
</div>
</div>
<div class="panel-body">
<img src="<?php echo $global['webSiteRootURL']; ?>admin/img/netflix.jpg" class="img-responsive img-radio">
</div>
</div>
</div>
<div class="clearfix hidden-md hidden-lg"></div>
<div class="col-sm-6 col-md-3 col-lg-3 <?php echo getCSSAnimationClassAndStyle('animate__flipInY', 'layout', $delay); ?>">
<div class="panel panel-default">
<div class="panel-heading">
Channel
<div class="material-switch pull-right">
<input class="" data-toggle="toggle" type="checkbox" id="channelListSwitch" <?php echo $channelListSwitch ? "checked" : ""; ?>>
<label for="channelListSwitch" class="label-primary"></label>
</div>
</div>
<div class="panel-body">
<img src="<?php echo $global['webSiteRootURL']; ?>admin/img/channel.png" class="img-responsive img-radio">
</div>
</div>
</div>
<div class="col-sm-6 col-md-3 col-lg-3 <?php echo getCSSAnimationClassAndStyle('animate__flipInY', 'layout', $delay); ?>">
<div class="panel panel-default">
<div class="panel-heading">
Gallery
<div class="material-switch pull-right">
<input class="" data-toggle="toggle" type="checkbox" id="gallerySwitch" <?php echo $gallerySwitch ? "checked" : ""; ?>>
<label for="gallerySwitch" class="label-primary"></label>
</div>
</div>
<div class="panel-body">
<img src="<?php echo $global['webSiteRootURL']; ?>admin/img/gallery.jpg" class="img-responsive">
</div>
</div>
</div>
</div>
<script>
function checkSwitch() {
var defaultSwitch = $('#defaultSwitch').is(":checked");
var netflixSwitch = $('#netflixSwitch').is(":checked");
var gallerySwitch = $('#gallerySwitch').is(":checked");
var youtubeSwitch = $('#youtubeSwitch').is(":checked");
var channelListSwitch = $('#channelListSwitch').is(":checked");
if (!defaultSwitch && !netflixSwitch && !gallerySwitch && !youtubeSwitch && !channelListSwitch) {
$('#netflixSwitch').prop('checked', false);
$('#gallerySwitch').prop('checked', false);
$('#youtubeSwitch').prop('checked', false);
$('#channelListSwitch').prop('checked', false);
$('#defaultSwitch').prop('checked', true);
}
}
$(document).ready(function () {
$('#defaultSwitch').change(function (e) {
if ($(this).is(":checked")) {
$('#netflixSwitch').prop('checked', false);
$('#gallerySwitch').prop('checked', false);
$('#youtubeSwitch').prop('checked', false);
$('#channelListSwitch').prop('checked', false);
}
checkSwitch();
modal.showPleaseWait();
$.ajax({
url: '<?php echo $global['webSiteRootURL']; ?>objects/pluginSwitch.json.php',
data: {"uuid": "a06505bf-3570-4b1f-977a-fd0e5cab205d", "name": "Gallery", "dir": "Gallery", "enable": false},
type: 'post',
success: function (response) {
$.ajax({
url: '<?php echo $global['webSiteRootURL']; ?>objects/pluginSwitch.json.php',
data: {"uuid": "e3a568e6-ef61-4dcc-aad0-0109e9be8e36", "name": "YouPHPFlix2", "dir": "YouPHPFlix2", "enable": false},
type: 'post',
success: function (response) {
$.ajax({
url: '<?php echo $global['webSiteRootURL']; ?>objects/pluginSwitch.json.php',
data: {"uuid": "youu05bf-3570-4b1f-977a-fd0e5cabtube", "name": "YouTube", "dir": "YouTube", "enable": false},
type: 'post',
success: function (response) {
$.ajax({
url: '<?php echo $global['webSiteRootURL']; ?>objects/pluginSwitch.json.php',
data: {"uuid": "channel-first-page-977a-fd0e5cab205d", "name": "FirstPageChannelList", "dir": "FirstPageChannelList", "enable": false},
type: 'post',
success: function (response) {
$.ajax({
url: '<?php echo $global['webSiteRootURL']; ?>admin/themeUpdate.json.php',
data: {"theme": 'default'},
type: 'post',
success: function (response) {
modal.hidePleaseWait();
}
});
}
});
}
});
}
});
}
});
});
$('#netflixSwitch').change(function (e) {
if ($(this).is(":checked")) {
$('#gallerySwitch').prop('checked', false);
$('#defaultSwitch').prop('checked', false);
$('#youtubeSwitch').prop('checked', false);
$('#channelListSwitch').prop('checked', false);
}
checkSwitch();
modal.showPleaseWait();
$.ajax({
url: '<?php echo $global['webSiteRootURL']; ?>objects/pluginSwitch.json.php',
data: {"uuid": "a06505bf-3570-4b1f-977a-fd0e5cab205d", "name": "Gallery", "dir": "Gallery", "enable": false},
type: 'post',
success: function (response) {
$.ajax({
url: '<?php echo $global['webSiteRootURL']; ?>objects/pluginSwitch.json.php',
data: {"uuid": "youu05bf-3570-4b1f-977a-fd0e5cabtube", "name": "YouTube", "dir": "YouTube", "enable": false},
type: 'post',
success: function (response) {
$.ajax({
url: '<?php echo $global['webSiteRootURL']; ?>objects/pluginSwitch.json.php',
data: {"uuid": "e3a568e6-ef61-4dcc-aad0-0109e9be8e36", "name": "YouPHPFlix2", "dir": "YouPHPFlix2", "enable": true},
type: 'post',
success: function (response) {
$.ajax({
url: '<?php echo $global['webSiteRootURL']; ?>objects/pluginSwitch.json.php',
data: {"uuid": "channel-first-page-977a-fd0e5cab205d", "name": "FirstPageChannelList", "dir": "FirstPageChannelList", "enable": false},
type: 'post',
success: function (response) {
$.ajax({
url: '<?php echo $global['webSiteRootURL']; ?>admin/themeUpdate.json.php',
data: {"theme": 'netflix'},
type: 'post',
success: function (response) {
modal.hidePleaseWait();
}
});
}
});
}
});
}
});
}
});
});
$('#gallerySwitch').change(function (e) {
if ($(this).is(":checked")) {
$('#netflixSwitch').prop('checked', false);
$('#defaultSwitch').prop('checked', false);
$('#youtubeSwitch').prop('checked', false);
$('#channelListSwitch').prop('checked', false);
}
checkSwitch();
modal.showPleaseWait();
$.ajax({
url: '<?php echo $global['webSiteRootURL']; ?>objects/pluginSwitch.json.php',
data: {"uuid": "a06505bf-3570-4b1f-977a-fd0e5cab205d", "name": "Gallery", "dir": "Gallery", "enable": true},
type: 'post',
success: function (response) {
$.ajax({
url: '<?php echo $global['webSiteRootURL']; ?>objects/pluginSwitch.json.php',
data: {"uuid": "youu05bf-3570-4b1f-977a-fd0e5cabtube", "name": "YouTube", "dir": "YouTube", "enable": false},
type: 'post',
success: function (response) {
$.ajax({
url: '<?php echo $global['webSiteRootURL']; ?>objects/pluginSwitch.json.php',
data: {"uuid": "e3a568e6-ef61-4dcc-aad0-0109e9be8e36", "name": "YouPHPFlix2", "dir": "YouPHPFlix2", "enable": false},
type: 'post',
success: function (response) {
$.ajax({
url: '<?php echo $global['webSiteRootURL']; ?>objects/pluginSwitch.json.php',
data: {"uuid": "channel-first-page-977a-fd0e5cab205d", "name": "FirstPageChannelList", "dir": "FirstPageChannelList", "enable": false},
type: 'post',
success: function (response) {
$.ajax({
url: '<?php echo $global['webSiteRootURL']; ?>admin/themeUpdate.json.php',
data: {"theme": 'default'},
type: 'post',
success: function (response) {
modal.hidePleaseWait();
}
});
}
});
}
});
}
});
}
});
});
$('#youtubeSwitch').change(function (e) {
if ($(this).is(":checked")) {
$('#gallerySwitch').prop('checked', false);
$('#defaultSwitch').prop('checked', false);
$('#netflixSwitch').prop('checked', false);
$('#channelListSwitch').prop('checked', false);
}
checkSwitch();
modal.showPleaseWait();
$.ajax({
url: '<?php echo $global['webSiteRootURL']; ?>objects/pluginSwitch.json.php',
data: {"uuid": "a06505bf-3570-4b1f-977a-fd0e5cab205d", "name": "Gallery", "dir": "Gallery", "enable": false},
type: 'post',
success: function (response) {
$.ajax({
url: '<?php echo $global['webSiteRootURL']; ?>objects/pluginSwitch.json.php',
data: {"uuid": "e3a568e6-ef61-4dcc-aad0-0109e9be8e36", "name": "YouPHPFlix2", "dir": "YouPHPFlix2", "enable": false},
type: 'post',
success: function (response) {
$.ajax({
url: '<?php echo $global['webSiteRootURL']; ?>objects/pluginSwitch.json.php',
data: {"uuid": "youu05bf-3570-4b1f-977a-fd0e5cabtube", "name": "YouTube", "dir": "YouTube", "enable": true},
type: 'post',
success: function (response) {
$.ajax({
url: '<?php echo $global['webSiteRootURL']; ?>objects/pluginSwitch.json.php',
data: {"uuid": "channel-first-page-977a-fd0e5cab205d", "name": "FirstPageChannelList", "dir": "FirstPageChannelList", "enable": false},
type: 'post',
success: function (response) {
$.ajax({
url: '<?php echo $global['webSiteRootURL']; ?>admin/themeUpdate.json.php',
data: {"theme": 'default'},
type: 'post',
success: function (response) {
modal.hidePleaseWait();
}
});
}
});
}
});
}
});
}
});
});
$('#channelListSwitch').change(function (e) {
if ($(this).is(":checked")) {
$('#gallerySwitch').prop('checked', false);
$('#defaultSwitch').prop('checked', false);
$('#netflixSwitch').prop('checked', false);
$('#youtubeSwitch').prop('checked', false);
}
checkSwitch();
modal.showPleaseWait();
$.ajax({
url: '<?php echo $global['webSiteRootURL']; ?>objects/pluginSwitch.json.php',
data: {"uuid": "a06505bf-3570-4b1f-977a-fd0e5cab205d", "name": "Gallery", "dir": "Gallery", "enable": false},
type: 'post',
success: function (response) {
$.ajax({
url: '<?php echo $global['webSiteRootURL']; ?>objects/pluginSwitch.json.php',
data: {"uuid": "e3a568e6-ef61-4dcc-aad0-0109e9be8e36", "name": "YouPHPFlix2", "dir": "YouPHPFlix2", "enable": false},
type: 'post',
success: function (response) {
$.ajax({
url: '<?php echo $global['webSiteRootURL']; ?>objects/pluginSwitch.json.php',
data: {"uuid": "youu05bf-3570-4b1f-977a-fd0e5cabtube", "name": "YouTube", "dir": "YouTube", "enable": false},
type: 'post',
success: function (response) {
$.ajax({
url: '<?php echo $global['webSiteRootURL']; ?>objects/pluginSwitch.json.php',
data: {"uuid": "channel-first-page-977a-fd0e5cab205d", "name": "FirstPageChannelList", "dir": "FirstPageChannelList", "enable": true},
type: 'post',
success: function (response) {
$.ajax({
url: '<?php echo $global['webSiteRootURL']; ?>admin/themeUpdate.json.php',
data: {"theme": 'default'},
type: 'post',
success: function (response) {
modal.hidePleaseWait();
}
});
}
});
}
});
}
});
}
});
});
});
</script>

View file

@ -1,72 +1,72 @@
<?php
$obj = AVideoPlugin::getObjectDataIfEnabled('PlayerSkins');
$dir = $global['systemRootPath'] . 'plugin/PlayerSkins/skins/';
$delay = 0.2;
?>
<div class="row">
<div class="col-xs-6 <?php echo getCSSAnimationClassAndStyle('animate__fadeInUp', 'player', $delay); ?>">
<div class="panel panel-default">
<div class="panel-heading">
Default
<div class="material-switch pull-right">
<input class="playerSwitch" data-toggle="toggle" type="checkbox" value="" id="themeSwitch" <?php echo (empty($obj) || empty($obj->skin)) ? "checked" : ""; ?>>
<label for="themeSwitch" class="label-primary"></label>
</div>
</div>
<div class="panel-body" style="padding: 0;">
<iframe fameBorder="0"
src="<?php echo $global['webSiteRootURL']; ?>plugin/PlayerSkins/playerSample.php"
style="width: 100%; height: 300px; border: 0;"></iframe>
</div>
</div>
</div>
<?php
foreach (glob($dir . '*.css') as $filename) {
//echo "$filename size " . filesize($filename) . "\n";
$file = basename($filename); // $file is set to "index.php"
$fileEx = basename($filename, ".css"); // $file is set to "index"
?>
<div class="col-xs-6 <?php echo getCSSAnimationClassAndStyle('animate__fadeInUp', 'player', $delay); ?>">
<div class="panel panel-default">
<div class="panel-heading">
<?php echo ucfirst($fileEx); ?>
<div class="material-switch pull-right">
<input class="playerSwitch" data-toggle="toggle" type="checkbox" value="<?php echo($fileEx); ?>" id="themeSwitch<?php echo($fileEx); ?>" <?php echo (!empty($obj) && $fileEx == $obj->skin) ? "checked" : ""; ?>>
<label for="themeSwitch<?php echo($fileEx); ?>" class="label-primary"></label>
</div>
</div>
<div class="panel-body" style="padding: 0;">
<iframe fameBorder="0"
src="<?php echo $global['webSiteRootURL']; ?>plugin/PlayerSkins/playerSample.php?playerSkin=<?php echo($fileEx); ?>"
style="width: 100%; height: 300px; border: 0;"></iframe>
</div>
</div>
</div>
<?php
}
?>
</div>
<script>
$(document).ready(function () {
$('.playerSwitch').change(function (e) {
modal.showPleaseWait();
$('.playerSwitch').not(this).prop('checked', false);
var skin = $(this).val();
$.ajax({
url: '<?php echo $global['webSiteRootURL']; ?>objects/pluginSwitch.json.php',
data: {"uuid": "e9a568e6-ef61-4dcc-aad0-0109e9be8e36", "name": "PlayerSkins", "dir": "PlayerSkins", "enable": true},
type: 'post',
success: function (response) {
$.ajax({
url: '<?php echo $global['webSiteRootURL']; ?>admin/playerUpdate.json.php',
data: {"skin": skin},
type: 'post',
success: function (response) {
modal.hidePleaseWait();
}
});
}
});
});
});
</script>
<?php
$obj = AVideoPlugin::getObjectDataIfEnabled('PlayerSkins');
$dir = $global['systemRootPath'] . 'plugin/PlayerSkins/skins/';
$delay = 0.2;
?>
<div class="row">
<div class="col-xs-6 <?php echo getCSSAnimationClassAndStyle('animate__fadeInUp', 'player', $delay); ?>">
<div class="panel panel-default">
<div class="panel-heading">
Default
<div class="material-switch pull-right">
<input class="playerSwitch" data-toggle="toggle" type="checkbox" value="" id="themeSwitch" <?php echo (empty($obj) || empty($obj->skin)) ? "checked" : ""; ?>>
<label for="themeSwitch" class="label-primary"></label>
</div>
</div>
<div class="panel-body" style="padding: 0;">
<iframe fameBorder="0"
src="<?php echo $global['webSiteRootURL']; ?>plugin/PlayerSkins/playerSample.php"
style="width: 100%; height: 300px; border: 0;"></iframe>
</div>
</div>
</div>
<?php
foreach (glob($dir . '*.css') as $filename) {
//echo "$filename size " . filesize($filename) . "\n";
$file = basename($filename); // $file is set to "index.php"
$fileEx = basename($filename, ".css"); // $file is set to "index"
?>
<div class="col-xs-6 <?php echo getCSSAnimationClassAndStyle('animate__fadeInUp', 'player', $delay); ?>">
<div class="panel panel-default">
<div class="panel-heading">
<?php echo ucfirst($fileEx); ?>
<div class="material-switch pull-right">
<input class="playerSwitch" data-toggle="toggle" type="checkbox" value="<?php echo($fileEx); ?>" id="themeSwitch<?php echo($fileEx); ?>" <?php echo (!empty($obj) && $fileEx == $obj->skin) ? "checked" : ""; ?>>
<label for="themeSwitch<?php echo($fileEx); ?>" class="label-primary"></label>
</div>
</div>
<div class="panel-body" style="padding: 0;">
<iframe fameBorder="0"
src="<?php echo $global['webSiteRootURL']; ?>plugin/PlayerSkins/playerSample.php?playerSkin=<?php echo($fileEx); ?>"
style="width: 100%; height: 300px; border: 0;"></iframe>
</div>
</div>
</div>
<?php
}
?>
</div>
<script>
$(document).ready(function () {
$('.playerSwitch').change(function (e) {
modal.showPleaseWait();
$('.playerSwitch').not(this).prop('checked', false);
var skin = $(this).val();
$.ajax({
url: '<?php echo $global['webSiteRootURL']; ?>objects/pluginSwitch.json.php',
data: {"uuid": "e9a568e6-ef61-4dcc-aad0-0109e9be8e36", "name": "PlayerSkins", "dir": "PlayerSkins", "enable": true},
type: 'post',
success: function (response) {
$.ajax({
url: '<?php echo $global['webSiteRootURL']; ?>admin/playerUpdate.json.php',
data: {"skin": skin},
type: 'post',
success: function (response) {
modal.hidePleaseWait();
}
});
}
});
});
});
</script>

View file

@ -1,54 +1,54 @@
<div class="row">
<?php
$savedTheme = $config->getTheme();
$delay = 0.2;
foreach (glob("{$global['systemRootPath']}view/css/custom/*.css") as $filename) {
//echo "$filename size " . filesize($filename) . "\n";
$file = basename($filename); // $file is set to "index.php"
$fileEx = basename($filename, ".css"); // $file is set to "index"
?>
<div class="col-xs-4 <?php echo getCSSAnimationClassAndStyle('animate__fadeInUp', 'themess', $delay); ?>">
<div class="panel panel-default">
<div class="panel-heading">
<?php echo ucfirst($fileEx); ?>
<div class="material-switch pull-right">
<input class="themeSwitch" data-toggle="toggle" type="checkbox" value="<?php echo($fileEx); ?>" id="themeSwitch<?php echo($fileEx); ?>" <?php echo ($fileEx == $savedTheme) ? "checked" : ""; ?>>
<label for="themeSwitch<?php echo($fileEx); ?>" class="label-primary"></label>
</div>
</div>
<div class="panel-body">
<img src="<?php echo $global['webSiteRootURL'], "view/css/custom/", $fileEx, ".png"; ?>" class="img-responsive">
</div>
</div>
</div>
<?php
}
?>
</div>
<script>
function checkSwitch() {
var defaultSwitch = $('#defaultSwitch').is(":checked");
var netflixSwitch = $('#netflixSwitch').is(":checked");
var gallerySwitch = $('#gallerySwitch').is(":checked");
if (!defaultSwitch && !netflixSwitch && !gallerySwitch) {
$('#netflixSwitch').prop('checked', false);
$('#gallerySwitch').prop('checked', false);
$('#defaultSwitch').prop('checked', true);
}
}
$(document).ready(function () {
$('.themeSwitch').change(function (e) {
modal.showPleaseWait();
$('.themeSwitch').not(this).prop('checked', false);
$.ajax({
url: '<?php echo $global['webSiteRootURL']; ?>admin/themeUpdate.json.php',
data: {"theme": $(this).val()},
type: 'post',
success: function (response) {
modal.hidePleaseWait();
}
});
});
});
</script>
<div class="row">
<?php
$savedTheme = $config->getTheme();
$delay = 0.2;
foreach (glob("{$global['systemRootPath']}view/css/custom/*.css") as $filename) {
//echo "$filename size " . filesize($filename) . "\n";
$file = basename($filename); // $file is set to "index.php"
$fileEx = basename($filename, ".css"); // $file is set to "index"
?>
<div class="col-xs-4 <?php echo getCSSAnimationClassAndStyle('animate__fadeInUp', 'themess', $delay); ?>">
<div class="panel panel-default">
<div class="panel-heading">
<?php echo ucfirst($fileEx); ?>
<div class="material-switch pull-right">
<input class="themeSwitch" data-toggle="toggle" type="checkbox" value="<?php echo($fileEx); ?>" id="themeSwitch<?php echo($fileEx); ?>" <?php echo ($fileEx == $savedTheme) ? "checked" : ""; ?>>
<label for="themeSwitch<?php echo($fileEx); ?>" class="label-primary"></label>
</div>
</div>
<div class="panel-body">
<img src="<?php echo $global['webSiteRootURL'], "view/css/custom/", $fileEx, ".png"; ?>" class="img-responsive">
</div>
</div>
</div>
<?php
}
?>
</div>
<script>
function checkSwitch() {
var defaultSwitch = $('#defaultSwitch').is(":checked");
var netflixSwitch = $('#netflixSwitch').is(":checked");
var gallerySwitch = $('#gallerySwitch').is(":checked");
if (!defaultSwitch && !netflixSwitch && !gallerySwitch) {
$('#netflixSwitch').prop('checked', false);
$('#gallerySwitch').prop('checked', false);
$('#defaultSwitch').prop('checked', true);
}
}
$(document).ready(function () {
$('.themeSwitch').change(function (e) {
modal.showPleaseWait();
$('.themeSwitch').not(this).prop('checked', false);
$.ajax({
url: '<?php echo $global['webSiteRootURL']; ?>admin/themeUpdate.json.php',
data: {"theme": $(this).val()},
type: 'post',
success: function (response) {
modal.hidePleaseWait();
}
});
});
});
</script>

View file

@ -1,95 +1,95 @@
<?php
function createTable($pluginName, $filter = [])
{
$plugin = AVideoPlugin::getObjectData($pluginName);
if (empty($filter)) {
foreach ($plugin as $keyJson => $valueJson) {
$filter[$keyJson] = "&nbsp;";
}
}
//var_dump($filter);exit;
echo '<form class="adminOptionsForm">';
echo '<input type="hidden" value="' . $pluginName . '" name="pluginName"/>';
echo '<input type="hidden" value="' . implode("|", array_keys($filter)) . '" name="pluginsList"/>';
echo '<table class="table table-hover">';
$pluginsList = [];
if (!AVideoPlugin::exists($pluginName)) {
echo "<tr><td colspan='2'> ".__('Sorry you do not have the plugin')." </td></tr>";
} else {
if (!empty($plugin)) {
$form = jsonToFormElements($plugin, $filter);
//var_dump($form);
echo implode("", $form);
}
echo "<tr><td colspan='2'> <button class='btn btn-block btn-primary'><i class='fa fa-save'></i> ".__('Save')."</button> </td></tr>";
}
echo '</table></form>';
}
function jsonToFormElements($json, $filter = [])
{
//var_dump($json, $filter);exit;
$elements = [];
foreach ($json as $keyJson => $valueJson) {
if (!empty($filter) && empty($filter[$keyJson])) {
continue;
}
$label = "<label>{$keyJson}</label>";
$help = '';
if (!empty($filter[$keyJson])) {
$help = "<small class=\"form-text text-muted\">{$filter[$keyJson]}</small>";
}
$input = '';
if (is_object($valueJson)) {
if ($valueJson->type === 'textarea') {
$input = "<textarea class='form-control jsonElement' name='{$keyJson}' pluginType='object'>{$valueJson->value}</textarea>";
} elseif (is_array($valueJson->type)) {
$input = "<select class='form-control jsonElement' name='{$keyJson}' pluginType='object'>";
foreach ($valueJson->type as $key => $value) {
$select = '';
if ($valueJson->value == $key) {
$select = "selected";
}
$input .= "<option value='{$key}' {$select}>{$value}</option>";
}
$input .= "</select>";
} else {
if (!is_string($valueJson->type) || !is_string($valueJson->value)) {
continue;
}
$input = "<input class='form-control jsonElement' name='{$keyJson}' "
. "pluginType='object' type='{$valueJson->type}' value='{$valueJson->value}'/>";
}
$elements[] = "<tr><td>{$label} </td><td>{$input}{$help}</td></tr>";
} elseif (is_bool($valueJson)) {
$id = uniqid();
$input = '<div class="material-switch">
<input data-toggle="toggle" type="checkbox" id="' . $keyJson . $id . '" name="' . $keyJson . '" value="1" ' . ($valueJson ? "checked" : "") . ' >
<label for="' . $keyJson . $id . '" class="label-primary"></label>
</div>';
$elements[] = "<tr><td>{$input}</td><td>{$label}<br>{$help}</td></tr>";
} else {
$input = "<input class='form-control jsonElement' name='{$keyJson}' type='text' value='{$valueJson}'/>";
$elements[] = "<tr><td>{$label} </td><td>{$input}{$help}</td></tr>";
}
}
return $elements;
}
function getPluginSwitch($pluginName)
{
if (!AVideoPlugin::exists($pluginName)) {
$input = '<a href="https://youphp.tube/marketplace/" class="btn btn-danger btn-sm btn-xs">'.__('Buy this plugin now').'</a>';
} else {
$plugin = AVideoPlugin::loadPluginIfEnabled($pluginName);
$pluginForced = AVideoPlugin::loadPlugin($pluginName);
$id = uniqid();
$uuid = $pluginForced->getUUID();
$input = '<div class="material-switch">
<input class="pluginSwitch" data-toggle="toggle" type="checkbox" id="' . $id . '" uuid="' . $uuid . '" name="' . $pluginName . '" value="1" ' . (!empty($plugin) ? "checked" : "") . ' >
<label for="' . $id . '" class="label-primary"></label>
</div>';
}
return $input;
}
<?php
function createTable($pluginName, $filter = [])
{
$plugin = AVideoPlugin::getObjectData($pluginName);
if (empty($filter)) {
foreach ($plugin as $keyJson => $valueJson) {
$filter[$keyJson] = "&nbsp;";
}
}
//var_dump($filter);exit;
echo '<form class="adminOptionsForm">';
echo '<input type="hidden" value="' . $pluginName . '" name="pluginName"/>';
echo '<input type="hidden" value="' . implode("|", array_keys($filter)) . '" name="pluginsList"/>';
echo '<table class="table table-hover">';
$pluginsList = [];
if (!AVideoPlugin::exists($pluginName)) {
echo "<tr><td colspan='2'> ".__('Sorry you do not have the plugin')." </td></tr>";
} else {
if (!empty($plugin)) {
$form = jsonToFormElements($plugin, $filter);
//var_dump($form);
echo implode("", $form);
}
echo "<tr><td colspan='2'> <button class='btn btn-block btn-primary'><i class='fa fa-save'></i> ".__('Save')."</button> </td></tr>";
}
echo '</table></form>';
}
function jsonToFormElements($json, $filter = [])
{
//var_dump($json, $filter);exit;
$elements = [];
foreach ($json as $keyJson => $valueJson) {
if (!empty($filter) && empty($filter[$keyJson])) {
continue;
}
$label = "<label>{$keyJson}</label>";
$help = '';
if (!empty($filter[$keyJson])) {
$help = "<small class=\"form-text text-muted\">{$filter[$keyJson]}</small>";
}
$input = '';
if (is_object($valueJson)) {
if ($valueJson->type === 'textarea') {
$input = "<textarea class='form-control jsonElement' name='{$keyJson}' pluginType='object'>{$valueJson->value}</textarea>";
} elseif (is_array($valueJson->type)) {
$input = "<select class='form-control jsonElement' name='{$keyJson}' pluginType='object'>";
foreach ($valueJson->type as $key => $value) {
$select = '';
if ($valueJson->value == $key) {
$select = "selected";
}
$input .= "<option value='{$key}' {$select}>{$value}</option>";
}
$input .= "</select>";
} else {
if (!is_string($valueJson->type) || !is_string($valueJson->value)) {
continue;
}
$input = "<input class='form-control jsonElement' name='{$keyJson}' "
. "pluginType='object' type='{$valueJson->type}' value='{$valueJson->value}'/>";
}
$elements[] = "<tr><td>{$label} </td><td>{$input}{$help}</td></tr>";
} elseif (is_bool($valueJson)) {
$id = uniqid();
$input = '<div class="material-switch">
<input data-toggle="toggle" type="checkbox" id="' . $keyJson . $id . '" name="' . $keyJson . '" value="1" ' . ($valueJson ? "checked" : "") . ' >
<label for="' . $keyJson . $id . '" class="label-primary"></label>
</div>';
$elements[] = "<tr><td>{$input}</td><td>{$label}<br>{$help}</td></tr>";
} else {
$input = "<input class='form-control jsonElement' name='{$keyJson}' type='text' value='{$valueJson}'/>";
$elements[] = "<tr><td>{$label} </td><td>{$input}{$help}</td></tr>";
}
}
return $elements;
}
function getPluginSwitch($pluginName)
{
if (!AVideoPlugin::exists($pluginName)) {
$input = '<a href="https://youphp.tube/marketplace/" class="btn btn-danger btn-sm btn-xs">'.__('Buy this plugin now').'</a>';
} else {
$plugin = AVideoPlugin::loadPluginIfEnabled($pluginName);
$pluginForced = AVideoPlugin::loadPlugin($pluginName);
$id = uniqid();
$uuid = $pluginForced->getUUID();
$input = '<div class="material-switch">
<input class="pluginSwitch" data-toggle="toggle" type="checkbox" id="' . $id . '" uuid="' . $uuid . '" name="' . $pluginName . '" value="1" ' . (!empty($plugin) ? "checked" : "") . ' >
<label for="' . $id . '" class="label-primary"></label>
</div>';
}
return $input;
}

View file

@ -1,27 +1,27 @@
<div class="row">
<div class="col-md-6">
<div class="panel panel-default">
<div class="panel-heading"><?php echo __('Users') ?></div>
<div class="panel-body"><?php include './general_settings_user.php'; ?></div>
</div>
</div>
<div class="col-md-6">
<div class="panel panel-default">
<div class="panel-heading"><?php echo __('Upload') ?></div>
<div class="panel-body"><?php include './general_settings_upload.php'; ?></div>
</div>
</div>
<div class="col-md-6">
<div class="panel panel-default">
<div class="panel-heading"><?php echo __('Encoder') ?></div>
<div class="panel-body"><?php include './general_settings_encoder.php'; ?></div>
</div>
</div>
<div class="col-md-6">
<div class="panel panel-default">
<div class="panel-heading"><?php echo __('Sign In/Up') ?></div>
<div class="panel-body"><?php include './general_settings_user.php'; ?></div>
</div>
</div>
</div>
<div class="row">
<div class="col-md-6">
<div class="panel panel-default">
<div class="panel-heading"><?php echo __('Users') ?></div>
<div class="panel-body"><?php include './general_settings_user.php'; ?></div>
</div>
</div>
<div class="col-md-6">
<div class="panel panel-default">
<div class="panel-heading"><?php echo __('Upload') ?></div>
<div class="panel-body"><?php include './general_settings_upload.php'; ?></div>
</div>
</div>
<div class="col-md-6">
<div class="panel panel-default">
<div class="panel-heading"><?php echo __('Encoder') ?></div>
<div class="panel-body"><?php include './general_settings_encoder.php'; ?></div>
</div>
</div>
<div class="col-md-6">
<div class="panel panel-default">
<div class="panel-heading"><?php echo __('Sign In/Up') ?></div>
<div class="panel-body"><?php include './general_settings_user.php'; ?></div>
</div>
</div>
</div>

View file

@ -1,11 +1,11 @@
<?php
$filter = [
'useEncoderNetworkRecomendation' => __('Let the encoder network (If configured) choose what is the best encoder to use'),
'doNotShowEncoderResolutionLow' => __('Do not allow encode in Low resolution'),
'doNotShowEncoderResolutionSD' => __('Do not allow encode in SD resolution'),
'doNotShowEncoderResolutionHD' => __('Do not allow encode in HD resolution'),
'makeVideosInactiveAfterEncode' => __('Maybe you need to approve or check something on your video before make it public'),
'makeVideosUnlistedAfterEncode' => __('Maybe you need to approve or check something on your video before make it public'),
];
createTable("CustomizeAdvanced", $filter);
<?php
$filter = [
'useEncoderNetworkRecomendation' => __('Let the encoder network (If configured) choose what is the best encoder to use'),
'doNotShowEncoderResolutionLow' => __('Do not allow encode in Low resolution'),
'doNotShowEncoderResolutionSD' => __('Do not allow encode in SD resolution'),
'doNotShowEncoderResolutionHD' => __('Do not allow encode in HD resolution'),
'makeVideosInactiveAfterEncode' => __('Maybe you need to approve or check something on your video before make it public'),
'makeVideosUnlistedAfterEncode' => __('Maybe you need to approve or check something on your video before make it public'),
];
createTable("CustomizeAdvanced", $filter);

View file

@ -1,10 +1,10 @@
<?php
$filter = [
'encoderNetwork' => 'The <a target="_blank" href="https://github.com/WWBN/AVideo-Encoder-Network">Encoder Network</a> URL ',
'useEncoderNetworkRecomendation' => __('Let the encoder network (if configured) choose what is the best encoder to use'),
'doNotShowUploadMP4Button' => __('Users will not be able to directly upload, only use the encoder'),
'doNotShowImportMP4Button' => __('Disable the option to import MP4 videos from your local (Server) storage'),
'doNotShowEncoderButton' => __('Do not show the button to the encoder'),
'doNotShowEmbedButton' => __('Check this if you will not use embed videos on your site'),
];
createTable("CustomizeAdvanced", $filter);
<?php
$filter = [
'encoderNetwork' => 'The <a target="_blank" href="https://github.com/WWBN/AVideo-Encoder-Network">Encoder Network</a> URL ',
'useEncoderNetworkRecomendation' => __('Let the encoder network (if configured) choose what is the best encoder to use'),
'doNotShowUploadMP4Button' => __('Users will not be able to directly upload, only use the encoder'),
'doNotShowImportMP4Button' => __('Disable the option to import MP4 videos from your local (Server) storage'),
'doNotShowEncoderButton' => __('Do not show the button to the encoder'),
'doNotShowEmbedButton' => __('Check this if you will not use embed videos on your site'),
];
createTable("CustomizeAdvanced", $filter);

View file

@ -1,15 +1,15 @@
<?php
$filter = [
'disableNativeSignUp'=>__('This is useful if you want to use our LDAP plugin or maybe only allow authentication from Social Networks'),
'disableNativeSignIn'=>__('This is useful if you want to use our LDAP plugin or maybe only allow authentication from Social Networks'),
'disablePersonalInfo'=>__('Disable the My Account personal info like: First and Last Name and address'),
'newUsersCanStream'=>__('Automatic allow new users to use your Livestream Platform'),
'doNotIdentifyByEmail'=>__('Do not show user\'s email on the site'),
'doNotIdentifyByName'=>__('Do not show user\'s name on the site'),
'doNotIdentifyByUserName'=>__('Do not show user\'s username on the site'),
'unverifiedEmailsCanNOTLogin'=>__('Users must verify their emails before login'),
'onlyVerifiedEmailCanUpload'=>__('Users must verify their emails before upload/submit videos'),
'sendVerificationMailAutomatic'=>__('After sign up we will automatic send a verification email'),
'userMustBeLoggedIn'=>__('Hide the website to non logged users'),
];
createTable("CustomizeUser", $filter);
<?php
$filter = [
'disableNativeSignUp'=>__('This is useful if you want to use our LDAP plugin or maybe only allow authentication from Social Networks'),
'disableNativeSignIn'=>__('This is useful if you want to use our LDAP plugin or maybe only allow authentication from Social Networks'),
'disablePersonalInfo'=>__('Disable the My Account personal info like: First and Last Name and address'),
'newUsersCanStream'=>__('Automatic allow new users to use your Livestream Platform'),
'doNotIdentifyByEmail'=>__('Do not show user\'s email on the site'),
'doNotIdentifyByName'=>__('Do not show user\'s name on the site'),
'doNotIdentifyByUserName'=>__('Do not show user\'s username on the site'),
'unverifiedEmailsCanNOTLogin'=>__('Users must verify their emails before login'),
'onlyVerifiedEmailCanUpload'=>__('Users must verify their emails before upload/submit videos'),
'sendVerificationMailAutomatic'=>__('After sign up we will automatic send a verification email'),
'userMustBeLoggedIn'=>__('Hide the website to non logged users'),
];
createTable("CustomizeUser", $filter);

View file

@ -1,309 +1,309 @@
<?php
function _isAPPInstalled($appName)
{
$appName = preg_replace('/[^a-z0-9_-]/i', '', $appName);
return trim(shell_exec("which {$appName}"));
}
$phpExtensions = [];
$phpExtensions[] = ['pdo_mysql'];
$phpExtensions[] = ['curl'];
$phpExtensions[] = ['gd', 'Important to generate images'];
$phpExtensions[] = ['xml', 'Important to get the live stats'];
$phpExtensions[] = ['zip', 'Important handle HLS files'];
// $phpExtensions[] = array('mbstring'); // I could not detect that
$apacheModules = [];
$apacheModules[] = ['mod_php'];
$apacheModules[] = ['mod_xsendfile', 'https://github.com/WWBN/AVideo/wiki/Install-Apache-XSendFIle'];
$apacheModules[] = ['mod_rewrite'];
$apacheModules[] = ['mod_expires', 'Important for CDN and cache configuration'];
$apacheModules[] = ['mod_headers', 'Important for CDN and cache configuration'];
$linuxApps = [];
$linuxApps[] = ['mysql'];
$linuxApps[] = ['ffmpeg'];
$linuxApps[] = ['git'];
$linuxApps[] = ['exiftool'];
$linuxApps[] = ['unzip'];
$linuxApps[] = ['youtube-dl'];
$linuxApps[] = ['sshpass', 'https://github.com/WWBN/AVideo/wiki/Clone-Site-Plugin#the-process-with-rsync-support-hls'];
$linuxApps[] = ['apache2'];
$messages = ['Server' => [], 'PHP' => [], 'Apache' => []];
$version = phpversion();
$phpMinVersion = '7.3.0';
if (strnatcmp($version, $phpMinVersion) >= 0) {
$messages['PHP'][] = "PHP v{$version}";
} else {
$messages['PHP'][] = "PHP v{$version}, please upgrade to version {$phpMinVersion} or greater";
}
$extensions = array_map('strtolower', get_loaded_extensions());
//var_dump($extensions);
foreach ($phpExtensions as $value) {
if (in_array($value[0], $extensions)) {
$messages['PHP'][] = $value[0];
} else {
$messages['PHP'][] = [$value[0], 'sudo apt-get install php-' . str_replace('_', '-', $value[0]) . ' -y && sudo /etc/init.d/apache2 restart'];
}
}
if (isset($_SERVER["HTTPS"])) {
$messages['Apache'][] = "HTTPS is enabled";
} else {
$messages['Apache'][] = ["HTTPS is not enabled", 'https://github.com/WWBN/AVideo/wiki/Why-use-HTTPS'];
}
if (function_exists('apache_get_modules')) {
$mods = array_map('strtolower', apache_get_modules());
//var_dump($mods);
foreach ($apacheModules as $value) {
if (in_array($value[0], $mods)) {
$messages['Apache'][] = $value[0];
} else {
$found = false;
foreach ($mods as $value2) {
if (preg_match("/{$value[0]}/", $value2)) {
$found = $value2;
break;
}
}
if ($found) {
$messages['Apache'][] = $found;
} else {
$messages['Apache'][] = [$value[0], @$value[1]];
}
}
}
} else {
foreach ($apacheModules as $value) {
$messages['Apache'][] = [$value[0], 'We could not check your installed modules. We recommend you to use apache as a module NOT as a FPM'];
}
}
foreach ($linuxApps as $value) {
$response = _isAPPInstalled($value[0]);
if (!empty($response)) {
$messages['Server'][] = "{$value[0]} is installed here {$response}";
} else {
$messages['Server'][] = ["{$value[0]} is NOT installed", @$value[1]];
}
}
$videosDir = getVideosDir();
if (is_writable($videosDir)) {
$messages['Server'][] = "{$videosDir} is writable";
} else {
$messages['Server'][] = ["{$videosDir} is NOT writable", 'sudo chmod -R 777 ' . $videosDir];
}
if (is_writable($global['logfile'])) {
$messages['Server'][] = "Log file is writable";
} else {
$messages['Server'][] = ["{$global['logfile']} is NOT writable", 'sudo chmod -R 777 ' . $global['logfile']];
}
$cacheDir = "{$videosDir}cache/";
if (is_writable($cacheDir)) {
$messages['Server'][] = "Cache is writable";
} else {
$messages['Server'][] = ["{$cacheDir} is NOT writable", 'sudo chmod -R 777 ' . $cacheDir];
}
$_50GB = 53687091200;
$df = disk_free_space("/");
if ($df > $_50GB) {
$messages['Server'][] = "You have enough free disk space " . humanFileSize($df);
} else {
$messages['Server'][] = ["Your disk is almost full, you have only " . humanFileSize($df) . ' free'];
}
$dfVideos = disk_free_space($videosDir);
if ($dfVideos > $_50GB) {
$messages['Server'][] = "You have enough free disk space for the videos directory " . humanFileSize($dfVideos);
} else {
$messages['Server'][] = ["Your videos directory is almost full, you have only " . humanFileSize($dfVideos) . ' free'];
}
$verified = verify($global['webSiteRootURL']);
if (empty($verified)) {
$messages['Server'][] = ["We could not verify your server from outside {$global['webSiteRootURL']}"];
} else {
if (!empty($verified->verified)) {
$messages['Server'][] = "Server Checked from outside: <br>" . implode('<br>', $verified->msg);
} else {
$messages['Server'][] = ["Something is wrong: ", implode('<br>', $verified->msg)];
}
/*
if(!empty($verified->screenshot)){
$messages['Server'][] = "<img src='$verified->screenshot' class='img img-responsive'>";
}
*
*/
}
?>
<style>
#healthCheck .alert{
overflow: auto;
}
</style>
<div class="panel panel-default" id="healthCheck">
<div class="panel-heading">
<?php echo '<h1>' . PHP_OS . '</h1>'; ?>
</div>
<div class="panel-body">
<div class="row">
<div class="col-lg-8 col-md-6">
<div class="panel panel-default">
<div class="panel-heading">
Server
</div>
<div class="panel-body">
<div class="row">
<?php
$count = 0;
foreach ($messages['Server'] as $value) {
$count++;
if (is_array($value)) {
?>
<div class="col-lg-4 col-md-6 <?php echo getCSSAnimationClassAndStyle('animate__flipInX'); ?>">
<div class="alert alert-danger">
<i class="fas fa-times"></i> <?php
echo $value[0];
if (!empty($value[1])) {
if (preg_match('/^http/i', $value[1])) {
?>
<a href="<?php echo $value[1]; ?>" class="btn btn-danger btn-xs btn-block" target="_blank"><i class="fas fa-hand-holding-medical"></i> </a>
<?php
} else {
?>
<br><code><?php echo $value[1]; ?></code>
<?php
}
} ?>
</div>
</div>
<?php
} else {
?>
<div class="col-lg-4 col-md-6 <?php echo getCSSAnimationClassAndStyle('animate__flipInX'); ?>">
<div class="alert alert-success">
<i class="fas fa-check"></i> <?php
echo $value; ?>
</div>
</div>
<?php
}
if ($count % 2 === 0) {
echo '<div class="clearfix visible-md"></div>';
}
if ($count % 3 === 0) {
echo '<div class="clearfix visible-lg"></div>';
}
}
?>
</div>
</div>
</div>
</div>
<div class="col-lg-2 col-md-3">
<div class="panel panel-default">
<div class="panel-heading">
PHP
</div>
<div class="panel-body">
<div class="row">
<?php
foreach ($messages['PHP'] as $value) {
if (is_array($value)) {
?>
<div class="col-sm-12 <?php echo getCSSAnimationClassAndStyle('animate__flipInX'); ?>">
<div class="alert alert-danger">
<i class="fas fa-times"></i> <?php
echo $value[0];
if (!empty($value[1])) {
if (preg_match('/^http/i', $value[1])) {
?>
<a href="<?php echo $value[1]; ?>" class="btn btn-danger btn-xs btn-block" target="_blank"><i class="fas fa-hand-holding-medical"></i> </a>
<?php
} else {
?>
<br><code><?php echo $value[1]; ?></code>
<?php
}
} ?>
</div>
</div>
<?php
} else {
?>
<div class="col-sm-12 <?php echo getCSSAnimationClassAndStyle('animate__flipInX'); ?>">
<div class="alert alert-success">
<i class="fas fa-check"></i> <?php
echo $value; ?>
</div>
</div>
<?php
}
}
?>
</div>
</div>
</div>
</div>
<div class="col-lg-2 col-md-3">
<div class="panel panel-default">
<div class="panel-heading">
Apache
</div>
<div class="panel-body">
<div class="row">
<?php
foreach ($messages['Apache'] as $value) {
if (is_array($value)) {
?>
<div class="col-sm-12 <?php echo getCSSAnimationClassAndStyle('animate__flipInX'); ?>">
<div class="alert alert-danger">
<i class="fas fa-times"></i> <?php
echo $value[0];
if (!empty($value[1])) {
if (preg_match('/^http/i', $value[1])) {
?>
<a href="<?php echo $value[1]; ?>" class="btn btn-danger btn-xs btn-block" target="_blank"><i class="fas fa-hand-holding-medical"></i> </a>
<?php
} else {
?>
<br><code><?php echo $value[1]; ?></code>
<?php
}
} ?>
</div>
</div>
<?php
} else {
?>
<div class="col-sm-12 <?php echo getCSSAnimationClassAndStyle('animate__flipInX'); ?>">
<div class="alert alert-success">
<i class="fas fa-check"></i> <?php
echo $value; ?>
</div>
</div>
<?php
}
}
?>
</div>
</div>
</div>
</div>
</div>
</div>
<?php
function _isAPPInstalled($appName)
{
$appName = preg_replace('/[^a-z0-9_-]/i', '', $appName);
return trim(shell_exec("which {$appName}"));
}
$phpExtensions = [];
$phpExtensions[] = ['pdo_mysql'];
$phpExtensions[] = ['curl'];
$phpExtensions[] = ['gd', 'Important to generate images'];
$phpExtensions[] = ['xml', 'Important to get the live stats'];
$phpExtensions[] = ['zip', 'Important handle HLS files'];
// $phpExtensions[] = array('mbstring'); // I could not detect that
$apacheModules = [];
$apacheModules[] = ['mod_php'];
$apacheModules[] = ['mod_xsendfile', 'https://github.com/WWBN/AVideo/wiki/Install-Apache-XSendFIle'];
$apacheModules[] = ['mod_rewrite'];
$apacheModules[] = ['mod_expires', 'Important for CDN and cache configuration'];
$apacheModules[] = ['mod_headers', 'Important for CDN and cache configuration'];
$linuxApps = [];
$linuxApps[] = ['mysql'];
$linuxApps[] = ['ffmpeg'];
$linuxApps[] = ['git'];
$linuxApps[] = ['exiftool'];
$linuxApps[] = ['unzip'];
$linuxApps[] = ['youtube-dl'];
$linuxApps[] = ['sshpass', 'https://github.com/WWBN/AVideo/wiki/Clone-Site-Plugin#the-process-with-rsync-support-hls'];
$linuxApps[] = ['apache2'];
$messages = ['Server' => [], 'PHP' => [], 'Apache' => []];
$version = phpversion();
$phpMinVersion = '7.3.0';
if (strnatcmp($version, $phpMinVersion) >= 0) {
$messages['PHP'][] = "PHP v{$version}";
} else {
$messages['PHP'][] = "PHP v{$version}, please upgrade to version {$phpMinVersion} or greater";
}
$extensions = array_map('strtolower', get_loaded_extensions());
//var_dump($extensions);
foreach ($phpExtensions as $value) {
if (in_array($value[0], $extensions)) {
$messages['PHP'][] = $value[0];
} else {
$messages['PHP'][] = [$value[0], 'sudo apt-get install php-' . str_replace('_', '-', $value[0]) . ' -y && sudo /etc/init.d/apache2 restart'];
}
}
if (isset($_SERVER["HTTPS"])) {
$messages['Apache'][] = "HTTPS is enabled";
} else {
$messages['Apache'][] = ["HTTPS is not enabled", 'https://github.com/WWBN/AVideo/wiki/Why-use-HTTPS'];
}
if (function_exists('apache_get_modules')) {
$mods = array_map('strtolower', apache_get_modules());
//var_dump($mods);
foreach ($apacheModules as $value) {
if (in_array($value[0], $mods)) {
$messages['Apache'][] = $value[0];
} else {
$found = false;
foreach ($mods as $value2) {
if (preg_match("/{$value[0]}/", $value2)) {
$found = $value2;
break;
}
}
if ($found) {
$messages['Apache'][] = $found;
} else {
$messages['Apache'][] = [$value[0], @$value[1]];
}
}
}
} else {
foreach ($apacheModules as $value) {
$messages['Apache'][] = [$value[0], 'We could not check your installed modules. We recommend you to use apache as a module NOT as a FPM'];
}
}
foreach ($linuxApps as $value) {
$response = _isAPPInstalled($value[0]);
if (!empty($response)) {
$messages['Server'][] = "{$value[0]} is installed here {$response}";
} else {
$messages['Server'][] = ["{$value[0]} is NOT installed", @$value[1]];
}
}
$videosDir = getVideosDir();
if (is_writable($videosDir)) {
$messages['Server'][] = "{$videosDir} is writable";
} else {
$messages['Server'][] = ["{$videosDir} is NOT writable", 'sudo chmod -R 777 ' . $videosDir];
}
if (is_writable($global['logfile'])) {
$messages['Server'][] = "Log file is writable";
} else {
$messages['Server'][] = ["{$global['logfile']} is NOT writable", 'sudo chmod -R 777 ' . $global['logfile']];
}
$cacheDir = "{$videosDir}cache/";
if (is_writable($cacheDir)) {
$messages['Server'][] = "Cache is writable";
} else {
$messages['Server'][] = ["{$cacheDir} is NOT writable", 'sudo chmod -R 777 ' . $cacheDir];
}
$_50GB = 53687091200;
$df = disk_free_space("/");
if ($df > $_50GB) {
$messages['Server'][] = "You have enough free disk space " . humanFileSize($df);
} else {
$messages['Server'][] = ["Your disk is almost full, you have only " . humanFileSize($df) . ' free'];
}
$dfVideos = disk_free_space($videosDir);
if ($dfVideos > $_50GB) {
$messages['Server'][] = "You have enough free disk space for the videos directory " . humanFileSize($dfVideos);
} else {
$messages['Server'][] = ["Your videos directory is almost full, you have only " . humanFileSize($dfVideos) . ' free'];
}
$verified = verify($global['webSiteRootURL']);
if (empty($verified)) {
$messages['Server'][] = ["We could not verify your server from outside {$global['webSiteRootURL']}"];
} else {
if (!empty($verified->verified)) {
$messages['Server'][] = "Server Checked from outside: <br>" . implode('<br>', $verified->msg);
} else {
$messages['Server'][] = ["Something is wrong: ", implode('<br>', $verified->msg)];
}
/*
if(!empty($verified->screenshot)){
$messages['Server'][] = "<img src='$verified->screenshot' class='img img-responsive'>";
}
*
*/
}
?>
<style>
#healthCheck .alert{
overflow: auto;
}
</style>
<div class="panel panel-default" id="healthCheck">
<div class="panel-heading">
<?php echo '<h1>' . PHP_OS . '</h1>'; ?>
</div>
<div class="panel-body">
<div class="row">
<div class="col-lg-8 col-md-6">
<div class="panel panel-default">
<div class="panel-heading">
Server
</div>
<div class="panel-body">
<div class="row">
<?php
$count = 0;
foreach ($messages['Server'] as $value) {
$count++;
if (is_array($value)) {
?>
<div class="col-lg-4 col-md-6 <?php echo getCSSAnimationClassAndStyle('animate__flipInX'); ?>">
<div class="alert alert-danger">
<i class="fas fa-times"></i> <?php
echo $value[0];
if (!empty($value[1])) {
if (preg_match('/^http/i', $value[1])) {
?>
<a href="<?php echo $value[1]; ?>" class="btn btn-danger btn-xs btn-block" target="_blank"><i class="fas fa-hand-holding-medical"></i> </a>
<?php
} else {
?>
<br><code><?php echo $value[1]; ?></code>
<?php
}
} ?>
</div>
</div>
<?php
} else {
?>
<div class="col-lg-4 col-md-6 <?php echo getCSSAnimationClassAndStyle('animate__flipInX'); ?>">
<div class="alert alert-success">
<i class="fas fa-check"></i> <?php
echo $value; ?>
</div>
</div>
<?php
}
if ($count % 2 === 0) {
echo '<div class="clearfix visible-md"></div>';
}
if ($count % 3 === 0) {
echo '<div class="clearfix visible-lg"></div>';
}
}
?>
</div>
</div>
</div>
</div>
<div class="col-lg-2 col-md-3">
<div class="panel panel-default">
<div class="panel-heading">
PHP
</div>
<div class="panel-body">
<div class="row">
<?php
foreach ($messages['PHP'] as $value) {
if (is_array($value)) {
?>
<div class="col-sm-12 <?php echo getCSSAnimationClassAndStyle('animate__flipInX'); ?>">
<div class="alert alert-danger">
<i class="fas fa-times"></i> <?php
echo $value[0];
if (!empty($value[1])) {
if (preg_match('/^http/i', $value[1])) {
?>
<a href="<?php echo $value[1]; ?>" class="btn btn-danger btn-xs btn-block" target="_blank"><i class="fas fa-hand-holding-medical"></i> </a>
<?php
} else {
?>
<br><code><?php echo $value[1]; ?></code>
<?php
}
} ?>
</div>
</div>
<?php
} else {
?>
<div class="col-sm-12 <?php echo getCSSAnimationClassAndStyle('animate__flipInX'); ?>">
<div class="alert alert-success">
<i class="fas fa-check"></i> <?php
echo $value; ?>
</div>
</div>
<?php
}
}
?>
</div>
</div>
</div>
</div>
<div class="col-lg-2 col-md-3">
<div class="panel panel-default">
<div class="panel-heading">
Apache
</div>
<div class="panel-body">
<div class="row">
<?php
foreach ($messages['Apache'] as $value) {
if (is_array($value)) {
?>
<div class="col-sm-12 <?php echo getCSSAnimationClassAndStyle('animate__flipInX'); ?>">
<div class="alert alert-danger">
<i class="fas fa-times"></i> <?php
echo $value[0];
if (!empty($value[1])) {
if (preg_match('/^http/i', $value[1])) {
?>
<a href="<?php echo $value[1]; ?>" class="btn btn-danger btn-xs btn-block" target="_blank"><i class="fas fa-hand-holding-medical"></i> </a>
<?php
} else {
?>
<br><code><?php echo $value[1]; ?></code>
<?php
}
} ?>
</div>
</div>
<?php
} else {
?>
<div class="col-sm-12 <?php echo getCSSAnimationClassAndStyle('animate__flipInX'); ?>">
<div class="alert alert-success">
<i class="fas fa-check"></i> <?php
echo $value; ?>
</div>
</div>
<?php
}
}
?>
</div>
</div>
</div>
</div>
</div>
</div>
</div>

View file

@ -1,385 +1,385 @@
<?php
$vars = [];
require_once '../videos/configuration.php';
require_once './functions.php';
if (!User::isAdmin()) {
header("Location: {$global['webSiteRootURL']}");
exit;
}
$isAdminPanel = 1;
class MenuAdmin
{
public $title;
public $icon;
public $href;
public $active = false;
public $show = false;
public $itens = [];
public $data_toggle;
public $data_target;
public function __construct($title, $icon, $href = "", $data_toggle = "", $data_target = "")
{
$this->title = $title;
$this->icon = $icon;
$this->href = $href;
$this->data_toggle = $data_toggle;
$this->data_target = $data_target;
if (!empty($href)) {
$fileName = basename($_SERVER["SCRIPT_NAME"]);
if ($href === $fileName) {
$this->active = true;
}
}
}
public function addItem(MenuAdmin $menu)
{
$this->itens[] = $menu;
if ($menu->active) {
$this->show = true;
}
}
}
$itens = [];
$menu = new MenuAdmin(__("Dashboard"), "fa fa-tachometer-alt", "dashboard");
$itens[] = $menu;
/*
$menu = new MenuAdmin(__("Premium Featrures"), "fas fa-star", "premium");
$itens[] = $menu;
*/
$menu = new MenuAdmin(__("Settings"), "fa fa-wrench");
$menu->addItem(new MenuAdmin(__("Remove Branding"), "far fa-edit", "customize_settings"));
$menu->addItem(new MenuAdmin(__("General Settings"), "fas fa-cog", "general_settings"));
$menu->addItem(new MenuAdmin(__("Site Settings"), "fas fa-sitemap", "site_settings"));
$menu->addItem(new MenuAdmin(__("Social Login Settings"), "fas fa-sign-in-alt", "socialLogin_settings"));
$menu->addItem(new MenuAdmin(__("S3, B2, FTP settings"), "fas fa-hdd", "storage_settings"));
$menu->addItem(new MenuAdmin(__("Payments Settings"), "far fa-money-bill-alt", "payments_settings"));
$itens[] = $menu;
$menu = new MenuAdmin(__("Contents"), "fas fa-list-ul");
$menu->addItem(new MenuAdmin(__("Videos"), "fas fa-play-circle", "videos"));
$menu->addItem(new MenuAdmin(__("Live Stuff"), "fas fa-broadcast-tower", "live"));
$menu->addItem(new MenuAdmin(__("Users"), "glyphicon glyphicon-user", "users"));
$menu->addItem(new MenuAdmin(__("Users Groups"), "fa fa-users", "usersGroups"));
$menu->addItem(new MenuAdmin(__("Categories"), "glyphicon glyphicon-list", "categories"));
$menu->addItem(new MenuAdmin(__("Backup"), "fas fa-undo-alt", "backup"));
$itens[] = $menu;
$menu = new MenuAdmin(__("Design"), "fas fa-pen-fancy");
$menu->addItem(new MenuAdmin(__("First Page Style"), "fas fa-columns", "design_first_page"));
$menu->addItem(new MenuAdmin(__("Player Skin"), "fas fa-play-circle", "design_player"));
$menu->addItem(new MenuAdmin(__("Themes"), "fas fa-palette", "design_themes"));
$menu->addItem(new MenuAdmin(__("Colors"), "fas fa-palette", "design_colors"));
//$menu->addItem(new MenuAdmin(__("Custom CSS"), "fab fa-css3-alt", "design_css"));
$itens[] = $menu;
$menu = new MenuAdmin(__("Monetize"), "fas fa-dollar-sign");
$menu->addItem(new MenuAdmin(__("Site Advertisement with VAST Video ads"), "fas fa-money-check-alt", "monetize_vast"));
$menu->addItem(new MenuAdmin(__("Pay User per Video View"), "far fa-money-bill-alt", "monetize_user"));
$menu->addItem(new MenuAdmin(__("Create Subscription Plans"), "fas fa-money-bill-alt", "monetize_subscription"));
//$menu->addItem(new MenuAdmin(__("Banner Script code"), "fas fa-money-check-alt", "advertisement_script"));
$itens[] = $menu;
/*
$menu = new MenuAdmin(__("Update Version"), "glyphicon glyphicon-refresh", "{$global['webSiteRootURL']}update/");
$itens[] = $menu;
*/
$menu = new MenuAdmin(__("Miscellaneous"), "fas fa-th");
$menu->addItem(new MenuAdmin(__("Plugins"), "fas fa-puzzle-piece", "plugins"));
$menu->addItem(new MenuAdmin(__("Email All Users"), "fas fa-mail-bulk", "mail_all_users"));
$itens[] = $menu;
$menu = new MenuAdmin(__("Health Check"), "fas fa-notes-medical", "health_check");
$itens[] = $menu;
$_GET['page'] = xss_esc(@$_GET['page']);
$includeHead = '';
$includeBody = '';
switch ($_GET['page']) {
case "backup":
$includeBody = $global['systemRootPath'] . 'admin/backup.php';
break;
case "premium":
$includeBody = $global['systemRootPath'] . 'admin/premium.php';
break;
case "design_first_page":
$includeBody = $global['systemRootPath'] . 'admin/design_first_page.php';
break;
case "design_themes":
$includeBody = $global['systemRootPath'] . 'admin/design_themes.php';
break;
case "design_colors":
$includeBody = $global['systemRootPath'] . 'admin/design_colors.php';
break;
case "design_player":
$includeBody = $global['systemRootPath'] . 'admin/design_player.php';
break;
case "customize_settings":
$includeBody = $global['systemRootPath'] . 'admin/customize_settings.php';
break;
case "storage_settings":
$includeBody = $global['systemRootPath'] . 'admin/storage_settings.php';
break;
case "general_settings":
$includeBody = $global['systemRootPath'] . 'admin/general_settings.php';
break;
case "payments_settings":
$includeBody = $global['systemRootPath'] . 'admin/payments_settings.php';
break;
case "socialLogin_settings":
$includeBody = $global['systemRootPath'] . 'admin/socialLogin_settings.php';
break;
case "site_settings":
$includeHead = $global['systemRootPath'] . 'view/configurations_head.php';
$includeBody = $global['systemRootPath'] . 'view/configurations_body.php';
break;
case "monetize_subscription":
$includeHead = $global['systemRootPath'] . 'plugin/Subscription/page/editor_head.php';
$includeBody = [];
$includeBody[] = $global['systemRootPath'] . 'plugin/Subscription/page/editor_body.php';
$includeBody[] = $global['systemRootPath'] . 'admin/monetize_subscription.php';
break;
case "monetize_vast":
$includeHead = $global['systemRootPath'] . 'plugin/AD_Server/index_head.php';
$includeBody = $global['systemRootPath'] . 'plugin/AD_Server/index_body.php';
break;
case "monetize_user":
$includeBody = $global['systemRootPath'] . 'admin/monetize_user.php';
break;
case "plugins":
$includeHead = $global['systemRootPath'] . 'view/managerPlugins_head.php';
$includeBody = $global['systemRootPath'] . 'view/managerPlugins_body.php';
break;
case "mail_all_users":
$includeBody = $global['systemRootPath'] . 'admin/mail_all_users.php';
break;
case "users":
$includeHead = $global['systemRootPath'] . 'view/managerUsers_head.php';
$includeBody = $global['systemRootPath'] . 'view/managerUsers_body.php';
break;
case "live":
$includeBody = $global['systemRootPath'] . 'admin/live.php';
break;
case "usersGroups":
$includeHead = $global['systemRootPath'] . 'view/managerUsersGroups_head.php';
$includeBody = $global['systemRootPath'] . 'view/managerUsersGroups_body.php';
break;
case "categories":
$includeHead = $global['systemRootPath'] . 'view/managerCategories_head.php';
$includeBody = $global['systemRootPath'] . 'view/managerCategories_body.php';
break;
case "videos":
$includeHead = $global['systemRootPath'] . 'view/managerVideos_head.php';
$includeBody = $global['systemRootPath'] . 'view/managerVideos_body.php';
break;
case "health_check":
$includeBody = $global['systemRootPath'] . 'admin/health_check.php';
break;
default:
$includeHead = $global['systemRootPath'] . 'view/charts_head.php';
$includeBody = $global['systemRootPath'] . 'view/charts_body.php';
break;
}
?>
<!DOCTYPE html>
<html lang="<?php echo $config->getLanguage(); ?>">
<head>
<?php
echo getHTMLTitle(__("Administration"));
?>
<?php
include $global['systemRootPath'] . 'view/include/head.php';
if (!empty($includeHead) && file_exists($includeHead)) {
echo "<!-- Include $includeHead -->";
include $includeHead;
echo "<!-- END Include $includeHead -->";
}
?>
<style>
@media (max-width: 767px) {
.affix {
position: static;
}
}
.leftMenu .panel-body {
padding: 0px;
}
.adminLeftMenu.panel-default i, .adminLeftMenu.panel-default{
-webkit-transition: opacity 0.5s ease-in-out;
-moz-transition: opacity 0.5s ease-in-out;
transition: opacity 0.5s ease-in-out;
}
.adminLeftMenu.panel-default i{
opacity: 0.2;
}
.adminLeftMenu:hover.panel-default i{
opacity: 1;
}
.adminLeftMenu.panel-default{
opacity: 0.6;
}
.adminLeftMenu:hover.panel-default{
opacity: 1;
}
</style>
</head>
<body class="<?php echo $global['bodyClass']; ?>">
<?php
include $global['systemRootPath'] . 'view/include/navbar.php';
?>
<div class="container-fluid">
<br>
<div class="row">
<div class=" col-lg-2 col-md-3 col-sm-3 fixed affix leftMenu">
<div class="panel-group" id="accordion">
<?php
$panel = 'panel-default';
if (empty($_REQUEST['page'])) {
$panel = 'panel-primary';
}
foreach ($itens as $key => $value) {
$uid = uniqid();
$href = 'data-toggle="collapse" data-parent="#accordion" href="#collapse' . $uid . '"';
if (!empty($value->href)) {
$href = 'href="' . $global['webSiteRootURL'] . 'admin/?page=' . $value->href . '"';
}
if (!empty($_REQUEST['page']) && $_REQUEST['page'] == $value->href) {
$panel = 'panel-primary';
} else {
foreach ($value->itens as $key2 => $value2) {
if (!empty($_REQUEST['page']) && $_REQUEST['page'] === $value2->href) {
$panel = 'panel-primary';
}
}
} ?>
<div class="panel <?php echo $panel; ?> adminLeftMenu <?php echo getCSSAnimationClassAndStyle('animate__bounceInLeft', 'menu'); ?>">
<div class="panel-heading">
<h4 class="panel-title">
<a <?php echo $href; ?> >
<i class="<?php echo $value->icon; ?> "></i> <?php echo $value->title; ?>
</a>
</h4>
</div>
<?php
if (!empty($value->itens)) {
$in = '';
if (!empty($_GET['page'])) {
foreach ($value->itens as $search) {
if ($_GET['page'] === $search->href) {
$in = "in";
break;
}
}
} ?>
<div id="collapse<?php echo $uid; ?>" class="panel-collapse collapse <?php echo $in; ?>">
<div class="panel-body">
<table class="table">
<?php
$active = '';
if (empty($_GET['page'])) {
$active = "active";
}
foreach ($value->itens as $key2 => $value2) {
if (!empty($_GET['page']) && $_GET['page'] === $value2->href) {
$active = "active";
} ?>
<tr>
<td class="<?php echo $active; ?>">
<a href="<?php echo "{$global['webSiteRootURL']}admin/?page=" . $value2->href; ?>"><i class="<?php echo $value2->icon; ?>"></i> <?php echo $value2->title; ?></a>
</td>
</tr>
<?php
$active = '';
} ?>
</table>
</div>
</div>
<?php
} ?>
</div>
<?php
$panel = 'panel-default';
}
?>
</div>
</div>
<div class=" col-lg-10 col-md-9 col-sm-9 col-sm-offset-3 col-md-offset-3 col-lg-offset-2 ">
<?php
if (!empty($includeBody)) {
if (is_array($includeBody)) {
foreach ($includeBody as $value) {
if (file_exists($value)) {
include $value;
} else {
?>
<div class="alert alert-danger">
<?php echo __('Please forgive us for bothering you, but unfortunately you do not have this plugin yet. But do not hesitate to purchase it in our online store'); ?>
<a class="btn btn-danger" href="https://youphp.tube/marketplace/"><?php echo __('Plugin Store'); ?></a>
</div>
<?php
}
}
} else {
if (file_exists($includeBody)) {
include $includeBody;
} else {
?>
<div class="alert alert-danger">
<?php echo __('Please forgive us for bothering you, but unfortunately you do not have this plugin yet. But do not hesitate to purchase it in our online store'); ?>
<a class="btn btn-danger" href="https://youphp.tube/marketplace/"><?php echo __('Plugin Store'); ?></a>
</div>
<?php
}
}
}
?>
</div>
</div>
</div>
<?php
include_once $global['systemRootPath'] . 'view/include/footer.php';
?>
<script>
$(document).ready(function () {
$('.adminOptionsForm').submit(function (e) {
e.preventDefault();
modal.showPleaseWait();
$.ajax({
url: '<?php echo $global['webSiteRootURL']; ?>admin/save.json.php',
data: $(this).serialize(),
type: 'post',
success: function (response) {
modal.hidePleaseWait();
}
});
});
$('.pluginSwitch').change(function (e) {
modal.showPleaseWait();
$.ajax({
url: '<?php echo $global['webSiteRootURL']; ?>objects/pluginSwitch.json.php',
data: {"uuid": $(this).attr('uuid'), "name": $(this).attr('name'), "dir": $(this).attr('name'), "enable": $(this).is(":checked")},
type: 'post',
success: function (response) {
modal.hidePleaseWait();
}
});
});
});
</script>
</body>
</html>
<?php
$vars = [];
require_once '../videos/configuration.php';
require_once './functions.php';
if (!User::isAdmin()) {
header("Location: {$global['webSiteRootURL']}");
exit;
}
$isAdminPanel = 1;
class MenuAdmin
{
public $title;
public $icon;
public $href;
public $active = false;
public $show = false;
public $itens = [];
public $data_toggle;
public $data_target;
public function __construct($title, $icon, $href = "", $data_toggle = "", $data_target = "")
{
$this->title = $title;
$this->icon = $icon;
$this->href = $href;
$this->data_toggle = $data_toggle;
$this->data_target = $data_target;
if (!empty($href)) {
$fileName = basename($_SERVER["SCRIPT_NAME"]);
if ($href === $fileName) {
$this->active = true;
}
}
}
public function addItem(MenuAdmin $menu)
{
$this->itens[] = $menu;
if ($menu->active) {
$this->show = true;
}
}
}
$itens = [];
$menu = new MenuAdmin(__("Dashboard"), "fa fa-tachometer-alt", "dashboard");
$itens[] = $menu;
/*
$menu = new MenuAdmin(__("Premium Featrures"), "fas fa-star", "premium");
$itens[] = $menu;
*/
$menu = new MenuAdmin(__("Settings"), "fa fa-wrench");
$menu->addItem(new MenuAdmin(__("Remove Branding"), "far fa-edit", "customize_settings"));
$menu->addItem(new MenuAdmin(__("General Settings"), "fas fa-cog", "general_settings"));
$menu->addItem(new MenuAdmin(__("Site Settings"), "fas fa-sitemap", "site_settings"));
$menu->addItem(new MenuAdmin(__("Social Login Settings"), "fas fa-sign-in-alt", "socialLogin_settings"));
$menu->addItem(new MenuAdmin(__("S3, B2, FTP settings"), "fas fa-hdd", "storage_settings"));
$menu->addItem(new MenuAdmin(__("Payments Settings"), "far fa-money-bill-alt", "payments_settings"));
$itens[] = $menu;
$menu = new MenuAdmin(__("Contents"), "fas fa-list-ul");
$menu->addItem(new MenuAdmin(__("Videos"), "fas fa-play-circle", "videos"));
$menu->addItem(new MenuAdmin(__("Live Stuff"), "fas fa-broadcast-tower", "live"));
$menu->addItem(new MenuAdmin(__("Users"), "glyphicon glyphicon-user", "users"));
$menu->addItem(new MenuAdmin(__("Users Groups"), "fa fa-users", "usersGroups"));
$menu->addItem(new MenuAdmin(__("Categories"), "glyphicon glyphicon-list", "categories"));
$menu->addItem(new MenuAdmin(__("Backup"), "fas fa-undo-alt", "backup"));
$itens[] = $menu;
$menu = new MenuAdmin(__("Design"), "fas fa-pen-fancy");
$menu->addItem(new MenuAdmin(__("First Page Style"), "fas fa-columns", "design_first_page"));
$menu->addItem(new MenuAdmin(__("Player Skin"), "fas fa-play-circle", "design_player"));
$menu->addItem(new MenuAdmin(__("Themes"), "fas fa-palette", "design_themes"));
$menu->addItem(new MenuAdmin(__("Colors"), "fas fa-palette", "design_colors"));
//$menu->addItem(new MenuAdmin(__("Custom CSS"), "fab fa-css3-alt", "design_css"));
$itens[] = $menu;
$menu = new MenuAdmin(__("Monetize"), "fas fa-dollar-sign");
$menu->addItem(new MenuAdmin(__("Site Advertisement with VAST Video ads"), "fas fa-money-check-alt", "monetize_vast"));
$menu->addItem(new MenuAdmin(__("Pay User per Video View"), "far fa-money-bill-alt", "monetize_user"));
$menu->addItem(new MenuAdmin(__("Create Subscription Plans"), "fas fa-money-bill-alt", "monetize_subscription"));
//$menu->addItem(new MenuAdmin(__("Banner Script code"), "fas fa-money-check-alt", "advertisement_script"));
$itens[] = $menu;
/*
$menu = new MenuAdmin(__("Update Version"), "glyphicon glyphicon-refresh", "{$global['webSiteRootURL']}update/");
$itens[] = $menu;
*/
$menu = new MenuAdmin(__("Miscellaneous"), "fas fa-th");
$menu->addItem(new MenuAdmin(__("Plugins"), "fas fa-puzzle-piece", "plugins"));
$menu->addItem(new MenuAdmin(__("Email All Users"), "fas fa-mail-bulk", "mail_all_users"));
$itens[] = $menu;
$menu = new MenuAdmin(__("Health Check"), "fas fa-notes-medical", "health_check");
$itens[] = $menu;
$_GET['page'] = xss_esc(@$_GET['page']);
$includeHead = '';
$includeBody = '';
switch ($_GET['page']) {
case "backup":
$includeBody = $global['systemRootPath'] . 'admin/backup.php';
break;
case "premium":
$includeBody = $global['systemRootPath'] . 'admin/premium.php';
break;
case "design_first_page":
$includeBody = $global['systemRootPath'] . 'admin/design_first_page.php';
break;
case "design_themes":
$includeBody = $global['systemRootPath'] . 'admin/design_themes.php';
break;
case "design_colors":
$includeBody = $global['systemRootPath'] . 'admin/design_colors.php';
break;
case "design_player":
$includeBody = $global['systemRootPath'] . 'admin/design_player.php';
break;
case "customize_settings":
$includeBody = $global['systemRootPath'] . 'admin/customize_settings.php';
break;
case "storage_settings":
$includeBody = $global['systemRootPath'] . 'admin/storage_settings.php';
break;
case "general_settings":
$includeBody = $global['systemRootPath'] . 'admin/general_settings.php';
break;
case "payments_settings":
$includeBody = $global['systemRootPath'] . 'admin/payments_settings.php';
break;
case "socialLogin_settings":
$includeBody = $global['systemRootPath'] . 'admin/socialLogin_settings.php';
break;
case "site_settings":
$includeHead = $global['systemRootPath'] . 'view/configurations_head.php';
$includeBody = $global['systemRootPath'] . 'view/configurations_body.php';
break;
case "monetize_subscription":
$includeHead = $global['systemRootPath'] . 'plugin/Subscription/page/editor_head.php';
$includeBody = [];
$includeBody[] = $global['systemRootPath'] . 'plugin/Subscription/page/editor_body.php';
$includeBody[] = $global['systemRootPath'] . 'admin/monetize_subscription.php';
break;
case "monetize_vast":
$includeHead = $global['systemRootPath'] . 'plugin/AD_Server/index_head.php';
$includeBody = $global['systemRootPath'] . 'plugin/AD_Server/index_body.php';
break;
case "monetize_user":
$includeBody = $global['systemRootPath'] . 'admin/monetize_user.php';
break;
case "plugins":
$includeHead = $global['systemRootPath'] . 'view/managerPlugins_head.php';
$includeBody = $global['systemRootPath'] . 'view/managerPlugins_body.php';
break;
case "mail_all_users":
$includeBody = $global['systemRootPath'] . 'admin/mail_all_users.php';
break;
case "users":
$includeHead = $global['systemRootPath'] . 'view/managerUsers_head.php';
$includeBody = $global['systemRootPath'] . 'view/managerUsers_body.php';
break;
case "live":
$includeBody = $global['systemRootPath'] . 'admin/live.php';
break;
case "usersGroups":
$includeHead = $global['systemRootPath'] . 'view/managerUsersGroups_head.php';
$includeBody = $global['systemRootPath'] . 'view/managerUsersGroups_body.php';
break;
case "categories":
$includeHead = $global['systemRootPath'] . 'view/managerCategories_head.php';
$includeBody = $global['systemRootPath'] . 'view/managerCategories_body.php';
break;
case "videos":
$includeHead = $global['systemRootPath'] . 'view/managerVideos_head.php';
$includeBody = $global['systemRootPath'] . 'view/managerVideos_body.php';
break;
case "health_check":
$includeBody = $global['systemRootPath'] . 'admin/health_check.php';
break;
default:
$includeHead = $global['systemRootPath'] . 'view/charts_head.php';
$includeBody = $global['systemRootPath'] . 'view/charts_body.php';
break;
}
?>
<!DOCTYPE html>
<html lang="<?php echo $config->getLanguage(); ?>">
<head>
<?php
echo getHTMLTitle(__("Administration"));
?>
<?php
include $global['systemRootPath'] . 'view/include/head.php';
if (!empty($includeHead) && file_exists($includeHead)) {
echo "<!-- Include $includeHead -->";
include $includeHead;
echo "<!-- END Include $includeHead -->";
}
?>
<style>
@media (max-width: 767px) {
.affix {
position: static;
}
}
.leftMenu .panel-body {
padding: 0px;
}
.adminLeftMenu.panel-default i, .adminLeftMenu.panel-default{
-webkit-transition: opacity 0.5s ease-in-out;
-moz-transition: opacity 0.5s ease-in-out;
transition: opacity 0.5s ease-in-out;
}
.adminLeftMenu.panel-default i{
opacity: 0.2;
}
.adminLeftMenu:hover.panel-default i{
opacity: 1;
}
.adminLeftMenu.panel-default{
opacity: 0.6;
}
.adminLeftMenu:hover.panel-default{
opacity: 1;
}
</style>
</head>
<body class="<?php echo $global['bodyClass']; ?>">
<?php
include $global['systemRootPath'] . 'view/include/navbar.php';
?>
<div class="container-fluid">
<br>
<div class="row">
<div class=" col-lg-2 col-md-3 col-sm-3 fixed affix leftMenu">
<div class="panel-group" id="accordion">
<?php
$panel = 'panel-default';
if (empty($_REQUEST['page'])) {
$panel = 'panel-primary';
}
foreach ($itens as $key => $value) {
$uid = uniqid();
$href = 'data-toggle="collapse" data-parent="#accordion" href="#collapse' . $uid . '"';
if (!empty($value->href)) {
$href = 'href="' . $global['webSiteRootURL'] . 'admin/?page=' . $value->href . '"';
}
if (!empty($_REQUEST['page']) && $_REQUEST['page'] == $value->href) {
$panel = 'panel-primary';
} else {
foreach ($value->itens as $key2 => $value2) {
if (!empty($_REQUEST['page']) && $_REQUEST['page'] === $value2->href) {
$panel = 'panel-primary';
}
}
} ?>
<div class="panel <?php echo $panel; ?> adminLeftMenu <?php echo getCSSAnimationClassAndStyle('animate__bounceInLeft', 'menu'); ?>">
<div class="panel-heading">
<h4 class="panel-title">
<a <?php echo $href; ?> >
<i class="<?php echo $value->icon; ?> "></i> <?php echo $value->title; ?>
</a>
</h4>
</div>
<?php
if (!empty($value->itens)) {
$in = '';
if (!empty($_GET['page'])) {
foreach ($value->itens as $search) {
if ($_GET['page'] === $search->href) {
$in = "in";
break;
}
}
} ?>
<div id="collapse<?php echo $uid; ?>" class="panel-collapse collapse <?php echo $in; ?>">
<div class="panel-body">
<table class="table">
<?php
$active = '';
if (empty($_GET['page'])) {
$active = "active";
}
foreach ($value->itens as $key2 => $value2) {
if (!empty($_GET['page']) && $_GET['page'] === $value2->href) {
$active = "active";
} ?>
<tr>
<td class="<?php echo $active; ?>">
<a href="<?php echo "{$global['webSiteRootURL']}admin/?page=" . $value2->href; ?>"><i class="<?php echo $value2->icon; ?>"></i> <?php echo $value2->title; ?></a>
</td>
</tr>
<?php
$active = '';
} ?>
</table>
</div>
</div>
<?php
} ?>
</div>
<?php
$panel = 'panel-default';
}
?>
</div>
</div>
<div class=" col-lg-10 col-md-9 col-sm-9 col-sm-offset-3 col-md-offset-3 col-lg-offset-2 ">
<?php
if (!empty($includeBody)) {
if (is_array($includeBody)) {
foreach ($includeBody as $value) {
if (file_exists($value)) {
include $value;
} else {
?>
<div class="alert alert-danger">
<?php echo __('Please forgive us for bothering you, but unfortunately you do not have this plugin yet. But do not hesitate to purchase it in our online store'); ?>
<a class="btn btn-danger" href="https://youphp.tube/marketplace/"><?php echo __('Plugin Store'); ?></a>
</div>
<?php
}
}
} else {
if (file_exists($includeBody)) {
include $includeBody;
} else {
?>
<div class="alert alert-danger">
<?php echo __('Please forgive us for bothering you, but unfortunately you do not have this plugin yet. But do not hesitate to purchase it in our online store'); ?>
<a class="btn btn-danger" href="https://youphp.tube/marketplace/"><?php echo __('Plugin Store'); ?></a>
</div>
<?php
}
}
}
?>
</div>
</div>
</div>
<?php
include_once $global['systemRootPath'] . 'view/include/footer.php';
?>
<script>
$(document).ready(function () {
$('.adminOptionsForm').submit(function (e) {
e.preventDefault();
modal.showPleaseWait();
$.ajax({
url: '<?php echo $global['webSiteRootURL']; ?>admin/save.json.php',
data: $(this).serialize(),
type: 'post',
success: function (response) {
modal.hidePleaseWait();
}
});
});
$('.pluginSwitch').change(function (e) {
modal.showPleaseWait();
$.ajax({
url: '<?php echo $global['webSiteRootURL']; ?>objects/pluginSwitch.json.php',
data: {"uuid": $(this).attr('uuid'), "name": $(this).attr('name'), "dir": $(this).attr('name'), "enable": $(this).is(":checked")},
type: 'post',
success: function (response) {
modal.hidePleaseWait();
}
});
});
});
</script>
</body>
</html>

View file

@ -1,50 +1,50 @@
<div class="row">
<div class="col-md-6">
<div class="panel panel-default">
<div class="panel-heading"><?php echo __('Live') ?> <div class="pull-right"><?php echo getPluginSwitch('Live'); ?></div></div>
<div class="panel-body">
<?php
createTable("Live");
?>
</div>
</div>
</div>
<div class="col-md-6">
<div class="panel panel-default">
<div class="panel-heading"><?php echo __('Chat') ?> <div class="pull-right"><?php echo getPluginSwitch('Chat2'); ?></div></div>
<div class="panel-body">
<?php
createTable("Chat2");
?>
</div>
</div>
</div>
<div class="col-md-6">
<div class="panel panel-default">
<div class="panel-heading"><?php echo __('Live Users') ?> <div class="pull-right"><?php echo getPluginSwitch('LiveUsers'); ?></div></div>
<div class="panel-body">
<?php
$filter = [
'doNotDisplayCounter' => 'It will collect usage info but will not display the counter on the live video'
];
createTable("LiveUsers", $filter);
?>
</div>
</div>
</div>
<div class="col-md-6">
<div class="panel panel-default">
<div class="panel-heading"><?php echo __('Live Links') ?> <div class="pull-right"><?php echo getPluginSwitch('LiveLinks'); ?></div></div>
<div class="panel-body">
<?php
createTable("LiveLinks");
?>
</div>
</div>
</div>
<div class="row">
<div class="col-md-6">
<div class="panel panel-default">
<div class="panel-heading"><?php echo __('Live') ?> <div class="pull-right"><?php echo getPluginSwitch('Live'); ?></div></div>
<div class="panel-body">
<?php
createTable("Live");
?>
</div>
</div>
</div>
<div class="col-md-6">
<div class="panel panel-default">
<div class="panel-heading"><?php echo __('Chat') ?> <div class="pull-right"><?php echo getPluginSwitch('Chat2'); ?></div></div>
<div class="panel-body">
<?php
createTable("Chat2");
?>
</div>
</div>
</div>
<div class="col-md-6">
<div class="panel panel-default">
<div class="panel-heading"><?php echo __('Live Users') ?> <div class="pull-right"><?php echo getPluginSwitch('LiveUsers'); ?></div></div>
<div class="panel-body">
<?php
$filter = [
'doNotDisplayCounter' => 'It will collect usage info but will not display the counter on the live video'
];
createTable("LiveUsers", $filter);
?>
</div>
</div>
</div>
<div class="col-md-6">
<div class="panel panel-default">
<div class="panel-heading"><?php echo __('Live Links') ?> <div class="pull-right"><?php echo getPluginSwitch('LiveLinks'); ?></div></div>
<div class="panel-body">
<?php
createTable("LiveLinks");
?>
</div>
</div>
</div>
</div>

View file

@ -1,78 +1,78 @@
<link href="<?php echo getCDN(); ?>view/js/bootstrap3-wysiwyg/bootstrap3-wysihtml5.min.css" rel="stylesheet" type="text/css"/>
<div class="panel panel-default">
<div class="panel-heading"><?php echo __("Email All Users"); ?></div>
<div class="panel-body">
<div class="row">
<label class="col-md-4" style="text-align: right;">
<?php echo __('Sent only to this email'); ?>:
</label>
<div class="col-md-8">
<input class="form-control" type="email" id="email" placeholder="test@email.com">
<small><?php echo __('Leave it blank to send to all users'); ?> <?php echo __('or user group selected below'); ?></small>
</div>
</div>
<div class="row">
<label class="col-md-4" style="text-align: right;">
<?php echo __('Filter users'); ?>:
</label>
<div class="col-md-8">
<label class="radio-inline"><input type="radio" name="userGroup" value="0" checked><?php echo __("All"); ?></label>
<?php
$userGroups = UserGroups::getAllUsersGroupsArray();
foreach ($userGroups as $key => $value) {
echo '<label class="radio-inline"><input type="radio" name="userGroup" value="' . $key . '">' . $value . '</label>';
}
?>
</div>
</div>
<hr>
<div class="row">
<div class="col-lg-12">
<textarea id="emailMessage" placeholder="<?php echo __("Enter text"); ?> ..." style="width: 100%;"></textarea>
</div>
</div>
<div class="row">
<div class="col-lg-12">
<button type="button" class="btn btn-success btn-block" id="sendSubscribeBtn">
<i class="fas fa-envelope-square"></i> <?php echo __("Send Email"); ?>
</button>
</div>
</div>
</div>
</div>
<script src="<?php echo getCDN(); ?>view/js/bootstrap3-wysiwyg/bootstrap3-wysihtml5.all.min.js" type="text/javascript"></script>
<script>
function notify() {
modal.showPleaseWait();
$.ajax({
url: '<?php echo $global['webSiteRootURL']; ?>objects/emailAllUsers.json.php',
method: 'POST',
data: {
'message': $('#emailMessage').val(),
'email': $('#email').val(),
'users_groups_id': $('input[name="userGroup"]:checked').val()
},
success: function (response) {
console.log(response);
if (response.error) {
avideoAlert("<?php echo __("Sorry!"); ?>", response.msg[0], "error");
} else {
avideoAlert("<?php echo __("Success"); ?>", "You have sent " + response.count + " emails", "success");
}
modal.hidePleaseWait();
}
});
}
$(document).ready(function () {
$('#emailMessage').wysihtml5();
$("#sendSubscribeBtn").click(function () {
notify();
});
});
</script>
<link href="<?php echo getCDN(); ?>view/js/bootstrap3-wysiwyg/bootstrap3-wysihtml5.min.css" rel="stylesheet" type="text/css"/>
<div class="panel panel-default">
<div class="panel-heading"><?php echo __("Email All Users"); ?></div>
<div class="panel-body">
<div class="row">
<label class="col-md-4" style="text-align: right;">
<?php echo __('Sent only to this email'); ?>:
</label>
<div class="col-md-8">
<input class="form-control" type="email" id="email" placeholder="test@email.com">
<small><?php echo __('Leave it blank to send to all users'); ?> <?php echo __('or user group selected below'); ?></small>
</div>
</div>
<div class="row">
<label class="col-md-4" style="text-align: right;">
<?php echo __('Filter users'); ?>:
</label>
<div class="col-md-8">
<label class="radio-inline"><input type="radio" name="userGroup" value="0" checked><?php echo __("All"); ?></label>
<?php
$userGroups = UserGroups::getAllUsersGroupsArray();
foreach ($userGroups as $key => $value) {
echo '<label class="radio-inline"><input type="radio" name="userGroup" value="' . $key . '">' . $value . '</label>';
}
?>
</div>
</div>
<hr>
<div class="row">
<div class="col-lg-12">
<textarea id="emailMessage" placeholder="<?php echo __("Enter text"); ?> ..." style="width: 100%;"></textarea>
</div>
</div>
<div class="row">
<div class="col-lg-12">
<button type="button" class="btn btn-success btn-block" id="sendSubscribeBtn">
<i class="fas fa-envelope-square"></i> <?php echo __("Send Email"); ?>
</button>
</div>
</div>
</div>
</div>
<script src="<?php echo getCDN(); ?>view/js/bootstrap3-wysiwyg/bootstrap3-wysihtml5.all.min.js" type="text/javascript"></script>
<script>
function notify() {
modal.showPleaseWait();
$.ajax({
url: '<?php echo $global['webSiteRootURL']; ?>objects/emailAllUsers.json.php',
method: 'POST',
data: {
'message': $('#emailMessage').val(),
'email': $('#email').val(),
'users_groups_id': $('input[name="userGroup"]:checked').val()
},
success: function (response) {
console.log(response);
if (response.error) {
avideoAlert("<?php echo __("Sorry!"); ?>", response.msg[0], "error");
} else {
avideoAlert("<?php echo __("Success"); ?>", "You have sent " + response.count + " emails", "success");
}
modal.hidePleaseWait();
}
});
}
$(document).ready(function () {
$('#emailMessage').wysihtml5();
$("#sendSubscribeBtn").click(function () {
notify();
});
});
</script>

View file

@ -1,17 +1,17 @@
<div class="row">
<div class="col-md-12">
<div class="panel panel-default">
<div class="panel-heading"><i class="fa fa-cog"></i> Subscription Configuration </div>
<div class="panel-body" style="overflow: hidden;">
<?php
$filter = [
'displayTopBarSubscribeButton' => 'Show a button on the top to subscribe',
'displayLeftMenuSubscribeButton' => 'Show a button on the the left menu to subscribe',
'textSubscribe' => 'The button text label'
];
createTable("Subscription", $filter);
?>
</div>
</div>
</div>
</div>
<div class="row">
<div class="col-md-12">
<div class="panel panel-default">
<div class="panel-heading"><i class="fa fa-cog"></i> Subscription Configuration </div>
<div class="panel-body" style="overflow: hidden;">
<?php
$filter = [
'displayTopBarSubscribeButton' => 'Show a button on the top to subscribe',
'displayLeftMenuSubscribeButton' => 'Show a button on the the left menu to subscribe',
'textSubscribe' => 'The button text label'
];
createTable("Subscription", $filter);
?>
</div>
</div>
</div>
</div>

View file

@ -1,36 +1,36 @@
<div class="row">
<div class="col-md-6">
<div class="panel panel-default">
<div class="panel-heading"><?php echo __('Monetize User') ?> <div class="pull-right"><?php echo getPluginSwitch('MonetizeUsers'); ?></div></div>
<div class="panel-body">
<?php
$filter = [
'rewardPerView' => 'How much will your users receive per each video view',
'rewardOnlyLoggedUsersView' => 'Check this to allow only count rewards from logged users'
];
createTable("MonetizeUsers", $filter);
?>
</div>
</div>
</div>
<div class="col-md-6">
<div class="panel panel-default">
<div class="panel-heading"><?php echo __('Wallet') ?> <div class="pull-right"><?php echo getPluginSwitch('YPTWallet'); ?></div></div>
<div class="panel-body">
<?php
$filter = [
'decimalPrecision' => 'Usually for USD we use 2, for cryptocurrencies we use more the 2',
'currency' => 'Australian Dollar = AUD, Brazilian Real = BRL, Canadian Dollar = CAD, Euro = EUR, U.S. Dollar = USD, etc',
'currency_symbol' => '$, R$, etc, the format will be {currency} {value} {currency_symbol} for example ($ 10.00 USD) or (R$ 10.00 BRL)',
'manualAddFundsTransferFromUserId' => 'When some one buy something on your web site, the wallet balance will be transferred to this user ID',
'enablePlugin_YPTWalletPayPal' => 'You need to enable it to be able to use PayPal to add funds on your wallet',
'enableManualWithdrawFundsPage' => 'Let users request withdraws from their wallet. The withdraw must be done manually'
];
createTable("YPTWallet", $filter);
?>
</div>
</div>
</div>
</div>
<div class="row">
<div class="col-md-6">
<div class="panel panel-default">
<div class="panel-heading"><?php echo __('Monetize User') ?> <div class="pull-right"><?php echo getPluginSwitch('MonetizeUsers'); ?></div></div>
<div class="panel-body">
<?php
$filter = [
'rewardPerView' => 'How much will your users receive per each video view',
'rewardOnlyLoggedUsersView' => 'Check this to allow only count rewards from logged users'
];
createTable("MonetizeUsers", $filter);
?>
</div>
</div>
</div>
<div class="col-md-6">
<div class="panel panel-default">
<div class="panel-heading"><?php echo __('Wallet') ?> <div class="pull-right"><?php echo getPluginSwitch('YPTWallet'); ?></div></div>
<div class="panel-body">
<?php
$filter = [
'decimalPrecision' => 'Usually for USD we use 2, for cryptocurrencies we use more the 2',
'currency' => 'Australian Dollar = AUD, Brazilian Real = BRL, Canadian Dollar = CAD, Euro = EUR, U.S. Dollar = USD, etc',
'currency_symbol' => '$, R$, etc, the format will be {currency} {value} {currency_symbol} for example ($ 10.00 USD) or (R$ 10.00 BRL)',
'manualAddFundsTransferFromUserId' => 'When some one buy something on your web site, the wallet balance will be transferred to this user ID',
'enablePlugin_YPTWalletPayPal' => 'You need to enable it to be able to use PayPal to add funds on your wallet',
'enableManualWithdrawFundsPage' => 'Let users request withdraws from their wallet. The withdraw must be done manually'
];
createTable("YPTWallet", $filter);
?>
</div>
</div>
</div>
</div>

View file

@ -1,29 +1,29 @@
<div class="row">
<div class="col-md-12">
<div class="panel panel-default">
<div class="panel-heading"><i class="fas fa-wallet"></i> <?php echo __('Wallet'); ?> <div class="pull-right"><?php echo getPluginSwitch('YPTWallet'); ?></div></div>
<div class="panel-body" style="overflow: hidden;">
<?php
$filter = [
'decimalPrecision' => __('Usually for USD we use 2, for cryptocurrencies we use more the 2'),
'currency' => __('Australian Dollar = AUD, Brazilian Real = BRL, Canadian Dollar = CAD, Euro = EUR, U.S. Dollar = USD, etc'),
'currency_symbol' => __('$, R$, etc, the format will be {currency} {value} {currency_symbol} for example ($ 10.00 USD) or (R$ 10.00 BRL)'),
'manualAddFundsTransferFromUserId' => __('When some one buy something on your web site, the wallet balance will be transferred to this user ID'),
'enablePlugin_YPTWalletPayPal' => __('You need to enable it to be able to use PayPal to add funds on your wallet'),
'enableManualWithdrawFundsPage' => __('Let users request withdraws from his wallet. the withdraw mus be done manually'), ];
createTable("YPTWallet", $filter);
?>
</div>
</div>
</div>
<div class="col-md-12">
<div class="panel panel-default">
<div class="panel-heading"><i class="fab fa-paypal"></i> PayPal <div class="pull-right"><?php echo getPluginSwitch('PayPalYPT'); ?></div></div>
<div class="panel-body" style="overflow: hidden;">
<?php
createTable("PayPalYPT");
?>
</div>
</div>
</div>
</div>
<div class="row">
<div class="col-md-12">
<div class="panel panel-default">
<div class="panel-heading"><i class="fas fa-wallet"></i> <?php echo __('Wallet'); ?> <div class="pull-right"><?php echo getPluginSwitch('YPTWallet'); ?></div></div>
<div class="panel-body" style="overflow: hidden;">
<?php
$filter = [
'decimalPrecision' => __('Usually for USD we use 2, for cryptocurrencies we use more the 2'),
'currency' => __('Australian Dollar = AUD, Brazilian Real = BRL, Canadian Dollar = CAD, Euro = EUR, U.S. Dollar = USD, etc'),
'currency_symbol' => __('$, R$, etc, the format will be {currency} {value} {currency_symbol} for example ($ 10.00 USD) or (R$ 10.00 BRL)'),
'manualAddFundsTransferFromUserId' => __('When some one buy something on your web site, the wallet balance will be transferred to this user ID'),
'enablePlugin_YPTWalletPayPal' => __('You need to enable it to be able to use PayPal to add funds on your wallet'),
'enableManualWithdrawFundsPage' => __('Let users request withdraws from his wallet. the withdraw mus be done manually'), ];
createTable("YPTWallet", $filter);
?>
</div>
</div>
</div>
<div class="col-md-12">
<div class="panel panel-default">
<div class="panel-heading"><i class="fab fa-paypal"></i> PayPal <div class="pull-right"><?php echo getPluginSwitch('PayPalYPT'); ?></div></div>
<div class="panel-body" style="overflow: hidden;">
<?php
createTable("PayPalYPT");
?>
</div>
</div>
</div>
</div>

View file

@ -1,25 +1,25 @@
<?php
header('Content-Type: application/json');
global $global, $config;
if (!isset($global['systemRootPath'])) {
require_once '../videos/configuration.php';
}
require_once $global['systemRootPath'] . 'objects/user.php';
if (!User::isAdmin()) {
die('{"error":"' . __("Permission denied") . '"}');
}
$pluginName = 'PlayerSkins';
$pluginDO = AVideoPlugin::getObjectData($pluginName);
$pluginDB = Plugin::getOrCreatePluginByName($pluginName, 'active');
$pluginDO->skin = $_POST['skin'];
$p = new Plugin($pluginDB['id']);
$p->setObject_data(json_encode($pluginDO));
$obj = new stdClass();
$obj->save = $p->save();
echo(json_encode($obj));
<?php
header('Content-Type: application/json');
global $global, $config;
if (!isset($global['systemRootPath'])) {
require_once '../videos/configuration.php';
}
require_once $global['systemRootPath'] . 'objects/user.php';
if (!User::isAdmin()) {
die('{"error":"' . __("Permission denied") . '"}');
}
$pluginName = 'PlayerSkins';
$pluginDO = AVideoPlugin::getObjectData($pluginName);
$pluginDB = Plugin::getOrCreatePluginByName($pluginName, 'active');
$pluginDO->skin = $_POST['skin'];
$p = new Plugin($pluginDB['id']);
$p->setObject_data(json_encode($pluginDO));
$obj = new stdClass();
$obj->save = $p->save();
echo(json_encode($obj));

View file

@ -1,39 +1,39 @@
<div class="row">
<div class="col-sm-6">
<div class="panel panel-default">
<div class="panel-heading"><?php echo __('CDN'); ?> </div>
<div class="panel-body">
</div>
</div>
</div>
<div class="col-sm-6">
<div class="panel panel-default">
<div class="panel-heading"><?php echo __('CDN Storage'); ?> </div>
<div class="panel-body">
</div>
</div>
</div>
<div class="col-sm-6">
<div class="panel panel-default">
<div class="panel-heading"><?php echo __('WebCam to Live'); ?> </div>
<div class="panel-body">
</div>
</div>
</div>
<div class="col-sm-6">
<div class="panel panel-default">
<div class="panel-heading"><?php echo __('Meet'); ?> </div>
<div class="panel-body">
</div>
</div>
</div>
</div>
<script>
$(document).ready(function () {
});
</script>
<div class="row">
<div class="col-sm-6">
<div class="panel panel-default">
<div class="panel-heading"><?php echo __('CDN'); ?> </div>
<div class="panel-body">
</div>
</div>
</div>
<div class="col-sm-6">
<div class="panel panel-default">
<div class="panel-heading"><?php echo __('CDN Storage'); ?> </div>
<div class="panel-body">
</div>
</div>
</div>
<div class="col-sm-6">
<div class="panel panel-default">
<div class="panel-heading"><?php echo __('WebCam to Live'); ?> </div>
<div class="panel-body">
</div>
</div>
</div>
<div class="col-sm-6">
<div class="panel panel-default">
<div class="panel-heading"><?php echo __('Meet'); ?> </div>
<div class="panel-body">
</div>
</div>
</div>
</div>
<script>
$(document).ready(function () {
});
</script>

View file

@ -1,50 +1,50 @@
<?php
header('Content-Type: application/json');
global $global, $config;
if (!isset($global['systemRootPath'])) {
require_once '../videos/configuration.php';
}
require_once $global['systemRootPath'] . 'objects/user.php';
if (!User::isAdmin()) {
die('{"error":"' . __("Permission denied") . '"}');
}
$pluginName = $_POST['pluginName'];
if (empty($_POST['pluginsList'])) {
unset($_POST['pluginsList']);
unset($_POST['pluginName']);
$pluginValues = $_POST;
} else {
$pluginsList = explode("|", $_POST['pluginsList']);
$pluginValues = [];
foreach ($pluginsList as $value) {
$pluginValues[$value] = empty($_POST[$value]) ? false : ($_POST[$value]==1||$_POST[$value]=="true" ? true : $_POST[$value]);
}
}
$pluginDO = AVideoPlugin::getObjectData($pluginName);
$pluginDB = Plugin::getPluginByName($pluginName);
foreach ($pluginDO as $key => $value) {
if (isset($pluginValues[$key])) {
if (is_bool($pluginDO->$key)) {
$pluginDO->$key = empty($pluginValues[$key]) ? false : true;
} else {
//$pluginDO->$key = str_replace('"', '\\"', $pluginValues[$key]);
$pluginDO->$key = $pluginValues[$key];
}
}
}
$p = new Plugin($pluginDB['id']);
$p->setObject_data(json_encode($pluginDO));
$obj = new stdClass();
$obj->save = $p->save();
if ($obj->save === false) {
_error_log("[ERROR] Error saving plugin $pluginName data. Maybe plugin is not enabled?", AVideoLog::$ERROR);
}
echo(json_encode($obj));
<?php
header('Content-Type: application/json');
global $global, $config;
if (!isset($global['systemRootPath'])) {
require_once '../videos/configuration.php';
}
require_once $global['systemRootPath'] . 'objects/user.php';
if (!User::isAdmin()) {
die('{"error":"' . __("Permission denied") . '"}');
}
$pluginName = $_POST['pluginName'];
if (empty($_POST['pluginsList'])) {
unset($_POST['pluginsList']);
unset($_POST['pluginName']);
$pluginValues = $_POST;
} else {
$pluginsList = explode("|", $_POST['pluginsList']);
$pluginValues = [];
foreach ($pluginsList as $value) {
$pluginValues[$value] = empty($_POST[$value]) ? false : ($_POST[$value]==1||$_POST[$value]=="true" ? true : $_POST[$value]);
}
}
$pluginDO = AVideoPlugin::getObjectData($pluginName);
$pluginDB = Plugin::getPluginByName($pluginName);
foreach ($pluginDO as $key => $value) {
if (isset($pluginValues[$key])) {
if (is_bool($pluginDO->$key)) {
$pluginDO->$key = empty($pluginValues[$key]) ? false : true;
} else {
//$pluginDO->$key = str_replace('"', '\\"', $pluginValues[$key]);
$pluginDO->$key = $pluginValues[$key];
}
}
}
$p = new Plugin($pluginDB['id']);
$p->setObject_data(json_encode($pluginDO));
$obj = new stdClass();
$obj->save = $p->save();
if ($obj->save === false) {
_error_log("[ERROR] Error saving plugin $pluginName data. Maybe plugin is not enabled?", AVideoLog::$ERROR);
}
echo(json_encode($obj));

View file

@ -1,106 +1,106 @@
<div class="row">
<div class="col-md-6">
<div class="panel panel-default">
<div class="panel-heading"><i class="fa fa-cog"></i> <?php echo __('Customize options'); ?> <div class="pull-right"><?php echo getPluginSwitch('CustomizeAdvanced'); ?></div></div>
<div class="panel-body" style="overflow: hidden;">
<?php
$filter = [
'disableNativeSignUp' => __('The form to signup will not exists'),
'disableNativeSignIn' => __('The regular form to signin will not exist, if you check this will only have social login or LDAP option'),
'userMustBeLoggedIn' => __('The site will display only a login form to un authenticated users'), ];
createTable("CustomizeUser", $filter);
?>
</div>
</div>
</div>
<div class="col-md-6">
<div class="panel panel-default">
<div class="panel-heading"><i class="fab fa-facebook-square"></i> Facebook <div class="pull-right"><?php echo getPluginSwitch('LoginFacebook'); ?></div></div>
<div class="panel-body" style="overflow: hidden;">
<?php
createTable("LoginFacebook");
?>
<small class="form-text text-muted">
<a href="https://developers.facebook.com/apps"><?php echo __('Get Facebook ID and Key'); ?></a><br>
<?php echo __('Valid OAuth redirect URIs'); ?>: <strong><?php echo $global['webSiteRootURL']; ?>objects/login.json.php?type=Facebook</strong><br>
<?php echo __('For mobile a Valid OAuth redirect URIs'); ?>: <strong><?php echo $global['webSiteRootURL']; ?>plugin/MobileManager/oauth2.php?type=Facebook</strong>
</small>
</div>
</div>
</div>
<div class="col-md-6">
<div class="panel panel-default">
<div class="panel-heading"><i class="fab fa-google-plus-g"></i> Google <div class="pull-right"><?php echo getPluginSwitch('LoginGoogle'); ?></div></div>
<div class="panel-body" style="overflow: hidden;">
<?php
createTable("LoginGoogle");
?>
<small class="form-text text-muted">
<a href="https://console.developers.google.com/apis/credentials"><?php echo __('Get Google ID and Key'); ?></a><br>
<?php echo __('Valid OAuth redirect URIs'); ?>: <strong><?php echo $global['webSiteRootURL']; ?>objects/login.json.php?type=Google</strong><br>
<?php echo __('For mobile a Valid OAuth redirect URIs'); ?>: <strong><?php echo $global['webSiteRootURL']; ?>plugin/MobileManager/oauth2.php?type=Google</strong>
</small>
</div>
</div>
</div>
<div class="col-md-6">
<div class="panel panel-default">
<div class="panel-heading"><i class="fab fa-linkedin"></i> Linkedin <div class="pull-right"><?php echo getPluginSwitch('LoginLinkedin'); ?></div></div>
<div class="panel-body" style="overflow: hidden;">
<?php
createTable("LoginLinkedin");
?>
<small class="form-text text-muted">
<a href="https://www.linkedin.com/secure/developer"><?php echo __('Get Linkedin ID and Key'); ?></a><br>
<?php echo __('Valid OAuth redirect URIs'); ?>: <strong><?php echo $global['webSiteRootURL']; ?>objects/login.json.php?type=Linkedin</strong><br>
<?php echo __('For mobile a Valid OAuth redirect URIs'); ?>: <strong><?php echo $global['webSiteRootURL']; ?>plugin/MobileManager/oauth2.php?type=Linkedin</strong>
</small>
</div>
</div>
</div>
<div class="col-md-6">
<div class="panel panel-default">
<div class="panel-heading"><i class="fab fa-twitter-square"></i> Twitter <div class="pull-right"><?php echo getPluginSwitch('LoginTwitter'); ?></div></div>
<div class="panel-body" style="overflow: hidden;">
<?php
createTable("LoginTwitter");
?>
<small class="form-text text-muted">
<a href="https://apps.twitter.com/"><?php echo __('Get Twitter ID and Key'); ?></a><br>
<?php echo __('Valid OAuth redirect URIs'); ?>: <strong><?php echo $global['webSiteRootURL']; ?>objects/login.json.php?type=Twitter</strong><br>
<?php echo __('For mobile a Valid OAuth redirect URIs'); ?>: <strong><?php echo $global['webSiteRootURL']; ?>plugin/MobileManager/oauth2.php?type=Twitter</strong>
</small>
</div>
</div>
</div>
<div class="col-md-6">
<div class="panel panel-default">
<div class="panel-heading"><i class="fab fa-yahoo"></i> Yahoo <div class="pull-right"><?php echo getPluginSwitch('LoginYahoo'); ?></div></div>
<div class="panel-body" style="overflow: hidden;">
<?php
createTable("LoginYahoo");
?>
<small class="form-text text-muted">
<a href="https://developer.yahoo.com/oauth2/guide/flows_authcode/"><?php echo __('Get Yahoo ID and Key'); ?></a><br>
<?php echo __('Valid OAuth redirect URIs'); ?>: <strong><?php echo $global['webSiteRootURL']; ?>objects/login.json.php?type=Yahoo</strong><br>
<?php echo __('For mobile a Valid OAuth redirect URIs'); ?>: <strong><?php echo $global['webSiteRootURL']; ?>plugin/MobileManager/oauth2.php?type=Yahoo</strong>
</small>
</div>
</div>
</div>
<div class="col-md-6">
<div class="panel panel-default">
<div class="panel-heading"><i class="fas fa-sign-in-alt"></i> LDAP <div class="pull-right"><?php echo getPluginSwitch('LoginLDAP'); ?></div></div>
<div class="panel-body" style="overflow: hidden;">
<?php
createTable("LoginLDAP");
?>
<small class="form-text text-muted">
<a href="https://github.com/WWBN/AVideo/wiki/Configure-LDAP-Plugin"><?php echo __('Help Page'); ?></a>
</small>
</div>
</div>
</div>
</div>
<div class="row">
<div class="col-md-6">
<div class="panel panel-default">
<div class="panel-heading"><i class="fa fa-cog"></i> <?php echo __('Customize options'); ?> <div class="pull-right"><?php echo getPluginSwitch('CustomizeAdvanced'); ?></div></div>
<div class="panel-body" style="overflow: hidden;">
<?php
$filter = [
'disableNativeSignUp' => __('The form to signup will not exists'),
'disableNativeSignIn' => __('The regular form to signin will not exist, if you check this will only have social login or LDAP option'),
'userMustBeLoggedIn' => __('The site will display only a login form to un authenticated users'), ];
createTable("CustomizeUser", $filter);
?>
</div>
</div>
</div>
<div class="col-md-6">
<div class="panel panel-default">
<div class="panel-heading"><i class="fab fa-facebook-square"></i> Facebook <div class="pull-right"><?php echo getPluginSwitch('LoginFacebook'); ?></div></div>
<div class="panel-body" style="overflow: hidden;">
<?php
createTable("LoginFacebook");
?>
<small class="form-text text-muted">
<a href="https://developers.facebook.com/apps"><?php echo __('Get Facebook ID and Key'); ?></a><br>
<?php echo __('Valid OAuth redirect URIs'); ?>: <strong><?php echo $global['webSiteRootURL']; ?>objects/login.json.php?type=Facebook</strong><br>
<?php echo __('For mobile a Valid OAuth redirect URIs'); ?>: <strong><?php echo $global['webSiteRootURL']; ?>plugin/MobileManager/oauth2.php?type=Facebook</strong>
</small>
</div>
</div>
</div>
<div class="col-md-6">
<div class="panel panel-default">
<div class="panel-heading"><i class="fab fa-google-plus-g"></i> Google <div class="pull-right"><?php echo getPluginSwitch('LoginGoogle'); ?></div></div>
<div class="panel-body" style="overflow: hidden;">
<?php
createTable("LoginGoogle");
?>
<small class="form-text text-muted">
<a href="https://console.developers.google.com/apis/credentials"><?php echo __('Get Google ID and Key'); ?></a><br>
<?php echo __('Valid OAuth redirect URIs'); ?>: <strong><?php echo $global['webSiteRootURL']; ?>objects/login.json.php?type=Google</strong><br>
<?php echo __('For mobile a Valid OAuth redirect URIs'); ?>: <strong><?php echo $global['webSiteRootURL']; ?>plugin/MobileManager/oauth2.php?type=Google</strong>
</small>
</div>
</div>
</div>
<div class="col-md-6">
<div class="panel panel-default">
<div class="panel-heading"><i class="fab fa-linkedin"></i> Linkedin <div class="pull-right"><?php echo getPluginSwitch('LoginLinkedin'); ?></div></div>
<div class="panel-body" style="overflow: hidden;">
<?php
createTable("LoginLinkedin");
?>
<small class="form-text text-muted">
<a href="https://www.linkedin.com/secure/developer"><?php echo __('Get Linkedin ID and Key'); ?></a><br>
<?php echo __('Valid OAuth redirect URIs'); ?>: <strong><?php echo $global['webSiteRootURL']; ?>objects/login.json.php?type=Linkedin</strong><br>
<?php echo __('For mobile a Valid OAuth redirect URIs'); ?>: <strong><?php echo $global['webSiteRootURL']; ?>plugin/MobileManager/oauth2.php?type=Linkedin</strong>
</small>
</div>
</div>
</div>
<div class="col-md-6">
<div class="panel panel-default">
<div class="panel-heading"><i class="fab fa-twitter-square"></i> Twitter <div class="pull-right"><?php echo getPluginSwitch('LoginTwitter'); ?></div></div>
<div class="panel-body" style="overflow: hidden;">
<?php
createTable("LoginTwitter");
?>
<small class="form-text text-muted">
<a href="https://apps.twitter.com/"><?php echo __('Get Twitter ID and Key'); ?></a><br>
<?php echo __('Valid OAuth redirect URIs'); ?>: <strong><?php echo $global['webSiteRootURL']; ?>objects/login.json.php?type=Twitter</strong><br>
<?php echo __('For mobile a Valid OAuth redirect URIs'); ?>: <strong><?php echo $global['webSiteRootURL']; ?>plugin/MobileManager/oauth2.php?type=Twitter</strong>
</small>
</div>
</div>
</div>
<div class="col-md-6">
<div class="panel panel-default">
<div class="panel-heading"><i class="fab fa-yahoo"></i> Yahoo <div class="pull-right"><?php echo getPluginSwitch('LoginYahoo'); ?></div></div>
<div class="panel-body" style="overflow: hidden;">
<?php
createTable("LoginYahoo");
?>
<small class="form-text text-muted">
<a href="https://developer.yahoo.com/oauth2/guide/flows_authcode/"><?php echo __('Get Yahoo ID and Key'); ?></a><br>
<?php echo __('Valid OAuth redirect URIs'); ?>: <strong><?php echo $global['webSiteRootURL']; ?>objects/login.json.php?type=Yahoo</strong><br>
<?php echo __('For mobile a Valid OAuth redirect URIs'); ?>: <strong><?php echo $global['webSiteRootURL']; ?>plugin/MobileManager/oauth2.php?type=Yahoo</strong>
</small>
</div>
</div>
</div>
<div class="col-md-6">
<div class="panel panel-default">
<div class="panel-heading"><i class="fas fa-sign-in-alt"></i> LDAP <div class="pull-right"><?php echo getPluginSwitch('LoginLDAP'); ?></div></div>
<div class="panel-body" style="overflow: hidden;">
<?php
createTable("LoginLDAP");
?>
<small class="form-text text-muted">
<a href="https://github.com/WWBN/AVideo/wiki/Configure-LDAP-Plugin"><?php echo __('Help Page'); ?></a>
</small>
</div>
</div>
</div>
</div>

View file

@ -1,32 +1,32 @@
<div class="row">
<div class="col-md-6">
<div class="panel panel-default">
<div class="panel-heading"><i class="fab fa-aws"></i> S3 Storage <div class="pull-right"><?php echo getPluginSwitch('AWS_S3'); ?></div></div>
<div class="panel-body" style="overflow: hidden;">
<?php
createTable("AWS_S3");
?>
</div>
</div>
</div>
<div class="col-md-6">
<div class="panel panel-default">
<div class="panel-heading"><i class="fas fa-hdd"></i> B2 Storage <div class="pull-right"><?php echo getPluginSwitch('Blackblaze_B2'); ?></div></div>
<div class="panel-body" style="overflow: hidden;">
<?php
createTable("Blackblaze_B2");
?>
</div>
</div>
</div>
<div class="col-md-12">
<div class="panel panel-default">
<div class="panel-heading"><i class="fas fa-hdd"></i> FTP <div class="pull-right"><?php echo getPluginSwitch('FTP_Storage'); ?></div></div>
<div class="panel-body" style="overflow: hidden;">
<?php
createTable("FTP_Storage");
?>
</div>
</div>
</div>
</div>
<div class="row">
<div class="col-md-6">
<div class="panel panel-default">
<div class="panel-heading"><i class="fab fa-aws"></i> S3 Storage <div class="pull-right"><?php echo getPluginSwitch('AWS_S3'); ?></div></div>
<div class="panel-body" style="overflow: hidden;">
<?php
createTable("AWS_S3");
?>
</div>
</div>
</div>
<div class="col-md-6">
<div class="panel panel-default">
<div class="panel-heading"><i class="fas fa-hdd"></i> B2 Storage <div class="pull-right"><?php echo getPluginSwitch('Blackblaze_B2'); ?></div></div>
<div class="panel-body" style="overflow: hidden;">
<?php
createTable("Blackblaze_B2");
?>
</div>
</div>
</div>
<div class="col-md-12">
<div class="panel panel-default">
<div class="panel-heading"><i class="fas fa-hdd"></i> FTP <div class="pull-right"><?php echo getPluginSwitch('FTP_Storage'); ?></div></div>
<div class="panel-body" style="overflow: hidden;">
<?php
createTable("FTP_Storage");
?>
</div>
</div>
</div>
</div>

View file

@ -1,15 +1,15 @@
<?php
header('Content-Type: application/json');
global $global, $config;
if (!isset($global['systemRootPath'])) {
require_once '../videos/configuration.php';
}
require_once $global['systemRootPath'] . 'objects/user.php';
if (!User::isAdmin()) {
die('{"error":"' . __("Permission denied") . '"}');
}
$config = new Configuration();
$config->setTheme($_POST['theme']);
echo '{"status":"' . $config->save() . '"}';
<?php
header('Content-Type: application/json');
global $global, $config;
if (!isset($global['systemRootPath'])) {
require_once '../videos/configuration.php';
}
require_once $global['systemRootPath'] . 'objects/user.php';
if (!User::isAdmin()) {
die('{"error":"' . __("Permission denied") . '"}');
}
$config = new Configuration();
$config->setTheme($_POST['theme']);
echo '{"status":"' . $config->save() . '"}';

View file

@ -1,47 +1,47 @@
{
"name": "wwbn/avideo",
"description": "Audio Video Platform",
"type": "project",
"config": {
"platform-check": false,
"vendor-dir": "vendor",
"platform": {
"php": "7.3"
}
},
"require": {
"php": "^7.3|^8",
"ext-curl": "*",
"ext-json": "*",
"chrisjean/php-ico": "^1.0",
"ezyang/htmlpurifier": "^4.13",
"google/apiclient": "^2.11",
"google/apiclient-services": "*",
"google/auth": "^1.14.3",
"guzzlehttp/guzzle": "^6.5",
"guzzlehttp/psr7": "^1.7",
"hybridauth/hybridauth": "^3.3",
"james-heinrich/getid3": "^1.9",
"monolog/monolog": "^1.17",
"phpmailer/phpmailer": "^6.2",
"psr/cache": "^1.0",
"psr/http-message": "^1.0",
"cboden/ratchet": "^0.4.3",
"ratchet/pawl": "^0.3.5",
"singpolyma/openpgp-php": "^0.5.0",
"aws/aws-sdk-php": "^3.180",
"gliterd/backblaze-b2": "^1.1",
"paypal/rest-api-sdk-php": "*",
"paypal/paypal-payouts-sdk": "^1.0",
"paypal/paypal-checkout-sdk": "^1.0",
"emojione/assets": "^4.5",
"mervick/emojionearea": "^3.4",
"emojione/emojione": "^4.5",
"abraham/twitteroauth": "^1.0",
"symfony/http-client": "^5.3",
"nyholm/psr7": "^1.4",
"norkunas/onesignal-php-api": "^2.7",
"stripe/stripe-php": "^7.97",
"symfony/translation": "^5.3"
}
}
{
"name": "wwbn/avideo",
"description": "Audio Video Platform",
"type": "project",
"config": {
"platform-check": false,
"vendor-dir": "vendor",
"platform": {
"php": "7.3"
}
},
"require": {
"php": "^7.3|^8",
"ext-curl": "*",
"ext-json": "*",
"chrisjean/php-ico": "^1.0",
"ezyang/htmlpurifier": "^4.13",
"google/apiclient": "^2.11",
"google/apiclient-services": "*",
"google/auth": "^1.14.3",
"guzzlehttp/guzzle": "^6.5",
"guzzlehttp/psr7": "^1.7",
"hybridauth/hybridauth": "^3.3",
"james-heinrich/getid3": "^1.9",
"monolog/monolog": "^1.17",
"phpmailer/phpmailer": "^6.2",
"psr/cache": "^1.0",
"psr/http-message": "^1.0",
"cboden/ratchet": "^0.4.3",
"ratchet/pawl": "^0.3.5",
"singpolyma/openpgp-php": "^0.5.0",
"aws/aws-sdk-php": "^3.180",
"gliterd/backblaze-b2": "^1.1",
"paypal/rest-api-sdk-php": "*",
"paypal/paypal-payouts-sdk": "^1.0",
"paypal/paypal-checkout-sdk": "^1.0",
"emojione/assets": "^4.5",
"mervick/emojionearea": "^3.4",
"emojione/emojione": "^4.5",
"abraham/twitteroauth": "^1.0",
"symfony/http-client": "^5.3",
"nyholm/psr7": "^1.4",
"norkunas/onesignal-php-api": "^2.7",
"stripe/stripe-php": "^7.97",
"symfony/translation": "^5.3"
}
}

9032
composer.lock generated

File diff suppressed because it is too large Load diff

View file

@ -1,4 +1,4 @@
<Location "/phpmyadmin">
ProxyPass "http://phpmyadmin/"
ProxyPassReverse "http://phpmyadmin/"
</Location>
<Location "/phpmyadmin">
ProxyPass "http://phpmyadmin/"
ProxyPassReverse "http://phpmyadmin/"
</Location>

View file

@ -1,75 +1,75 @@
#!/bin/bash
echo "Starting AVideo Platform..."
CONFIG_FILE=/etc/apache2/sites-enabled/000-default.conf
if [ "_${CREATE_TLS_CERTIFICATE}_" == "_yes_" ]; then
echo "Generate Certificate..."
echo "Certificate file: ${TLS_CERTIFICATE_FILE}"
echo "Certificate key: ${TLS_CERTIFICATE_KEY}"
mkdir -p `dirname ${TLS_CERTIFICATE_FILE}`
mkdir -p `dirname ${TLS_CERTIFICATE_KEY}`
subjectAltName="IP:127.0.0.1,DNS:${SERVER_NAME}"
CONFIG=""
CONFIG="${CONFIG}[dn]\n"
CONFIG="${CONFIG}C=NN\n"
CONFIG="${CONFIG}L=Earth\n"
CONFIG="${CONFIG}O=AVideo\n"
CONFIG="${CONFIG}OU=Development\n"
CONFIG="${CONFIG}CN=localhost\n"
CONFIG="${CONFIG}\n"
CONFIG="${CONFIG}[req]\n"
CONFIG="${CONFIG}distinguished_name=dn\n"
CONFIG="${CONFIG}\n"
CONFIG="${CONFIG}[EXT]\n"
CONFIG="${CONFIG}subjectAltName=${subjectAltName}\n"
CONFIG="${CONFIG}extendedKeyUsage=serverAuth\n"
CONFIG="${CONFIG}\n"
openssl req -x509 \
-out ${TLS_CERTIFICATE_FILE} -keyout ${TLS_CERTIFICATE_KEY} \
-newkey rsa:4096 \
-nodes \
-sha256 \
-days 3650 \
-subj '/C=NN/L=Earth/O=avideo/OU=DEV/CN=localhost' \
-extensions EXT -config <( \
printf "${CONFIG}")
echo "New Certificate config..."
openssl x509 -in ${TLS_CERTIFICATE_FILE} -noout -text || true
fi
echo "Configure Apache..."
sed -i 's#SERVER_NAME#'${SERVER_NAME}'#' ${CONFIG_FILE}
sed -i 's#TLS_CERTIFICATE_FILE#'${TLS_CERTIFICATE_FILE}'#' ${CONFIG_FILE}
sed -i 's#TLS_CERTIFICATE_KEY#'${TLS_CERTIFICATE_KEY}'#' ${CONFIG_FILE}
sed -i 's#CONTACT_EMAIL#'${CONTACT_EMAIL}'#' ${CONFIG_FILE}
if [ "_${ENABLE_PHPMYADMIN}_" = "_yes_" ]; then
echo "Enabling local PHPMyAdmin on https://${SERVER_NAME}/phpmyadmin"
cp /etc/apache2/conf-available/phpmyadmin.conf /etc/apache2/conf-enabled/phpmyadmin.conf
a2enmod proxy
a2enmod proxy_http
fi
echo "Waiting for database ${DB_MYSQL_HOST} to be up and running"
php /usr/local/bin/wait-for-db.php
if [ $? -ne 0 ]; then
echo "Stopping container"
exit 1
fi
if [ -f /var/www/html/AVideo/videos/configuration.php ]; then
echo "Using existing configuration..."
else
echo "Create new configuration..."
cd /var/www/html/AVideo/install/
php ./cli.php
cd /var/www/html/AVideo/
fi
apache2-foreground
#!/bin/bash
echo "Starting AVideo Platform..."
CONFIG_FILE=/etc/apache2/sites-enabled/000-default.conf
if [ "_${CREATE_TLS_CERTIFICATE}_" == "_yes_" ]; then
echo "Generate Certificate..."
echo "Certificate file: ${TLS_CERTIFICATE_FILE}"
echo "Certificate key: ${TLS_CERTIFICATE_KEY}"
mkdir -p `dirname ${TLS_CERTIFICATE_FILE}`
mkdir -p `dirname ${TLS_CERTIFICATE_KEY}`
subjectAltName="IP:127.0.0.1,DNS:${SERVER_NAME}"
CONFIG=""
CONFIG="${CONFIG}[dn]\n"
CONFIG="${CONFIG}C=NN\n"
CONFIG="${CONFIG}L=Earth\n"
CONFIG="${CONFIG}O=AVideo\n"
CONFIG="${CONFIG}OU=Development\n"
CONFIG="${CONFIG}CN=localhost\n"
CONFIG="${CONFIG}\n"
CONFIG="${CONFIG}[req]\n"
CONFIG="${CONFIG}distinguished_name=dn\n"
CONFIG="${CONFIG}\n"
CONFIG="${CONFIG}[EXT]\n"
CONFIG="${CONFIG}subjectAltName=${subjectAltName}\n"
CONFIG="${CONFIG}extendedKeyUsage=serverAuth\n"
CONFIG="${CONFIG}\n"
openssl req -x509 \
-out ${TLS_CERTIFICATE_FILE} -keyout ${TLS_CERTIFICATE_KEY} \
-newkey rsa:4096 \
-nodes \
-sha256 \
-days 3650 \
-subj '/C=NN/L=Earth/O=avideo/OU=DEV/CN=localhost' \
-extensions EXT -config <( \
printf "${CONFIG}")
echo "New Certificate config..."
openssl x509 -in ${TLS_CERTIFICATE_FILE} -noout -text || true
fi
echo "Configure Apache..."
sed -i 's#SERVER_NAME#'${SERVER_NAME}'#' ${CONFIG_FILE}
sed -i 's#TLS_CERTIFICATE_FILE#'${TLS_CERTIFICATE_FILE}'#' ${CONFIG_FILE}
sed -i 's#TLS_CERTIFICATE_KEY#'${TLS_CERTIFICATE_KEY}'#' ${CONFIG_FILE}
sed -i 's#CONTACT_EMAIL#'${CONTACT_EMAIL}'#' ${CONFIG_FILE}
if [ "_${ENABLE_PHPMYADMIN}_" = "_yes_" ]; then
echo "Enabling local PHPMyAdmin on https://${SERVER_NAME}/phpmyadmin"
cp /etc/apache2/conf-available/phpmyadmin.conf /etc/apache2/conf-enabled/phpmyadmin.conf
a2enmod proxy
a2enmod proxy_http
fi
echo "Waiting for database ${DB_MYSQL_HOST} to be up and running"
php /usr/local/bin/wait-for-db.php
if [ $? -ne 0 ]; then
echo "Stopping container"
exit 1
fi
if [ -f /var/www/html/AVideo/videos/configuration.php ]; then
echo "Using existing configuration..."
else
echo "Create new configuration..."
cd /var/www/html/AVideo/install/
php ./cli.php
cd /var/www/html/AVideo/
fi
apache2-foreground
#eof

View file

@ -1,31 +1,31 @@
<?php
$counter = 0;
$sleep = 5;
$timeout = 60;
$connected = false;
$db_host = getenv("DB_MYSQL_HOST");
$db_port = getenv("DB_MYSQL_PORT");
$db_name = getenv("DB_MYSQL_NAME");
$db_user = getenv("DB_MYSQL_USER");
$db_pass = getenv("DB_MYSQL_PASSWORD");
while (!$connected) {
echo "Checking database connection....";
$mysqli = @new mysqli($db_host, $db_user, $db_pass, $db_name, $db_port);
if ($mysqli !== false) {
echo "OK\n";
$connected = true;
} else {
$counter ++;
echo "Failed (attempt ".$counter.")\n";
if ($counter*$sleep > $timeout) {
echo "Giving up...";
exit(1);
}
sleep($sleep);
}
}
exit(0);
<?php
$counter = 0;
$sleep = 5;
$timeout = 60;
$connected = false;
$db_host = getenv("DB_MYSQL_HOST");
$db_port = getenv("DB_MYSQL_PORT");
$db_name = getenv("DB_MYSQL_NAME");
$db_user = getenv("DB_MYSQL_USER");
$db_pass = getenv("DB_MYSQL_PASSWORD");
while (!$connected) {
echo "Checking database connection....";
$mysqli = @new mysqli($db_host, $db_user, $db_pass, $db_name, $db_port);
if ($mysqli !== false) {
echo "OK\n";
$connected = true;
} else {
$counter ++;
echo "Failed (attempt ".$counter.")\n";
if ($counter*$sleep > $timeout) {
echo "Giving up...";
exit(1);
}
sleep($sleep);
}
}
exit(0);

View file

@ -1,62 +1,62 @@
<?php
//header("Content-Type: application/rss+xml; charset=UTF8");
require_once '../videos/configuration.php';
require_once '../objects/video.php';
$_POST['sort']["created"] = "DESC";
$_POST['current'] = 1;
$_REQUEST['rowCount'] = getRowCount();
$showOnlyLoggedUserVideos = false;
$title = $config->getWebSiteTitle();
$link = $global['webSiteRootURL'];
$logo = getURL("videos/userPhoto/logo.png");
$description = '';
$extraPluginFile = $global['systemRootPath'] . 'plugin/Customize/Objects/ExtraConfig.php';
if (file_exists($extraPluginFile) && AVideoPlugin::isEnabledByName("Customize")) {
require_once $extraPluginFile;
$ec = new ExtraConfig();
$description = $ec->getDescription();
}
if (!empty($_GET['channelName'])) {
$user = User::getChannelOwner($_GET['channelName']);
$showOnlyLoggedUserVideos = $user['id'];
$title = User::getNameIdentificationById($user['id']);
$about = User::getDescriptionById($user['id'], true);
if(!isHTMLEmpty($about)){
$description = $about;
}
$link = User::getChannelLink($user['id']);
$logo = User::getPhoto($user['id']);
}
$cacheName = "feedCache".json_encode($_GET);
$rows = ObjectYPT::getCache($cacheName, 0);
if (empty($rows)) {
// send $_GET['catName'] to be able to filter by category
$sort = @$_POST['sort'];
if(empty($_POST['sort'])){
$_POST['sort'] = array('created'=>'DESC');
}
$rows = Video::getAllVideos("viewable", $showOnlyLoggedUserVideos);
$_POST['sort'] = $sort;
ObjectYPT::setCache($cacheName, $rows);
} else {
$rows = object_to_array($rows);
}
if (!empty($_REQUEST['roku'])) {
include $global['systemRootPath'] . 'feed/roku.json.php';
} elseif (empty($_REQUEST['mrss'])) {
include $global['systemRootPath'] . 'feed/rss.php';
} else {
include $global['systemRootPath'] . 'feed/mrss.php';
}
function feedText($text)
{
return str_replace(['&&'], ['&'], str_replace(['&','<','>'], ['&amp;','&lt;','&gt;'], (strip_tags(br2nl($text)))));
}
<?php
//header("Content-Type: application/rss+xml; charset=UTF8");
require_once '../videos/configuration.php';
require_once '../objects/video.php';
$_POST['sort']["created"] = "DESC";
$_POST['current'] = 1;
$_REQUEST['rowCount'] = getRowCount();
$showOnlyLoggedUserVideos = false;
$title = $config->getWebSiteTitle();
$link = $global['webSiteRootURL'];
$logo = getURL("videos/userPhoto/logo.png");
$description = '';
$extraPluginFile = $global['systemRootPath'] . 'plugin/Customize/Objects/ExtraConfig.php';
if (file_exists($extraPluginFile) && AVideoPlugin::isEnabledByName("Customize")) {
require_once $extraPluginFile;
$ec = new ExtraConfig();
$description = $ec->getDescription();
}
if (!empty($_GET['channelName'])) {
$user = User::getChannelOwner($_GET['channelName']);
$showOnlyLoggedUserVideos = $user['id'];
$title = User::getNameIdentificationById($user['id']);
$about = User::getDescriptionById($user['id'], true);
if(!isHTMLEmpty($about)){
$description = $about;
}
$link = User::getChannelLink($user['id']);
$logo = User::getPhoto($user['id']);
}
$cacheName = "feedCache".json_encode($_GET);
$rows = ObjectYPT::getCache($cacheName, 0);
if (empty($rows)) {
// send $_GET['catName'] to be able to filter by category
$sort = @$_POST['sort'];
if(empty($_POST['sort'])){
$_POST['sort'] = array('created'=>'DESC');
}
$rows = Video::getAllVideos("viewable", $showOnlyLoggedUserVideos);
$_POST['sort'] = $sort;
ObjectYPT::setCache($cacheName, $rows);
} else {
$rows = object_to_array($rows);
}
if (!empty($_REQUEST['roku'])) {
include $global['systemRootPath'] . 'feed/roku.json.php';
} elseif (empty($_REQUEST['mrss'])) {
include $global['systemRootPath'] . 'feed/rss.php';
} else {
include $global['systemRootPath'] . 'feed/mrss.php';
}
function feedText($text)
{
return str_replace(['&&'], ['&'], str_replace(['&','<','>'], ['&amp;','&lt;','&gt;'], (strip_tags(br2nl($text)))));
}

View file

@ -1,81 +1,81 @@
<?php
//header('Content-Type: text/xml; charset=UTF8');
//header("Content-Type: application/rss+xml; charset=UTF8");
header("Content-Type: application/rss+xml;");
$cacheFeedName = "feedCacheMRSS" . json_encode($_REQUEST);
$lifetime = 43200;
$feed = ObjectYPT::getCache($cacheFeedName, $lifetime);
if (empty($feed)) {
ob_start();
echo'<?xml version="1.0" encoding="UTF-8"?>'; ?>
<rss version="2.0" xmlns:media="http://search.yahoo.com/mrss/"
xmlns:georss="http://www.georss.org/georss"
xmlns:gml="http://www.opengis.net/gml">
<channel>
<title><?php echo feedText($title); ?></title>
<description><?php echo feedText($description); ?></description>
<link><?php echo $link; ?></link>
<image>
<title><?php echo feedText($title); ?></title>
<url><?php echo $logo; ?></url>
<link><?php echo $link; ?></link>
<width>144</width>
<height>40</height>
<description>AVideo version rss</description>
</image>
<?php
foreach ($rows as $row) {
$video = Video::getVideoFromFileName($row['filename']);
$files = getVideosURL($row['filename']);
$enclosure = '';
$videoSource = Video::getSourceFileURL($row['filename']);
if (empty($videoSource)) {
continue;
}
foreach ($files as $value) {
if ($value["type"] === "video" && file_exists($value['path'])) {
$path_parts = pathinfo($value['path']);
$value['mime'] = "video/{$path_parts['extension']}";
$value['size'] = filesize($value['path']);
// replace to validate
$value['url'] = str_replace("http://", "https://", $value['url']);
$enclosure = '<enclosure url="' . $value['url'] . '" length="' . $value['size'] . '" type="' . $value['mime'] . '" />';
break;
}
} ?>
<item>
<title><?php echo feedText($row['title']); ?></title>
<description><?php echo feedText($row['title']); ?></description>
<link> <?php echo Video::getLink($row['id'], $row['clean_title']); ?></link>
<?php echo $enclosure; ?>
<pubDate><?php echo date('r', strtotime($row['created'])); ?></pubDate>
<guid isPermaLink="true"><?php echo Video::getLinkToVideo($row['id'], $row['clean_title'], false, "permalink"); ?></guid>
<media:category><?php echo $row["category"]; ?></media:category>
<media:content url="<?php echo $videoSource; ?>" fileSize="<?php echo $video["filesize"]; ?>" bitrate="128"
type="<?php echo mime_content_type_per_filename($videoSource); ?>" expression="full"
duration="<?php echo durationToSeconds($row['duration']); ?>">
<media:title type="plain"><?php echo htmlspecialchars($row['title']); ?></media:title>
<media:description type="html"><![CDATA[<?php echo Video::htmlDescription($row['title']); ?>]]></media:description>
<media:thumbnail url="<?php echo Video::getPoster($row['id']); ?>" />
</media:content>
<media:embed url="<?php echo str_replace('&', '&amp;', Video::getLinkToVideo($row['id'], $row['clean_title'], true)); ?>"/>
<media:status state="active" />
</item>
<?php
} ?>
</channel>
</rss>
<?php
$feed = ob_get_contents();
ob_end_clean();
//var_dump($cacheFeedName, $feed);exit;
ObjectYPT::setCache($cacheFeedName, $feed);
//echo '<!-- NO cache -->';
} else {
//echo '<!-- cache -->';
}
if (!is_string($feed)) {
$feed = json_encode($feed);
}
echo $feed;
<?php
//header('Content-Type: text/xml; charset=UTF8');
//header("Content-Type: application/rss+xml; charset=UTF8");
header("Content-Type: application/rss+xml;");
$cacheFeedName = "feedCacheMRSS" . json_encode($_REQUEST);
$lifetime = 43200;
$feed = ObjectYPT::getCache($cacheFeedName, $lifetime);
if (empty($feed)) {
ob_start();
echo'<?xml version="1.0" encoding="UTF-8"?>'; ?>
<rss version="2.0" xmlns:media="http://search.yahoo.com/mrss/"
xmlns:georss="http://www.georss.org/georss"
xmlns:gml="http://www.opengis.net/gml">
<channel>
<title><?php echo feedText($title); ?></title>
<description><?php echo feedText($description); ?></description>
<link><?php echo $link; ?></link>
<image>
<title><?php echo feedText($title); ?></title>
<url><?php echo $logo; ?></url>
<link><?php echo $link; ?></link>
<width>144</width>
<height>40</height>
<description>AVideo version rss</description>
</image>
<?php
foreach ($rows as $row) {
$video = Video::getVideoFromFileName($row['filename']);
$files = getVideosURL($row['filename']);
$enclosure = '';
$videoSource = Video::getSourceFileURL($row['filename']);
if (empty($videoSource)) {
continue;
}
foreach ($files as $value) {
if ($value["type"] === "video" && file_exists($value['path'])) {
$path_parts = pathinfo($value['path']);
$value['mime'] = "video/{$path_parts['extension']}";
$value['size'] = filesize($value['path']);
// replace to validate
$value['url'] = str_replace("http://", "https://", $value['url']);
$enclosure = '<enclosure url="' . $value['url'] . '" length="' . $value['size'] . '" type="' . $value['mime'] . '" />';
break;
}
} ?>
<item>
<title><?php echo feedText($row['title']); ?></title>
<description><?php echo feedText($row['title']); ?></description>
<link> <?php echo Video::getLink($row['id'], $row['clean_title']); ?></link>
<?php echo $enclosure; ?>
<pubDate><?php echo date('r', strtotime($row['created'])); ?></pubDate>
<guid isPermaLink="true"><?php echo Video::getLinkToVideo($row['id'], $row['clean_title'], false, "permalink"); ?></guid>
<media:category><?php echo $row["category"]; ?></media:category>
<media:content url="<?php echo $videoSource; ?>" fileSize="<?php echo $video["filesize"]; ?>" bitrate="128"
type="<?php echo mime_content_type_per_filename($videoSource); ?>" expression="full"
duration="<?php echo durationToSeconds($row['duration']); ?>">
<media:title type="plain"><?php echo htmlspecialchars($row['title']); ?></media:title>
<media:description type="html"><![CDATA[<?php echo Video::htmlDescription($row['title']); ?>]]></media:description>
<media:thumbnail url="<?php echo Video::getPoster($row['id']); ?>" />
</media:content>
<media:embed url="<?php echo str_replace('&', '&amp;', Video::getLinkToVideo($row['id'], $row['clean_title'], true)); ?>"/>
<media:status state="active" />
</item>
<?php
} ?>
</channel>
</rss>
<?php
$feed = ob_get_contents();
ob_end_clean();
//var_dump($cacheFeedName, $feed);exit;
ObjectYPT::setCache($cacheFeedName, $feed);
//echo '<!-- NO cache -->';
} else {
//echo '<!-- cache -->';
}
if (!is_string($feed)) {
$feed = json_encode($feed);
}
echo $feed;

View file

@ -1,117 +1,117 @@
<?php
function rokuRating($avideoRating)
{
//('', 'g', 'pg', 'pg-13', 'r', 'nc-17', 'ma');
switch (strtolower($avideoRating)) {
case 'g':
return 'G';
break;
case 'pg':
return 'PG';
break;
case 'pg-13':
return 'PG13';
break;
case 'r':
return 'R';
break;
case 'nc-17':
return 'NC17';
break;
case 'ma':
return '18+';
break;
default:
return 'G';
break;
}
}
header('Content-Type: application/json');
$cacheFeedName = "feedCache_ROKU" . json_encode($_REQUEST);
$lifetime = 43200;
$output = ObjectYPT::getCache($cacheFeedName, $lifetime);
if (empty($output)) {
$obj = new stdClass();
$obj->providerName = $title;
$obj->language = "en";
$obj->lastUpdated = date('c');
$obj->movies = [];
$cacheName = "feedCache_ROKU_movies".json_encode($_REQUEST);
$movies = ObjectYPT::getCache($cacheName, 0);
if (empty($movies)) {
foreach ($rows as $row) {
$videoSource = Video::getSourceFileURL($row['filename']);
$videoResolution = Video::getResolutionFromFilename($videoSource);
//var_dump($videoSource);
if (empty($videoSource)) {
_error_log("Roku Empty video source {$row['id']}, {$row['clean_title']}, {$row['filename']}");
continue;
}
$movie = new stdClass();
$movie->id = 'video_'.$row['id'];
$movie->title = UTF8encode($row['title']);
$movie->longDescription = "=> " . _substr(strip_tags(br2nl(UTF8encode($row['description']))), 0, 490);
$movie->shortDescription = _substr($movie->longDescription, 0, 200);
$movie->thumbnail = Video::getRokuImage($row['id']);
$movie->tags = [_substr(UTF8encode($row['category']), 0, 20)];
$movie->genres = ["special"];
$movie->releaseDate = date('c', strtotime($row['created']));
$movie->categories_id = $row['categories_id'];
$rrating = $row['rrating'];
if (!empty($rrating)) {
$movie->rating = new stdClass();
$movie->rating->rating = rokuRating($rrating);
$movie->rating->ratingSource = 'MPAA';
}
$content = new stdClass();
$content->dateAdded = date('c', strtotime($row['created']));
$content->captions = [];
$content->duration = durationToSeconds($row['duration']);
$content->language = "en";
$content->adBreaks = ["00:00:00"];
$video = new stdClass();
$video->url = $videoSource;
$video->quality = getResolutionTextRoku($videoResolution);
$video->videoType = Video::getVideoTypeText($row['filename']);
$content->videos = [$video];
$movie->content = $content;
$obj->movies[] = $movie;
}
ObjectYPT::setCache($cacheName, $obj->movies);
} else {
$obj->movies = $movies;
}
$itemIds = [];
foreach ($obj->movies as $value) {
$itemIds[] = $value->id;
}
$obj->playlists = [['name' => 'all', 'itemIds'=>$itemIds]];
$obj->categories = [['name' => 'All', 'playlistName' => 'all', 'order' => 'most_recent']];
$output = _json_encode($obj, JSON_UNESCAPED_UNICODE);
if (empty($output) && json_last_error()) {
$output = json_encode(json_last_error_msg());
var_dump($obj);
} else {
ObjectYPT::setCache($cacheFeedName, $output);
}
} else {
//echo '<!-- cache -->';
}
if (!is_string($output)) {
$output = json_encode($output);
}
die($output);
<?php
function rokuRating($avideoRating)
{
//('', 'g', 'pg', 'pg-13', 'r', 'nc-17', 'ma');
switch (strtolower($avideoRating)) {
case 'g':
return 'G';
break;
case 'pg':
return 'PG';
break;
case 'pg-13':
return 'PG13';
break;
case 'r':
return 'R';
break;
case 'nc-17':
return 'NC17';
break;
case 'ma':
return '18+';
break;
default:
return 'G';
break;
}
}
header('Content-Type: application/json');
$cacheFeedName = "feedCache_ROKU" . json_encode($_REQUEST);
$lifetime = 43200;
$output = ObjectYPT::getCache($cacheFeedName, $lifetime);
if (empty($output)) {
$obj = new stdClass();
$obj->providerName = $title;
$obj->language = "en";
$obj->lastUpdated = date('c');
$obj->movies = [];
$cacheName = "feedCache_ROKU_movies".json_encode($_REQUEST);
$movies = ObjectYPT::getCache($cacheName, 0);
if (empty($movies)) {
foreach ($rows as $row) {
$videoSource = Video::getSourceFileURL($row['filename']);
$videoResolution = Video::getResolutionFromFilename($videoSource);
//var_dump($videoSource);
if (empty($videoSource)) {
_error_log("Roku Empty video source {$row['id']}, {$row['clean_title']}, {$row['filename']}");
continue;
}
$movie = new stdClass();
$movie->id = 'video_'.$row['id'];
$movie->title = UTF8encode($row['title']);
$movie->longDescription = "=> " . _substr(strip_tags(br2nl(UTF8encode($row['description']))), 0, 490);
$movie->shortDescription = _substr($movie->longDescription, 0, 200);
$movie->thumbnail = Video::getRokuImage($row['id']);
$movie->tags = [_substr(UTF8encode($row['category']), 0, 20)];
$movie->genres = ["special"];
$movie->releaseDate = date('c', strtotime($row['created']));
$movie->categories_id = $row['categories_id'];
$rrating = $row['rrating'];
if (!empty($rrating)) {
$movie->rating = new stdClass();
$movie->rating->rating = rokuRating($rrating);
$movie->rating->ratingSource = 'MPAA';
}
$content = new stdClass();
$content->dateAdded = date('c', strtotime($row['created']));
$content->captions = [];
$content->duration = durationToSeconds($row['duration']);
$content->language = "en";
$content->adBreaks = ["00:00:00"];
$video = new stdClass();
$video->url = $videoSource;
$video->quality = getResolutionTextRoku($videoResolution);
$video->videoType = Video::getVideoTypeText($row['filename']);
$content->videos = [$video];
$movie->content = $content;
$obj->movies[] = $movie;
}
ObjectYPT::setCache($cacheName, $obj->movies);
} else {
$obj->movies = $movies;
}
$itemIds = [];
foreach ($obj->movies as $value) {
$itemIds[] = $value->id;
}
$obj->playlists = [['name' => 'all', 'itemIds'=>$itemIds]];
$obj->categories = [['name' => 'All', 'playlistName' => 'all', 'order' => 'most_recent']];
$output = _json_encode($obj, JSON_UNESCAPED_UNICODE);
if (empty($output) && json_last_error()) {
$output = json_encode(json_last_error_msg());
var_dump($obj);
} else {
ObjectYPT::setCache($cacheFeedName, $output);
}
} else {
//echo '<!-- cache -->';
}
if (!is_string($output)) {
$output = json_encode($output);
}
die($output);

View file

@ -1,70 +1,70 @@
<?php
header('Content-Type: text/xml; charset=UTF8');
$cacheFeedName = "feedCacheRSS" . json_encode($_REQUEST);
$lifetime = 43200;
$feed = ObjectYPT::getCache($cacheFeedName, $lifetime);
if (empty($feed)) {
ob_start();
echo'<?xml version="1.0" encoding="UTF-8"?>'
?>
<rss version="2.0" xmlns:content="http://purl.org/rss/1.0/modules/content/"
xmlns:wfw="http://wellformedweb.org/CommentAPI/"
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:atom="http://www.w3.org/2005/Atom"
xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
xmlns:slash="http://purl.org/rss/1.0/modules/slash/">
<channel>
<atom:link href="<?php echo $global['webSiteRootURL'] . ltrim($_SERVER["REQUEST_URI"], "/"); ?>" rel="self" type="application/rss+xml" />
<title><?php echo feedText($title); ?></title>
<description><?php echo feedText($description); ?></description>
<link><?php echo $link; ?></link>
<sy:updatePeriod>hourly</sy:updatePeriod>
<sy:updateFrequency>1</sy:updateFrequency>
<image>
<title><?php echo feedText($title); ?></title>
<url><?php echo $logo; ?></url>
<link><?php echo $link; ?></link>
<width>144</width>
<height>40</height>
<description>AVideo version rss</description>
</image>
<?php
foreach ($rows as $row) {
$files = getVideosURL($row['filename']);
$enclosure = '';
foreach ($files as $value) {
if ($value["type"] === "video" && file_exists($value['path'])) {
$path_parts = pathinfo($value['path']);
$value['mime'] = "video/{$path_parts['extension']}";
$value['size'] = filesize($value['path']);
// replace to validate
$value['url'] = str_replace("http://", "https://", $value['url']);
$enclosure = '<enclosure url="' . $value['url'] . '" length="' . $value['size'] . '" type="' . $value['mime'] . '" />';
break;
}
} ?>
<item>
<title><?php echo feedText($row['title']); ?></title>
<description><?php echo feedText($row['description']); ?></description>
<link> <?php echo Video::getLink($row['id'], $row['clean_title']); ?></link>
<?php echo $enclosure; ?>
<pubDate><?php echo date('r', strtotime($row['created'])); ?></pubDate>
<guid><?php echo Video::getLinkToVideo($row['id'], $row['clean_title'], false, "permalink"); ?></guid>
</item>
<?php
} ?>
</channel>
</rss>
<?php
$feed = ob_get_contents();
ob_end_clean();
ObjectYPT::setCache($cacheFeedName, $feed);
} else {
//echo '<!-- cache -->';
}
if (!is_string($feed)) {
$feed = json_encode($feed);
}
echo $feed;
<?php
header('Content-Type: text/xml; charset=UTF8');
$cacheFeedName = "feedCacheRSS" . json_encode($_REQUEST);
$lifetime = 43200;
$feed = ObjectYPT::getCache($cacheFeedName, $lifetime);
if (empty($feed)) {
ob_start();
echo'<?xml version="1.0" encoding="UTF-8"?>'
?>
<rss version="2.0" xmlns:content="http://purl.org/rss/1.0/modules/content/"
xmlns:wfw="http://wellformedweb.org/CommentAPI/"
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:atom="http://www.w3.org/2005/Atom"
xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
xmlns:slash="http://purl.org/rss/1.0/modules/slash/">
<channel>
<atom:link href="<?php echo $global['webSiteRootURL'] . ltrim($_SERVER["REQUEST_URI"], "/"); ?>" rel="self" type="application/rss+xml" />
<title><?php echo feedText($title); ?></title>
<description><?php echo feedText($description); ?></description>
<link><?php echo $link; ?></link>
<sy:updatePeriod>hourly</sy:updatePeriod>
<sy:updateFrequency>1</sy:updateFrequency>
<image>
<title><?php echo feedText($title); ?></title>
<url><?php echo $logo; ?></url>
<link><?php echo $link; ?></link>
<width>144</width>
<height>40</height>
<description>AVideo version rss</description>
</image>
<?php
foreach ($rows as $row) {
$files = getVideosURL($row['filename']);
$enclosure = '';
foreach ($files as $value) {
if ($value["type"] === "video" && file_exists($value['path'])) {
$path_parts = pathinfo($value['path']);
$value['mime'] = "video/{$path_parts['extension']}";
$value['size'] = filesize($value['path']);
// replace to validate
$value['url'] = str_replace("http://", "https://", $value['url']);
$enclosure = '<enclosure url="' . $value['url'] . '" length="' . $value['size'] . '" type="' . $value['mime'] . '" />';
break;
}
} ?>
<item>
<title><?php echo feedText($row['title']); ?></title>
<description><?php echo feedText($row['description']); ?></description>
<link> <?php echo Video::getLink($row['id'], $row['clean_title']); ?></link>
<?php echo $enclosure; ?>
<pubDate><?php echo date('r', strtotime($row['created'])); ?></pubDate>
<guid><?php echo Video::getLinkToVideo($row['id'], $row['clean_title'], false, "permalink"); ?></guid>
</item>
<?php
} ?>
</channel>
</rss>
<?php
$feed = ob_get_contents();
ob_end_clean();
ObjectYPT::setCache($cacheFeedName, $feed);
} else {
//echo '<!-- cache -->';
}
if (!is_string($feed)) {
$feed = json_encode($feed);
}
echo $feed;

View file

@ -1,19 +1,19 @@
<?php
header('Content-Type: application/json');
$cmd = "git log -1";
exec($cmd . " 2>&1", $output, $return_val);
$obj = new stdClass();
$obj->output = $output;
foreach ($output as $value) {
preg_match("/Date:(.*)/i", $value, $match);
if (!empty($match[1])) {
$obj->date = strtotime($match[1]);
$obj->dateString = trim($match[1]);
$obj->dateMySQL = date("Y-m-d H:i:s", $obj->date);
}
}
echo json_encode($obj);
<?php
header('Content-Type: application/json');
$cmd = "git log -1";
exec($cmd . " 2>&1", $output, $return_val);
$obj = new stdClass();
$obj->output = $output;
foreach ($output as $value) {
preg_match("/Date:(.*)/i", $value, $match);
if (!empty($match[1])) {
$obj->date = strtotime($match[1]);
$obj->dateString = trim($match[1]);
$obj->dateMySQL = date("Y-m-d H:i:s", $obj->date);
}
}
echo json_encode($obj);

232
index.php
View file

@ -1,116 +1,116 @@
<!DOCTYPE html>
<html lang="en">
<head>
<title><?php echo __("Error Page"); ?></title>
<link href="view/bootstrap/css/bootstrap.css" rel="stylesheet" type="text/css" />
<style>
body {
margin: 0;
padding: 0;
background: #e7ecf0;
font-family: Arial, Helvetica, sans-serif;
}
* {
margin: 0;
padding: 0;
}
p {
font-size: 12px;
color: #373737;
font-family: Arial, Helvetica, sans-serif;
line-height: 18px;
}
p a {
color: #218bdc;
font-size: 12px;
text-decoration: none;
}
a {
outline: none;
}
.f-left {
float: left;
}
.f-right {
float: right;
}
.clear {
clear: both;
overflow: hidden;
}
#block_error {
width: 1000px;
height: 700px;
border: 1px solid #cccccc;
margin: 72px auto 0;
-moz-border-radius: 4px;
-webkit-border-radius: 4px;
border-radius: 4px;
background: #fff url(https://tutorials.wwbn.net/view/img/transparent1px.png) no-repeat 0 51px;
}
#block_error div {
padding: 10px 40px 0 186px;
}
#block_error div h2 {
color: #218bdc;
font-size: 24px;
display: block;
padding: 0 0 14px 0;
border-bottom: 1px solid #cccccc;
margin-bottom: 12px;
font-weight: normal;
}
img {
max-height: 50px;
margin: 10px 0 0 5px;
}
</style>
</head>
<body marginwidth="0" marginheight="0">
<div id="block_error">
<img src="view/img/logo.png" class="img img-responsive center-block"/>
<div>
<h2><?php echo __("Error. Oops you've encountered an error"); ?></h2>
<p>
<?php echo __("It appears that either something went wrong or the mod rewrite configration is not correct."); ?><br />
</p>
<p><b><?php echo __("If you don't use apache, just let .htaccess stay or create a empty file - then this check will pass."); ?></b></p>
<p><?php echo __("We need to allow Apache to read .htaccess files located under the "); echo getcwd(); echo __(" directory."); ?>
<?php echo __("You can do this by editing the Apache configuration file:"); ?></p>
<p>
<?php echo __("Find the section <code>"); echo htmlentities("<directory /var/www/html>"); echo __("</code> and change <b>AllowOverride None</b> to <b>AllowOverride All</b>"); ?>
</p>
<p><pre><code>sudo nano /etc/apache2/apache2.conf</code></pre></p>
<p>
<?php echo __("After editing the above file your code should be like this:"); ?>
</p>
<p><pre><code><?php echo htmlentities("<Directory /var/www/>
Options Indexes FollowSymLinks
AllowOverride All
Require all granted
</Directory>"); ?></code></pre></p>
<p><?php echo __("In order to use mod_rewrite you can type the following command in the terminal:</p>"); ?>
<p><pre><code>sudo a2enmod rewrite</code></pre></p>
<p><?php echo __("Restart apache2 after"); ?></p>
<p><pre><code>sudo /etc/init.d/apache2 restart</code></pre></p>
<p><?php echo __("or"); ?></p>
<p><pre><code>sudo service apache2 restart</code></pre></p>
</div>
</div>
</body>
</html>
<?php
function __($text)
{
return $text;
}
<!DOCTYPE html>
<html lang="en">
<head>
<title><?php echo __("Error Page"); ?></title>
<link href="view/bootstrap/css/bootstrap.css" rel="stylesheet" type="text/css" />
<style>
body {
margin: 0;
padding: 0;
background: #e7ecf0;
font-family: Arial, Helvetica, sans-serif;
}
* {
margin: 0;
padding: 0;
}
p {
font-size: 12px;
color: #373737;
font-family: Arial, Helvetica, sans-serif;
line-height: 18px;
}
p a {
color: #218bdc;
font-size: 12px;
text-decoration: none;
}
a {
outline: none;
}
.f-left {
float: left;
}
.f-right {
float: right;
}
.clear {
clear: both;
overflow: hidden;
}
#block_error {
width: 1000px;
height: 700px;
border: 1px solid #cccccc;
margin: 72px auto 0;
-moz-border-radius: 4px;
-webkit-border-radius: 4px;
border-radius: 4px;
background: #fff url(https://tutorials.wwbn.net/view/img/transparent1px.png) no-repeat 0 51px;
}
#block_error div {
padding: 10px 40px 0 186px;
}
#block_error div h2 {
color: #218bdc;
font-size: 24px;
display: block;
padding: 0 0 14px 0;
border-bottom: 1px solid #cccccc;
margin-bottom: 12px;
font-weight: normal;
}
img {
max-height: 50px;
margin: 10px 0 0 5px;
}
</style>
</head>
<body marginwidth="0" marginheight="0">
<div id="block_error">
<img src="view/img/logo.png" class="img img-responsive center-block"/>
<div>
<h2><?php echo __("Error. Oops you've encountered an error"); ?></h2>
<p>
<?php echo __("It appears that either something went wrong or the mod rewrite configration is not correct."); ?><br />
</p>
<p><b><?php echo __("If you don't use apache, just let .htaccess stay or create a empty file - then this check will pass."); ?></b></p>
<p><?php echo __("We need to allow Apache to read .htaccess files located under the "); echo getcwd(); echo __(" directory."); ?>
<?php echo __("You can do this by editing the Apache configuration file:"); ?></p>
<p>
<?php echo __("Find the section <code>"); echo htmlentities("<directory /var/www/html>"); echo __("</code> and change <b>AllowOverride None</b> to <b>AllowOverride All</b>"); ?>
</p>
<p><pre><code>sudo nano /etc/apache2/apache2.conf</code></pre></p>
<p>
<?php echo __("After editing the above file your code should be like this:"); ?>
</p>
<p><pre><code><?php echo htmlentities("<Directory /var/www/>
Options Indexes FollowSymLinks
AllowOverride All
Require all granted
</Directory>"); ?></code></pre></p>
<p><?php echo __("In order to use mod_rewrite you can type the following command in the terminal:</p>"); ?>
<p><pre><code>sudo a2enmod rewrite</code></pre></p>
<p><?php echo __("Restart apache2 after"); ?></p>
<p><pre><code>sudo /etc/init.d/apache2 restart</code></pre></p>
<p><?php echo __("or"); ?></p>
<p><pre><code>sudo service apache2 restart</code></pre></p>
</div>
</div>
</body>
</html>
<?php
function __($text)
{
return $text;
}

View file

@ -1,241 +1,241 @@
<?php
if (file_exists("../videos/configuration.php")) {
error_log("Can not create configuration again: ". json_encode($_SERVER));
exit;
}
$installationVersion = "11.7";
error_log("Installation: ".__LINE__." ". json_encode($_POST));
header('Content-Type: application/json');
$obj = new stdClass();
$obj->post = $_POST;
if (!file_exists($_POST['systemRootPath'] . "index.php")) {
$obj->error = "Your system path to application ({$_POST['systemRootPath']}) is wrong";
echo json_encode($obj);
exit;
}
error_log("Installation: ".__LINE__);
$mysqli = @new mysqli($_POST['databaseHost'], $_POST['databaseUser'], $_POST['databasePass'], "", $_POST['databasePort']);
/*
* This is the "official" OO way to do it,
* BUT $connect_error was broken until PHP 5.2.9 and 5.3.0.
*/
if ($mysqli->connect_error) {
$obj->error = ('Connect Error (' . $mysqli->connect_errno . ') ' . $mysqli->connect_error);
echo json_encode($obj);
exit;
}
error_log("Installation: ".__LINE__);
if ($_POST['createTables'] == 2) {
$sql = "CREATE DATABASE IF NOT EXISTS {$_POST['databaseName']}";
if ($mysqli->query($sql) !== true) {
$obj->error = "Error creating database: " . $mysqli->error;
echo json_encode($obj);
exit;
}
}
$mysqli->select_db($_POST['databaseName']);
error_log("Installation: ".__LINE__);
/*
$cmd = "mysql -h {$_POST['databaseHost']} -u {$_POST['databaseUser']} -p {$_POST['databasePass']} {$_POST['databaseName']} < {$_POST['systemRootPath']}install/database.sql";
exec("{$cmd} 2>&1", $output, $return_val);
if ($return_val !== 0) {
$obj->error = "Error on command: {$cmd}";
echo json_encode($obj);
exit;
}
*/
error_log("Installation: ".__LINE__);
if ($_POST['createTables'] > 0) {
error_log("Installation: ".__LINE__);
// Temporary variable, used to store current query
$templine = '';
$installFile = "{$_POST['systemRootPath']}install/database.sql";
if (!file_exists($installFile)) {
$obj->error = "File Not found {$installFile}";
echo json_encode($obj);
exit;
}
error_log("Installation: ".__LINE__);
// Read in entire file
$lines = file($installFile);
if (empty($lines)) {
$obj->error = "File is empty {$installFile}";
echo json_encode($obj);
exit;
}
error_log("Installation: ".__LINE__);
// Loop through each line
$obj->error = '';
foreach ($lines as $line) {
// Skip it if it's a comment
if (substr($line, 0, 2) == '--' || $line == '') {
continue;
}
// Add this line to the current segment
$templine .= $line;
// If it has a semicolon at the end, it's the end of the query
if (substr(trim($line), -1, 1) == ';') {
// Perform the query
//error_log("Installation: ".$templine);
if (!$mysqli->query($templine)) {
error_log("Installation: SQL ERROR ".$mysqli->error);
$obj->error = ('Error performing query \'<strong>' . $templine . '\': ' . $mysqli->error . '<br /><br />');
}
// Reset temp variable to empty
$templine = '';
}
}
error_log("Installation: ".__LINE__);
}
error_log("Installation: ".__LINE__);
$sql = "DELETE FROM users WHERE id = 1 ";
if ($mysqli->query($sql) !== true) {
$obj->error = "Error deleting user: " . $mysqli->error;
echo json_encode($obj);
exit;
}
error_log("Installation: ".__LINE__);
$sql = "INSERT INTO users (id, user, email, password, created, modified, isAdmin) VALUES (1, 'admin', '" . $_POST['contactEmail'] . "', '" . md5($_POST['systemAdminPass']) . "', now(), now(), true)";
if ($mysqli->query($sql) !== true) {
$obj->error = "Error creating admin user: " . $mysqli->error;
echo json_encode($obj);
exit;
}
error_log("Installation: ".__LINE__);
$sql = "DELETE FROM categories WHERE id = 1 ";
if ($mysqli->query($sql) !== true) {
$obj->error = "Error deleting category: " . $mysqli->error;
echo json_encode($obj);
exit;
}
error_log("Installation: ".__LINE__);
$sql = "INSERT INTO categories (id, name, clean_name, description, created, modified) VALUES (1, 'Default', 'default','', now(), now())";
if ($mysqli->query($sql) !== true) {
$obj->error = "Error creating category: " . $mysqli->error;
echo json_encode($obj);
exit;
}
error_log("Installation: ".__LINE__);
$sql = "DELETE FROM configurations WHERE id = 1 ";
if ($mysqli->query($sql) !== true) {
$obj->error = "Error deleting configuration: " . $mysqli->error;
echo json_encode($obj);
exit;
}
error_log("Installation: ".__LINE__);
$encoder = 'https://encoder1.wwbn.net/';
if (is_dir("{$_POST['systemRootPath']}Encoder")) {
$encoder = "{$_POST['webSiteRootURL']}Encoder/";
}
$sql = "INSERT INTO configurations (id, video_resolution, users_id, version, webSiteTitle, language, contactEmail, encoderURL, created, modified) "
. " VALUES "
. " (1, '858:480', 1,'{$installationVersion}', '{$_POST['webSiteTitle']}', '{$_POST['mainLanguage']}', '{$_POST['contactEmail']}', '{$encoder}', now(), now())";
if ($mysqli->query($sql) !== true) {
$obj->error = "Error creating configuration: " . $mysqli->error;
echo json_encode($obj);
exit;
}
error_log("Installation: ".__LINE__);
$sql = "INSERT INTO `plugins` VALUES (NULL, 'a06505bf-3570-4b1f-977a-fd0e5cab205d', 'active', now(), now(), '', 'Gallery', 'Gallery', '1.0');";
if ($mysqli->query($sql) !== true) {
$obj->error = "Error enabling Gallery Plugin: " . $mysqli->error;
echo json_encode($obj);
exit;
}
error_log("Installation: ".__LINE__);
$mysqli->close();
if (empty($_POST['salt'])) {
$_POST['salt'] = uniqid();
}
$content = "<?php
\$global['configurationVersion'] = 3.1;
\$global['disableAdvancedConfigurations'] = 0;
\$global['videoStorageLimitMinutes'] = 0;
\$global['disableTimeFix'] = 0;
\$global['logfile'] = '{$_POST['systemRootPath']}videos/avideo.log';
if(!empty(\$_SERVER['SERVER_NAME']) && \$_SERVER['SERVER_NAME']!=='localhost' && !filter_var(\$_SERVER['SERVER_NAME'], FILTER_VALIDATE_IP)) {
// get the subdirectory, if exists
\$file = str_replace(\"\\\\\", \"/\", __FILE__);
\$subDir = str_replace(array(\$_SERVER[\"DOCUMENT_ROOT\"], 'videos/configuration.php'), array('',''), \$file);
\$global['webSiteRootURL'] = \"http\".(!empty(\$_SERVER['HTTPS'])?\"s\":\"\").\"://\".\$_SERVER['SERVER_NAME'].\$subDir;
}else{
\$global['webSiteRootURL'] = '{$_POST['webSiteRootURL']}';
}
\$global['systemRootPath'] = '{$_POST['systemRootPath']}';
\$global['salt'] = '{$_POST['salt']}';
\$global['disableTimeFix'] = 0;
\$global['enableDDOSprotection'] = 1;
\$global['ddosMaxConnections'] = 40;
\$global['ddosSecondTimeout'] = 5;
\$global['strictDDOSprotection'] = 0;
\$global['noDebug'] = 0;
\$global['webSiteRootPath'] = '';
if(empty(\$global['webSiteRootPath'])){
preg_match('/https?:\/\/[^\/]+(.*)/i', \$global['webSiteRootURL'], \$matches);
if(!empty(\$matches[1])){
\$global['webSiteRootPath'] = \$matches[1];
}
}
if(empty(\$global['webSiteRootPath'])){
die('Please configure your webSiteRootPath');
}
\$mysqlHost = '{$_POST['databaseHost']}';
\$mysqlPort = '{$_POST['databasePort']}';
\$mysqlUser = '{$_POST['databaseUser']}';
\$mysqlPass = '{$_POST['databasePass']}';
\$mysqlDatabase = '{$_POST['databaseName']}';
//\$global['stopBotsList'] = array('bot','spider','rouwler','Nuclei','MegaIndex','NetSystemsResearch','CensysInspect','slurp','crawler','curl','fetch','loader');
//\$global['stopBotsWhiteList'] = array('google','bing','yahoo','yandex','twitter');
/**
* Do NOT change from here
*/
require_once \$global['systemRootPath'].'objects/include_config.php';
";
error_log("Installation: ".__LINE__);
$fp = fopen($_POST['systemRootPath'] . "videos/configuration.php", "wb");
fwrite($fp, $content);
fclose($fp);
error_log("Installation: ".__LINE__);
/*
//copy the 100% progress sample file to be used when the uploaded file is already encoded in the MP4 or WBM formats
exec("cp {$_POST['systemRootPath']}install/FinishedProgressSample.* {$_POST['systemRootPath']}videos/", $output, $return_val);
if ($return_val !== 0) {
$obj->error = "Error copying the encoding progress sample files. Check whether the directory {$_POST['systemRootPath']}videos/ exists and the process have permission";
echo json_encode($obj);
exit;
}
*/
error_log("Installation: ".__LINE__);
$obj->success = true;
echo json_encode($obj);
error_log("Installation: ".__LINE__);
<?php
if (file_exists("../videos/configuration.php")) {
error_log("Can not create configuration again: ". json_encode($_SERVER));
exit;
}
$installationVersion = "11.7";
error_log("Installation: ".__LINE__." ". json_encode($_POST));
header('Content-Type: application/json');
$obj = new stdClass();
$obj->post = $_POST;
if (!file_exists($_POST['systemRootPath'] . "index.php")) {
$obj->error = "Your system path to application ({$_POST['systemRootPath']}) is wrong";
echo json_encode($obj);
exit;
}
error_log("Installation: ".__LINE__);
$mysqli = @new mysqli($_POST['databaseHost'], $_POST['databaseUser'], $_POST['databasePass'], "", $_POST['databasePort']);
/*
* This is the "official" OO way to do it,
* BUT $connect_error was broken until PHP 5.2.9 and 5.3.0.
*/
if ($mysqli->connect_error) {
$obj->error = ('Connect Error (' . $mysqli->connect_errno . ') ' . $mysqli->connect_error);
echo json_encode($obj);
exit;
}
error_log("Installation: ".__LINE__);
if ($_POST['createTables'] == 2) {
$sql = "CREATE DATABASE IF NOT EXISTS {$_POST['databaseName']}";
if ($mysqli->query($sql) !== true) {
$obj->error = "Error creating database: " . $mysqli->error;
echo json_encode($obj);
exit;
}
}
$mysqli->select_db($_POST['databaseName']);
error_log("Installation: ".__LINE__);
/*
$cmd = "mysql -h {$_POST['databaseHost']} -u {$_POST['databaseUser']} -p {$_POST['databasePass']} {$_POST['databaseName']} < {$_POST['systemRootPath']}install/database.sql";
exec("{$cmd} 2>&1", $output, $return_val);
if ($return_val !== 0) {
$obj->error = "Error on command: {$cmd}";
echo json_encode($obj);
exit;
}
*/
error_log("Installation: ".__LINE__);
if ($_POST['createTables'] > 0) {
error_log("Installation: ".__LINE__);
// Temporary variable, used to store current query
$templine = '';
$installFile = "{$_POST['systemRootPath']}install/database.sql";
if (!file_exists($installFile)) {
$obj->error = "File Not found {$installFile}";
echo json_encode($obj);
exit;
}
error_log("Installation: ".__LINE__);
// Read in entire file
$lines = file($installFile);
if (empty($lines)) {
$obj->error = "File is empty {$installFile}";
echo json_encode($obj);
exit;
}
error_log("Installation: ".__LINE__);
// Loop through each line
$obj->error = '';
foreach ($lines as $line) {
// Skip it if it's a comment
if (substr($line, 0, 2) == '--' || $line == '') {
continue;
}
// Add this line to the current segment
$templine .= $line;
// If it has a semicolon at the end, it's the end of the query
if (substr(trim($line), -1, 1) == ';') {
// Perform the query
//error_log("Installation: ".$templine);
if (!$mysqli->query($templine)) {
error_log("Installation: SQL ERROR ".$mysqli->error);
$obj->error = ('Error performing query \'<strong>' . $templine . '\': ' . $mysqli->error . '<br /><br />');
}
// Reset temp variable to empty
$templine = '';
}
}
error_log("Installation: ".__LINE__);
}
error_log("Installation: ".__LINE__);
$sql = "DELETE FROM users WHERE id = 1 ";
if ($mysqli->query($sql) !== true) {
$obj->error = "Error deleting user: " . $mysqli->error;
echo json_encode($obj);
exit;
}
error_log("Installation: ".__LINE__);
$sql = "INSERT INTO users (id, user, email, password, created, modified, isAdmin) VALUES (1, 'admin', '" . $_POST['contactEmail'] . "', '" . md5($_POST['systemAdminPass']) . "', now(), now(), true)";
if ($mysqli->query($sql) !== true) {
$obj->error = "Error creating admin user: " . $mysqli->error;
echo json_encode($obj);
exit;
}
error_log("Installation: ".__LINE__);
$sql = "DELETE FROM categories WHERE id = 1 ";
if ($mysqli->query($sql) !== true) {
$obj->error = "Error deleting category: " . $mysqli->error;
echo json_encode($obj);
exit;
}
error_log("Installation: ".__LINE__);
$sql = "INSERT INTO categories (id, name, clean_name, description, created, modified) VALUES (1, 'Default', 'default','', now(), now())";
if ($mysqli->query($sql) !== true) {
$obj->error = "Error creating category: " . $mysqli->error;
echo json_encode($obj);
exit;
}
error_log("Installation: ".__LINE__);
$sql = "DELETE FROM configurations WHERE id = 1 ";
if ($mysqli->query($sql) !== true) {
$obj->error = "Error deleting configuration: " . $mysqli->error;
echo json_encode($obj);
exit;
}
error_log("Installation: ".__LINE__);
$encoder = 'https://encoder1.wwbn.net/';
if (is_dir("{$_POST['systemRootPath']}Encoder")) {
$encoder = "{$_POST['webSiteRootURL']}Encoder/";
}
$sql = "INSERT INTO configurations (id, video_resolution, users_id, version, webSiteTitle, language, contactEmail, encoderURL, created, modified) "
. " VALUES "
. " (1, '858:480', 1,'{$installationVersion}', '{$_POST['webSiteTitle']}', '{$_POST['mainLanguage']}', '{$_POST['contactEmail']}', '{$encoder}', now(), now())";
if ($mysqli->query($sql) !== true) {
$obj->error = "Error creating configuration: " . $mysqli->error;
echo json_encode($obj);
exit;
}
error_log("Installation: ".__LINE__);
$sql = "INSERT INTO `plugins` VALUES (NULL, 'a06505bf-3570-4b1f-977a-fd0e5cab205d', 'active', now(), now(), '', 'Gallery', 'Gallery', '1.0');";
if ($mysqli->query($sql) !== true) {
$obj->error = "Error enabling Gallery Plugin: " . $mysqli->error;
echo json_encode($obj);
exit;
}
error_log("Installation: ".__LINE__);
$mysqli->close();
if (empty($_POST['salt'])) {
$_POST['salt'] = uniqid();
}
$content = "<?php
\$global['configurationVersion'] = 3.1;
\$global['disableAdvancedConfigurations'] = 0;
\$global['videoStorageLimitMinutes'] = 0;
\$global['disableTimeFix'] = 0;
\$global['logfile'] = '{$_POST['systemRootPath']}videos/avideo.log';
if(!empty(\$_SERVER['SERVER_NAME']) && \$_SERVER['SERVER_NAME']!=='localhost' && !filter_var(\$_SERVER['SERVER_NAME'], FILTER_VALIDATE_IP)) {
// get the subdirectory, if exists
\$file = str_replace(\"\\\\\", \"/\", __FILE__);
\$subDir = str_replace(array(\$_SERVER[\"DOCUMENT_ROOT\"], 'videos/configuration.php'), array('',''), \$file);
\$global['webSiteRootURL'] = \"http\".(!empty(\$_SERVER['HTTPS'])?\"s\":\"\").\"://\".\$_SERVER['SERVER_NAME'].\$subDir;
}else{
\$global['webSiteRootURL'] = '{$_POST['webSiteRootURL']}';
}
\$global['systemRootPath'] = '{$_POST['systemRootPath']}';
\$global['salt'] = '{$_POST['salt']}';
\$global['disableTimeFix'] = 0;
\$global['enableDDOSprotection'] = 1;
\$global['ddosMaxConnections'] = 40;
\$global['ddosSecondTimeout'] = 5;
\$global['strictDDOSprotection'] = 0;
\$global['noDebug'] = 0;
\$global['webSiteRootPath'] = '';
if(empty(\$global['webSiteRootPath'])){
preg_match('/https?:\/\/[^\/]+(.*)/i', \$global['webSiteRootURL'], \$matches);
if(!empty(\$matches[1])){
\$global['webSiteRootPath'] = \$matches[1];
}
}
if(empty(\$global['webSiteRootPath'])){
die('Please configure your webSiteRootPath');
}
\$mysqlHost = '{$_POST['databaseHost']}';
\$mysqlPort = '{$_POST['databasePort']}';
\$mysqlUser = '{$_POST['databaseUser']}';
\$mysqlPass = '{$_POST['databasePass']}';
\$mysqlDatabase = '{$_POST['databaseName']}';
//\$global['stopBotsList'] = array('bot','spider','rouwler','Nuclei','MegaIndex','NetSystemsResearch','CensysInspect','slurp','crawler','curl','fetch','loader');
//\$global['stopBotsWhiteList'] = array('google','bing','yahoo','yandex','twitter');
/**
* Do NOT change from here
*/
require_once \$global['systemRootPath'].'objects/include_config.php';
";
error_log("Installation: ".__LINE__);
$fp = fopen($_POST['systemRootPath'] . "videos/configuration.php", "wb");
fwrite($fp, $content);
fclose($fp);
error_log("Installation: ".__LINE__);
/*
//copy the 100% progress sample file to be used when the uploaded file is already encoded in the MP4 or WBM formats
exec("cp {$_POST['systemRootPath']}install/FinishedProgressSample.* {$_POST['systemRootPath']}videos/", $output, $return_val);
if ($return_val !== 0) {
$obj->error = "Error copying the encoding progress sample files. Check whether the directory {$_POST['systemRootPath']}videos/ exists and the process have permission";
echo json_encode($obj);
exit;
}
*/
error_log("Installation: ".__LINE__);
$obj->success = true;
echo json_encode($obj);
error_log("Installation: ".__LINE__);

View file

@ -1,16 +1,16 @@
<?php
$_POST["systemRootPath"] = "/var/www/html/AVideo/";
$_POST["databaseHost"] = getenv("DB_MYSQL_HOST");
$_POST["databasePort"] = getenv("DB_MYSQL_PORT");
$_POST["databaseName"] = getenv("DB_MYSQL_NAME");
$_POST["databaseUser"] = getenv("DB_MYSQL_USER");
$_POST["databasePass"] = getenv("DB_MYSQL_PASSWORD");
$_POST["createTables"] = 1;
$_POST["contactEmail"] = getenv("CONTACT_EMAIL");
$_POST["systemAdminPass"] = getenv("SYSTEM_ADMIN_PASSWORD");
$_POST["webSiteTitle"] = getenv("WEBSITE_TITLE");
$_POST["mainLanguage"] = getenv("MAIN_LANGUAGE");
$_POST["webSiteRootURL"] = "https://".getenv("SERVER_NAME")."/";
require_once "./checkConfiguration.php";
<?php
$_POST["systemRootPath"] = "/var/www/html/AVideo/";
$_POST["databaseHost"] = getenv("DB_MYSQL_HOST");
$_POST["databasePort"] = getenv("DB_MYSQL_PORT");
$_POST["databaseName"] = getenv("DB_MYSQL_NAME");
$_POST["databaseUser"] = getenv("DB_MYSQL_USER");
$_POST["databasePass"] = getenv("DB_MYSQL_PASSWORD");
$_POST["createTables"] = 1;
$_POST["contactEmail"] = getenv("CONTACT_EMAIL");
$_POST["systemAdminPass"] = getenv("SYSTEM_ADMIN_PASSWORD");
$_POST["webSiteTitle"] = getenv("WEBSITE_TITLE");
$_POST["mainLanguage"] = getenv("MAIN_LANGUAGE");
$_POST["webSiteRootURL"] = "https://".getenv("SERVER_NAME")."/";
require_once "./checkConfiguration.php";

File diff suppressed because it is too large Load diff

View file

@ -1,83 +1,83 @@
<?php
//streamer config
require_once '../videos/configuration.php';
if (!isCommandLineInterface()) {
return die('Command Line only');
}
$doNotDeleteFilesList = ['configuration.php', 'favicon.ico', 'favicon.png', 'avideo.log', 'PayPal.log', 'socketPID.log', 'logo.png', 'logoOverlay.png'];
$lockFilename = '.move_v1.lock';
$path = getVideosDir();
$files = array_diff(scandir($path), ['.', '..']);
echo "*** Total filenames " . count($files) . "\n";
foreach ($files as $key => $value) {
$dir = "{$path}{$value}";
if (!is_dir($dir)) {
$bname = basename($dir);
if (in_array($bname, $doNotDeleteFilesList) || preg_match('/configuration\./i', $bname)) {
unset($files[$key]);
} else {
$filename = Video::getCleanFilenameFromFile($dir);
$video = Video::getVideoFromFileName($filename, true);
if (!empty($video)) {
//echo "+++ Video FOUND for filename {$filename} ".PHP_EOL;
unset($files[$key]);
} else {
$files[$key] = [$value, $dir];
//echo "*** Video NOT found for filename {$filename} ".PHP_EOL;
}
}
continue;
}
$file = "{$dir}" . DIRECTORY_SEPARATOR . "{$lockFilename}";
if (file_exists($file)) {
$filename = Video::getCleanFilenameFromFile($dir);
$video = Video::getVideoFromFileName($filename, true);
if (!empty($video)) {
//echo "+++ Video FOUND for filename {$filename} ".PHP_EOL;
unset($files[$key]);
} else {
$files[$key] = [$value, $dir];
//echo "*** Video NOT found for filename {$filename} ".PHP_EOL;
}
} else {
//echo "*** Lock file does not exists {$file} ".PHP_EOL;
unset($files[$key]);
}
}
$total = count($files);
echo "*** Total filenames " . $total . " Will be deleted\n";
if (empty($total)) {
exit;
}
$totalSize = 0;
foreach ($files as $key => $value) {
$size = getDirSize($value[1]);
$totalSize += $size;
echo "{$value[0]} => $value[1] " . (humanFileSize($size)) . " \n";
}
echo "*** Confirm Delete Them (" . humanFileSize($totalSize) . ")? y/n: ";
ob_flush();
$confirm = trim(readline(""));
if (!empty($confirm) && strtolower($confirm) === 'y') {
foreach ($files as $key => $value) {
if (is_dir($value[1])) {
rrmdir($value[1]);
if (is_dir($value[1])) {
echo "$value[1] Directory Deleted \n";
} else {
echo "$value[1] Directory Could Not be Deleted \n";
}
} elseif (unlink($value[1])) {
echo "$value[1] Deleted \n";
} else {
echo "$value[1] Could Not be Deleted \n";
}
}
}
<?php
//streamer config
require_once '../videos/configuration.php';
if (!isCommandLineInterface()) {
return die('Command Line only');
}
$doNotDeleteFilesList = ['configuration.php', 'favicon.ico', 'favicon.png', 'avideo.log', 'PayPal.log', 'socketPID.log', 'logo.png', 'logoOverlay.png'];
$lockFilename = '.move_v1.lock';
$path = getVideosDir();
$files = array_diff(scandir($path), ['.', '..']);
echo "*** Total filenames " . count($files) . "\n";
foreach ($files as $key => $value) {
$dir = "{$path}{$value}";
if (!is_dir($dir)) {
$bname = basename($dir);
if (in_array($bname, $doNotDeleteFilesList) || preg_match('/configuration\./i', $bname)) {
unset($files[$key]);
} else {
$filename = Video::getCleanFilenameFromFile($dir);
$video = Video::getVideoFromFileName($filename, true);
if (!empty($video)) {
//echo "+++ Video FOUND for filename {$filename} ".PHP_EOL;
unset($files[$key]);
} else {
$files[$key] = [$value, $dir];
//echo "*** Video NOT found for filename {$filename} ".PHP_EOL;
}
}
continue;
}
$file = "{$dir}" . DIRECTORY_SEPARATOR . "{$lockFilename}";
if (file_exists($file)) {
$filename = Video::getCleanFilenameFromFile($dir);
$video = Video::getVideoFromFileName($filename, true);
if (!empty($video)) {
//echo "+++ Video FOUND for filename {$filename} ".PHP_EOL;
unset($files[$key]);
} else {
$files[$key] = [$value, $dir];
//echo "*** Video NOT found for filename {$filename} ".PHP_EOL;
}
} else {
//echo "*** Lock file does not exists {$file} ".PHP_EOL;
unset($files[$key]);
}
}
$total = count($files);
echo "*** Total filenames " . $total . " Will be deleted\n";
if (empty($total)) {
exit;
}
$totalSize = 0;
foreach ($files as $key => $value) {
$size = getDirSize($value[1]);
$totalSize += $size;
echo "{$value[0]} => $value[1] " . (humanFileSize($size)) . " \n";
}
echo "*** Confirm Delete Them (" . humanFileSize($totalSize) . ")? y/n: ";
ob_flush();
$confirm = trim(readline(""));
if (!empty($confirm) && strtolower($confirm) === 'y') {
foreach ($files as $key => $value) {
if (is_dir($value[1])) {
rrmdir($value[1]);
if (is_dir($value[1])) {
echo "$value[1] Directory Deleted \n";
} else {
echo "$value[1] Directory Could Not be Deleted \n";
}
} elseif (unlink($value[1])) {
echo "$value[1] Deleted \n";
} else {
echo "$value[1] Could Not be Deleted \n";
}
}
}

View file

@ -1,110 +1,110 @@
<?php
//streamer config
require_once '../videos/configuration.php';
if (!isCommandLineInterface()) {
return die('Command Line only');
}
$p = AVideoPlugin::loadPluginIfEnabled('YPTStorage');
if (empty($p)) {
return die('YPTStorage plugin disabled');
}
$fileExtensions = ['jpg', 'gif', 'mp4', 'webm', 'tgz'];
$files = [];
//foreach (glob("../videos/*.{" . implode(",", $fileExtensions) . "}", GLOB_BRACE) as $filename) {
foreach (glob("../videos/*", GLOB_BRACE) as $filename) {
$base = basename($filename);
if (is_dir($filename)) {
if (strpos($base, "_YPTuniqid_") !== false) {
$files[$base] = [$base, $filename];
}
} else {
$baseName = explode("_portrait", $base);
if (!empty($baseName[1])) {
$files[$base] = [$baseName[0], $filename];
} else {
$baseName = explode("_thumbs", $base);
if (!empty($baseName[1])) {
$files[$base] = [$baseName[0], $filename];
} else {
$types = ['_HD', '_Low', '_SD'];
$notFound = true;
foreach ($types as $value) {
$baseName = explode($value, $base);
if (!empty($baseName[1])) {
$files[$base] = [$baseName[0], $filename];
$notFound = false;
}
}
if ($notFound) {
foreach ($fileExtensions as $value) {
if (strpos($base, ".$value") === false) {
continue;
}
$baseName = str_replace("." . $value, "", $base);
if (!empty($baseName[1])) {
if (!in_array($baseName, $files)) {
$files[$base] = [$baseName, $filename];
}
}
}
}
}
}
}
}
echo "*** Total filenames " . count($files) . "\n";
$max = 10;
$count = 0;
$countExecuted = 0;
$checkedFiles = [];
foreach ($files as $key => $value) {
if (!empty($checkedFiles[$value[0]])) {
continue;
}
$checkedFiles[$value[0]] = [true];
$getUsageFromFilename = YPTStorage::getUsageFromFilename($value[0]);
$checkedFiles[$value[0]][] = $getUsageFromFilename;
if ($getUsageFromFilename < 200000) {
//echo "Local file is too small, probably transfered already or is a directory (HLS) \n";
continue;
}
$video = Video::getVideoFromFileName($value[0], true);
if (!empty($video)) {
$sites_id = $video['sites_id'];
if ($sites_id > 0) {
$count++;
if ($count > $max) {
exit;
}
echo "{$count}: Local file videos_id = {$video['id']} {$video['title']}=> $getUsageFromFilename " . humanFileSize($getUsageFromFilename) . "\n";
$source_size = YPTStorage::getFileSize($video['id'], -1);
$destination_size = YPTStorage::getFileSize($video['id'], $sites_id);
if (!empty($destination_size) && $destination_size > 5000000 && $source_size <= $destination_size) {
$countExecuted++;
if ($countExecuted > $max) {
exit;
}
YPTStorage::createDummy($video['id']);
$tgzFile = $global['systemRootPath'] . "videos/{$video['filename']}.tgz";
if (file_exists($tgzFile)) {
unlink($tgzFile);
}
echo "****** File size is the same videos_id = {$video['id']} {$sites_id} [$source_size!==$destination_size][" . humanFileSize($source_size) . "!==" . humanFileSize($destination_size) . "]\n";
//exit;
} elseif ($source_sizee > 5000000) {
echo "----- ERROR File size is NOT the same videos_id and it's supposed to be on the storage = {$video['id']} {$sites_id} [$source_size!==$destination_size][" . humanFileSize($source_size) . "!==" . humanFileSize($destination_size) . "]\n";
} elseif ($source_sizee > 5000000) {
echo "+++++ All seems fine with video {$video['id']} {$sites_id} [$source_size!==$destination_size][" . humanFileSize($source_size) . "!==" . humanFileSize($destination_size) . "]\n";
}
} else {
//echo "The video_id {$video['id']} ({$video['title']}) is not hosted on the storage\n";
}
}
}
<?php
//streamer config
require_once '../videos/configuration.php';
if (!isCommandLineInterface()) {
return die('Command Line only');
}
$p = AVideoPlugin::loadPluginIfEnabled('YPTStorage');
if (empty($p)) {
return die('YPTStorage plugin disabled');
}
$fileExtensions = ['jpg', 'gif', 'mp4', 'webm', 'tgz'];
$files = [];
//foreach (glob("../videos/*.{" . implode(",", $fileExtensions) . "}", GLOB_BRACE) as $filename) {
foreach (glob("../videos/*", GLOB_BRACE) as $filename) {
$base = basename($filename);
if (is_dir($filename)) {
if (strpos($base, "_YPTuniqid_") !== false) {
$files[$base] = [$base, $filename];
}
} else {
$baseName = explode("_portrait", $base);
if (!empty($baseName[1])) {
$files[$base] = [$baseName[0], $filename];
} else {
$baseName = explode("_thumbs", $base);
if (!empty($baseName[1])) {
$files[$base] = [$baseName[0], $filename];
} else {
$types = ['_HD', '_Low', '_SD'];
$notFound = true;
foreach ($types as $value) {
$baseName = explode($value, $base);
if (!empty($baseName[1])) {
$files[$base] = [$baseName[0], $filename];
$notFound = false;
}
}
if ($notFound) {
foreach ($fileExtensions as $value) {
if (strpos($base, ".$value") === false) {
continue;
}
$baseName = str_replace("." . $value, "", $base);
if (!empty($baseName[1])) {
if (!in_array($baseName, $files)) {
$files[$base] = [$baseName, $filename];
}
}
}
}
}
}
}
}
echo "*** Total filenames " . count($files) . "\n";
$max = 10;
$count = 0;
$countExecuted = 0;
$checkedFiles = [];
foreach ($files as $key => $value) {
if (!empty($checkedFiles[$value[0]])) {
continue;
}
$checkedFiles[$value[0]] = [true];
$getUsageFromFilename = YPTStorage::getUsageFromFilename($value[0]);
$checkedFiles[$value[0]][] = $getUsageFromFilename;
if ($getUsageFromFilename < 200000) {
//echo "Local file is too small, probably transfered already or is a directory (HLS) \n";
continue;
}
$video = Video::getVideoFromFileName($value[0], true);
if (!empty($video)) {
$sites_id = $video['sites_id'];
if ($sites_id > 0) {
$count++;
if ($count > $max) {
exit;
}
echo "{$count}: Local file videos_id = {$video['id']} {$video['title']}=> $getUsageFromFilename " . humanFileSize($getUsageFromFilename) . "\n";
$source_size = YPTStorage::getFileSize($video['id'], -1);
$destination_size = YPTStorage::getFileSize($video['id'], $sites_id);
if (!empty($destination_size) && $destination_size > 5000000 && $source_size <= $destination_size) {
$countExecuted++;
if ($countExecuted > $max) {
exit;
}
YPTStorage::createDummy($video['id']);
$tgzFile = $global['systemRootPath'] . "videos/{$video['filename']}.tgz";
if (file_exists($tgzFile)) {
unlink($tgzFile);
}
echo "****** File size is the same videos_id = {$video['id']} {$sites_id} [$source_size!==$destination_size][" . humanFileSize($source_size) . "!==" . humanFileSize($destination_size) . "]\n";
//exit;
} elseif ($source_sizee > 5000000) {
echo "----- ERROR File size is NOT the same videos_id and it's supposed to be on the storage = {$video['id']} {$sites_id} [$source_size!==$destination_size][" . humanFileSize($source_size) . "!==" . humanFileSize($destination_size) . "]\n";
} elseif ($source_sizee > 5000000) {
echo "+++++ All seems fine with video {$video['id']} {$sites_id} [$source_size!==$destination_size][" . humanFileSize($source_size) . "!==" . humanFileSize($destination_size) . "]\n";
}
} else {
//echo "The video_id {$video['id']} ({$video['title']}) is not hosted on the storage\n";
}
}
}

View file

@ -1,25 +1,25 @@
<?php
//streamer config
require_once '../videos/configuration.php';
ob_end_flush();
if (!isCommandLineInterface()) {
return die('Command Line only');
}
$path = getVideosDir();
$files = array_diff(scandir($path), ['.', '..']);
foreach ($files as $value) {
$dir = "{$path}{$value}";
if (is_dir($dir)) {
$files2 = array_diff(scandir($dir), ['.', '..']);
foreach ($files2 as $value2) {
$ext = pathinfo($value2, PATHINFO_EXTENSION);
if ($ext=='tgz') {
$file = "{$dir}/{$value2}";
echo $file.' '. humanFileSize(filesize($file)).PHP_EOL;
unlink($file);
}
}
}
}
<?php
//streamer config
require_once '../videos/configuration.php';
ob_end_flush();
if (!isCommandLineInterface()) {
return die('Command Line only');
}
$path = getVideosDir();
$files = array_diff(scandir($path), ['.', '..']);
foreach ($files as $value) {
$dir = "{$path}{$value}";
if (is_dir($dir)) {
$files2 = array_diff(scandir($dir), ['.', '..']);
foreach ($files2 as $value2) {
$ext = pathinfo($value2, PATHINFO_EXTENSION);
if ($ext=='tgz') {
$file = "{$dir}/{$value2}";
echo $file.' '. humanFileSize(filesize($file)).PHP_EOL;
unlink($file);
}
}
}
}

View file

@ -1,33 +1,33 @@
<?php
//streamer config
require_once '../videos/configuration.php';
require_once $global['systemRootPath'] . 'objects/video.php';
if (!isCommandLineInterface()) {
return die('Command Line only');
}
ob_end_flush();
$checkIfIsCorrupted = intval(@$argv[1]);
echo "checkIfIsCorrupted = $checkIfIsCorrupted".PHP_EOL;
$users_ids = [];
$sql = "SELECT * FROM videos ";
$res = sqlDAL::readSql($sql);
$fullData = sqlDAL::fetchAllAssoc($res);
$total = count($fullData);
sqlDAL::close($res);
$rows = [];
if ($res != false) {
$count = 0;
foreach ($fullData as $key => $row) {
$count++;
$filename = $row['filename'];
$totalDeleted = Video::deleteThumbs($filename, true, $checkIfIsCorrupted);
if ($totalDeleted) {
echo "{$total}/{$count} Thumbs deleted ($totalDeleted) from {$row['title']}".PHP_EOL;
} else {
echo "{$total}/{$count} Thumbs NOT deleted from {$row['title']}".PHP_EOL;
}
}
} else {
die($sql . '\nError : (' . $global['mysqli']->errno . ') ' . $global['mysqli']->error);
}
<?php
//streamer config
require_once '../videos/configuration.php';
require_once $global['systemRootPath'] . 'objects/video.php';
if (!isCommandLineInterface()) {
return die('Command Line only');
}
ob_end_flush();
$checkIfIsCorrupted = intval(@$argv[1]);
echo "checkIfIsCorrupted = $checkIfIsCorrupted".PHP_EOL;
$users_ids = [];
$sql = "SELECT * FROM videos ";
$res = sqlDAL::readSql($sql);
$fullData = sqlDAL::fetchAllAssoc($res);
$total = count($fullData);
sqlDAL::close($res);
$rows = [];
if ($res != false) {
$count = 0;
foreach ($fullData as $key => $row) {
$count++;
$filename = $row['filename'];
$totalDeleted = Video::deleteThumbs($filename, true, $checkIfIsCorrupted);
if ($totalDeleted) {
echo "{$total}/{$count} Thumbs deleted ($totalDeleted) from {$row['title']}".PHP_EOL;
} else {
echo "{$total}/{$count} Thumbs NOT deleted from {$row['title']}".PHP_EOL;
}
}
} else {
die($sql . '\nError : (' . $global['mysqli']->errno . ') ' . $global['mysqli']->error);
}

View file

@ -1,42 +1,42 @@
<?php
//streamer config
require_once '../videos/configuration.php';
require_once $global['systemRootPath'] . 'objects/playlist.php';
if (!isCommandLineInterface()) {
return die('Command Line only');
}
ob_end_flush();
$sql = "select * FROM users";
$res = sqlDAL::readSql($sql);
$fullData = sqlDAL::fetchAllAssoc($res);
sqlDAL::close($res);
$rows = [];
$count = ['NoPermanent'=>0, 'NoDynamic'=>0, 'Deleted'=>0];
if ($res != false) {
foreach ($fullData as $key => $row) {
$rowsUser = UserGroups::getUserGroups($row['id']);
if (empty($rowsUser)) {
//echo "This user has no permanent usergroups".PHP_EOL;
$count['NoPermanent']++;
} else {
$user = new User($row['id'], $row['user'], $row['password']);
$user->login(true, false, true);
$user_groups_id = AVideoPlugin::getDynamicUserGroupsId($row['id']);
if (empty($user_groups_id)) {
//echo "This user has no dynamic usergroups".PHP_EOL;
$count['NoDynamic']++;
} else {
echo "found dynamic usergroups from users_id={$row['id']} user={$row['user']} usergroups=". implode(',', $user_groups_id).PHP_EOL;
$sqlUG = "DELETE FROM users_has_users_groups WHERE users_id = ? AND users_groups_id IN (". implode(',', $user_groups_id).")";
sqlDAL::writeSql($sqlUG, "i", [$row['id']]);
$count['Deleted']++;
}
}
}
} else {
die($sql . '\nError : (' . $global['mysqli']->errno . ') ' . $global['mysqli']->error);
}
echo "Finish, ". json_encode($count);
<?php
//streamer config
require_once '../videos/configuration.php';
require_once $global['systemRootPath'] . 'objects/playlist.php';
if (!isCommandLineInterface()) {
return die('Command Line only');
}
ob_end_flush();
$sql = "select * FROM users";
$res = sqlDAL::readSql($sql);
$fullData = sqlDAL::fetchAllAssoc($res);
sqlDAL::close($res);
$rows = [];
$count = ['NoPermanent'=>0, 'NoDynamic'=>0, 'Deleted'=>0];
if ($res != false) {
foreach ($fullData as $key => $row) {
$rowsUser = UserGroups::getUserGroups($row['id']);
if (empty($rowsUser)) {
//echo "This user has no permanent usergroups".PHP_EOL;
$count['NoPermanent']++;
} else {
$user = new User($row['id'], $row['user'], $row['password']);
$user->login(true, false, true);
$user_groups_id = AVideoPlugin::getDynamicUserGroupsId($row['id']);
if (empty($user_groups_id)) {
//echo "This user has no dynamic usergroups".PHP_EOL;
$count['NoDynamic']++;
} else {
echo "found dynamic usergroups from users_id={$row['id']} user={$row['user']} usergroups=". implode(',', $user_groups_id).PHP_EOL;
$sqlUG = "DELETE FROM users_has_users_groups WHERE users_id = ? AND users_groups_id IN (". implode(',', $user_groups_id).")";
sqlDAL::writeSql($sqlUG, "i", [$row['id']]);
$count['Deleted']++;
}
}
}
} else {
die($sql . '\nError : (' . $global['mysqli']->errno . ') ' . $global['mysqli']->error);
}
echo "Finish, ". json_encode($count);

View file

@ -1,98 +1,98 @@
<?php
//streamer config
require_once '../videos/configuration.php';
if (!isCommandLineInterface()) {
return die('Command Line only');
}
$global['limitForUnlimitedVideos'] = -1;
$videos = video::getAllVideosLight("", false, true);
$count = 0;
foreach ($videos as $value) {
$count++;
echo "\n Start ($count) ******\n";
if ($value['type'] != 'video') {
echo "\nType ({$value['type']}) is not a video: " . $value['title'];
echo "\n End ($count) ******\n";
ob_flush();
continue;
}
echo "\nStart: " . $value['title'];
ob_flush();
$videoFileName = $value['filename'];
$destination = Video::getPathToFile("{$videoFileName}.webp");
if (!file_exists($destination)) {
echo "\nGet webp";
ob_flush();
$videosURL = getFirstVideoURL($videoFileName);
$videoPath = getFirstVideoPath($videoFileName);
$duration = (Video::getItemDurationSeconds(Video::getDurationFromFile($videoPath)) / 2);
if (!empty($videosURL)) {
$url = $videosURL;
$context = stream_context_create([
'ssl' => [
'verify_peer' => false,
'verify_peer_name' => false,
],
]);
$file_headers = @get_headers($url, 0, $context);
if (!$file_headers || $file_headers[0] == 'HTTP/1.1 404 Not Found') {
echo "\nGet webp not found {$url}";
ob_flush();
continue;
} else {
$url = $config->getEncoderURL() . "getImageMP4/" . base64_encode($url) . "/webp/{$duration}";
$image = url_get_contents($url);
file_put_contents($destination, $image);
}
} else {
echo "\nVideo URL empty";
ob_flush();
}
echo "\nGet done";
ob_flush();
} else {
echo "\nFile exists: " . $value['title'] . " {$destination}";
ob_flush();
}
echo "\nFinish: " . $value['title'];
echo "\n******\n";
ob_flush();
}
function getFirstVideoURL($videoFileName)
{
$types = ['', '_Low', '_SD', '_HD'];
$videosList = getVideosURL($videoFileName);
if (!empty($videosList['m3u8']["url"])) {
return $videosList['m3u8']["url"];
}
foreach ($types as $value) {
if (!empty($videosList['mp4' . $value]["url"])) {
return $videosList['mp4' . $value]["url"];
} elseif (!empty($videosList['webm' . $value]["url"])) {
return $videosList['webm' . $value]["url"];
}
}
return false;
}
function getFirstVideoPath($videoFileName)
{
$types = ['', '_Low', '_SD', '_HD'];
$videosList = getVideosURL($videoFileName);
if (!empty($videosList['m3u8']["path"])) {
return $videosList['m3u8']["path"];
}
foreach ($types as $value) {
if (!empty($videosList['mp4' . $value]["path"])) {
return $videosList['mp4' . $value]["path"];
} elseif (!empty($videosList['webm' . $value]["path"])) {
return $videosList['webm' . $value]["path"];
}
}
return false;
}
<?php
//streamer config
require_once '../videos/configuration.php';
if (!isCommandLineInterface()) {
return die('Command Line only');
}
$global['limitForUnlimitedVideos'] = -1;
$videos = video::getAllVideosLight("", false, true);
$count = 0;
foreach ($videos as $value) {
$count++;
echo "\n Start ($count) ******\n";
if ($value['type'] != 'video') {
echo "\nType ({$value['type']}) is not a video: " . $value['title'];
echo "\n End ($count) ******\n";
ob_flush();
continue;
}
echo "\nStart: " . $value['title'];
ob_flush();
$videoFileName = $value['filename'];
$destination = Video::getPathToFile("{$videoFileName}.webp");
if (!file_exists($destination)) {
echo "\nGet webp";
ob_flush();
$videosURL = getFirstVideoURL($videoFileName);
$videoPath = getFirstVideoPath($videoFileName);
$duration = (Video::getItemDurationSeconds(Video::getDurationFromFile($videoPath)) / 2);
if (!empty($videosURL)) {
$url = $videosURL;
$context = stream_context_create([
'ssl' => [
'verify_peer' => false,
'verify_peer_name' => false,
],
]);
$file_headers = @get_headers($url, 0, $context);
if (!$file_headers || $file_headers[0] == 'HTTP/1.1 404 Not Found') {
echo "\nGet webp not found {$url}";
ob_flush();
continue;
} else {
$url = $config->getEncoderURL() . "getImageMP4/" . base64_encode($url) . "/webp/{$duration}";
$image = url_get_contents($url);
file_put_contents($destination, $image);
}
} else {
echo "\nVideo URL empty";
ob_flush();
}
echo "\nGet done";
ob_flush();
} else {
echo "\nFile exists: " . $value['title'] . " {$destination}";
ob_flush();
}
echo "\nFinish: " . $value['title'];
echo "\n******\n";
ob_flush();
}
function getFirstVideoURL($videoFileName)
{
$types = ['', '_Low', '_SD', '_HD'];
$videosList = getVideosURL($videoFileName);
if (!empty($videosList['m3u8']["url"])) {
return $videosList['m3u8']["url"];
}
foreach ($types as $value) {
if (!empty($videosList['mp4' . $value]["url"])) {
return $videosList['mp4' . $value]["url"];
} elseif (!empty($videosList['webm' . $value]["url"])) {
return $videosList['webm' . $value]["url"];
}
}
return false;
}
function getFirstVideoPath($videoFileName)
{
$types = ['', '_Low', '_SD', '_HD'];
$videosList = getVideosURL($videoFileName);
if (!empty($videosList['m3u8']["path"])) {
return $videosList['m3u8']["path"];
}
foreach ($types as $value) {
if (!empty($videosList['mp4' . $value]["path"])) {
return $videosList['mp4' . $value]["path"];
} elseif (!empty($videosList['webm' . $value]["path"])) {
return $videosList['webm' . $value]["path"];
}
}
return false;
}

View file

@ -1,350 +1,350 @@
<?php
require_once '../objects/functions.php';
require_once '../locale/function.php';
//var_dump($_SERVER);exit;
?>
<!DOCTYPE html>
<html lang="en">
<head>
<title>Install AVideo</title>
<script src="../node_modules/jquery/dist/jquery.min.js" type="text/javascript"></script>
<link rel="icon" href="../view/img/favicon.png">
<link href="../view/bootstrap/css/bootstrap.min.css" rel="stylesheet" type="text/css"/>
<link href="../view/bootstrap/bootstrapSelectPicker/css/bootstrap-select.min.css" rel="stylesheet" type="text/css"/>
<link href="../node_modules/@fortawesome/fontawesome-free/css/all.min.css" rel="stylesheet" type="text/css"/>
<link href="../view/css/flagstrap/css/flags.css" rel="stylesheet" type="text/css"/>
<style>
.bootstrap-select{
width: 100% !important;
}
</style>
</head>
<body>
<?php
if (file_exists('../videos/configuration.php')) {
require_once '../videos/configuration.php'; ?>
<div class="container">
<h3 class="alert alert-success">
<span class="glyphicon glyphicon-ok-circle"></span>
Your system is installed, remove the <code><?php echo $global['systemRootPath']; ?>install</code> directory to continue
<hr>
<a href="<?php echo $global['webSiteRootURL']; ?>" class="btn btn-success btn-lg center-block">Go to the main page</a>
</h3>
</div>
<?php
} else {
?>
<div class="container">
<img src="../view/img/logo.png" alt="Logo" class="img img-responsive center-block"/>
<div class="row">
<div class="col-md-4">
<div class="panel panel-default">
<div class="panel-heading"><i class="fas fa-tasks"></i> Check list</div>
<div class="panel-body">
<?php
if (isApache()) {
?>
<div class="alert alert-success">
<span class="glyphicon glyphicon-check"></span>
<strong><?php echo $_SERVER['SERVER_SOFTWARE']; ?> is Present</strong>
</div>
<?php
} else {
?>
<div class="alert alert-danger">
<span class="glyphicon glyphicon-unchecked"></span>
<strong>Your server is <?php echo $_SERVER['SERVER_SOFTWARE']; ?>, you must install Apache</strong>
</div>
<?php
} ?>
<?php
if (isPHP('7.3')) {
?>
<div class="alert alert-success">
<span class="glyphicon glyphicon-check"></span>
<strong>PHP <?php echo PHP_VERSION; ?> is present.</strong>
</div>
<?php
} else {
?>
<div class="alert alert-warning">
<span class="glyphicon glyphicon-exclamation-sign"></span>
<strong>Your PHP version is <?php echo PHP_VERSION; ?>. PHP 7.3 or newer is required.</strong>
</div>
<?php
} ?>
<?php
if (checkVideosDir()) {
?>
<div class="alert alert-success">
<span class="glyphicon glyphicon-check"></span>
<strong>Your videos directory is writable</strong>
</div>
<?php
} else {
?>
<div class="alert alert-danger">
<span class="glyphicon glyphicon-unchecked"></span>
<strong>Your videos directory must be writable</strong>
<details>
<?php
$dir = getPathToApplication() . "videos";
if (!file_exists($dir)) {
?>
The video directory does not exists, AVideo had no permition to create it, you must create it manualy!
<br>
<pre><code>sudo mkdir <?php echo $dir; ?></code></pre>
<?php
} ?>
<br>
Then you can set the permissions (www-data means apache user).
<br>
<pre><code>sudo chown www-data:www-data <?php echo $dir; ?> && sudo chmod 755 <?php echo $dir; ?> </code></pre>
</details>
</div>
<?php
}
$pathToPHPini = php_ini_loaded_file();
if (empty($pathToPHPini)) {
$pathToPHPini = "/etc/php/7.0/cli/php.ini";
} ?>
<?php
if (check_post_max_size()) {
?>
<div class="alert alert-success">
<span class="glyphicon glyphicon-check"></span>
<strong>Your post_max_size is <?php echo ini_get('post_max_size'); ?></strong>
</div>
<?php
} else {
?>
<div class="alert alert-danger">
<span class="glyphicon glyphicon-unchecked"></span>
<strong>Your post_max_size is <?php echo ini_get('post_max_size'); ?>, it must be at least 100M</strong>
<details>
Edit the <code>php.ini</code> file
<br>
<pre><code>sudo nano <?php echo $pathToPHPini; ?></code></pre>
</details>
</div>
<?php
} ?>
<?php
if (check_upload_max_filesize()) {
?>
<div class="alert alert-success">
<span class="glyphicon glyphicon-check"></span>
<strong>Your upload_max_filesize is <?php echo ini_get('upload_max_filesize'); ?></strong>
</div>
<?php
} else {
?>
<div class="alert alert-danger">
<span class="glyphicon glyphicon-unchecked"></span>
<strong>Your upload_max_filesize is <?php echo ini_get('upload_max_filesize'); ?>, it must be at least 100M</strong>
<details>
Edit the <code>php.ini</code> file
<br>
<pre><code>sudo nano <?php echo $pathToPHPini; ?></code></pre>
</details>
</div>
<?php
} ?>
</div>
</div>
</div>
<form id="configurationForm">
<div class="col-md-4">
<div class="panel panel-default">
<div class="panel-heading"><i class="fas fa-play-circle"></i> Site Configuration</div>
<div class="panel-body">
<div class="form-group">
<label for="webSiteRootURL">Your Site URL</label>
<input type="text" class="form-control" id="webSiteRootURL" placeholder="Enter your URL (http://yoursite.com)" value="<?php echo getURLToApplication(); ?>" required="required">
</div>
<div class="form-group">
<label for="systemRootPath">System Path to Application</label>
<input type="text" class="form-control" id="systemRootPath" placeholder="System Path to Application (/var/www/[application_path])" value="<?php echo getPathToApplication(); ?>" required="required">
</div>
<div class="row">
<div class="form-group col-md-8">
<label for="webSiteTitle">Title of your Web Site</label>
<input type="text" class="form-control" id="webSiteTitle" placeholder="Enter the title of your Web Site" value="AVideo" required="required">
</div>
<div class="form-group col-md-4">
<label for="mainLanguage">Language</label><br>
<select class="selectpicker" id="mainLanguage">
<?php
global $global;
include_once '../objects/bcp47.php';
$dir = "../locale/";
$flags = [];
if ($handle = opendir($dir)) {
while (false !== ($entry = readdir($handle))) {
if ($entry != '.' && $entry != '..' && $entry != 'index.php' && $entry != 'function.php' && $entry != 'save.php') {
$flags[] = str_replace('.php', '', $entry);
}
}
closedir($handle);
}
sort($flags);
foreach ($flags as $flag) {
//var_dump($global['bcp47'][$flag]);
$fileEx = $global['bcp47'][$flag]['flag'];
echo "<option data-content='<span class=\"flagstrap-icon flagstrap-$fileEx\"></span> {$global['bcp47'][$flag]['label']}' value=\"$fileEx\" " . (('us' == $fileEx) ? " selected" : "") . ">{$global['bcp47'][$flag]['label']}</option>";
} ?>
</select>
</div>
</div>
<div class="form-group">
<label for="contactEmail">Contact E-mail</label>
<input type="email" class="form-control" id="contactEmail" placeholder="Enter e-mail contact of your Web Site" required="required">
</div>
<div class="form-group">
<label for="systemAdminPass">System Admin password</label>
<?php
getInputPassword("systemAdminPass", 'class="form-control" required="required"', __("Enter System Admin password")); ?>
</div>
<div class="form-group">
<label for="confirmSystemAdminPass">Confirm System Admin password</label>
<?php
getInputPassword("confirmSystemAdminPass", 'class="form-control" required="required"', __("Confirm System Admin password")); ?>
</div>
</div>
</div>
</div>
<div class="col-md-4">
<div class="panel panel-default">
<div class="panel-heading"><i class="fas fa-database"></i> Database</div>
<div class="panel-body">
<div class="form-group">
<label for="databaseHost">Database Host</label>
<input type="text" class="form-control" id="databaseHost" placeholder="Enter Database Host" value="localhost" required="required">
</div>
<div class="form-group">
<label for="databasePort">Database Port</label>
<input type="text" class="form-control" id="databasePort" placeholder="Enter Database Port" value="3306" required="required">
</div>
<div class="form-group">
<label for="databaseUser">Database User</label>
<input type="text" class="form-control" id="databaseUser" placeholder="Enter Database User" value="avideo" required="required">
</div>
<div class="form-group">
<label for="databasePass">Database Password</label>
<?php
getInputPassword("databasePass", 'class="form-control"', __("Enter Database Password")); ?>
</div>
<div class="form-group">
<label for="databaseName">Database Name</label>
<input type="text" class="form-control" id="databaseName" placeholder="Enter Database Name" value="avideo" required="required">
</div>
<div class="form-group">
<label for="createTables">Do you want to create database and tables?</label><br>
<select class="selectpicker" id="createTables">
<option value="2">Create database and tables</option>
<option value="1">Create only tables (Do not create database)</option>
<option value="0">Do not create any, I will import the script manually</option>
</select>
</div>
</div>
</div>
</div>
<div class="col-md-12">
<button type="submit" class="btn btn-primary btn-block"><i class="fas fa-cogs"></i> Install now</button>
</div>
</form>
</div>
</div>
<?php
} ?>
<script src="../view/bootstrap/js/bootstrap.min.js" type="text/javascript"></script>
<script src="../view/css/flagstrap/js/jquery.flagstrap.min.js" type="text/javascript"></script>
<script src="../view/bootstrap/bootstrapSelectPicker/js/bootstrap-select.min.js" type="text/javascript"></script>
<script src="../node_modules/sweetalert/dist/sweetalert.min.js" type="text/javascript"></script>
<script src="../view/js/jquery.lazy/jquery.lazy.min.js" type="text/javascript"></script>
<script src="../view/js/jquery.lazy/jquery.lazy.plugins.min.js" type="text/javascript"></script>
<script src="../view/js/js-cookie/js.cookie.js" type="text/javascript"></script>
<script src="../view/js/script.js" type="text/javascript"></script>
<script>
$(function () {
$('.selectpicker').selectpicker();
$('#configurationForm').submit(function (evt) {
evt.preventDefault();
var systemAdminPass = $('#systemAdminPass').val();
var confirmSystemAdminPass = $('#confirmSystemAdminPass').val();
if (!systemAdminPass) {
avideoAlert("Sorry!", "Your System Admin Password can not be blank!", "error");
return false;
}
if (systemAdminPass != confirmSystemAdminPass) {
avideoAlert("Sorry!", "Your System Admin Password must be confirmed!", "error");
return false;
}
modal.showPleaseWait();
var webSiteRootURL = $('#webSiteRootURL').val();
var systemRootPath = $('#systemRootPath').val();
var webSiteTitle = $('#webSiteTitle').val();
var databaseHost = $('#databaseHost').val();
var databasePort = $('#databasePort').val();
var databaseUser = $('#databaseUser').val();
var databasePass = $('#databasePass').val();
var databaseName = $('#databaseName').val();
var mainLanguage = $('#mainLanguage').val();
var contactEmail = $('#contactEmail').val();
var createTables = $('#createTables').val();
$.ajax({
url: webSiteRootURL + 'install/checkConfiguration.php',
data: {
webSiteRootURL: webSiteRootURL,
systemRootPath: systemRootPath,
webSiteTitle: webSiteTitle,
databaseHost: databaseHost,
databasePort: databasePort,
databaseUser: databaseUser,
databasePass: databasePass,
databaseName: databaseName,
mainLanguage: mainLanguage,
systemAdminPass: systemAdminPass,
contactEmail: contactEmail,
createTables: createTables
},
type: 'post',
success: function (response) {
modal.hidePleaseWait();
if (response.error) {
avideoAlert("Sorry!", response.error, "error");
} else {
avideoAlert("Congratulations!", response.error, "success");
window.location.reload(false);
}
},
error: function (xhr, ajaxOptions, thrownError) {
modal.hidePleaseWait();
if (xhr.status == 404) {
avideoAlert("Sorry!", "Your Site URL is wrong!", "error");
} else {
avideoAlert("Sorry!", "Unknown error!", "error");
}
}
});
});
});
</script>
</body>
</html>
<?php
require_once '../objects/functions.php';
require_once '../locale/function.php';
//var_dump($_SERVER);exit;
?>
<!DOCTYPE html>
<html lang="en">
<head>
<title>Install AVideo</title>
<script src="../node_modules/jquery/dist/jquery.min.js" type="text/javascript"></script>
<link rel="icon" href="../view/img/favicon.png">
<link href="../view/bootstrap/css/bootstrap.min.css" rel="stylesheet" type="text/css"/>
<link href="../view/bootstrap/bootstrapSelectPicker/css/bootstrap-select.min.css" rel="stylesheet" type="text/css"/>
<link href="../node_modules/@fortawesome/fontawesome-free/css/all.min.css" rel="stylesheet" type="text/css"/>
<link href="../view/css/flagstrap/css/flags.css" rel="stylesheet" type="text/css"/>
<style>
.bootstrap-select{
width: 100% !important;
}
</style>
</head>
<body>
<?php
if (file_exists('../videos/configuration.php')) {
require_once '../videos/configuration.php'; ?>
<div class="container">
<h3 class="alert alert-success">
<span class="glyphicon glyphicon-ok-circle"></span>
Your system is installed, remove the <code><?php echo $global['systemRootPath']; ?>install</code> directory to continue
<hr>
<a href="<?php echo $global['webSiteRootURL']; ?>" class="btn btn-success btn-lg center-block">Go to the main page</a>
</h3>
</div>
<?php
} else {
?>
<div class="container">
<img src="../view/img/logo.png" alt="Logo" class="img img-responsive center-block"/>
<div class="row">
<div class="col-md-4">
<div class="panel panel-default">
<div class="panel-heading"><i class="fas fa-tasks"></i> Check list</div>
<div class="panel-body">
<?php
if (isApache()) {
?>
<div class="alert alert-success">
<span class="glyphicon glyphicon-check"></span>
<strong><?php echo $_SERVER['SERVER_SOFTWARE']; ?> is Present</strong>
</div>
<?php
} else {
?>
<div class="alert alert-danger">
<span class="glyphicon glyphicon-unchecked"></span>
<strong>Your server is <?php echo $_SERVER['SERVER_SOFTWARE']; ?>, you must install Apache</strong>
</div>
<?php
} ?>
<?php
if (isPHP('7.3')) {
?>
<div class="alert alert-success">
<span class="glyphicon glyphicon-check"></span>
<strong>PHP <?php echo PHP_VERSION; ?> is present.</strong>
</div>
<?php
} else {
?>
<div class="alert alert-warning">
<span class="glyphicon glyphicon-exclamation-sign"></span>
<strong>Your PHP version is <?php echo PHP_VERSION; ?>. PHP 7.3 or newer is required.</strong>
</div>
<?php
} ?>
<?php
if (checkVideosDir()) {
?>
<div class="alert alert-success">
<span class="glyphicon glyphicon-check"></span>
<strong>Your videos directory is writable</strong>
</div>
<?php
} else {
?>
<div class="alert alert-danger">
<span class="glyphicon glyphicon-unchecked"></span>
<strong>Your videos directory must be writable</strong>
<details>
<?php
$dir = getPathToApplication() . "videos";
if (!file_exists($dir)) {
?>
The video directory does not exists, AVideo had no permition to create it, you must create it manualy!
<br>
<pre><code>sudo mkdir <?php echo $dir; ?></code></pre>
<?php
} ?>
<br>
Then you can set the permissions (www-data means apache user).
<br>
<pre><code>sudo chown www-data:www-data <?php echo $dir; ?> && sudo chmod 755 <?php echo $dir; ?> </code></pre>
</details>
</div>
<?php
}
$pathToPHPini = php_ini_loaded_file();
if (empty($pathToPHPini)) {
$pathToPHPini = "/etc/php/7.0/cli/php.ini";
} ?>
<?php
if (check_post_max_size()) {
?>
<div class="alert alert-success">
<span class="glyphicon glyphicon-check"></span>
<strong>Your post_max_size is <?php echo ini_get('post_max_size'); ?></strong>
</div>
<?php
} else {
?>
<div class="alert alert-danger">
<span class="glyphicon glyphicon-unchecked"></span>
<strong>Your post_max_size is <?php echo ini_get('post_max_size'); ?>, it must be at least 100M</strong>
<details>
Edit the <code>php.ini</code> file
<br>
<pre><code>sudo nano <?php echo $pathToPHPini; ?></code></pre>
</details>
</div>
<?php
} ?>
<?php
if (check_upload_max_filesize()) {
?>
<div class="alert alert-success">
<span class="glyphicon glyphicon-check"></span>
<strong>Your upload_max_filesize is <?php echo ini_get('upload_max_filesize'); ?></strong>
</div>
<?php
} else {
?>
<div class="alert alert-danger">
<span class="glyphicon glyphicon-unchecked"></span>
<strong>Your upload_max_filesize is <?php echo ini_get('upload_max_filesize'); ?>, it must be at least 100M</strong>
<details>
Edit the <code>php.ini</code> file
<br>
<pre><code>sudo nano <?php echo $pathToPHPini; ?></code></pre>
</details>
</div>
<?php
} ?>
</div>
</div>
</div>
<form id="configurationForm">
<div class="col-md-4">
<div class="panel panel-default">
<div class="panel-heading"><i class="fas fa-play-circle"></i> Site Configuration</div>
<div class="panel-body">
<div class="form-group">
<label for="webSiteRootURL">Your Site URL</label>
<input type="text" class="form-control" id="webSiteRootURL" placeholder="Enter your URL (http://yoursite.com)" value="<?php echo getURLToApplication(); ?>" required="required">
</div>
<div class="form-group">
<label for="systemRootPath">System Path to Application</label>
<input type="text" class="form-control" id="systemRootPath" placeholder="System Path to Application (/var/www/[application_path])" value="<?php echo getPathToApplication(); ?>" required="required">
</div>
<div class="row">
<div class="form-group col-md-8">
<label for="webSiteTitle">Title of your Web Site</label>
<input type="text" class="form-control" id="webSiteTitle" placeholder="Enter the title of your Web Site" value="AVideo" required="required">
</div>
<div class="form-group col-md-4">
<label for="mainLanguage">Language</label><br>
<select class="selectpicker" id="mainLanguage">
<?php
global $global;
include_once '../objects/bcp47.php';
$dir = "../locale/";
$flags = [];
if ($handle = opendir($dir)) {
while (false !== ($entry = readdir($handle))) {
if ($entry != '.' && $entry != '..' && $entry != 'index.php' && $entry != 'function.php' && $entry != 'save.php') {
$flags[] = str_replace('.php', '', $entry);
}
}
closedir($handle);
}
sort($flags);
foreach ($flags as $flag) {
//var_dump($global['bcp47'][$flag]);
$fileEx = $global['bcp47'][$flag]['flag'];
echo "<option data-content='<span class=\"flagstrap-icon flagstrap-$fileEx\"></span> {$global['bcp47'][$flag]['label']}' value=\"$fileEx\" " . (('us' == $fileEx) ? " selected" : "") . ">{$global['bcp47'][$flag]['label']}</option>";
} ?>
</select>
</div>
</div>
<div class="form-group">
<label for="contactEmail">Contact E-mail</label>
<input type="email" class="form-control" id="contactEmail" placeholder="Enter e-mail contact of your Web Site" required="required">
</div>
<div class="form-group">
<label for="systemAdminPass">System Admin password</label>
<?php
getInputPassword("systemAdminPass", 'class="form-control" required="required"', __("Enter System Admin password")); ?>
</div>
<div class="form-group">
<label for="confirmSystemAdminPass">Confirm System Admin password</label>
<?php
getInputPassword("confirmSystemAdminPass", 'class="form-control" required="required"', __("Confirm System Admin password")); ?>
</div>
</div>
</div>
</div>
<div class="col-md-4">
<div class="panel panel-default">
<div class="panel-heading"><i class="fas fa-database"></i> Database</div>
<div class="panel-body">
<div class="form-group">
<label for="databaseHost">Database Host</label>
<input type="text" class="form-control" id="databaseHost" placeholder="Enter Database Host" value="localhost" required="required">
</div>
<div class="form-group">
<label for="databasePort">Database Port</label>
<input type="text" class="form-control" id="databasePort" placeholder="Enter Database Port" value="3306" required="required">
</div>
<div class="form-group">
<label for="databaseUser">Database User</label>
<input type="text" class="form-control" id="databaseUser" placeholder="Enter Database User" value="avideo" required="required">
</div>
<div class="form-group">
<label for="databasePass">Database Password</label>
<?php
getInputPassword("databasePass", 'class="form-control"', __("Enter Database Password")); ?>
</div>
<div class="form-group">
<label for="databaseName">Database Name</label>
<input type="text" class="form-control" id="databaseName" placeholder="Enter Database Name" value="avideo" required="required">
</div>
<div class="form-group">
<label for="createTables">Do you want to create database and tables?</label><br>
<select class="selectpicker" id="createTables">
<option value="2">Create database and tables</option>
<option value="1">Create only tables (Do not create database)</option>
<option value="0">Do not create any, I will import the script manually</option>
</select>
</div>
</div>
</div>
</div>
<div class="col-md-12">
<button type="submit" class="btn btn-primary btn-block"><i class="fas fa-cogs"></i> Install now</button>
</div>
</form>
</div>
</div>
<?php
} ?>
<script src="../view/bootstrap/js/bootstrap.min.js" type="text/javascript"></script>
<script src="../view/css/flagstrap/js/jquery.flagstrap.min.js" type="text/javascript"></script>
<script src="../view/bootstrap/bootstrapSelectPicker/js/bootstrap-select.min.js" type="text/javascript"></script>
<script src="../node_modules/sweetalert/dist/sweetalert.min.js" type="text/javascript"></script>
<script src="../view/js/jquery.lazy/jquery.lazy.min.js" type="text/javascript"></script>
<script src="../view/js/jquery.lazy/jquery.lazy.plugins.min.js" type="text/javascript"></script>
<script src="../view/js/js-cookie/js.cookie.js" type="text/javascript"></script>
<script src="../view/js/script.js" type="text/javascript"></script>
<script>
$(function () {
$('.selectpicker').selectpicker();
$('#configurationForm').submit(function (evt) {
evt.preventDefault();
var systemAdminPass = $('#systemAdminPass').val();
var confirmSystemAdminPass = $('#confirmSystemAdminPass').val();
if (!systemAdminPass) {
avideoAlert("Sorry!", "Your System Admin Password can not be blank!", "error");
return false;
}
if (systemAdminPass != confirmSystemAdminPass) {
avideoAlert("Sorry!", "Your System Admin Password must be confirmed!", "error");
return false;
}
modal.showPleaseWait();
var webSiteRootURL = $('#webSiteRootURL').val();
var systemRootPath = $('#systemRootPath').val();
var webSiteTitle = $('#webSiteTitle').val();
var databaseHost = $('#databaseHost').val();
var databasePort = $('#databasePort').val();
var databaseUser = $('#databaseUser').val();
var databasePass = $('#databasePass').val();
var databaseName = $('#databaseName').val();
var mainLanguage = $('#mainLanguage').val();
var contactEmail = $('#contactEmail').val();
var createTables = $('#createTables').val();
$.ajax({
url: webSiteRootURL + 'install/checkConfiguration.php',
data: {
webSiteRootURL: webSiteRootURL,
systemRootPath: systemRootPath,
webSiteTitle: webSiteTitle,
databaseHost: databaseHost,
databasePort: databasePort,
databaseUser: databaseUser,
databasePass: databasePass,
databaseName: databaseName,
mainLanguage: mainLanguage,
systemAdminPass: systemAdminPass,
contactEmail: contactEmail,
createTables: createTables
},
type: 'post',
success: function (response) {
modal.hidePleaseWait();
if (response.error) {
avideoAlert("Sorry!", response.error, "error");
} else {
avideoAlert("Congratulations!", response.error, "success");
window.location.reload(false);
}
},
error: function (xhr, ajaxOptions, thrownError) {
modal.hidePleaseWait();
if (xhr.status == 404) {
avideoAlert("Sorry!", "Your Site URL is wrong!", "error");
} else {
avideoAlert("Sorry!", "Unknown error!", "error");
}
}
});
});
});
</script>
</body>
</html>

View file

@ -1,58 +1,58 @@
<?php
require_once '../objects/functions.php';
if (!isCommandLineInterface()) {
die('Command Line only');
}
if (file_exists("../videos/configuration.php")) {
die("Can not create configuration again: " . json_encode($_SERVER));
}
$databaseUser = "youphptube";
$databasePass = "youphptube";
if (version_compare(phpversion(), '7.2', '<')) {
$databaseUser = "root";
}
$webSiteRootURL = @$argv[1];
$webSiteRootURL = preg_replace("/[^0-9a-z._\/:-]/i", "", trim($webSiteRootURL));
$databaseUser = empty($argv[2]) ? $databaseUser : $argv[2];
$databasePass = empty($argv[3]) ? $databasePass : $argv[3];
$systemAdminPass = empty($argv[4]) ? "123" : $argv[4];
$contactEmail = empty($argv[5]) ? "undefined@youremail.com" : $argv[5];
if (!filter_var($webSiteRootURL, FILTER_VALIDATE_URL)) {
if (!empty($webSiteRootURL)) {
echo "Invalid Site URL ({$webSiteRootURL})\n";
}
echo "Enter Site URL\n";
@ob_flush();
$webSiteRootURL = trim(readline(""));
if (!filter_var($webSiteRootURL, FILTER_VALIDATE_URL)) {
die("Invalid Site URL ({$webSiteRootURL})\n");
}
}
$webSiteRootURL = rtrim($webSiteRootURL, '/') . '/';
$_POST['systemRootPath'] = str_replace("install", "", getcwd());
if (!is_dir($_POST['systemRootPath'])) {
$_POST['systemRootPath'] = "/var/www/html/YouPHPTube/";
if (!is_dir($_POST['systemRootPath'])) {
$_POST['systemRootPath'] = "/var/www/html/AVideo/";
}
}
$_POST['databaseHost'] = "localhost";
$_POST['databaseUser'] = $databaseUser;
$_POST['databasePass'] = $databasePass;
$_POST['databasePort'] = "3306";
$_POST['databaseName'] = "AVideo_". preg_replace("/[^0-9a-z]/i", "", parse_url($webSiteRootURL, PHP_URL_HOST));
$_POST['createTables'] = 2;
$_POST['contactEmail'] = $contactEmail;
$_POST['systemAdminPass'] = $systemAdminPass;
$_POST['mainLanguage'] = "en";
$_POST['webSiteTitle'] = "AVideo";
$_POST['webSiteRootURL'] = $webSiteRootURL;
include './checkConfiguration.php';
<?php
require_once '../objects/functions.php';
if (!isCommandLineInterface()) {
die('Command Line only');
}
if (file_exists("../videos/configuration.php")) {
die("Can not create configuration again: " . json_encode($_SERVER));
}
$databaseUser = "youphptube";
$databasePass = "youphptube";
if (version_compare(phpversion(), '7.2', '<')) {
$databaseUser = "root";
}
$webSiteRootURL = @$argv[1];
$webSiteRootURL = preg_replace("/[^0-9a-z._\/:-]/i", "", trim($webSiteRootURL));
$databaseUser = empty($argv[2]) ? $databaseUser : $argv[2];
$databasePass = empty($argv[3]) ? $databasePass : $argv[3];
$systemAdminPass = empty($argv[4]) ? "123" : $argv[4];
$contactEmail = empty($argv[5]) ? "undefined@youremail.com" : $argv[5];
if (!filter_var($webSiteRootURL, FILTER_VALIDATE_URL)) {
if (!empty($webSiteRootURL)) {
echo "Invalid Site URL ({$webSiteRootURL})\n";
}
echo "Enter Site URL\n";
@ob_flush();
$webSiteRootURL = trim(readline(""));
if (!filter_var($webSiteRootURL, FILTER_VALIDATE_URL)) {
die("Invalid Site URL ({$webSiteRootURL})\n");
}
}
$webSiteRootURL = rtrim($webSiteRootURL, '/') . '/';
$_POST['systemRootPath'] = str_replace("install", "", getcwd());
if (!is_dir($_POST['systemRootPath'])) {
$_POST['systemRootPath'] = "/var/www/html/YouPHPTube/";
if (!is_dir($_POST['systemRootPath'])) {
$_POST['systemRootPath'] = "/var/www/html/AVideo/";
}
}
$_POST['databaseHost'] = "localhost";
$_POST['databaseUser'] = $databaseUser;
$_POST['databasePass'] = $databasePass;
$_POST['databasePort'] = "3306";
$_POST['databaseName'] = "AVideo_". preg_replace("/[^0-9a-z]/i", "", parse_url($webSiteRootURL, PHP_URL_HOST));
$_POST['createTables'] = 2;
$_POST['contactEmail'] = $contactEmail;
$_POST['systemAdminPass'] = $systemAdminPass;
$_POST['mainLanguage'] = "en";
$_POST['webSiteTitle'] = "AVideo";
$_POST['webSiteRootURL'] = $webSiteRootURL;
include './checkConfiguration.php';

View file

@ -1,153 +1,153 @@
<?php
//streamer config
require_once '../videos/configuration.php';
if (!isCommandLineInterface()) {
return die('Command Line only');
}
function _rsearch($folder, $pattern)
{
$dir = new RecursiveDirectoryIterator($folder);
$ite = new RecursiveIteratorIterator($dir);
$files = new RegexIterator($ite, $pattern, RegexIterator::GET_MATCH);
$fileList = [];
foreach ($files as $file) {
foreach ($file as $key => $value) {
$file[$key] = "{$folder}{$dir}/{$value}";
}
$fileList = array_merge($fileList, $file);
}
usort(
$fileList,
function ($a, $b) {
return preg_match('/SendRecordedToEncoder/', $a) ? 1 : 0;
}
);
return $fileList;
}
$option = intval(@$argv[1]);
if (empty($option)) {
echo "1 - Install tables and enable plugins\n";
echo "2 - Install tables only\n";
echo "3 - Enable plugins only\n";
echo "4 - Update plugins only\n";
echo "Choose an option: ";
ob_flush();
$option = trim(readline(""));
}
if ($option == 1 || $option == 2) {
$files = _rsearch("{$global['systemRootPath']}plugin/", "/install\/install.sql$/i");
$templine = '';
$global['mysqli']->begin_transaction();
$totalFiles = count($files);
$countFiles = 0;
foreach ($files as $value) {
$countFiles++;
$lines = file($value);
$totalLines = count($lines);
$countLines = 0;
foreach ($lines as $line) {
$countLines++;
if (substr($line, 0, 2) == '--' || $line == '') {
continue;
}
$templine .= $line;
if (substr(trim($line), -1, 1) == ';') {
try {
if (!$global['mysqli']->query($templine)) {
echo($value . ' Error performing query \'<strong>' . $templine . '\': ' . $global['mysqli']->error . '<br /><br />');
die(json_encode($obj));
} else {
echo "[{$countFiles}/{$totalFiles}][{$countLines}/{$totalLines}] Success performing query from $value\n";
}
} catch (Exception $exc) {
echo $exc->getTraceAsString();
}
$templine = '';
}
}
}
$global['mysqli']->commit();
}
if ($option == 1 || $option == 3) {
$EnablePlugins = [
['1apicbec-91db-4357-bb10-ee08b0913778', 'API', 'API'],
['6daca392-7b14-44fb-aa33-51cba620d92e', 'CookieAlert', 'CookieAlert'],
['55a4fa56-8a30-48d4-a0fb-8aa6b3f69033', 'CustomizeAdvanced', 'CustomizeAdvanced'],
['55a4fa56-8a30-48d4-a0fb-8aa6b3fuser3', 'CustomizeUser', 'CustomizeUser'],
['a06505bf-3570-4b1f-977a-fd0e5cab205d', 'Gallery', 'Gallery'],
['e06b161c-cbd0-4c1d-a484-71018efa2f35', 'Live', 'Live'],
['5310b394-b54f-48ab-9049-995df4d95239', 'NextButton', 'NextButton'],
['plist12345-370-4b1f-977a-fd0e5cabtube', 'Programs', 'PlayLists'],
['b5e223db-785b-4436-8f7b-f297860c9be0', 'ReportVideo', 'ReportVideo'],
['f7596843-51b1-47a0-8bb1-b4ad91f87d6b', 'TheaterButton', 'TheaterButton'],
['45432a78-d0c6-47f3-8ac4-8fd05f507386', 'User_Location', 'User_Location'],
['4c1f4f76-b336-4ddc-a4de-184efe715c09', 'MobileManager', 'MobileManager'],
['52chata2-3f14-49db-958e-15ccb1a07f0e', 'Chat2', 'Chat2'],
['cf145581-7d5e-4bb6-8c12-48fc37c0630d', 'LiveUsers', 'LiveUsers'],
['996c9afb-b90e-40ca-90cb-934856180bb9', 'MP4ThumbsAndGif', 'MP4ThumbsAndGif'],
['eb6e2808-d876-4488-94cb-2448a6b14e0b', 'SendRecordedToEncoder', 'SendRecordedToEncoder'],
['f2hls8c6-9359-4cc1-809f-fac32c8a4333', 'VideoHLS', 'VideoHLS'],
['4b9142c0-f0c3-42be-8fe5-a4775111239c', 'VideoResolutionSwitcher', 'VideoResolutionSwitcher'],
['28e74f9a-a2ef-4644-86f0-40234ae7c1b5', 'VideoThumbnails', 'VideoThumbnails'],
['meet225-3807-4167-ba81-0509dd280e06', 'Meet', 'Meet'],
['YPTSocket-5ee8405eaaa16', 'YPTSocket', 'YPTSocket'],
['Scheduler-5ee8405eaaa16', 'Scheduler', 'Scheduler'],
];
foreach ($EnablePlugins as $value) {
if ($plugin = Plugin::getOrCreatePluginByName($value[2], 'active')) {
echo "Success enable plugin ($value[2]) " . $plugin['name'] . "\n";
} else {
echo "ERROR enable plugin ($value[2]) \n";
}
}
}
if ($option == 4) {
echo "Searching for {$global['systemRootPath']}plugin/[plugin]/install/install.sql" . PHP_EOL;
$files = _rsearch("{$global['systemRootPath']}plugin/", "/install\/install.sql$/i");
$templine = '';
foreach ($files as $value) {
if (preg_match("/User_Location/", $value)) {
continue;
}
if (preg_match("/Customize/", $value)) {
continue;
}
echo "Checking tables from {$value}" . PHP_EOL;
$lines = file($value);
foreach ($lines as $line) {
if (substr($line, 0, 2) == '--' || $line == '') {
continue;
}
$templine .= $line;
if (substr(trim($line), -1, 1) == ';') {
if (!$global['mysqli']->query($templine)) {
echo($value . ' Error performing query \'<strong>' . $templine . '\': ' . $global['mysqli']->error . '<br /><br />');
//die(json_encode($obj));
} else {
echo "Success performing query from $value\n";
}
$templine = '';
}
}
}
$plugins = Plugin::getAvailablePlugins();
foreach ($plugins as $value) {
$p = AVideoPlugin::loadPlugin($value->dir);
if (empty($p)) {
continue;
}
$currentVersion = $p->getPluginVersion();
if (AVideoPlugin::updatePlugin($value->dir)) {
$p = AVideoPlugin::loadPlugin($value->dir, true);
$newVersion = $p->getPluginVersion();
echo "{$value->dir} updated FROM {$currentVersion} TO {$newVersion}" . PHP_EOL;
}
}
}
echo "Option {$option} finished \n";
<?php
//streamer config
require_once '../videos/configuration.php';
if (!isCommandLineInterface()) {
return die('Command Line only');
}
function _rsearch($folder, $pattern)
{
$dir = new RecursiveDirectoryIterator($folder);
$ite = new RecursiveIteratorIterator($dir);
$files = new RegexIterator($ite, $pattern, RegexIterator::GET_MATCH);
$fileList = [];
foreach ($files as $file) {
foreach ($file as $key => $value) {
$file[$key] = "{$folder}{$dir}/{$value}";
}
$fileList = array_merge($fileList, $file);
}
usort(
$fileList,
function ($a, $b) {
return preg_match('/SendRecordedToEncoder/', $a) ? 1 : 0;
}
);
return $fileList;
}
$option = intval(@$argv[1]);
if (empty($option)) {
echo "1 - Install tables and enable plugins\n";
echo "2 - Install tables only\n";
echo "3 - Enable plugins only\n";
echo "4 - Update plugins only\n";
echo "Choose an option: ";
ob_flush();
$option = trim(readline(""));
}
if ($option == 1 || $option == 2) {
$files = _rsearch("{$global['systemRootPath']}plugin/", "/install\/install.sql$/i");
$templine = '';
$global['mysqli']->begin_transaction();
$totalFiles = count($files);
$countFiles = 0;
foreach ($files as $value) {
$countFiles++;
$lines = file($value);
$totalLines = count($lines);
$countLines = 0;
foreach ($lines as $line) {
$countLines++;
if (substr($line, 0, 2) == '--' || $line == '') {
continue;
}
$templine .= $line;
if (substr(trim($line), -1, 1) == ';') {
try {
if (!$global['mysqli']->query($templine)) {
echo($value . ' Error performing query \'<strong>' . $templine . '\': ' . $global['mysqli']->error . '<br /><br />');
die(json_encode($obj));
} else {
echo "[{$countFiles}/{$totalFiles}][{$countLines}/{$totalLines}] Success performing query from $value\n";
}
} catch (Exception $exc) {
echo $exc->getTraceAsString();
}
$templine = '';
}
}
}
$global['mysqli']->commit();
}
if ($option == 1 || $option == 3) {
$EnablePlugins = [
['1apicbec-91db-4357-bb10-ee08b0913778', 'API', 'API'],
['6daca392-7b14-44fb-aa33-51cba620d92e', 'CookieAlert', 'CookieAlert'],
['55a4fa56-8a30-48d4-a0fb-8aa6b3f69033', 'CustomizeAdvanced', 'CustomizeAdvanced'],
['55a4fa56-8a30-48d4-a0fb-8aa6b3fuser3', 'CustomizeUser', 'CustomizeUser'],
['a06505bf-3570-4b1f-977a-fd0e5cab205d', 'Gallery', 'Gallery'],
['e06b161c-cbd0-4c1d-a484-71018efa2f35', 'Live', 'Live'],
['5310b394-b54f-48ab-9049-995df4d95239', 'NextButton', 'NextButton'],
['plist12345-370-4b1f-977a-fd0e5cabtube', 'Programs', 'PlayLists'],
['b5e223db-785b-4436-8f7b-f297860c9be0', 'ReportVideo', 'ReportVideo'],
['f7596843-51b1-47a0-8bb1-b4ad91f87d6b', 'TheaterButton', 'TheaterButton'],
['45432a78-d0c6-47f3-8ac4-8fd05f507386', 'User_Location', 'User_Location'],
['4c1f4f76-b336-4ddc-a4de-184efe715c09', 'MobileManager', 'MobileManager'],
['52chata2-3f14-49db-958e-15ccb1a07f0e', 'Chat2', 'Chat2'],
['cf145581-7d5e-4bb6-8c12-48fc37c0630d', 'LiveUsers', 'LiveUsers'],
['996c9afb-b90e-40ca-90cb-934856180bb9', 'MP4ThumbsAndGif', 'MP4ThumbsAndGif'],
['eb6e2808-d876-4488-94cb-2448a6b14e0b', 'SendRecordedToEncoder', 'SendRecordedToEncoder'],
['f2hls8c6-9359-4cc1-809f-fac32c8a4333', 'VideoHLS', 'VideoHLS'],
['4b9142c0-f0c3-42be-8fe5-a4775111239c', 'VideoResolutionSwitcher', 'VideoResolutionSwitcher'],
['28e74f9a-a2ef-4644-86f0-40234ae7c1b5', 'VideoThumbnails', 'VideoThumbnails'],
['meet225-3807-4167-ba81-0509dd280e06', 'Meet', 'Meet'],
['YPTSocket-5ee8405eaaa16', 'YPTSocket', 'YPTSocket'],
['Scheduler-5ee8405eaaa16', 'Scheduler', 'Scheduler'],
];
foreach ($EnablePlugins as $value) {
if ($plugin = Plugin::getOrCreatePluginByName($value[2], 'active')) {
echo "Success enable plugin ($value[2]) " . $plugin['name'] . "\n";
} else {
echo "ERROR enable plugin ($value[2]) \n";
}
}
}
if ($option == 4) {
echo "Searching for {$global['systemRootPath']}plugin/[plugin]/install/install.sql" . PHP_EOL;
$files = _rsearch("{$global['systemRootPath']}plugin/", "/install\/install.sql$/i");
$templine = '';
foreach ($files as $value) {
if (preg_match("/User_Location/", $value)) {
continue;
}
if (preg_match("/Customize/", $value)) {
continue;
}
echo "Checking tables from {$value}" . PHP_EOL;
$lines = file($value);
foreach ($lines as $line) {
if (substr($line, 0, 2) == '--' || $line == '') {
continue;
}
$templine .= $line;
if (substr(trim($line), -1, 1) == ';') {
if (!$global['mysqli']->query($templine)) {
echo($value . ' Error performing query \'<strong>' . $templine . '\': ' . $global['mysqli']->error . '<br /><br />');
//die(json_encode($obj));
} else {
echo "Success performing query from $value\n";
}
$templine = '';
}
}
}
$plugins = Plugin::getAvailablePlugins();
foreach ($plugins as $value) {
$p = AVideoPlugin::loadPlugin($value->dir);
if (empty($p)) {
continue;
}
$currentVersion = $p->getPluginVersion();
if (AVideoPlugin::updatePlugin($value->dir)) {
$p = AVideoPlugin::loadPlugin($value->dir, true);
$newVersion = $p->getPluginVersion();
echo "{$value->dir} updated FROM {$currentVersion} TO {$newVersion}" . PHP_EOL;
}
}
}
echo "Option {$option} finished \n";

View file

@ -1,29 +1,29 @@
<?php
//streamer config
require_once '../videos/configuration.php';
if (!isCommandLineInterface()) {
return die('Command Line only');
}
AVideoPlugin::loadPlugin("Live");
$channelName = $global['mysqli']->real_escape_string($channelName);
$sql = "SELECT lt.*, u.* FROM users u LEFT JOIN live_transmitions lt ON users_id = u.id "
. " WHERE canStream = 1 AND status = 'a' ORDER BY public DESC LIMIT 20";
$res = sqlDAL::readSql($sql);
$users = sqlDAL::fetchAllAssoc($res);
sqlDAL::close($res);
if ($res != false) {
foreach ($users as $row) {
echo "-----------------------------------".PHP_EOL;
if (!empty($row['public'])) {
echo "PUBLIC ";
}
echo "{$row['id']} - {$row['user']} ".PHP_EOL;
echo Live::getServer() . "?p=" . $row['password'] . "/" . $row['key'].PHP_EOL;
echo Live::getLinkToLiveFromUsers_id($row['id']).PHP_EOL;
echo "-----------------------------------".PHP_EOL;
}
}
die();
<?php
//streamer config
require_once '../videos/configuration.php';
if (!isCommandLineInterface()) {
return die('Command Line only');
}
AVideoPlugin::loadPlugin("Live");
$channelName = $global['mysqli']->real_escape_string($channelName);
$sql = "SELECT lt.*, u.* FROM users u LEFT JOIN live_transmitions lt ON users_id = u.id "
. " WHERE canStream = 1 AND status = 'a' ORDER BY public DESC LIMIT 20";
$res = sqlDAL::readSql($sql);
$users = sqlDAL::fetchAllAssoc($res);
sqlDAL::close($res);
if ($res != false) {
foreach ($users as $row) {
echo "-----------------------------------".PHP_EOL;
if (!empty($row['public'])) {
echo "PUBLIC ";
}
echo "{$row['id']} - {$row['user']} ".PHP_EOL;
echo Live::getServer() . "?p=" . $row['password'] . "/" . $row['key'].PHP_EOL;
echo Live::getLinkToLiveFromUsers_id($row['id']).PHP_EOL;
echo "-----------------------------------".PHP_EOL;
}
}
die();

View file

@ -1,32 +1,32 @@
<?php
//streamer config
require_once '../videos/configuration.php';
if (!isCommandLineInterface()) {
return die('Command Line only');
}
echo "Enter the username or press enter to skip:";
echo "\n";
ob_flush();
$userName = trim(readline(""));
if (!empty($userName)) {
$user = new User(0, $userName, false);
if (!empty($user->getBdId())) {
$sql = "UPDATE users SET isAdmin = 1, status = 'a' where id = ".$user->getBdId();
$insert_row = sqlDAL::writeSql($sql);
if ($insert_row) {
echo "Your user {$userName} is admin now";
echo "\n";
die();
}
} else {
echo "User ({$userName}) Not found";
echo "\n";
die();
}
}
echo "Bye";
echo "\n";
die();
<?php
//streamer config
require_once '../videos/configuration.php';
if (!isCommandLineInterface()) {
return die('Command Line only');
}
echo "Enter the username or press enter to skip:";
echo "\n";
ob_flush();
$userName = trim(readline(""));
if (!empty($userName)) {
$user = new User(0, $userName, false);
if (!empty($user->getBdId())) {
$sql = "UPDATE users SET isAdmin = 1, status = 'a' where id = ".$user->getBdId();
$insert_row = sqlDAL::writeSql($sql);
if ($insert_row) {
echo "Your user {$userName} is admin now";
echo "\n";
die();
}
} else {
echo "User ({$userName}) Not found";
echo "\n";
die();
}
}
echo "Bye";
echo "\n";
die();

View file

@ -1,13 +1,13 @@
<?php
//streamer config
require_once '../videos/configuration.php';
if (!isCommandLineInterface()) {
return die('Command Line only');
}
$obj = AVideoPlugin::getDataObject('Live');
$result = !LiveTransmitionHistory::finishALL();
var_dump($result);
<?php
//streamer config
require_once '../videos/configuration.php';
if (!isCommandLineInterface()) {
return die('Command Line only');
}
$obj = AVideoPlugin::getDataObject('Live');
$result = !LiveTransmitionHistory::finishALL();
var_dump($result);

View file

@ -1,64 +1,64 @@
<?php
//streamer config
require_once '../videos/configuration.php';
if (!isCommandLineInterface()) {
return die('Command Line only');
}
set_time_limit(1800);
ini_set('max_execution_time', 1800);
$global['rowCount'] = $global['limitForUnlimitedVideos'] = 999999;
$path = getVideosDir();
$total = Video::getTotalVideos("", false, true, true, false, false);
$videos = Video::getAllVideosLight("", false, true, false);
$count = 0;
$isStorage = isAnyStorageEnabled();
foreach ($videos as $value) {
$count++;
$basename = "{$path}{$value['filename']}";
echo " {$count}/{$total} Searching {$basename} ".PHP_EOL;
$glob = glob("{$basename}*");
$totalItems = count($glob);
if ($totalItems) {
echo "Creating dir {$basename} " . PHP_EOL;
make_path(addLastSlash($basename));
}
echo "Found total of {$totalItems} items " . PHP_EOL;
$dirname = $basename.DIRECTORY_SEPARATOR;
$countItems = 0;
foreach ($glob as $file) {
$countItems++;
echo "[$countItems/$totalItems] Process file {$file} " . PHP_EOL;
if (is_dir($file)) {
if (!$isStorage && !Video::isNewVideoFilename($move['oldDir'])) {
//echo $file.PHP_EOL;
$move = Video::updateDirectoryFilename($file);
echo "-->".PHP_EOL." {$count}/{$total} move directory {$move['oldDir']} to {$move['newDir']} ".PHP_EOL."<--" . PHP_EOL . PHP_EOL;
} else {
echo " We will not rename directory {$file} ".PHP_EOL;
}
continue;
}
$filename = basename($file);
$newname = Video::getPathToFile($filename);
$renamed = rename($file, $newname);
if ($renamed) {
echo "{$count}/{$total} moved $filename to $newname" . PHP_EOL;
} else {
echo "{$count}/{$total} fail to move $filename to $newname" . PHP_EOL;
}
}
ob_flush();
}
echo PHP_EOL." Deleting cache ... ";
ObjectYPT::deleteALLCache();
$videosDir = Video::getStoragePath();
exec("chown -R www-data:www-data {$videosDir}");
exec("chmod -R 755 {$videosDir}");
echo PHP_EOL." Done! ".PHP_EOL;
die();
<?php
//streamer config
require_once '../videos/configuration.php';
if (!isCommandLineInterface()) {
return die('Command Line only');
}
set_time_limit(1800);
ini_set('max_execution_time', 1800);
$global['rowCount'] = $global['limitForUnlimitedVideos'] = 999999;
$path = getVideosDir();
$total = Video::getTotalVideos("", false, true, true, false, false);
$videos = Video::getAllVideosLight("", false, true, false);
$count = 0;
$isStorage = isAnyStorageEnabled();
foreach ($videos as $value) {
$count++;
$basename = "{$path}{$value['filename']}";
echo " {$count}/{$total} Searching {$basename} ".PHP_EOL;
$glob = glob("{$basename}*");
$totalItems = count($glob);
if ($totalItems) {
echo "Creating dir {$basename} " . PHP_EOL;
make_path(addLastSlash($basename));
}
echo "Found total of {$totalItems} items " . PHP_EOL;
$dirname = $basename.DIRECTORY_SEPARATOR;
$countItems = 0;
foreach ($glob as $file) {
$countItems++;
echo "[$countItems/$totalItems] Process file {$file} " . PHP_EOL;
if (is_dir($file)) {
if (!$isStorage && !Video::isNewVideoFilename($move['oldDir'])) {
//echo $file.PHP_EOL;
$move = Video::updateDirectoryFilename($file);
echo "-->".PHP_EOL." {$count}/{$total} move directory {$move['oldDir']} to {$move['newDir']} ".PHP_EOL."<--" . PHP_EOL . PHP_EOL;
} else {
echo " We will not rename directory {$file} ".PHP_EOL;
}
continue;
}
$filename = basename($file);
$newname = Video::getPathToFile($filename);
$renamed = rename($file, $newname);
if ($renamed) {
echo "{$count}/{$total} moved $filename to $newname" . PHP_EOL;
} else {
echo "{$count}/{$total} fail to move $filename to $newname" . PHP_EOL;
}
}
ob_flush();
}
echo PHP_EOL." Deleting cache ... ";
ObjectYPT::deleteALLCache();
$videosDir = Video::getStoragePath();
exec("chown -R www-data:www-data {$videosDir}");
exec("chmod -R 755 {$videosDir}");
echo PHP_EOL." Done! ".PHP_EOL;
die();

View file

@ -1,56 +1,56 @@
<?php
//streamer config
require_once '../videos/configuration.php';
if (!isCommandLineInterface()) {
return die('Command Line only');
}
set_time_limit(300);
ini_set('max_execution_time', 300);
$global['rowCount'] = $global['limitForUnlimitedVideos'] = 999999;
$path = getVideosDir();
$logFile = $global['logfile'];
echo "Open $logFile" . PHP_EOL;
$handle = fopen($logFile, "r");
$pattern = '/Video::updateDirectoryFilename video folder renamed from \[olddir=(.+)\] \[newdir=(.+)\]/';
if ($handle) {
while (($line = fgets($handle)) !== false) {
if (preg_match($pattern, $line, $matches)) {
//var_dump($matches);
if (!is_dir($matches[2])) {
continue;
}
$glob = glob("{$matches[1]}*");
$totalItems = count($glob);
echo "Found total of {$totalItems} items " . PHP_EOL;
$countItems = 0;
foreach ($glob as $file) {
if (is_dir($file)) {
continue;
}
$pathInfo = pathinfo($file);
$sourceFilename = Video::getCleanFilenameFromFile($file);
$filename = Video::getCleanFilenameFromFile($matches[2]);
$basename = str_replace($sourceFilename, $filename, $pathInfo['basename']);
$destinationFile = "{$matches[2]}{$basename}";
//var_dump($pathInfo, $basename,$filename, $sourceFilename, $destinationFile);
$countItems++;
echo "[$countItems/$totalItems] move file {$file} to {$destinationFile}" . PHP_EOL;
rename($file, $destinationFile);
}
}
// process the line read.
}
fclose($handle);
} else {
// error opening the file.
}
<?php
//streamer config
require_once '../videos/configuration.php';
if (!isCommandLineInterface()) {
return die('Command Line only');
}
set_time_limit(300);
ini_set('max_execution_time', 300);
$global['rowCount'] = $global['limitForUnlimitedVideos'] = 999999;
$path = getVideosDir();
$logFile = $global['logfile'];
echo "Open $logFile" . PHP_EOL;
$handle = fopen($logFile, "r");
$pattern = '/Video::updateDirectoryFilename video folder renamed from \[olddir=(.+)\] \[newdir=(.+)\]/';
if ($handle) {
while (($line = fgets($handle)) !== false) {
if (preg_match($pattern, $line, $matches)) {
//var_dump($matches);
if (!is_dir($matches[2])) {
continue;
}
$glob = glob("{$matches[1]}*");
$totalItems = count($glob);
echo "Found total of {$totalItems} items " . PHP_EOL;
$countItems = 0;
foreach ($glob as $file) {
if (is_dir($file)) {
continue;
}
$pathInfo = pathinfo($file);
$sourceFilename = Video::getCleanFilenameFromFile($file);
$filename = Video::getCleanFilenameFromFile($matches[2]);
$basename = str_replace($sourceFilename, $filename, $pathInfo['basename']);
$destinationFile = "{$matches[2]}{$basename}";
//var_dump($pathInfo, $basename,$filename, $sourceFilename, $destinationFile);
$countItems++;
echo "[$countItems/$totalItems] move file {$file} to {$destinationFile}" . PHP_EOL;
rename($file, $destinationFile);
}
}
// process the line read.
}
fclose($handle);
} else {
// error opening the file.
}

View file

@ -1,72 +1,72 @@
<?php
//streamer config
require_once '../videos/configuration.php';
if (!isCommandLineInterface()) {
return die('Command Line only');
}
$fileExtensions = ['mp4', 'webm', 'm3u8'];
$files = [];
//foreach (glob("../videos/*.{" . implode(",", $fileExtensions) . "}", GLOB_BRACE) as $filename) {
foreach (glob("../videos/*", GLOB_BRACE) as $filename) {
$base = basename($filename);
if (is_dir($filename)) {
if (strpos($base, "_YPTuniqid_") !== false) {
$files[$base] = [$base, $filename];
}
} else {
$types = ['_HD', '_Low', '_SD'];
$notFound = true;
foreach ($types as $value) {
$baseName = explode($value, $base);
if (!empty($baseName[1])) {
$files[$base] = [$baseName[0], $filename];
$notFound = false;
}
}
if ($notFound) {
foreach ($fileExtensions as $value) {
if (strpos($base, ".$value") === false) {
continue;
}
$baseName = str_replace("." . $value, "", $base);
if (!empty($baseName[1])) {
if (!in_array($baseName, $files)) {
$files[$base] = [$baseName, $filename];
}
}
}
}
}
}
$total = count($files);
echo "*** Total filenames " . $total . "\n";
foreach ($files as $key => $value) {
$video = Video::getVideoFromFileName($value[0], true);
if (!empty($video)) {
unset($files[$key]);
}
}
echo "*** Total filenames " . $total . " Will be created\n";
echo "*** Confirm Create Them? y/n: ";
ob_flush();
$confirm = trim(readline(""));
if (!empty($confirm) && strtolower($confirm) === 'y') {
$count = 0;
foreach ($files as $key => $value) {
$count++;
$title = "Video recovered: ".date("Y-m-d H:i:s", filectime($value[1]));
$video = new Video($title, $value[0]);
$video->setStatus(Video::$statusActive);
$video->setUsers_id(1);
if ($video->save(false, true)) {
echo "{$count}/{$total} {$title} created\n";
} else {
echo "{$count}/{$total} ERROR on create video {$title}\n";
}
}
}
<?php
//streamer config
require_once '../videos/configuration.php';
if (!isCommandLineInterface()) {
return die('Command Line only');
}
$fileExtensions = ['mp4', 'webm', 'm3u8'];
$files = [];
//foreach (glob("../videos/*.{" . implode(",", $fileExtensions) . "}", GLOB_BRACE) as $filename) {
foreach (glob("../videos/*", GLOB_BRACE) as $filename) {
$base = basename($filename);
if (is_dir($filename)) {
if (strpos($base, "_YPTuniqid_") !== false) {
$files[$base] = [$base, $filename];
}
} else {
$types = ['_HD', '_Low', '_SD'];
$notFound = true;
foreach ($types as $value) {
$baseName = explode($value, $base);
if (!empty($baseName[1])) {
$files[$base] = [$baseName[0], $filename];
$notFound = false;
}
}
if ($notFound) {
foreach ($fileExtensions as $value) {
if (strpos($base, ".$value") === false) {
continue;
}
$baseName = str_replace("." . $value, "", $base);
if (!empty($baseName[1])) {
if (!in_array($baseName, $files)) {
$files[$base] = [$baseName, $filename];
}
}
}
}
}
}
$total = count($files);
echo "*** Total filenames " . $total . "\n";
foreach ($files as $key => $value) {
$video = Video::getVideoFromFileName($value[0], true);
if (!empty($video)) {
unset($files[$key]);
}
}
echo "*** Total filenames " . $total . " Will be created\n";
echo "*** Confirm Create Them? y/n: ";
ob_flush();
$confirm = trim(readline(""));
if (!empty($confirm) && strtolower($confirm) === 'y') {
$count = 0;
foreach ($files as $key => $value) {
$count++;
$title = "Video recovered: ".date("Y-m-d H:i:s", filectime($value[1]));
$video = new Video($title, $value[0]);
$video->setStatus(Video::$statusActive);
$video->setUsers_id(1);
if ($video->save(false, true)) {
echo "{$count}/{$total} {$title} created\n";
} else {
echo "{$count}/{$total} ERROR on create video {$title}\n";
}
}
}

View file

@ -1,60 +1,60 @@
<?php
//streamer config
require_once '../videos/configuration.php';
if (!isCommandLineInterface()) {
return die('Command Line only');
}
$userName = trim(@$argv[1]);
$password = trim(@$argv[2]);
if (empty($userName) || empty($password)) {
echo "Enter the username or press enter to skip:";
echo "\n";
ob_flush();
$userName = trim(readline(""));
if (!empty($userName)) {
$user = new User(0, $userName, false);
if (!empty($user->getBdId())) {
echo "Enter a new password for the user {$userName} or press enter to skip:";
echo "\n";
ob_flush();
$password = trim(readline(""));
if (!empty($password)) {
echo "Confirm the new password for the user {$userName}:";
echo "\n";
ob_flush();
$password2 = trim(readline(""));
if ($password === $password2) {
$user->setPassword($password);
if ($user->save()) {
echo "Your new password was saved";
echo "\n";
die();
}
} else {
echo "The passwords do not match";
echo "\n";
die();
}
}
} else {
echo "User ({$userName}) Not found";
echo "\n";
die();
}
}
} else {
$user = new User(0, $userName, false);
$user->setPassword($password);
if ($user->save()) {
echo "Your new password was saved";
echo "\n";
die();
}
}
echo "Bye";
echo "\n";
die();
<?php
//streamer config
require_once '../videos/configuration.php';
if (!isCommandLineInterface()) {
return die('Command Line only');
}
$userName = trim(@$argv[1]);
$password = trim(@$argv[2]);
if (empty($userName) || empty($password)) {
echo "Enter the username or press enter to skip:";
echo "\n";
ob_flush();
$userName = trim(readline(""));
if (!empty($userName)) {
$user = new User(0, $userName, false);
if (!empty($user->getBdId())) {
echo "Enter a new password for the user {$userName} or press enter to skip:";
echo "\n";
ob_flush();
$password = trim(readline(""));
if (!empty($password)) {
echo "Confirm the new password for the user {$userName}:";
echo "\n";
ob_flush();
$password2 = trim(readline(""));
if ($password === $password2) {
$user->setPassword($password);
if ($user->save()) {
echo "Your new password was saved";
echo "\n";
die();
}
} else {
echo "The passwords do not match";
echo "\n";
die();
}
}
} else {
echo "User ({$userName}) Not found";
echo "\n";
die();
}
}
} else {
$user = new User(0, $userName, false);
$user->setPassword($password);
if ($user->save()) {
echo "Your new password was saved";
echo "\n";
die();
}
}
echo "Bye";
echo "\n";
die();

View file

@ -1,15 +1,15 @@
<?php
//streamer config
require_once '../videos/configuration.php';
require_once $global['systemRootPath'] . 'objects/playlist.php';
if (!isCommandLineInterface()) {
return die('Command Line only');
}
echo "Start delete statistics" . PHP_EOL;
$sql = "delete FROM videos_statistics where id > 0";
sqlDAL::writeSql($sql);
echo "Finish delete statistics" . PHP_EOL;
<?php
//streamer config
require_once '../videos/configuration.php';
require_once $global['systemRootPath'] . 'objects/playlist.php';
if (!isCommandLineInterface()) {
return die('Command Line only');
}
echo "Start delete statistics" . PHP_EOL;
$sql = "delete FROM videos_statistics where id > 0";
sqlDAL::writeSql($sql);
echo "Finish delete statistics" . PHP_EOL;

View file

@ -1,76 +1,76 @@
<?php
//streamer config
require_once '../videos/configuration.php';
require_once $global['systemRootPath'] . 'objects/playlist.php';
if (!isCommandLineInterface()) {
return die('Command Line only');
}
$users_ids = [];
$sql = "SELECT distinct(users_id) as users_id FROM playlists ";
$res = sqlDAL::readSql($sql);
$fullData = sqlDAL::fetchAllAssoc($res);
sqlDAL::close($res);
$rows = [];
if ($res != false) {
foreach ($fullData as $key => $row) {
$users_ids[] = $row['users_id'];
}
} else {
die($sql . '\nError : (' . $global['mysqli']->errno . ') ' . $global['mysqli']->error);
}
foreach ($users_ids as $user_id) {
echo "Process user_id = {$user_id} favorite\n";
ob_flush();
$sql = "SELECT * FROM playlists WHERE users_id = {$user_id} AND status = 'favorite' ORDER BY created ";
$res = sqlDAL::readSql($sql);
$fullData = sqlDAL::fetchAllAssoc($res);
sqlDAL::close($res);
$rows = [];
if ($res != false) {
foreach ($fullData as $key => $row) {
if ($key === 0) {
continue;
}
if (!empty(PlayList::getVideosIDFromPlaylistLight($row['id']))) {
continue;
}
$sql = "DELETE FROM playlists ";
$sql .= " WHERE id = ?";
echo $sql." = {$row['id']}\n";
ob_flush();
sqlDAL::writeSql($sql, "i", [$row['id']]);
}
} else {
die($sql . '\nError : (' . $global['mysqli']->errno . ') ' . $global['mysqli']->error);
}
echo "Process user_id = {$user_id} watch_later\n";
ob_flush();
$sql = "SELECT * FROM playlists WHERE users_id = {$user_id} AND status = 'watch_later' ORDER BY created ";
$res = sqlDAL::readSql($sql);
$fullData = sqlDAL::fetchAllAssoc($res);
sqlDAL::close($res);
$rows = [];
if ($res != false) {
foreach ($fullData as $key => $row) {
if ($key === 0) {
continue;
}
$sql = "DELETE FROM playlists ";
$sql .= " WHERE id = ?";
echo $sql." = {$row['id']}\n";
ob_flush();
sqlDAL::writeSql($sql, "i", [$row['id']]);
}
} else {
die($sql . '\nError : (' . $global['mysqli']->errno . ') ' . $global['mysqli']->error);
}
}
<?php
//streamer config
require_once '../videos/configuration.php';
require_once $global['systemRootPath'] . 'objects/playlist.php';
if (!isCommandLineInterface()) {
return die('Command Line only');
}
$users_ids = [];
$sql = "SELECT distinct(users_id) as users_id FROM playlists ";
$res = sqlDAL::readSql($sql);
$fullData = sqlDAL::fetchAllAssoc($res);
sqlDAL::close($res);
$rows = [];
if ($res != false) {
foreach ($fullData as $key => $row) {
$users_ids[] = $row['users_id'];
}
} else {
die($sql . '\nError : (' . $global['mysqli']->errno . ') ' . $global['mysqli']->error);
}
foreach ($users_ids as $user_id) {
echo "Process user_id = {$user_id} favorite\n";
ob_flush();
$sql = "SELECT * FROM playlists WHERE users_id = {$user_id} AND status = 'favorite' ORDER BY created ";
$res = sqlDAL::readSql($sql);
$fullData = sqlDAL::fetchAllAssoc($res);
sqlDAL::close($res);
$rows = [];
if ($res != false) {
foreach ($fullData as $key => $row) {
if ($key === 0) {
continue;
}
if (!empty(PlayList::getVideosIDFromPlaylistLight($row['id']))) {
continue;
}
$sql = "DELETE FROM playlists ";
$sql .= " WHERE id = ?";
echo $sql." = {$row['id']}\n";
ob_flush();
sqlDAL::writeSql($sql, "i", [$row['id']]);
}
} else {
die($sql . '\nError : (' . $global['mysqli']->errno . ') ' . $global['mysqli']->error);
}
echo "Process user_id = {$user_id} watch_later\n";
ob_flush();
$sql = "SELECT * FROM playlists WHERE users_id = {$user_id} AND status = 'watch_later' ORDER BY created ";
$res = sqlDAL::readSql($sql);
$fullData = sqlDAL::fetchAllAssoc($res);
sqlDAL::close($res);
$rows = [];
if ($res != false) {
foreach ($fullData as $key => $row) {
if ($key === 0) {
continue;
}
$sql = "DELETE FROM playlists ";
$sql .= " WHERE id = ?";
echo $sql." = {$row['id']}\n";
ob_flush();
sqlDAL::writeSql($sql, "i", [$row['id']]);
}
} else {
die($sql . '\nError : (' . $global['mysqli']->errno . ') ' . $global['mysqli']->error);
}
}

View file

@ -1,61 +1,61 @@
<?php
//streamer config
require_once '../videos/configuration.php';
require_once $global['systemRootPath'] . 'objects/playlist.php';
if (!isCommandLineInterface()) {
return die('Command Line only');
}
echo "Start fixing statistics" . PHP_EOL;
$session_id = [];
$sql = "SELECT distinct(session_id) as session_id FROM videos_statistics ";
$res = sqlDAL::readSql($sql);
$fullData = sqlDAL::fetchAllAssoc($res);
sqlDAL::close($res);
$rows = [];
if ($res != false) {
foreach ($fullData as $key => $row) {
$session_id[] = $row['session_id'];
}
} else {
die($sql . '\nError : (' . $global['mysqli']->errno . ') ' . $global['mysqli']->error);
}
foreach ($session_id as $id) {
echo "Process session_id = {$id}\n";
ob_flush();
$sql = "SELECT distinct(videos_id) as videos_id FROM videos_statistics WHERE session_id = '{$id}'";
echo $sql . PHP_EOL;
$res = sqlDAL::readSql($sql);
$fullData = sqlDAL::fetchAllAssoc($res);
sqlDAL::close($res);
$rows = [];
if ($res != false) {
foreach ($fullData as $row) {
$sql2 = "SELECT id FROM videos_statistics WHERE videos_id = {$row['videos_id']} AND session_id = '{$id}' ORDER BY `when` DESC LIMIT 1";
echo $sql . PHP_EOL;
$res2 = sqlDAL::readSql($sql2);
$fullData2 = sqlDAL::fetchAllAssoc($res2);
sqlDAL::close($res2);
if ($res != false) {
foreach ($fullData2 as $key2 => $row2) {
$sql = "DELETE FROM videos_statistics ";
$sql .= " WHERE videos_id = {$row['videos_id']} AND session_id = '{$id}' AND id != {$row2['id']} ";
echo $sql . PHP_EOL;
ob_flush();
sqlDAL::writeSql($sql);
}
} else {
die($sql . '\nError : (' . $global['mysqli']->errno . ') ' . $global['mysqli']->error);
}
}
} else {
die($sql . '\nError : (' . $global['mysqli']->errno . ') ' . $global['mysqli']->error);
}
}
echo "Finish fixing statistics" . PHP_EOL;
<?php
//streamer config
require_once '../videos/configuration.php';
require_once $global['systemRootPath'] . 'objects/playlist.php';
if (!isCommandLineInterface()) {
return die('Command Line only');
}
echo "Start fixing statistics" . PHP_EOL;
$session_id = [];
$sql = "SELECT distinct(session_id) as session_id FROM videos_statistics ";
$res = sqlDAL::readSql($sql);
$fullData = sqlDAL::fetchAllAssoc($res);
sqlDAL::close($res);
$rows = [];
if ($res != false) {
foreach ($fullData as $key => $row) {
$session_id[] = $row['session_id'];
}
} else {
die($sql . '\nError : (' . $global['mysqli']->errno . ') ' . $global['mysqli']->error);
}
foreach ($session_id as $id) {
echo "Process session_id = {$id}\n";
ob_flush();
$sql = "SELECT distinct(videos_id) as videos_id FROM videos_statistics WHERE session_id = '{$id}'";
echo $sql . PHP_EOL;
$res = sqlDAL::readSql($sql);
$fullData = sqlDAL::fetchAllAssoc($res);
sqlDAL::close($res);
$rows = [];
if ($res != false) {
foreach ($fullData as $row) {
$sql2 = "SELECT id FROM videos_statistics WHERE videos_id = {$row['videos_id']} AND session_id = '{$id}' ORDER BY `when` DESC LIMIT 1";
echo $sql . PHP_EOL;
$res2 = sqlDAL::readSql($sql2);
$fullData2 = sqlDAL::fetchAllAssoc($res2);
sqlDAL::close($res2);
if ($res != false) {
foreach ($fullData2 as $key2 => $row2) {
$sql = "DELETE FROM videos_statistics ";
$sql .= " WHERE videos_id = {$row['videos_id']} AND session_id = '{$id}' AND id != {$row2['id']} ";
echo $sql . PHP_EOL;
ob_flush();
sqlDAL::writeSql($sql);
}
} else {
die($sql . '\nError : (' . $global['mysqli']->errno . ') ' . $global['mysqli']->error);
}
}
} else {
die($sql . '\nError : (' . $global['mysqli']->errno . ') ' . $global['mysqli']->error);
}
}
echo "Finish fixing statistics" . PHP_EOL;

View file

@ -1,38 +1,38 @@
<?php
//streamer config
require_once '../videos/configuration.php';
require_once $global['systemRootPath'] . 'objects/playlist.php';
if (!isCommandLineInterface()) {
return die('Command Line only');
}
echo "1 - Reset all plugins Parameters\n";
echo "2 - Reset CustomizeUser Plugin Parameters only\n";
echo "3 - Reset all plugins (Will also inactivate the plugins)\n";
echo "Choose an option: ";
ob_flush();
$option = trim(readline(""));
exec("rm -R ".Video::getStoragePath()."cache/*");
if ($option == 1) {
$sql = "UPDATE plugins ";
$sql .= " SET object_data = '' WHERE id > 0";
sqlDAL::writeSql($sql);
echo "* Reset all plugins Parameters DONE\n";
ob_flush();
} elseif ($option == 2) {
$sql = "UPDATE plugins ";
$sql .= " SET object_data = '' WHERE name = 'CustomizeUser'";
sqlDAL::writeSql($sql);
echo "* Reset CustomizeUser Plugin Parameters only DONE\n";
ob_flush();
} elseif ($option == 3) {
$sql = "DELETE FROM plugins ";
$sql .= " WHERE id > 0";
sqlDAL::writeSql($sql);
echo "* Reset all plugins (All plugins inactivated) DONE\n";
ob_flush();
} else {
echo "Bye\n";
}
<?php
//streamer config
require_once '../videos/configuration.php';
require_once $global['systemRootPath'] . 'objects/playlist.php';
if (!isCommandLineInterface()) {
return die('Command Line only');
}
echo "1 - Reset all plugins Parameters\n";
echo "2 - Reset CustomizeUser Plugin Parameters only\n";
echo "3 - Reset all plugins (Will also inactivate the plugins)\n";
echo "Choose an option: ";
ob_flush();
$option = trim(readline(""));
exec("rm -R ".Video::getStoragePath()."cache/*");
if ($option == 1) {
$sql = "UPDATE plugins ";
$sql .= " SET object_data = '' WHERE id > 0";
sqlDAL::writeSql($sql);
echo "* Reset all plugins Parameters DONE\n";
ob_flush();
} elseif ($option == 2) {
$sql = "UPDATE plugins ";
$sql .= " SET object_data = '' WHERE name = 'CustomizeUser'";
sqlDAL::writeSql($sql);
echo "* Reset CustomizeUser Plugin Parameters only DONE\n";
ob_flush();
} elseif ($option == 3) {
$sql = "DELETE FROM plugins ";
$sql .= " WHERE id > 0";
sqlDAL::writeSql($sql);
echo "* Reset all plugins (All plugins inactivated) DONE\n";
ob_flush();
} else {
echo "Bye\n";
}

View file

@ -1,49 +1,49 @@
<?php
//streamer config
require_once '../videos/configuration.php';
if (!isCommandLineInterface()) {
return die('Command Line only');
}
ob_end_flush();
set_time_limit(300);
ini_set('max_execution_time', 300);
$global['rowCount'] = $global['limitForUnlimitedVideos'] = 999999;
$path = getVideosDir();
$total = Video::getTotalVideos("", false, true, true, false, false);
$videos = Video::getAllVideosLight("", false, true, false);
echo "Path: {$path}" . PHP_EOL;
$sites_id_to_check = [];
foreach ($videos as $value) {
if ($value['status'] !== Video::$statusBrokenMissingFiles) {
continue;
}
$sites_id_to_check[] = $value['id'];
echo "{$key}/{$total} added to move {$global['webSiteRootURL']}v/{$value['id']} {$value['title']}" . PHP_EOL;
}
$total = count($sites_id_to_check);
foreach ($sites_id_to_check as $key => $value) {
if (!empty($index) && $key<$index) {
continue;
}
$video = new Video('', '', $value);
$filename = $video->getFilename();
echo "{$key}/{$total} Start check {$filename} " . PHP_EOL;
if (Video::isMediaFileMissing($filename)) {
$sources = getVideosURL_V2($filename);
echo "{$key}/{$total} is missing ". json_encode($sources) . PHP_EOL;
} else if($video->getStatus()===Video::$statusBrokenMissingFiles){
$video->setStatus(Video::$statusActive);
echo "{$key}/{$total} is set to active " . PHP_EOL;
}
}
echo PHP_EOL . " Done! " . PHP_EOL;
die();
<?php
//streamer config
require_once '../videos/configuration.php';
if (!isCommandLineInterface()) {
return die('Command Line only');
}
ob_end_flush();
set_time_limit(300);
ini_set('max_execution_time', 300);
$global['rowCount'] = $global['limitForUnlimitedVideos'] = 999999;
$path = getVideosDir();
$total = Video::getTotalVideos("", false, true, true, false, false);
$videos = Video::getAllVideosLight("", false, true, false);
echo "Path: {$path}" . PHP_EOL;
$sites_id_to_check = [];
foreach ($videos as $value) {
if ($value['status'] !== Video::$statusBrokenMissingFiles) {
continue;
}
$sites_id_to_check[] = $value['id'];
echo "{$key}/{$total} added to move {$global['webSiteRootURL']}v/{$value['id']} {$value['title']}" . PHP_EOL;
}
$total = count($sites_id_to_check);
foreach ($sites_id_to_check as $key => $value) {
if (!empty($index) && $key<$index) {
continue;
}
$video = new Video('', '', $value);
$filename = $video->getFilename();
echo "{$key}/{$total} Start check {$filename} " . PHP_EOL;
if (Video::isMediaFileMissing($filename)) {
$sources = getVideosURL_V2($filename);
echo "{$key}/{$total} is missing ". json_encode($sources) . PHP_EOL;
} else if($video->getStatus()===Video::$statusBrokenMissingFiles){
$video->setStatus(Video::$statusActive);
echo "{$key}/{$total} is set to active " . PHP_EOL;
}
}
echo PHP_EOL . " Done! " . PHP_EOL;
die();

View file

@ -1,12 +1,12 @@
<?php
//streamer config
require_once '../videos/configuration.php';
AVideoPlugin::loadPlugin('YPTStorage');
if (!isCommandLineInterface()) {
return die('Command Line only');
}
error_reporting(E_ALL);
ini_set('display_errors', '1');
$filename = '_YPTuniqid_5f80cfc9990a82.31784835';
$size = YPTStorage::getUsageFromFilename($filename);
var_dump($size, humanFileSize($size));
<?php
//streamer config
require_once '../videos/configuration.php';
AVideoPlugin::loadPlugin('YPTStorage');
if (!isCommandLineInterface()) {
return die('Command Line only');
}
error_reporting(E_ALL);
ini_set('display_errors', '1');
$filename = '_YPTuniqid_5f80cfc9990a82.31784835';
$size = YPTStorage::getUsageFromFilename($filename);
var_dump($size, humanFileSize($size));

View file

@ -1,19 +1,19 @@
<?php
//streamer config
require_once '../videos/configuration.php';
if (!isCommandLineInterface()) {
return die('Command Line only');
}
$global['rowCount'] = 99999;
$total = Video::getTotalVideos("", false, true, true, false, false);
$videos = Video::getAllVideosLight("", false, true, false);
$count = 0;
foreach ($videos as $value) {
$count++;
$updated = Video::updateFilesize($value['id']);
echo "{$count}/{$total} (".($updated ? "success" : "fail").") [{$value['id']}] {$value['title']}".PHP_EOL;
ob_flush();
}
die();
<?php
//streamer config
require_once '../videos/configuration.php';
if (!isCommandLineInterface()) {
return die('Command Line only');
}
$global['rowCount'] = 99999;
$total = Video::getTotalVideos("", false, true, true, false, false);
$videos = Video::getAllVideosLight("", false, true, false);
$count = 0;
foreach ($videos as $value) {
$count++;
$updated = Video::updateFilesize($value['id']);
echo "{$count}/{$total} (".($updated ? "success" : "fail").") [{$value['id']}] {$value['title']}".PHP_EOL;
ob_flush();
}
die();

View file

@ -1,41 +1,41 @@
<?php
//streamer config
require_once '../videos/configuration.php';
if (!isCommandLineInterface()) {
return die('Command Line only');
}
echo "Enter the new Streamer URL or press enter to skip:";
echo "\n";
ob_flush();
$streamerURL = trim(readline(""));
if (!empty($streamerURL)) {
if (substr($streamerURL, -1) !== '/') {
$streamerURL.="/";
}
$global['webSiteRootURL'] = $streamerURL;
echo "Rewrite Streamer Config File\n";
// change the streamer config file
Configuration::rewriteConfigFile();
echo "Rewrite Streamer Config File - DONE\n";
}
$encoderConfigFile = "{$global['systemRootPath']}Encoder/videos/configuration.php";
echo "Checking encoder in {$encoderConfigFile}\n";
if (file_exists($encoderConfigFile)) {
echo "Encoder found in {$encoderConfigFile}\n";
require_once $encoderConfigFile;
// change the encoder database for admin user
echo "Encoder Update configurations set allowedStreamersURL\n";
$sql = "update configurations set allowedStreamersURL = '{$streamerURL}';";
$global['mysqli']->query($sql);
echo "Encoder Update streamers set siteURL\n";
$sql = "update streamers set siteURL = '{$streamerURL}';";
$global['mysqli']->query($sql);
// change the encoder config file
} else {
echo "Encoder not found in {$encoderConfigFile}\n";
}
<?php
//streamer config
require_once '../videos/configuration.php';
if (!isCommandLineInterface()) {
return die('Command Line only');
}
echo "Enter the new Streamer URL or press enter to skip:";
echo "\n";
ob_flush();
$streamerURL = trim(readline(""));
if (!empty($streamerURL)) {
if (substr($streamerURL, -1) !== '/') {
$streamerURL.="/";
}
$global['webSiteRootURL'] = $streamerURL;
echo "Rewrite Streamer Config File\n";
// change the streamer config file
Configuration::rewriteConfigFile();
echo "Rewrite Streamer Config File - DONE\n";
}
$encoderConfigFile = "{$global['systemRootPath']}Encoder/videos/configuration.php";
echo "Checking encoder in {$encoderConfigFile}\n";
if (file_exists($encoderConfigFile)) {
echo "Encoder found in {$encoderConfigFile}\n";
require_once $encoderConfigFile;
// change the encoder database for admin user
echo "Encoder Update configurations set allowedStreamersURL\n";
$sql = "update configurations set allowedStreamersURL = '{$streamerURL}';";
$global['mysqli']->query($sql);
echo "Encoder Update streamers set siteURL\n";
$sql = "update streamers set siteURL = '{$streamerURL}';";
$global['mysqli']->query($sql);
// change the encoder config file
} else {
echo "Encoder not found in {$encoderConfigFile}\n";
}

View file

@ -1,67 +1,67 @@
<?php
//streamer config
require_once '../videos/configuration.php';
if (!isCommandLineInterface()) {
return die('Command Line only');
}
ob_end_flush();
set_time_limit(300);
ini_set('max_execution_time', 300);
ini_set('display_errors', 1);
ini_set('display_startup_errors', 1);
error_reporting(E_ALL);
function currentVersionLowerThen($currentversion, $oldversion)
{
return version_compare($currentversion, $oldversion) > 0;
}
$updateDir = $global['systemRootPath'] . "updatedb/";
$currentVersion = $config->getVersion();
echo "Searching on ({$updateDir}) for updates greater then {$currentVersion}" . PHP_EOL;
global $global;
$files1 = scandir($updateDir);
$updateFiles = [];
foreach ($files1 as $value) {
preg_match("/updateDb.v([0-9.]*).sql/", $value, $match);
if (!empty($match)) {
if (currentVersionLowerThen($match[1], $currentVersion)) {
$updateFiles[] = ['filename' => $match[0], 'version' => $match[1]];
}
}
}
if (empty($updateFiles)) {
echo "No new update files found on ({$updateDir})" . PHP_EOL;
} else {
echo "Found ".count($updateFiles)." updaets" . PHP_EOL;
}
foreach ($updateFiles as $value) {
echo "Updating version " . $value['version'] . PHP_EOL;
$lines = file("{$updateDir}{$value['filename']}");
foreach ($lines as $line) {
if (substr($line, 0, 2) == '--' || $line == '') {
continue;
}
$templine .= $line;
if (substr(trim($line), -1, 1) == ';') {
try {
if (!$global['mysqli']->query($templine)) {
echo('Error performing query ' . $templine . ': ' . $global['mysqli']->error . PHP_EOL);
//exit;
}
} catch (Exception $exc) {
echo $exc->getTraceAsString(). PHP_EOL;
}
$templine = '';
}
}
}
echo PHP_EOL . " Done! " . PHP_EOL;
die();
<?php
//streamer config
require_once '../videos/configuration.php';
if (!isCommandLineInterface()) {
return die('Command Line only');
}
ob_end_flush();
set_time_limit(300);
ini_set('max_execution_time', 300);
ini_set('display_errors', 1);
ini_set('display_startup_errors', 1);
error_reporting(E_ALL);
function currentVersionLowerThen($currentversion, $oldversion)
{
return version_compare($currentversion, $oldversion) > 0;
}
$updateDir = $global['systemRootPath'] . "updatedb/";
$currentVersion = $config->getVersion();
echo "Searching on ({$updateDir}) for updates greater then {$currentVersion}" . PHP_EOL;
global $global;
$files1 = scandir($updateDir);
$updateFiles = [];
foreach ($files1 as $value) {
preg_match("/updateDb.v([0-9.]*).sql/", $value, $match);
if (!empty($match)) {
if (currentVersionLowerThen($match[1], $currentVersion)) {
$updateFiles[] = ['filename' => $match[0], 'version' => $match[1]];
}
}
}
if (empty($updateFiles)) {
echo "No new update files found on ({$updateDir})" . PHP_EOL;
} else {
echo "Found ".count($updateFiles)." updaets" . PHP_EOL;
}
foreach ($updateFiles as $value) {
echo "Updating version " . $value['version'] . PHP_EOL;
$lines = file("{$updateDir}{$value['filename']}");
foreach ($lines as $line) {
if (substr($line, 0, 2) == '--' || $line == '') {
continue;
}
$templine .= $line;
if (substr(trim($line), -1, 1) == ';') {
try {
if (!$global['mysqli']->query($templine)) {
echo('Error performing query ' . $templine . ': ' . $global['mysqli']->error . PHP_EOL);
//exit;
}
} catch (Exception $exc) {
echo $exc->getTraceAsString(). PHP_EOL;
}
$templine = '';
}
}
}
echo PHP_EOL . " Done! " . PHP_EOL;
die();

View file

@ -16,17 +16,23 @@ if (!empty($_GET['lang'])) {
function __($str, $allowHTML = false) {
global $t;
if (empty($t[$str])) {
if ($allowHTML) {
return $str;
}
return str_replace(array("'", '"', "<", '>'), array('&apos;', '&quot;', '&lt;', '&gt;'), $str);
} else {
if ($allowHTML) {
return $t[$str];
}
return str_replace(array("'", '"', "<", '>'), array('&apos;', '&quot;', '&lt;', '&gt;'), $t[$str]);
if (!isset($t_insensitive)) {
$t_insensitive = array_change_key_case($t);
}
$return = $str;
if (!empty($t[$str])) {
$return = $t[$str];
} else if (!empty($t_insensitive[strtolower($str)])) {
$return = $t_insensitive[strtolower($str)];
}
if ($allowHTML) {
return $return;
}
return str_replace(array("'", '"', "<", '>'), array('&apos;', '&quot;', '&lt;', '&gt;'), $return);
}
function isRTL() {

30
node_modules/.bin/mpd-to-m3u8-json generated vendored
View file

@ -1,15 +1,15 @@
#!/bin/sh
basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')")
case `uname` in
*CYGWIN*) basedir=`cygpath -w "$basedir"`;;
esac
if [ -x "$basedir/node" ]; then
"$basedir/node" "$basedir/../mpd-parser/bin/parse.js" "$@"
ret=$?
else
node "$basedir/../mpd-parser/bin/parse.js" "$@"
ret=$?
fi
exit $ret
#!/bin/sh
basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')")
case `uname` in
*CYGWIN*) basedir=`cygpath -w "$basedir"`;;
esac
if [ -x "$basedir/node" ]; then
"$basedir/node" "$basedir/../mpd-parser/bin/parse.js" "$@"
ret=$?
else
node "$basedir/../mpd-parser/bin/parse.js" "$@"
ret=$?
fi
exit $ret

30
node_modules/.bin/muxjs-transmux generated vendored
View file

@ -1,15 +1,15 @@
#!/bin/sh
basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')")
case `uname` in
*CYGWIN*) basedir=`cygpath -w "$basedir"`;;
esac
if [ -x "$basedir/node" ]; then
"$basedir/node" "$basedir/../mux.js/bin/transmux.js" "$@"
ret=$?
else
node "$basedir/../mux.js/bin/transmux.js" "$@"
ret=$?
fi
exit $ret
#!/bin/sh
basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')")
case `uname` in
*CYGWIN*) basedir=`cygpath -w "$basedir"`;;
esac
if [ -x "$basedir/node" ]; then
"$basedir/node" "$basedir/../mux.js/bin/transmux.js" "$@"
ret=$?
else
node "$basedir/../mux.js/bin/transmux.js" "$@"
ret=$?
fi
exit $ret

30
node_modules/.bin/pkcs7 generated vendored
View file

@ -1,15 +1,15 @@
#!/bin/sh
basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')")
case `uname` in
*CYGWIN*) basedir=`cygpath -w "$basedir"`;;
esac
if [ -x "$basedir/node" ]; then
"$basedir/node" "$basedir/../pkcs7/bin/cli.js" "$@"
ret=$?
else
node "$basedir/../pkcs7/bin/cli.js" "$@"
ret=$?
fi
exit $ret
#!/bin/sh
basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')")
case `uname` in
*CYGWIN*) basedir=`cygpath -w "$basedir"`;;
esac
if [ -x "$basedir/node" ]; then
"$basedir/node" "$basedir/../pkcs7/bin/cli.js" "$@"
ret=$?
else
node "$basedir/../pkcs7/bin/cli.js" "$@"
ret=$?
fi
exit $ret

44
node_modules/@babel/runtime/LICENSE generated vendored
View file

@ -1,22 +1,22 @@
MIT License
Copyright (c) 2014-present Sebastian McKenzie and other contributors
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:
The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
MIT License
Copyright (c) 2014-present Sebastian McKenzie and other contributors
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:
The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

View file

@ -1,19 +1,19 @@
# @babel/runtime
> babel's modular runtime helpers
See our website [@babel/runtime](https://babeljs.io/docs/en/babel-runtime) for more information.
## Install
Using npm:
```sh
npm install --save @babel/runtime
```
or using yarn:
```sh
yarn add @babel/runtime
```
# @babel/runtime
> babel's modular runtime helpers
See our website [@babel/runtime](https://babeljs.io/docs/en/babel-runtime) for more information.
## Install
Using npm:
```sh
npm install --save @babel/runtime
```
or using yarn:
```sh
yarn add @babel/runtime
```

View file

@ -1,99 +1,99 @@
var AwaitValue = require("./AwaitValue.js");
function AsyncGenerator(gen) {
var front, back;
function send(key, arg) {
return new Promise(function (resolve, reject) {
var request = {
key: key,
arg: arg,
resolve: resolve,
reject: reject,
next: null
};
if (back) {
back = back.next = request;
} else {
front = back = request;
resume(key, arg);
}
});
}
function resume(key, arg) {
try {
var result = gen[key](arg);
var value = result.value;
var wrappedAwait = value instanceof AwaitValue;
Promise.resolve(wrappedAwait ? value.wrapped : value).then(function (arg) {
if (wrappedAwait) {
resume(key === "return" ? "return" : "next", arg);
return;
}
settle(result.done ? "return" : "normal", arg);
}, function (err) {
resume("throw", err);
});
} catch (err) {
settle("throw", err);
}
}
function settle(type, value) {
switch (type) {
case "return":
front.resolve({
value: value,
done: true
});
break;
case "throw":
front.reject(value);
break;
default:
front.resolve({
value: value,
done: false
});
break;
}
front = front.next;
if (front) {
resume(front.key, front.arg);
} else {
back = null;
}
}
this._invoke = send;
if (typeof gen["return"] !== "function") {
this["return"] = undefined;
}
}
AsyncGenerator.prototype[typeof Symbol === "function" && Symbol.asyncIterator || "@@asyncIterator"] = function () {
return this;
};
AsyncGenerator.prototype.next = function (arg) {
return this._invoke("next", arg);
};
AsyncGenerator.prototype["throw"] = function (arg) {
return this._invoke("throw", arg);
};
AsyncGenerator.prototype["return"] = function (arg) {
return this._invoke("return", arg);
};
module.exports = AsyncGenerator;
var AwaitValue = require("./AwaitValue.js");
function AsyncGenerator(gen) {
var front, back;
function send(key, arg) {
return new Promise(function (resolve, reject) {
var request = {
key: key,
arg: arg,
resolve: resolve,
reject: reject,
next: null
};
if (back) {
back = back.next = request;
} else {
front = back = request;
resume(key, arg);
}
});
}
function resume(key, arg) {
try {
var result = gen[key](arg);
var value = result.value;
var wrappedAwait = value instanceof AwaitValue;
Promise.resolve(wrappedAwait ? value.wrapped : value).then(function (arg) {
if (wrappedAwait) {
resume(key === "return" ? "return" : "next", arg);
return;
}
settle(result.done ? "return" : "normal", arg);
}, function (err) {
resume("throw", err);
});
} catch (err) {
settle("throw", err);
}
}
function settle(type, value) {
switch (type) {
case "return":
front.resolve({
value: value,
done: true
});
break;
case "throw":
front.reject(value);
break;
default:
front.resolve({
value: value,
done: false
});
break;
}
front = front.next;
if (front) {
resume(front.key, front.arg);
} else {
back = null;
}
}
this._invoke = send;
if (typeof gen["return"] !== "function") {
this["return"] = undefined;
}
}
AsyncGenerator.prototype[typeof Symbol === "function" && Symbol.asyncIterator || "@@asyncIterator"] = function () {
return this;
};
AsyncGenerator.prototype.next = function (arg) {
return this._invoke("next", arg);
};
AsyncGenerator.prototype["throw"] = function (arg) {
return this._invoke("throw", arg);
};
AsyncGenerator.prototype["return"] = function (arg) {
return this._invoke("return", arg);
};
module.exports = AsyncGenerator;
module.exports["default"] = module.exports, module.exports.__esModule = true;

View file

@ -1,6 +1,6 @@
function _AwaitValue(value) {
this.wrapped = value;
}
module.exports = _AwaitValue;
function _AwaitValue(value) {
this.wrapped = value;
}
module.exports = _AwaitValue;
module.exports["default"] = module.exports, module.exports.__esModule = true;

View file

@ -1,31 +1,31 @@
function _applyDecoratedDescriptor(target, property, decorators, descriptor, context) {
var desc = {};
Object.keys(descriptor).forEach(function (key) {
desc[key] = descriptor[key];
});
desc.enumerable = !!desc.enumerable;
desc.configurable = !!desc.configurable;
if ('value' in desc || desc.initializer) {
desc.writable = true;
}
desc = decorators.slice().reverse().reduce(function (desc, decorator) {
return decorator(target, property, desc) || desc;
}, desc);
if (context && desc.initializer !== void 0) {
desc.value = desc.initializer ? desc.initializer.call(context) : void 0;
desc.initializer = undefined;
}
if (desc.initializer === void 0) {
Object.defineProperty(target, property, desc);
desc = null;
}
return desc;
}
module.exports = _applyDecoratedDescriptor;
function _applyDecoratedDescriptor(target, property, decorators, descriptor, context) {
var desc = {};
Object.keys(descriptor).forEach(function (key) {
desc[key] = descriptor[key];
});
desc.enumerable = !!desc.enumerable;
desc.configurable = !!desc.configurable;
if ('value' in desc || desc.initializer) {
desc.writable = true;
}
desc = decorators.slice().reverse().reduce(function (desc, decorator) {
return decorator(target, property, desc) || desc;
}, desc);
if (context && desc.initializer !== void 0) {
desc.value = desc.initializer ? desc.initializer.call(context) : void 0;
desc.initializer = undefined;
}
if (desc.initializer === void 0) {
Object.defineProperty(target, property, desc);
desc = null;
}
return desc;
}
module.exports = _applyDecoratedDescriptor;
module.exports["default"] = module.exports, module.exports.__esModule = true;

View file

@ -1,12 +1,12 @@
function _arrayLikeToArray(arr, len) {
if (len == null || len > arr.length) len = arr.length;
for (var i = 0, arr2 = new Array(len); i < len; i++) {
arr2[i] = arr[i];
}
return arr2;
}
module.exports = _arrayLikeToArray;
function _arrayLikeToArray(arr, len) {
if (len == null || len > arr.length) len = arr.length;
for (var i = 0, arr2 = new Array(len); i < len; i++) {
arr2[i] = arr[i];
}
return arr2;
}
module.exports = _arrayLikeToArray;
module.exports["default"] = module.exports, module.exports.__esModule = true;

View file

@ -1,6 +1,6 @@
function _arrayWithHoles(arr) {
if (Array.isArray(arr)) return arr;
}
module.exports = _arrayWithHoles;
function _arrayWithHoles(arr) {
if (Array.isArray(arr)) return arr;
}
module.exports = _arrayWithHoles;
module.exports["default"] = module.exports, module.exports.__esModule = true;

View file

@ -1,8 +1,8 @@
var arrayLikeToArray = require("./arrayLikeToArray.js");
function _arrayWithoutHoles(arr) {
if (Array.isArray(arr)) return arrayLikeToArray(arr);
}
module.exports = _arrayWithoutHoles;
var arrayLikeToArray = require("./arrayLikeToArray.js");
function _arrayWithoutHoles(arr) {
if (Array.isArray(arr)) return arrayLikeToArray(arr);
}
module.exports = _arrayWithoutHoles;
module.exports["default"] = module.exports, module.exports.__esModule = true;

View file

@ -1,10 +1,10 @@
function _assertThisInitialized(self) {
if (self === void 0) {
throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
}
return self;
}
module.exports = _assertThisInitialized;
function _assertThisInitialized(self) {
if (self === void 0) {
throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
}
return self;
}
module.exports = _assertThisInitialized;
module.exports["default"] = module.exports, module.exports.__esModule = true;

View file

@ -1,57 +1,57 @@
function _asyncGeneratorDelegate(inner, awaitWrap) {
var iter = {},
waiting = false;
function pump(key, value) {
waiting = true;
value = new Promise(function (resolve) {
resolve(inner[key](value));
});
return {
done: false,
value: awaitWrap(value)
};
}
;
iter[typeof Symbol !== "undefined" && Symbol.iterator || "@@iterator"] = function () {
return this;
};
iter.next = function (value) {
if (waiting) {
waiting = false;
return value;
}
return pump("next", value);
};
if (typeof inner["throw"] === "function") {
iter["throw"] = function (value) {
if (waiting) {
waiting = false;
throw value;
}
return pump("throw", value);
};
}
if (typeof inner["return"] === "function") {
iter["return"] = function (value) {
if (waiting) {
waiting = false;
return value;
}
return pump("return", value);
};
}
return iter;
}
module.exports = _asyncGeneratorDelegate;
function _asyncGeneratorDelegate(inner, awaitWrap) {
var iter = {},
waiting = false;
function pump(key, value) {
waiting = true;
value = new Promise(function (resolve) {
resolve(inner[key](value));
});
return {
done: false,
value: awaitWrap(value)
};
}
;
iter[typeof Symbol !== "undefined" && Symbol.iterator || "@@iterator"] = function () {
return this;
};
iter.next = function (value) {
if (waiting) {
waiting = false;
return value;
}
return pump("next", value);
};
if (typeof inner["throw"] === "function") {
iter["throw"] = function (value) {
if (waiting) {
waiting = false;
throw value;
}
return pump("throw", value);
};
}
if (typeof inner["return"] === "function") {
iter["return"] = function (value) {
if (waiting) {
waiting = false;
return value;
}
return pump("return", value);
};
}
return iter;
}
module.exports = _asyncGeneratorDelegate;
module.exports["default"] = module.exports, module.exports.__esModule = true;

View file

@ -1,16 +1,16 @@
function _asyncIterator(iterable) {
var method;
if (typeof Symbol !== "undefined") {
if (Symbol.asyncIterator) method = iterable[Symbol.asyncIterator];
if (method == null && Symbol.iterator) method = iterable[Symbol.iterator];
}
if (method == null) method = iterable["@@asyncIterator"];
if (method == null) method = iterable["@@iterator"];
if (method == null) throw new TypeError("Object is not async iterable");
return method.call(iterable);
}
module.exports = _asyncIterator;
function _asyncIterator(iterable) {
var method;
if (typeof Symbol !== "undefined") {
if (Symbol.asyncIterator) method = iterable[Symbol.asyncIterator];
if (method == null && Symbol.iterator) method = iterable[Symbol.iterator];
}
if (method == null) method = iterable["@@asyncIterator"];
if (method == null) method = iterable["@@iterator"];
if (method == null) throw new TypeError("Object is not async iterable");
return method.call(iterable);
}
module.exports = _asyncIterator;
module.exports["default"] = module.exports, module.exports.__esModule = true;

View file

@ -1,38 +1,38 @@
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
try {
var info = gen[key](arg);
var value = info.value;
} catch (error) {
reject(error);
return;
}
if (info.done) {
resolve(value);
} else {
Promise.resolve(value).then(_next, _throw);
}
}
function _asyncToGenerator(fn) {
return function () {
var self = this,
args = arguments;
return new Promise(function (resolve, reject) {
var gen = fn.apply(self, args);
function _next(value) {
asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);
}
function _throw(err) {
asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);
}
_next(undefined);
});
};
}
module.exports = _asyncToGenerator;
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
try {
var info = gen[key](arg);
var value = info.value;
} catch (error) {
reject(error);
return;
}
if (info.done) {
resolve(value);
} else {
Promise.resolve(value).then(_next, _throw);
}
}
function _asyncToGenerator(fn) {
return function () {
var self = this,
args = arguments;
return new Promise(function (resolve, reject) {
var gen = fn.apply(self, args);
function _next(value) {
asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);
}
function _throw(err) {
asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);
}
_next(undefined);
});
};
}
module.exports = _asyncToGenerator;
module.exports["default"] = module.exports, module.exports.__esModule = true;

View file

@ -1,8 +1,8 @@
var AwaitValue = require("./AwaitValue.js");
function _awaitAsyncGenerator(value) {
return new AwaitValue(value);
}
module.exports = _awaitAsyncGenerator;
var AwaitValue = require("./AwaitValue.js");
function _awaitAsyncGenerator(value) {
return new AwaitValue(value);
}
module.exports = _awaitAsyncGenerator;
module.exports["default"] = module.exports, module.exports.__esModule = true;

View file

@ -1,8 +1,8 @@
function _checkPrivateRedeclaration(obj, privateCollection) {
if (privateCollection.has(obj)) {
throw new TypeError("Cannot initialize the same private elements twice on an object");
}
}
module.exports = _checkPrivateRedeclaration;
function _checkPrivateRedeclaration(obj, privateCollection) {
if (privateCollection.has(obj)) {
throw new TypeError("Cannot initialize the same private elements twice on an object");
}
}
module.exports = _checkPrivateRedeclaration;
module.exports["default"] = module.exports, module.exports.__esModule = true;

View file

@ -1,23 +1,23 @@
function _classApplyDescriptorDestructureSet(receiver, descriptor) {
if (descriptor.set) {
if (!("__destrObj" in descriptor)) {
descriptor.__destrObj = {
set value(v) {
descriptor.set.call(receiver, v);
}
};
}
return descriptor.__destrObj;
} else {
if (!descriptor.writable) {
throw new TypeError("attempted to set read only private field");
}
return descriptor;
}
}
module.exports = _classApplyDescriptorDestructureSet;
function _classApplyDescriptorDestructureSet(receiver, descriptor) {
if (descriptor.set) {
if (!("__destrObj" in descriptor)) {
descriptor.__destrObj = {
set value(v) {
descriptor.set.call(receiver, v);
}
};
}
return descriptor.__destrObj;
} else {
if (!descriptor.writable) {
throw new TypeError("attempted to set read only private field");
}
return descriptor;
}
}
module.exports = _classApplyDescriptorDestructureSet;
module.exports["default"] = module.exports, module.exports.__esModule = true;

View file

@ -1,10 +1,10 @@
function _classApplyDescriptorGet(receiver, descriptor) {
if (descriptor.get) {
return descriptor.get.call(receiver);
}
return descriptor.value;
}
module.exports = _classApplyDescriptorGet;
function _classApplyDescriptorGet(receiver, descriptor) {
if (descriptor.get) {
return descriptor.get.call(receiver);
}
return descriptor.value;
}
module.exports = _classApplyDescriptorGet;
module.exports["default"] = module.exports, module.exports.__esModule = true;

View file

@ -1,14 +1,14 @@
function _classApplyDescriptorSet(receiver, descriptor, value) {
if (descriptor.set) {
descriptor.set.call(receiver, value);
} else {
if (!descriptor.writable) {
throw new TypeError("attempted to set read only private field");
}
descriptor.value = value;
}
}
module.exports = _classApplyDescriptorSet;
function _classApplyDescriptorSet(receiver, descriptor, value) {
if (descriptor.set) {
descriptor.set.call(receiver, value);
} else {
if (!descriptor.writable) {
throw new TypeError("attempted to set read only private field");
}
descriptor.value = value;
}
}
module.exports = _classApplyDescriptorSet;
module.exports["default"] = module.exports, module.exports.__esModule = true;

View file

@ -1,8 +1,8 @@
function _classCallCheck(instance, Constructor) {
if (!(instance instanceof Constructor)) {
throw new TypeError("Cannot call a class as a function");
}
}
module.exports = _classCallCheck;
function _classCallCheck(instance, Constructor) {
if (!(instance instanceof Constructor)) {
throw new TypeError("Cannot call a class as a function");
}
}
module.exports = _classCallCheck;
module.exports["default"] = module.exports, module.exports.__esModule = true;

View file

@ -1,8 +1,8 @@
function _classCheckPrivateStaticAccess(receiver, classConstructor) {
if (receiver !== classConstructor) {
throw new TypeError("Private static access of wrong provenance");
}
}
module.exports = _classCheckPrivateStaticAccess;
function _classCheckPrivateStaticAccess(receiver, classConstructor) {
if (receiver !== classConstructor) {
throw new TypeError("Private static access of wrong provenance");
}
}
module.exports = _classCheckPrivateStaticAccess;
module.exports["default"] = module.exports, module.exports.__esModule = true;

View file

@ -1,8 +1,8 @@
function _classCheckPrivateStaticFieldDescriptor(descriptor, action) {
if (descriptor === undefined) {
throw new TypeError("attempted to " + action + " private static field before its declaration");
}
}
module.exports = _classCheckPrivateStaticFieldDescriptor;
function _classCheckPrivateStaticFieldDescriptor(descriptor, action) {
if (descriptor === undefined) {
throw new TypeError("attempted to " + action + " private static field before its declaration");
}
}
module.exports = _classCheckPrivateStaticFieldDescriptor;
module.exports["default"] = module.exports, module.exports.__esModule = true;

View file

@ -1,10 +1,10 @@
function _classExtractFieldDescriptor(receiver, privateMap, action) {
if (!privateMap.has(receiver)) {
throw new TypeError("attempted to " + action + " private field on non-instance");
}
return privateMap.get(receiver);
}
module.exports = _classExtractFieldDescriptor;
function _classExtractFieldDescriptor(receiver, privateMap, action) {
if (!privateMap.has(receiver)) {
throw new TypeError("attempted to " + action + " private field on non-instance");
}
return privateMap.get(receiver);
}
module.exports = _classExtractFieldDescriptor;
module.exports["default"] = module.exports, module.exports.__esModule = true;

View file

@ -1,6 +1,6 @@
function _classNameTDZError(name) {
throw new Error("Class \"" + name + "\" cannot be referenced in computed property keys.");
}
module.exports = _classNameTDZError;
function _classNameTDZError(name) {
throw new Error("Class \"" + name + "\" cannot be referenced in computed property keys.");
}
module.exports = _classNameTDZError;
module.exports["default"] = module.exports, module.exports.__esModule = true;

View file

@ -1,11 +1,11 @@
var classApplyDescriptorDestructureSet = require("./classApplyDescriptorDestructureSet.js");
var classExtractFieldDescriptor = require("./classExtractFieldDescriptor.js");
function _classPrivateFieldDestructureSet(receiver, privateMap) {
var descriptor = classExtractFieldDescriptor(receiver, privateMap, "set");
return classApplyDescriptorDestructureSet(receiver, descriptor);
}
module.exports = _classPrivateFieldDestructureSet;
var classApplyDescriptorDestructureSet = require("./classApplyDescriptorDestructureSet.js");
var classExtractFieldDescriptor = require("./classExtractFieldDescriptor.js");
function _classPrivateFieldDestructureSet(receiver, privateMap) {
var descriptor = classExtractFieldDescriptor(receiver, privateMap, "set");
return classApplyDescriptorDestructureSet(receiver, descriptor);
}
module.exports = _classPrivateFieldDestructureSet;
module.exports["default"] = module.exports, module.exports.__esModule = true;

View file

@ -1,11 +1,11 @@
var classApplyDescriptorGet = require("./classApplyDescriptorGet.js");
var classExtractFieldDescriptor = require("./classExtractFieldDescriptor.js");
function _classPrivateFieldGet(receiver, privateMap) {
var descriptor = classExtractFieldDescriptor(receiver, privateMap, "get");
return classApplyDescriptorGet(receiver, descriptor);
}
module.exports = _classPrivateFieldGet;
var classApplyDescriptorGet = require("./classApplyDescriptorGet.js");
var classExtractFieldDescriptor = require("./classExtractFieldDescriptor.js");
function _classPrivateFieldGet(receiver, privateMap) {
var descriptor = classExtractFieldDescriptor(receiver, privateMap, "get");
return classApplyDescriptorGet(receiver, descriptor);
}
module.exports = _classPrivateFieldGet;
module.exports["default"] = module.exports, module.exports.__esModule = true;

View file

@ -1,9 +1,9 @@
var checkPrivateRedeclaration = require("./checkPrivateRedeclaration.js");
function _classPrivateFieldInitSpec(obj, privateMap, value) {
checkPrivateRedeclaration(obj, privateMap);
privateMap.set(obj, value);
}
module.exports = _classPrivateFieldInitSpec;
var checkPrivateRedeclaration = require("./checkPrivateRedeclaration.js");
function _classPrivateFieldInitSpec(obj, privateMap, value) {
checkPrivateRedeclaration(obj, privateMap);
privateMap.set(obj, value);
}
module.exports = _classPrivateFieldInitSpec;
module.exports["default"] = module.exports, module.exports.__esModule = true;

View file

@ -1,10 +1,10 @@
function _classPrivateFieldBase(receiver, privateKey) {
if (!Object.prototype.hasOwnProperty.call(receiver, privateKey)) {
throw new TypeError("attempted to use private field on non-instance");
}
return receiver;
}
module.exports = _classPrivateFieldBase;
function _classPrivateFieldBase(receiver, privateKey) {
if (!Object.prototype.hasOwnProperty.call(receiver, privateKey)) {
throw new TypeError("attempted to use private field on non-instance");
}
return receiver;
}
module.exports = _classPrivateFieldBase;
module.exports["default"] = module.exports, module.exports.__esModule = true;

View file

@ -1,8 +1,8 @@
var id = 0;
function _classPrivateFieldKey(name) {
return "__private_" + id++ + "_" + name;
}
module.exports = _classPrivateFieldKey;
var id = 0;
function _classPrivateFieldKey(name) {
return "__private_" + id++ + "_" + name;
}
module.exports = _classPrivateFieldKey;
module.exports["default"] = module.exports, module.exports.__esModule = true;

Some files were not shown because too many files have changed in this diff Show more