* * You should have received a copy of the GNU Affero General Public License, version 3, * along with this program. If not, see <http://www.gnu.org/licenses/> * */ use OC\Lock\NoopLockingProvider; OC_Util::checkAdminUser(); OC_App::setActiveNavigationEntry("admin"); $template = new OC_Template('settings', 'admin', 'user'); $l = OC_L10N::get('settings'); $showLog = \OC::$server->getConfig()->getSystemValue('log_type', 'owncloud') === 'owncloud'; $numEntriesToLoad = 3; $entries = OC_Log_Owncloud::getEntries($numEntriesToLoad + 1); $entriesRemaining = count($entries) > $numEntriesToLoad; $entries = array_slice($entries, 0, $numEntriesToLoad); $logFilePath = OC_Log_Owncloud::getLogFilePath(); $doesLogFileExist = file_exists($logFilePath); $logFileSize = filesize($logFilePath); $config = \OC::$server->getConfig(); $appConfig = \OC::$server->getAppConfig(); $request = \OC::$server->getRequest(); // Should we display sendmail as an option? $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", '')); $template->assign('mail_from_address', $config->getSystemValue("mail_from_address", '')); $template->assign('mail_smtpmode', $config->getSystemValue("mail_smtpmode", '')); $template->assign('mail_smtpsecure', $config->getSystemValue("mail_smtpsecure", '')); $template->assign('mail_smtphost', $config->getSystemValue("mail_smtphost", '')); $template->assign('mail_smtpport', $config->getSystemValue("mail_smtpport", '')); $template->assign('mail_smtpauthtype', $config->getSystemValue("mail_smtpauthtype", ''));
/** * download logfile * * @NoCSRFRequired * * @return StreamResponse */ public function download() { $resp = new StreamResponse(\OC_Log_Owncloud::getLogFilePath()); $resp->addHeader('Content-Disposition', 'attachment; filename="owncloud.log"'); return $resp; }