2011-08-22 23:40:13 +00:00
|
|
|
<?php
|
|
|
|
/**
|
|
|
|
* Copyright (c) 2011, Robin Appelman <icewind1991@gmail.com>
|
|
|
|
* This file is licensed under the Affero General Public License version 3 or later.
|
|
|
|
* See the COPYING-README file.
|
|
|
|
*/
|
|
|
|
|
2011-09-18 19:31:56 +00:00
|
|
|
OC_Util::checkAdminUser();
|
2011-08-22 23:40:13 +00:00
|
|
|
|
|
|
|
OC_Util::addStyle( "settings", "settings" );
|
2011-10-16 19:08:44 +00:00
|
|
|
OC_Util::addScript( "settings", "admin" );
|
2012-04-16 10:21:12 +00:00
|
|
|
OC_Util::addScript( "settings", "log" );
|
2014-05-13 13:22:18 +00:00
|
|
|
OC_Util::addScript( 'core', 'multiselect' );
|
2011-08-22 23:40:13 +00:00
|
|
|
OC_App::setActiveNavigationEntry( "admin" );
|
|
|
|
|
|
|
|
$tmpl = new OC_Template( 'settings', 'admin', 'user');
|
|
|
|
$forms=OC_App::getForms('admin');
|
2014-04-21 13:44:54 +00:00
|
|
|
$htaccessworking=OC_Util::isHtaccessWorking();
|
2012-04-16 10:21:12 +00:00
|
|
|
|
|
|
|
$entries=OC_Log_Owncloud::getEntries(3);
|
2013-08-17 21:38:26 +00:00
|
|
|
$entriesremain = count(OC_Log_Owncloud::getEntries(4)) > 3;
|
2012-08-04 15:38:31 +00:00
|
|
|
|
2014-03-05 13:53:20 +00:00
|
|
|
// Should we display sendmail as an option?
|
2014-06-30 13:01:12 +00:00
|
|
|
$tmpl->assign('sendmail_is_available', (bool) findBinaryPath('sendmail'));
|
2014-03-05 13:53:20 +00:00
|
|
|
|
2012-11-04 10:10:46 +00:00
|
|
|
$tmpl->assign('loglevel', OC_Config::getValue( "loglevel", 2 ));
|
2014-02-12 16:21:41 +00:00
|
|
|
$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", '' ));
|
2012-11-02 18:53:02 +00:00
|
|
|
$tmpl->assign('entries', $entries);
|
2012-08-04 15:38:31 +00:00
|
|
|
$tmpl->assign('entriesremain', $entriesremain);
|
2012-11-02 18:53:02 +00:00
|
|
|
$tmpl->assign('htaccessworking', $htaccessworking);
|
2013-05-31 21:24:09 +00:00
|
|
|
$tmpl->assign('internetconnectionworking', OC_Util::isInternetConnectionEnabled() ? OC_Util::isInternetConnectionWorking() : false);
|
2013-11-15 13:46:00 +00:00
|
|
|
$tmpl->assign('isLocaleWorking', OC_Util::isSetLocaleWorking());
|
2014-07-25 07:53:25 +00:00
|
|
|
$tmpl->assign('isPhpCharSetUtf8', OC_Util::isPhpCharSetUtf8());
|
2014-03-07 01:53:33 +00:00
|
|
|
$tmpl->assign('isAnnotationsWorking', OC_Util::isAnnotationsWorking());
|
2013-02-06 23:49:39 +00:00
|
|
|
$tmpl->assign('isWebDavWorking', OC_Util::isWebDAVWorking());
|
2013-02-04 14:04:26 +00:00
|
|
|
$tmpl->assign('has_fileinfo', OC_Util::fileInfoLoaded());
|
2013-12-03 13:30:32 +00:00
|
|
|
$tmpl->assign('old_php', OC_Util::isPHPoutdated());
|
2012-08-09 23:36:33 +00:00
|
|
|
$tmpl->assign('backgroundjobs_mode', OC_Appconfig::getValue('core', 'backgroundjobs_mode', 'ajax'));
|
2014-03-12 14:20:51 +00:00
|
|
|
$tmpl->assign('cron_log', OC_Config::getValue('cron_log', true));
|
|
|
|
$tmpl->assign('lastcron', OC_Appconfig::getValue('core', 'lastcron', false));
|
2012-08-28 00:36:34 +00:00
|
|
|
$tmpl->assign('shareAPIEnabled', OC_Appconfig::getValue('core', 'shareapi_enabled', 'yes'));
|
2014-04-23 10:50:24 +00:00
|
|
|
$tmpl->assign('shareDefaultExpireDateSet', OC_Appconfig::getValue('core', 'shareapi_default_expire_date', 'no'));
|
|
|
|
$tmpl->assign('shareExpireAfterNDays', OC_Appconfig::getValue('core', 'shareapi_expire_after_n_days', '7'));
|
|
|
|
$tmpl->assign('shareEnforceExpireDate', OC_Appconfig::getValue('core', 'shareapi_enforce_expire_date', 'no'));
|
2014-05-13 13:22:18 +00:00
|
|
|
$excludeGroups = OC_Appconfig::getValue('core', 'shareapi_exclude_groups', 'no') === 'yes' ? true : false;
|
|
|
|
$tmpl->assign('shareExcludeGroups', $excludeGroups);
|
|
|
|
$allGroups = OC_Group::getGroups();
|
|
|
|
$excludedGroupsList = OC_Appconfig::getValue('core', 'shareapi_exclude_groups_list', '');
|
|
|
|
$excludedGroups = $excludedGroupsList !== '' ? explode(',', $excludedGroupsList) : array();
|
|
|
|
$groups = array();
|
|
|
|
foreach ($allGroups as $group) {
|
|
|
|
if (in_array($group, $excludedGroups)) {
|
|
|
|
$groups[$group] = array('gid' => $group,
|
|
|
|
'excluded' => true);
|
|
|
|
} else {
|
|
|
|
$groups[$group] = array('gid' => $group,
|
|
|
|
'excluded' => false);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
ksort($groups);
|
|
|
|
$tmpl->assign('groups', $groups);
|
2014-04-23 10:50:24 +00:00
|
|
|
|
2013-01-11 13:18:51 +00:00
|
|
|
|
|
|
|
// Check if connected using HTTPS
|
2013-04-17 13:32:03 +00:00
|
|
|
if (OC_Request::serverProtocol() === 'https') {
|
2013-08-30 11:53:49 +00:00
|
|
|
$connectedHTTPS = true;
|
2013-01-11 13:18:51 +00:00
|
|
|
} else {
|
|
|
|
$connectedHTTPS = false;
|
2013-08-30 11:53:49 +00:00
|
|
|
}
|
2013-01-11 13:18:51 +00:00
|
|
|
$tmpl->assign('isConnectedViaHTTPS', $connectedHTTPS);
|
2013-07-12 15:03:51 +00:00
|
|
|
$tmpl->assign('enforceHTTPSEnabled', OC_Config::getValue( "forcessl", false));
|
2013-01-11 13:18:51 +00:00
|
|
|
|
2012-08-28 00:36:34 +00:00
|
|
|
$tmpl->assign('allowLinks', OC_Appconfig::getValue('core', 'shareapi_allow_links', 'yes'));
|
2014-05-12 10:19:07 +00:00
|
|
|
$tmpl->assign('enforceLinkPassword', \OCP\Util::isPublicLinkPasswordRequired());
|
2013-07-12 15:03:51 +00:00
|
|
|
$tmpl->assign('allowPublicUpload', OC_Appconfig::getValue('core', 'shareapi_allow_public_upload', 'yes'));
|
2012-08-28 00:36:34 +00:00
|
|
|
$tmpl->assign('allowResharing', OC_Appconfig::getValue('core', 'shareapi_allow_resharing', 'yes'));
|
2014-06-03 09:29:28 +00:00
|
|
|
$tmpl->assign('allowMailNotification', OC_Appconfig::getValue('core', 'shareapi_allow_mail_notification', 'no'));
|
2014-06-04 09:07:31 +00:00
|
|
|
$tmpl->assign('onlyShareWithGroupMembers', \OC\Share\Share::shareWithGroupMembersOnly());
|
2012-11-02 18:53:02 +00:00
|
|
|
$tmpl->assign('forms', array());
|
2012-09-07 13:22:01 +00:00
|
|
|
foreach($forms as $form) {
|
2012-11-02 18:53:02 +00:00
|
|
|
$tmpl->append('forms', $form);
|
2011-08-22 23:40:13 +00:00
|
|
|
}
|
2014-06-03 06:01:39 +00:00
|
|
|
|
2014-06-03 10:02:23 +00:00
|
|
|
$databaseOverload = (strpos(\OCP\Config::getSystemValue('dbtype'), 'sqlite') !== false);
|
2014-06-03 09:39:16 +00:00
|
|
|
$tmpl->assign('databaseOverload', $databaseOverload);
|
2014-06-03 06:01:39 +00:00
|
|
|
|
2011-09-18 19:31:56 +00:00
|
|
|
$tmpl->printPage();
|
2014-03-12 10:47:21 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Try to find a programm
|
|
|
|
*
|
|
|
|
* @param string $program
|
|
|
|
* @return null|string
|
|
|
|
*/
|
|
|
|
function findBinaryPath($program) {
|
2014-07-29 14:59:40 +00:00
|
|
|
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]);
|
|
|
|
}
|
2014-03-12 10:47:21 +00:00
|
|
|
}
|
|
|
|
return null;
|
|
|
|
}
|