Add disabled mode

This commit is contained in:
Pierre Rudloff 2015-01-07 11:04:06 +01:00
parent 69fec2bcb1
commit 5b7a90eb97
3 changed files with 54 additions and 1 deletions

View file

@ -12,7 +12,9 @@
* @license GNU General Public License http://www.gnu.org/licenses/gpl.html * @license GNU General Public License http://www.gnu.org/licenses/gpl.html
* @link http://rudloff.pro * @link http://rudloff.pro
* */ * */
if (MAINTENANCE) { if (DISABLED) {
header('Location: disabled.php'); exit;
} else if (MAINTENANCE) {
header('Location: maintenance.php'); exit; header('Location: maintenance.php'); exit;
} }
?> ?>

View file

@ -16,4 +16,5 @@ define('PYTHON', '/usr/bin/python');
define('PARAMS', '--no-playlist --no-warnings'); define('PARAMS', '--no-playlist --no-warnings');
define('CONVERT', true); define('CONVERT', true);
define('MAINTENANCE', false); define('MAINTENANCE', false);
define('DISABLED', false);
?> ?>

50
disabled.php Normal file
View file

@ -0,0 +1,50 @@
<?php
/**
* PHP web interface for youtube-dl (http://rg3.github.com/youtube-dl/)
* Index page
*
* PHP Version 5.3.10
*
* @category Youtube-dl
* @package Youtubedl
* @author Pierre Rudloff <contact@rudloff.pro>
* @author Olivier Haquette <contact@olivierhaquette.fr>
* @license GNU General Public License http://www.gnu.org/licenses/gpl.html
* @link http://rudloff.pro
* */
require_once 'config.php';
if (!DISABLED) {
header('Location: index.php'); exit;
}
require 'head.php';
?>
<body>
<?php
require 'header.php';
?>
<div class="wrapper">
<div class="main">
<h1><img itemprop="image" class="logo" src="img/logo.png"
alt="AllTube Download" width="328" height="284"></h1>
<div>
Due to various technical reasons,
we can no longer host an online version of AllTube.<br/>
However, you are free to
<a title="AllTube releases on GitHub"
href="https://github.com/Rudloff/alltube/releases">
download the code</a>
and run it on your own server.
</div>
</div>
</div>
<?php
require 'footer.php';
?>
</body>
</html>