Пример #1
0
<?php

use app\Lib\Users;
use app\Lib\Server;
$title_seedbox = 'seedbox-' . $userName;
$user = new Users($file_user_ini, $userName);
$serveur = new Server($file_user_ini, $userName);
$passwd = isset($_SERVER['PHP_AUTH_PW']) ? $_SERVER['PHP_AUTH_PW'] : null;
$passwd = htmlspecialchars($passwd, ENT_NOQUOTES);
// setting transdroid
$tableau_conf_trandroid = array('ui_swipe_labels' => false, 'alarm_vibrate' => false, 'alarm_enabled' => false, 'alarm_check_rss_feeds' => false, 'websites' => array(), 'ui_refresh_interval' => '60', 'ui_hide_refresh' => false, 'search_sort_by' => 'sort_seeders', 'alarm_play_sound' => false, 'ui_enable_ads' => true, 'ui_only_show_transferring' => false, 'search_num_results' => '25', 'servers' => array(array('port' => '443', 'host' => $_SERVER['HTTP_HOST'], 'ssl' => true, 'type' => 'daemon_rtorrent', 'password' => $passwd, 'os_type' => 'type_linux', 'folder' => $user->scgi_folder(), 'username' => $userName, 'use_auth' => true, 'name' => $title_seedbox, 'base_ftp_url' => 'ftp://' . $userName . '@' . $_SERVER['HTTP_HOST'] . '/torrents/', 'download_alarm' => true, 'new_torrent_alarm' => true, 'ssl_accept_all' => true)), 'alarm_interval' => '600000', 'rssfeeds' => array(), 'ui_ask_before_remove' => true);
$conf_json_trandroid = json_encode($tableau_conf_trandroid);
// setting filezilla
$conf_xml_filezilla = '<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>' . "\n" . '<FileZilla3>' . "\n" . '<Servers>' . "\n" . '<Server>' . "\n" . '<Host>' . $_SERVER['HTTP_HOST'] . '</Host>' . "\n" . '<Port>' . $user->portFtp() . '</Port>' . "\n" . '<Protocol>0</Protocol>' . "\n" . '<Type>0</Type>' . "\n" . '<User>' . $userName . '</User>' . "\n" . '<Pass>' . $passwd . '</Pass>' . "\n" . '<Logontype>1</Logontype>' . "\n" . '<TimezoneOffset>0</TimezoneOffset>' . "\n" . '<PasvMode>MODE_DEFAULT</PasvMode>' . "\n" . '<MaximumMultipleConnections>0</MaximumMultipleConnections>' . "\n" . '<EncodingType>UTF-8</EncodingType>' . "\n" . '<BypassProxy>0</BypassProxy>' . "\n" . '<Name>' . $title_seedbox . '-ftp</Name>' . "\n" . '<Comments />' . "\n" . '<LocalDir />' . "\n" . '<RemoteDir />' . "\n" . '<SyncBrowsing>0</SyncBrowsing>' . $title_seedbox . '-ftp&#x0A;' . "\n" . '</Server>' . "\n" . '<Server>' . "\n" . '<Host>' . $_SERVER['HTTP_HOST'] . '</Host>' . "\n" . '<Port>' . $user->portSftp() . '</Port>' . "\n" . '<Protocol>1</Protocol>' . "\n" . '<Type>0</Type>' . "\n" . '<User>' . $userName . '</User>' . "\n" . '<Pass>' . $passwd . '</Pass>' . "\n" . '<Logontype>1</Logontype>' . "\n" . '<TimezoneOffset>0</TimezoneOffset>' . "\n" . '<PasvMode>MODE_DEFAULT</PasvMode>' . "\n" . '<MaximumMultipleConnections>0</MaximumMultipleConnections>' . "\n" . '<EncodingType>Auto</EncodingType>' . "\n" . '<BypassProxy>0</BypassProxy>' . "\n" . '<Name>' . $title_seedbox . '-sftp</Name>' . "\n" . '<Comments />' . "\n" . '<LocalDir />' . "\n" . '<RemoteDir />' . "\n" . '<SyncBrowsing>0</SyncBrowsing>' . $title_seedbox . '-sftp&#x0A;' . "\n" . '</Server>' . "\n" . '</Servers>' . "\n" . '</FileZilla3>';
if ($_GET['file'] == 'transdroid') {
    $serveur->FileDownload('settings.json', $conf_json_trandroid);
} elseif ($_GET['file'] == 'filezilla') {
    $serveur->FileDownload('filezilla.xml', $conf_xml_filezilla);
}
Пример #2
0
}
if (isset($_POST['deleteUserName'])) {
    $log_delete_user = Users::delete_config_old_user('../conf/users/' . $_POST['deleteUserName']);
}
if (isset($_POST['support']) && isset($_POST['message'])) {
    $support = new Support($file_user_ini, $userName);
    $LogSupport = $support->sendTicket($_POST['message'], $_POST['user']);
}
if (isset($_POST['cloture']) && isset($_POST['user'])) {
    $LogCloture = Support::ClotureTicket($_POST['user']);
}
/* REQUEST GET */
if (isset($_GET['admin'])) {
    if (empty($_GET['user'])) {
        $loader_file_ini_user = new Users('../conf/users/' . $userName . '/config.ini', $userName);
    } else {
        $loader_file_ini_user = new Users('../conf/users/' . $_GET['user'] . '/config.ini', $_GET['user']);
    }
}
if (isset($_GET['download'])) {
    require '../app/downloads.php';
}
/* init objet */
$user = new Users($file_user_ini, $userName);
$serveur = new Server($file_user_ini, $userName);
$support = new Support($file_user_ini, $userName);
$read_data_reboot = $user->readFileDataReboot('../conf/users/' . $userName . '/data_reboot.txt');
/* init twig */
$loader = new Twig_Loader_Filesystem('themes/' . $user->theme());
$twig = new Twig_Environment($loader);
echo $twig->render('index.html', array('userName' => $userName, 'post' => $_POST, 'get' => $_GET, 'host' => $_SERVER['HTTP_HOST'], 'ipUser' => $_SERVER['REMOTE_ADDR'], 'user' => $user, 'serveur' => $serveur, 'support' => $support, 'rebootRtorrent' => @$rebootRtorrent, 'supportTicketSend' => @$LogSupport, 'supportTicketClose' => @$LogCloture, 'read_data_reboot' => $read_data_reboot, 'updateIniFileLogUser' => @$update_ini_file_log, 'updateIniFileLogOwner' => @$update_ini_file_log_owner, 'LogDeleteUser' => @$log_delete_user, 'UpdateOwner' => @$loader_file_ini_user, 'ClearCache' => @$ClearCache));