<?php
/*
 *    Copyright (c) 2010 Just Another Video script
 *
 *    This file is part of Just Another Video script.
 *    Come to website for support or buying additional plugins/modules.
 *    http://justanothervideoscript.com/
 */
require_once( "../../functions.php" );
session_start();
if (!Beveiliging()){
    header ( "location: ../../index.php" );
} else {
	include_once("../../modules/adminfunctions.inc");
	if($_GET['findthis']) {
		switch($_GET['findthis']) {
			case "ffmpeg":
				$cmd = 'whereis ffmpeg 2>&1' ;
			break;
			case "flvtool2":
				$cmd = 'whereis flvtool2 2>&1' ;
			break;
			case "MP4box":
				$cmd = 'whereis MP4Box 2>&1' ;
			break;
			case "curl":
				$cmd = 'whereis curl 2>&1' ;
			break;
			case "php":
				$cmd = 'whereis php 2>&1' ;
			break;
			case "wget":
				$cmd = 'whereis wget 2>&1' ;
			break;
		}
		if (isset($cmd)) {
			exec($cmd, $res, $err) ;
			echo str_replace(' ', '<br>', implode($res)) ;
		}
	}
	if($_GET['versionthis']) {
		switch($_GET['versionthis']) {
			case "ffmpeg":
				$cmd = 'ffmpeg -version 2>&1' ;
			break;
			case "flvtool2":
				$cmd = 'flvtool2 -V 2>&1' ;
			break;
			case "MP4box":
				$cmd = 'MP4Box -version 2>&1' ;
			break;
			case "curl":
				$cmd = 'curl -V 2>&1' ;
			break;
			case "php":
				$cmd = 'php -v 2>&1' ;
			break;
		}
		if (isset($cmd)) {
			$output = '';
			exec($cmd, $res, $err) ;
			foreach ($res as $value) {
				$output .= $value.'<br>' ;
			}
			echo $output ;
		}
	}
}
?>