Example #1
0
{
    exec('which ' . escapeshellarg($program) . ' 2> /dev/null', $output, $returnCode);
    if ($returnCode === 0 && count($output) > 0) {
        return escapeshellcmd($output[0]);
    }
    return null;
}
// movie preview is currently not supported on Windows
if (!\OC_Util::runningOnWindows()) {
    $isExecEnabled = !in_array('exec', explode(', ', ini_get('disable_functions')));
    $ffmpegBinary = null;
    $avconvBinary = null;
    if ($isExecEnabled) {
        $avconvBinary = findBinaryPath('avconv');
        if (!$avconvBinary) {
            $ffmpegBinary = findBinaryPath('ffmpeg');
        }
    }
    if ($isExecEnabled && ($avconvBinary || $ffmpegBinary)) {
        class Movie extends Provider
        {
            public static $avconvBinary;
            public static $ffmpegBinary;
            public function getMimeType()
            {
                return '/video\\/.*/';
            }
            public function getThumbnail($path, $maxX, $maxY, $scalingup, $fileview)
            {
                // TODO: use proc_open() and stream the source file ?
                $absPath = \OC_Helper::tmpFile();
Example #2
0
OCP\Util::addScript('settings', 'settings');
OCP\Util::addScript("settings", "admin");
OCP\Util::addScript("settings", "log");
OCP\Util::addScript('core', 'multiselect');
OCP\Util::addScript('core', 'select2/select2');
OCP\Util::addStyle('core', 'select2/select2');
OCP\Util::addScript('core', 'setupchecks');
OC_App::setActiveNavigationEntry("admin");
$tmpl = new OC_Template('settings', 'admin', 'user');
$forms = OC_App::getForms('admin');
$htaccessworking = OC_Util::isHtaccessWorking();
$entries = OC_Log_Owncloud::getEntries(3);
$entriesremain = count(OC_Log_Owncloud::getEntries(4)) > 3;
$config = \OC::$server->getConfig();
// Should we display sendmail as an option?
$tmpl->assign('sendmail_is_available', (bool) findBinaryPath('sendmail'));
$tmpl->assign('loglevel', OC_Config::getValue("loglevel", 2));
$tmpl->assign('mail_domain', OC_Config::getValue("mail_domain", ''));
$tmpl->assign('mail_from_address', OC_Config::getValue("mail_from_address", ''));
$tmpl->assign('mail_smtpmode', OC_Config::getValue("mail_smtpmode", ''));
$tmpl->assign('mail_smtpsecure', OC_Config::getValue("mail_smtpsecure", ''));
$tmpl->assign('mail_smtphost', OC_Config::getValue("mail_smtphost", ''));
$tmpl->assign('mail_smtpport', OC_Config::getValue("mail_smtpport", ''));
$tmpl->assign('mail_smtpauthtype', OC_Config::getValue("mail_smtpauthtype", ''));
$tmpl->assign('mail_smtpauth', OC_Config::getValue("mail_smtpauth", false));
$tmpl->assign('mail_smtpname', OC_Config::getValue("mail_smtpname", ''));
$tmpl->assign('mail_smtppassword', OC_Config::getValue("mail_smtppassword", ''));
$tmpl->assign('entries', $entries);
$tmpl->assign('entriesremain', $entriesremain);
$tmpl->assign('htaccessworking', $htaccessworking);
$tmpl->assign('readOnlyConfigEnabled', OC_Helper::isReadOnlyConfigEnabled());