Blame view
sources/settings/admin.php
4.95 KB
|
03e52840d
|
1 2 3 4 5 6 7 8 |
<?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. */ OC_Util::checkAdminUser(); |
|
03e52840d
|
9 10 11 12 |
OC_Util::addStyle( "settings", "settings" ); OC_Util::addScript( "settings", "admin" ); OC_Util::addScript( "settings", "log" ); |
|
6d9380f96
|
13 |
OC_Util::addScript( 'core', 'multiselect' ); |
|
03e52840d
|
14 15 16 17 |
OC_App::setActiveNavigationEntry( "admin" );
$tmpl = new OC_Template( 'settings', 'admin', 'user');
$forms=OC_App::getForms('admin');
|
|
6d9380f96
|
18 |
$htaccessworking=OC_Util::isHtaccessWorking(); |
|
03e52840d
|
19 20 |
$entries=OC_Log_Owncloud::getEntries(3); |
|
31b7f2792
|
21 |
$entriesremain = count(OC_Log_Owncloud::getEntries(4)) > 3; |
|
03e52840d
|
22 |
|
|
6d9380f96
|
23 24 |
// Should we display sendmail as an option?
$tmpl->assign('sendmail_is_available', (bool) findBinaryPath('sendmail'));
|
|
03e52840d
|
25 |
$tmpl->assign('loglevel', OC_Config::getValue( "loglevel", 2 ));
|
|
6d9380f96
|
26 27 28 29 30 31 32 33 34 35 |
$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", '' ));
|
|
03e52840d
|
36 37 38 |
$tmpl->assign('entries', $entries);
$tmpl->assign('entriesremain', $entriesremain);
$tmpl->assign('htaccessworking', $htaccessworking);
|
|
31b7f2792
|
39 40 |
$tmpl->assign('internetconnectionworking', OC_Util::isInternetConnectionEnabled() ? OC_Util::isInternetConnectionWorking() : false);
$tmpl->assign('isLocaleWorking', OC_Util::isSetLocaleWorking());
|
|
6d9380f96
|
41 |
$tmpl->assign('isAnnotationsWorking', OC_Util::isAnnotationsWorking());
|
|
03e52840d
|
42 43 |
$tmpl->assign('isWebDavWorking', OC_Util::isWebDAVWorking());
$tmpl->assign('has_fileinfo', OC_Util::fileInfoLoaded());
|
|
31b7f2792
|
44 |
$tmpl->assign('old_php', OC_Util::isPHPoutdated());
|
|
03e52840d
|
45 |
$tmpl->assign('backgroundjobs_mode', OC_Appconfig::getValue('core', 'backgroundjobs_mode', 'ajax'));
|
|
6d9380f96
|
46 47 |
$tmpl->assign('cron_log', OC_Config::getValue('cron_log', true));
$tmpl->assign('lastcron', OC_Appconfig::getValue('core', 'lastcron', false));
|
|
03e52840d
|
48 |
$tmpl->assign('shareAPIEnabled', OC_Appconfig::getValue('core', 'shareapi_enabled', 'yes'));
|
|
6d9380f96
|
49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 |
$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'));
$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);
|
|
03e52840d
|
69 70 |
// Check if connected using HTTPS |
|
31b7f2792
|
71 72 |
if (OC_Request::serverProtocol() === 'https') {
$connectedHTTPS = true;
|
|
03e52840d
|
73 74 |
} else {
$connectedHTTPS = false;
|
|
31b7f2792
|
75 |
} |
|
03e52840d
|
76 77 78 79 |
$tmpl->assign('isConnectedViaHTTPS', $connectedHTTPS);
$tmpl->assign('enforceHTTPSEnabled', OC_Config::getValue( "forcessl", false));
$tmpl->assign('allowLinks', OC_Appconfig::getValue('core', 'shareapi_allow_links', 'yes'));
|
|
6d9380f96
|
80 |
$tmpl->assign('enforceLinkPassword', \OCP\Util::isPublicLinkPasswordRequired());
|
|
03e52840d
|
81 82 |
$tmpl->assign('allowPublicUpload', OC_Appconfig::getValue('core', 'shareapi_allow_public_upload', 'yes'));
$tmpl->assign('allowResharing', OC_Appconfig::getValue('core', 'shareapi_allow_resharing', 'yes'));
|
|
6d9380f96
|
83 84 |
$tmpl->assign('allowMailNotification', OC_Appconfig::getValue('core', 'shareapi_allow_mail_notification', 'no'));
$tmpl->assign('onlyShareWithGroupMembers', \OC\Share\Share::shareWithGroupMembersOnly());
|
|
03e52840d
|
85 86 87 88 |
$tmpl->assign('forms', array());
foreach($forms as $form) {
$tmpl->append('forms', $form);
}
|
|
6d9380f96
|
89 90 91 |
$databaseOverload = (strpos(\OCP\Config::getSystemValue('dbtype'), 'sqlite') !== false);
$tmpl->assign('databaseOverload', $databaseOverload);
|
|
03e52840d
|
92 |
$tmpl->printPage(); |
|
6d9380f96
|
93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 |
/**
* Try to find a programm
*
* @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;
}
|