Merge pull request #7564 from owncloud/issue/7559
Hide QMail when not selected and hide SendMail when not available on the server
This commit is contained in:
commit
5fcfb2ef84
|
@ -20,6 +20,11 @@ $htaccessworking=OC_Util::isHtAccessWorking();
|
||||||
$entries=OC_Log_Owncloud::getEntries(3);
|
$entries=OC_Log_Owncloud::getEntries(3);
|
||||||
$entriesremain = count(OC_Log_Owncloud::getEntries(4)) > 3;
|
$entriesremain = count(OC_Log_Owncloud::getEntries(4)) > 3;
|
||||||
|
|
||||||
|
// Should we display sendmail as an option?
|
||||||
|
if (findBinaryPath('sendmailsendmail')) {
|
||||||
|
$tmpl->assign('sendmail_is_available', true);
|
||||||
|
}
|
||||||
|
|
||||||
$tmpl->assign('loglevel', OC_Config::getValue( "loglevel", 2 ));
|
$tmpl->assign('loglevel', OC_Config::getValue( "loglevel", 2 ));
|
||||||
$tmpl->assign('mail_domain', OC_Config::getValue( "mail_domain", '' ));
|
$tmpl->assign('mail_domain', OC_Config::getValue( "mail_domain", '' ));
|
||||||
$tmpl->assign('mail_from_address', OC_Config::getValue( "mail_from_address", '' ));
|
$tmpl->assign('mail_from_address', OC_Config::getValue( "mail_from_address", '' ));
|
||||||
|
@ -61,3 +66,17 @@ foreach($forms as $form) {
|
||||||
$tmpl->append('forms', $form);
|
$tmpl->append('forms', $form);
|
||||||
}
|
}
|
||||||
$tmpl->printPage();
|
$tmpl->printPage();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Try to find a programm
|
||||||
|
*
|
||||||
|
* @param string $program
|
||||||
|
* @return null|string
|
||||||
|
*/
|
||||||
|
function findBinaryPath($program) {
|
||||||
|
exec('command -v ' . escapeshellarg($program) . ' 2> /dev/null', $output, $returnCode);
|
||||||
|
if ($returnCode === 0 && count($output) > 0) {
|
||||||
|
return escapeshellcmd($output[0]);
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
|
@ -26,11 +26,15 @@ $mail_smtpsecure = array(
|
||||||
);
|
);
|
||||||
|
|
||||||
$mail_smtpmode = array(
|
$mail_smtpmode = array(
|
||||||
'sendmail',
|
|
||||||
'smtp',
|
|
||||||
'qmail',
|
|
||||||
'php',
|
'php',
|
||||||
|
'smtp',
|
||||||
);
|
);
|
||||||
|
if ($_['sendmail_is_available']) {
|
||||||
|
$mail_smtpmode[] = 'sendmail';
|
||||||
|
}
|
||||||
|
if ($_['mail_smtpmode'] == 'qmail') {
|
||||||
|
$mail_smtpmode[] = 'qmail';
|
||||||
|
}
|
||||||
|
|
||||||
?>
|
?>
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue