Example #1
0
//  rtGui is free software: you can redistribute it and/or modify
//  it under the terms of the GNU General Public License as published by
//  the Free Software Foundation, either version 3 of the License, or
//  (at your option) any later version.
//
//  rtGui is distributed in the hope that it will be useful,
//  but WITHOUT ANY WARRANTY; without even the implied warranty of
//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
//  GNU General Public License for more details.
//
//  You should have received a copy of the GNU General Public License
//  along with rtGui.  If not, see <http://www.gnu.org/licenses/>.
$execstart = microtime(true);
require_once 'config.php';
require_once 'functions.php';
rtgui_session_start();
extract($_REQUEST, EXTR_PREFIX_ALL, 'r');
// Try using alternative XMLRPC library from http://sourceforge.net/projects/phpxmlrpc/
// (see http://code.google.com/p/rtgui/issues/detail?id=19)
if (!function_exists('xml_parser_create')) {
    require_once 'xmlrpc.inc';
    require_once 'xmlrpc_extension_api.inc';
}
if (!isset($r_debug)) {
    $r_debug = 0;
}
$config = array('diskAlertThreshold' => $disk_alert_threshold, 'debugTab' => $debug_mode, 'dateAddedFormat' => $date_added_format, 'rtGuiPath' => get_rtgui_path(), 'canHideUnhide' => $can_hide_unhide, 'defaultFilterText' => 'Filter');
$user_settings = array('refreshInterval' => (int) get_user_setting('refresh_interval'), 'sortVar' => get_user_setting('sort_var'), 'sortDesc' => get_user_setting('sort_desc') == 'yes' ? true : false, 'theme' => get_current_theme(), 'useDialogs' => get_user_setting('use_dialogs') == 'yes' ? true : false, 'showHidden' => get_user_setting('show_hidden') == 'yes' ? true : false);
// Reset saved data (if any)
$_SESSION['rpc_cache'] = array();
$_SESSION['persistent'] = array();
Example #2
0
function on_page_requested()
{
    require_once 'session.php';
    rtgui_session_start();
    if (!$_SESSION['mounted']) {
        exec('mount | grep //htpc/bit.torrents || sudo mount-htpc 2>&1', $out, $err);
        if ($err) {
            die('<h1>Could not mount rTorrent directories</h1><pre>' . implode("\n", $out) . '</pre>');
        }
        $_SESSION['mounted'] = true;
    }
}