diff options
author | Morris Jobke <hey@morrisjobke.de> | 2014-11-24 14:03:07 +0100 |
---|---|---|
committer | Morris Jobke <hey@morrisjobke.de> | 2014-11-24 14:03:07 +0100 |
commit | 168fce0b182e69d1364e4432178a8131961d6583 (patch) | |
tree | ab0b80f1d3df45aeae25183dd00231f1a5d7a7c4 /settings | |
parent | 1b17429c1db8885227436d9f367b930b953e49af (diff) | |
parent | d15f1882f91c4ab71c8a41f62f5277bff5fa4ea6 (diff) | |
download | nextcloud-server-168fce0b182e69d1364e4432178a8131961d6583.tar.gz nextcloud-server-168fce0b182e69d1364e4432178a8131961d6583.zip |
Merge pull request #12303 from owncloud/windows-unknown-command-command
Deduplicate findBinaryPath() and do not try "command -v" on windows
Diffstat (limited to 'settings')
-rw-r--r-- | settings/admin.php | 18 |
1 files changed, 1 insertions, 17 deletions
diff --git a/settings/admin.php b/settings/admin.php index d1ed6e75f50..a669974891c 100644 --- a/settings/admin.php +++ b/settings/admin.php @@ -17,7 +17,7 @@ $config = \OC::$server->getConfig(); $appConfig = \OC::$server->getAppConfig(); // Should we display sendmail as an option? -$template->assign('sendmail_is_available', (bool)findBinaryPath('sendmail')); +$template->assign('sendmail_is_available', (bool) \OC_Helper::findBinaryPath('sendmail')); $template->assign('loglevel', $config->getSystemValue("loglevel", 2)); $template->assign('mail_domain', $config->getSystemValue("mail_domain", '')); @@ -115,19 +115,3 @@ $formsAndMore[] = array('anchor' => 'log-section', 'section-name' => $l->t('Log' $template->assign('forms', $formsAndMore); $template->printPage(); - -/** - * Try to find a program - * - * @param string $program - * @return null|string - */ -function findBinaryPath($program) { - if (OC_Helper::is_function_enabled('exec')) { - exec('command -v ' . escapeshellarg($program) . ' 2> /dev/null', $output, $returnCode); - if ($returnCode === 0 && count($output) > 0) { - return escapeshellcmd($output[0]); - } - } - return null; -} |