Added a page to display details about a source

Placeholder source detail page which checks that the source is valid and lies below the configured rips.source_dir.
This commit is contained in:
2010-03-21 02:46:31 +00:00
parent 835609a2c9
commit b26367e953
3 changed files with 48 additions and 1 deletions

View File

@@ -0,0 +1,24 @@
<?php
$main = HandBrakeCluster_Main::instance();
$req = $main->request();
$config = $main->config();
// Grab the name of this source
$source_id = $req->get('id');
$source = base64_decode(str_replace('-', '/', $source_id));
$real_source = realpath($source);
// Ensure the source is a valid directory, and lies below the configured source_dir
if (!is_dir($source)) {
return;
}
$real_source_dir = realpath($config->get('rips.source_dir'));
if (substr($real_source, 0, strlen($real_source_dir)) != $real_source_dir) {
return;
}
$this->smarty->assign('source', $source);
?>