/** * get log entries from logfile * * @param int $count * @param int $offset * @return JSONResponse */ public function getEntries($count = 50, $offset = 0) { return new JSONResponse(['data' => \OC_Log_Owncloud::getEntries($count, $offset), 'remain' => count(\OC_Log_Owncloud::getEntries(1, $offset + $count)) !== 0]); }
* but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Affero General Public License for more details. * * 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", ''));
/** * Copyright (c) 2011, Robin Appelman <*****@*****.**> * This file is licensed under the Affero General Public License version 3 or later. * See the COPYING-README file. */ require_once '../lib/base.php'; OC_Util::checkAdminUser(); OC_Util::addStyle("settings", "settings"); OC_Util::addScript("settings", "admin"); OC_Util::addScript("settings", "log"); 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 ? true : false; function compareEntries($a, $b) { return $b->time - $a->time; } usort($entries, 'compareEntries'); $tmpl->assign('loglevel', OC_Config::getValue("loglevel", 2)); $tmpl->assign('entries', OC_Util::sanitizeHTML($entries)); $tmpl->assign('entriesremain', $entriesremain); $tmpl->assign('htaccessworking', $htaccessworking); $tmpl->assign('forms', array()); foreach ($forms as $form) { $tmpl->append('forms', $form); } $tmpl->printPage();
<?php /** * Copyright (c) 2011, Robin Appelman <*****@*****.**> * This file is licensed under the Affero General Public License version 3 or later. * See the COPYING-README file. */ require_once '../lib/base.php'; OC_Util::checkAdminUser(); OC_Util::addStyle("settings", "settings"); OC_Util::addScript("settings", "admin"); OC_Util::addScript("settings", "log"); OC_App::setActiveNavigationEntry("admin"); $tmpl = new OC_Template('settings', 'admin', 'user'); $forms = OC_App::getForms('admin'); $entries = OC_Log_Owncloud::getEntries(3); function compareEntries($a, $b) { return $b->time - $a->time; } usort($entries, 'compareEntries'); $tmpl->assign('loglevel', OC_Config::getValue("loglevel", 2)); $tmpl->assign('entries', $entries); $tmpl->assign('forms', array()); foreach ($forms as $form) { $tmpl->append('forms', $form); } $tmpl->printPage();
*/ OC_Util::checkAdminUser(); OCP\Util::addStyle('settings', 'settings'); 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);
<?php /** * Copyright (c) 2012, Robin Appelman <*****@*****.**> * This file is licensed under the Affero General Public License version 3 or later. * See the COPYING-README file. */ OC_JSON::checkAdminUser(); $count = isset($_GET['count']) ? $_GET['count'] : 50; $offset = isset($_GET['offset']) ? $_GET['offset'] : 0; $entries = OC_Log_Owncloud::getEntries($count, $offset); OC_JSON::success(array("data" => OC_Util::sanitizeHTML($entries), "remain" => count(OC_Log_Owncloud::getEntries(1, $offset + $offset)) != 0 ? true : false));
<?php /** * Copyright (c) 2012, Robin Appelman <*****@*****.**> * This file is licensed under the Affero General Public License version 3 or later. * See the COPYING-README file. */ OC_JSON::checkAdminUser(); $count = isset($_GET['count']) ? $_GET['count'] : 50; $offset = isset($_GET['offset']) ? $_GET['offset'] : 0; $entries = OC_Log_Owncloud::getEntries($count, $offset); $data = array(); OC_JSON::success(array("data" => $entries, "remain" => count(OC_Log_Owncloud::getEntries(1, $offset + $offset)) != 0 ? true : false));
<?php /** * Copyright (c) 2012, Robin Appelman <*****@*****.**> * This file is licensed under the Affero General Public License version 3 or later. * See the COPYING-README file. */ OC_JSON::checkAdminUser(); $count = isset($_GET['count']) ? $_GET['count'] : 50; $offset = isset($_GET['offset']) ? $_GET['offset'] : 0; $entries = OC_Log_Owncloud::getEntries($count, $offset); $data = array(); OC_JSON::success(array("data" => $entries, "remain" => count(OC_Log_Owncloud::getEntries(1, $offset + $count)) !== 0));
<?php /** * Copyright (c) 2011, Robin Appelman <*****@*****.**> * This file is licensed under the Affero General Public License version 3 or later. * See the COPYING-README file. */ OC_Util::checkAdminUser(); OC_App::setActiveNavigationEntry("admin"); $template = new OC_Template('settings', 'admin', 'user'); $htAccessWorking = OC_Util::isHtaccessWorking(); $entries = OC_Log_Owncloud::getEntries(3); $entriesRemaining = count(OC_Log_Owncloud::getEntries(4)) > 3; $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('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", '')); $template->assign('mail_smtpauth', $config->getSystemValue("mail_smtpauth", false)); $template->assign('mail_smtpname', $config->getSystemValue("mail_smtpname", '')); $template->assign('mail_smtppassword', $config->getSystemValue("mail_smtppassword", '')); $template->assign('entries', $entries); $template->assign('entriesremain', $entriesRemaining); $template->assign('htaccessworking', $htAccessWorking);
<?php /** * Copyright (c) 2012, Robin Appelman <*****@*****.**> * This file is licensed under the Affero General Public License version 3 or later. * See the COPYING-README file. */ // Init owncloud require_once '../../lib/base.php'; OC_JSON::checkAdminUser(); $count = isset($_GET['count']) ? $_GET['count'] : 50; $offset = isset($_GET['offset']) ? $_GET['offset'] : 0; $entries = OC_Log_Owncloud::getEntries($count, $offset); OC_JSON::success(array("data" => $entries));
/** * download logfile * * @NoCSRFRequired * * @return DataDownloadResponse */ public function download() { return new DataDownloadResponse(json_encode(\OC_Log_Owncloud::getEntries(null, null)), $this->getFilenameForDownload(), 'application/json'); }