Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
die_coolen_jungs
our_own_cloud_project
Commits
d9db791c
Commit
d9db791c
authored
Oct 30, 2014
by
Thomas Müller
Browse files
introduce sidebar for admin page
parent
ea55848f
Changes
2
Hide whitespace changes
Inline
Side-by-side
settings/admin.php
View file @
d9db791c
...
...
@@ -6,89 +6,117 @@
*/
OC_Util
::
checkAdminUser
();
OC_App
::
setActiveNavigationEntry
(
"admin"
);
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
;
$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?
$tmpl
->
assign
(
'sendmail_is_available'
,
(
bool
)
findBinaryPath
(
'sendmail'
));
$tmpl
->
assign
(
'loglevel'
,
OC_C
onfig
::
getValue
(
"loglevel"
,
2
));
$tmpl
->
assign
(
'mail_domain'
,
OC_C
onfig
::
getValue
(
"mail_domain"
,
''
));
$tmpl
->
assign
(
'mail_from_address'
,
OC_C
onfig
::
getValue
(
"mail_from_address"
,
''
));
$tmpl
->
assign
(
'mail_smtpmode'
,
OC_C
onfig
::
getValue
(
"mail_smtpmode"
,
''
));
$tmpl
->
assign
(
'mail_smtpsecure'
,
OC_C
onfig
::
getValue
(
"mail_smtpsecure"
,
''
));
$tmpl
->
assign
(
'mail_smtphost'
,
OC_C
onfig
::
getValue
(
"mail_smtphost"
,
''
));
$tmpl
->
assign
(
'mail_smtpport'
,
OC_C
onfig
::
getValue
(
"mail_smtpport"
,
''
));
$tmpl
->
assign
(
'mail_smtpauthtype'
,
OC_C
onfig
::
getValue
(
"mail_smtpauthtype"
,
''
));
$tmpl
->
assign
(
'mail_smtpauth'
,
OC_C
onfig
::
getValue
(
"mail_smtpauth"
,
false
));
$tmpl
->
assign
(
'mail_smtpname'
,
OC_C
onfig
::
getValue
(
"mail_smtpname"
,
''
));
$tmpl
->
assign
(
'mail_smtppassword'
,
OC_C
onfig
::
getValue
(
"mail_smtppassword"
,
''
));
$tmpl
->
assign
(
'entries'
,
$entries
);
$tmpl
->
assign
(
'entriesremain'
,
$entries
r
emain
);
$tmpl
->
assign
(
'htaccessworking'
,
$ht
a
ccess
w
orking
);
$tmpl
->
assign
(
'isLocaleWorking'
,
OC_Util
::
isSetLocaleWorking
());
$tmpl
->
assign
(
'isPhpCharSetUtf8'
,
OC_Util
::
isPhpCharSetUtf8
());
$tmpl
->
assign
(
'isAnnotationsWorking'
,
OC_Util
::
isAnnotationsWorking
());
$tmpl
->
assign
(
'has_fileinfo'
,
OC_Util
::
fileInfoLoaded
());
$tmpl
->
assign
(
'old_php'
,
OC_Util
::
isPHPoutdated
());
$tmpl
->
assign
(
'backgroundjobs_mode'
,
OC_A
pp
c
onfig
::
getValue
(
'core'
,
'backgroundjobs_mode'
,
'ajax'
));
$tmpl
->
assign
(
'cron_log'
,
OC_C
onfig
::
getValue
(
'cron_log'
,
true
));
$tmpl
->
assign
(
'lastcron'
,
OC_A
pp
c
onfig
::
getValue
(
'core'
,
'lastcron'
,
false
));
$tmpl
->
assign
(
'shareAPIEnabled'
,
OC_A
pp
c
onfig
::
getValue
(
'core'
,
'shareapi_enabled'
,
'yes'
));
$tmpl
->
assign
(
'shareDefaultExpireDateSet'
,
OC_A
pp
c
onfig
::
getValue
(
'core'
,
'shareapi_default_expire_date'
,
'no'
));
$tmpl
->
assign
(
'shareExpireAfterNDays'
,
OC_A
pp
c
onfig
::
getValue
(
'core'
,
'shareapi_expire_after_n_days'
,
'7'
));
$tmpl
->
assign
(
'shareEnforceExpireDate'
,
OC_A
pp
c
onfig
::
getValue
(
'core'
,
'shareapi_enforce_expire_date'
,
'no'
));
$excludeGroups
=
OC_A
pp
c
onfig
::
getValue
(
'core'
,
'shareapi_exclude_groups'
,
'no'
)
===
'yes'
?
true
:
false
;
$tmpl
->
assign
(
'shareExcludeGroups'
,
$excludeGroups
);
$excludedGroupsList
=
OC_A
pp
c
onfig
::
getValue
(
'core'
,
'shareapi_exclude_groups_list'
,
''
);
$t
e
mpl
ate
->
assign
(
'sendmail_is_available'
,
(
bool
)
findBinaryPath
(
'sendmail'
));
$t
e
mpl
ate
->
assign
(
'loglevel'
,
$c
onfig
->
get
System
Value
(
"loglevel"
,
2
));
$t
e
mpl
ate
->
assign
(
'mail_domain'
,
$c
onfig
->
get
System
Value
(
"mail_domain"
,
''
));
$t
e
mpl
ate
->
assign
(
'mail_from_address'
,
$c
onfig
->
get
System
Value
(
"mail_from_address"
,
''
));
$t
e
mpl
ate
->
assign
(
'mail_smtpmode'
,
$c
onfig
->
get
System
Value
(
"mail_smtpmode"
,
''
));
$t
e
mpl
ate
->
assign
(
'mail_smtpsecure'
,
$c
onfig
->
get
System
Value
(
"mail_smtpsecure"
,
''
));
$t
e
mpl
ate
->
assign
(
'mail_smtphost'
,
$c
onfig
->
get
System
Value
(
"mail_smtphost"
,
''
));
$t
e
mpl
ate
->
assign
(
'mail_smtpport'
,
$c
onfig
->
get
System
Value
(
"mail_smtpport"
,
''
));
$t
e
mpl
ate
->
assign
(
'mail_smtpauthtype'
,
$c
onfig
->
get
System
Value
(
"mail_smtpauthtype"
,
''
));
$t
e
mpl
ate
->
assign
(
'mail_smtpauth'
,
$c
onfig
->
get
System
Value
(
"mail_smtpauth"
,
false
));
$t
e
mpl
ate
->
assign
(
'mail_smtpname'
,
$c
onfig
->
get
System
Value
(
"mail_smtpname"
,
''
));
$t
e
mpl
ate
->
assign
(
'mail_smtppassword'
,
$c
onfig
->
get
System
Value
(
"mail_smtppassword"
,
''
));
$t
e
mpl
ate
->
assign
(
'entries'
,
$entries
);
$t
e
mpl
ate
->
assign
(
'entriesremain'
,
$entries
R
emain
ing
);
$t
e
mpl
ate
->
assign
(
'htaccessworking'
,
$ht
A
ccess
W
orking
);
$t
e
mpl
ate
->
assign
(
'isLocaleWorking'
,
OC_Util
::
isSetLocaleWorking
());
$t
e
mpl
ate
->
assign
(
'isPhpCharSetUtf8'
,
OC_Util
::
isPhpCharSetUtf8
());
$t
e
mpl
ate
->
assign
(
'isAnnotationsWorking'
,
OC_Util
::
isAnnotationsWorking
());
$t
e
mpl
ate
->
assign
(
'has_fileinfo'
,
OC_Util
::
fileInfoLoaded
());
$t
e
mpl
ate
->
assign
(
'old_php'
,
OC_Util
::
isPHPoutdated
());
$t
e
mpl
ate
->
assign
(
'backgroundjobs_mode'
,
$a
pp
C
onfig
->
getValue
(
'core'
,
'backgroundjobs_mode'
,
'ajax'
));
$t
e
mpl
ate
->
assign
(
'cron_log'
,
$c
onfig
->
get
System
Value
(
'cron_log'
,
true
));
$t
e
mpl
ate
->
assign
(
'lastcron'
,
$a
pp
C
onfig
->
getValue
(
'core'
,
'lastcron'
,
false
));
$t
e
mpl
ate
->
assign
(
'shareAPIEnabled'
,
$a
pp
C
onfig
->
getValue
(
'core'
,
'shareapi_enabled'
,
'yes'
));
$t
e
mpl
ate
->
assign
(
'shareDefaultExpireDateSet'
,
$a
pp
C
onfig
->
getValue
(
'core'
,
'shareapi_default_expire_date'
,
'no'
));
$t
e
mpl
ate
->
assign
(
'shareExpireAfterNDays'
,
$a
pp
C
onfig
->
getValue
(
'core'
,
'shareapi_expire_after_n_days'
,
'7'
));
$t
e
mpl
ate
->
assign
(
'shareEnforceExpireDate'
,
$a
pp
C
onfig
->
getValue
(
'core'
,
'shareapi_enforce_expire_date'
,
'no'
));
$excludeGroups
=
$a
pp
C
onfig
->
getValue
(
'core'
,
'shareapi_exclude_groups'
,
'no'
)
===
'yes'
?
true
:
false
;
$t
e
mpl
ate
->
assign
(
'shareExcludeGroups'
,
$excludeGroups
);
$excludedGroupsList
=
$a
pp
C
onfig
->
getValue
(
'core'
,
'shareapi_exclude_groups_list'
,
''
);
$excludedGroupsList
=
explode
(
','
,
$excludedGroupsList
);
// FIXME: this should be JSON!
$tmpl
->
assign
(
'shareExcludedGroupsList'
,
implode
(
'|'
,
$excludedGroupsList
));
$t
e
mpl
ate
->
assign
(
'shareExcludedGroupsList'
,
implode
(
'|'
,
$excludedGroupsList
));
// Check if connected using HTTPS
$tmpl
->
assign
(
'isConnectedViaHTTPS'
,
OC_Request
::
serverProtocol
()
===
'https'
);
$tmpl
->
assign
(
'enforceHTTPSEnabled'
,
OC_C
onfig
::
getValue
(
"forcessl"
,
false
));
$t
e
mpl
ate
->
assign
(
'isConnectedViaHTTPS'
,
OC_Request
::
serverProtocol
()
===
'https'
);
$t
e
mpl
ate
->
assign
(
'enforceHTTPSEnabled'
,
$c
onfig
->
get
System
Value
(
"forcessl"
,
false
));
// If the current webroot is non-empty but the webroot from the config is,
// If the current web
root is non-empty but the web
root from the config is,
// and system cron is used, the URL generator fails to build valid URLs.
$shouldSuggestOverwriteWeb
r
oot
=
$config
->
getAppValue
(
'core'
,
'backgroundjobs_mode'
,
'ajax'
)
===
'cron'
&&
$shouldSuggestOverwriteWeb
R
oot
=
$config
->
getAppValue
(
'core'
,
'backgroundjobs_mode'
,
'ajax'
)
===
'cron'
&&
\
OC
::
$WEBROOT
&&
\
OC
::
$WEBROOT
!==
'/'
&&
!
$config
->
getSystemValue
(
'overwritewebroot'
,
''
);
$tmpl
->
assign
(
'suggestedOverwriteWebroot'
,
(
$shouldSuggestOverwriteWebroot
)
?
\
OC
::
$WEBROOT
:
''
);
$tmpl
->
assign
(
'allowLinks'
,
OC_Appconfig
::
getValue
(
'core'
,
'shareapi_allow_links'
,
'yes'
));
$tmpl
->
assign
(
'enforceLinkPassword'
,
\
OCP\Util
::
isPublicLinkPasswordRequired
());
$tmpl
->
assign
(
'allowPublicUpload'
,
OC_Appconfig
::
getValue
(
'core'
,
'shareapi_allow_public_upload'
,
'yes'
));
$tmpl
->
assign
(
'allowResharing'
,
OC_Appconfig
::
getValue
(
'core'
,
'shareapi_allow_resharing'
,
'yes'
));
$tmpl
->
assign
(
'allowMailNotification'
,
OC_Appconfig
::
getValue
(
'core'
,
'shareapi_allow_mail_notification'
,
'no'
));
$tmpl
->
assign
(
'onlyShareWithGroupMembers'
,
\
OC\Share\Share
::
shareWithGroupMembersOnly
());
$tmpl
->
assign
(
'forms'
,
array
());
foreach
(
$forms
as
$form
)
{
$tmpl
->
append
(
'forms'
,
$form
);
}
$suggestedOverwriteWebRoot
=
(
$shouldSuggestOverwriteWebRoot
)
?
\
OC
::
$WEBROOT
:
''
;
$template
->
assign
(
'suggestedOverwriteWebroot'
,
$suggestedOverwriteWebRoot
);
$template
->
assign
(
'allowLinks'
,
$appConfig
->
getValue
(
'core'
,
'shareapi_allow_links'
,
'yes'
));
$template
->
assign
(
'enforceLinkPassword'
,
\
OCP\Util
::
isPublicLinkPasswordRequired
());
$template
->
assign
(
'allowPublicUpload'
,
$appConfig
->
getValue
(
'core'
,
'shareapi_allow_public_upload'
,
'yes'
));
$template
->
assign
(
'allowResharing'
,
$appConfig
->
getValue
(
'core'
,
'shareapi_allow_resharing'
,
'yes'
));
$template
->
assign
(
'allowMailNotification'
,
$appConfig
->
getValue
(
'core'
,
'shareapi_allow_mail_notification'
,
'no'
));
$template
->
assign
(
'onlyShareWithGroupMembers'
,
\
OC\Share\Share
::
shareWithGroupMembersOnly
());
$databaseOverload
=
(
strpos
(
\
OCP\Config
::
getSystemValue
(
'dbtype'
),
'sqlite'
)
!==
false
);
$tmpl
->
assign
(
'databaseOverload'
,
$databaseOverload
);
$template
->
assign
(
'databaseOverload'
,
$databaseOverload
);
// add hardcoded forms from the template
$forms
=
OC_App
::
getForms
(
'admin'
);
$l
=
OC_L10N
::
get
(
'settings'
);
$formsAndMore
=
array
();
if
(
OC_Request
::
serverProtocol
()
!==
'https'
||
!
$htAccessWorking
||
!
OC_Util
::
isAnnotationsWorking
()
||
$suggestedOverwriteWebRoot
||
!
OC_Util
::
isSetLocaleWorking
()
||
!
OC_Util
::
isPhpCharSetUtf8
()
||
OC_Util
::
isPHPoutdated
()
||
!
OC_Util
::
fileInfoLoaded
()
||
$databaseOverload
)
{
$formsAndMore
[]
=
array
(
'anchor'
=>
'security-warning'
,
'section-name'
=>
$l
->
t
(
'Security & Setup Warnings'
));
}
$formsMap
=
array_map
(
function
(
$form
)
{
if
(
preg_match
(
'%(<h2[^>]*>.*?</h2>)%i'
,
$form
,
$regs
))
{
$sectionName
=
str_replace
(
'<h2>'
,
''
,
$regs
[
0
]);
$sectionName
=
str_replace
(
'</h2>'
,
''
,
$sectionName
);
$anchor
=
strtolower
(
$sectionName
);
$anchor
=
str_replace
(
' '
,
'-'
,
$anchor
);
return
array
(
'anchor'
=>
$anchor
,
'section-name'
=>
$sectionName
,
'form'
=>
$form
);
}
return
array
(
'form'
=>
$form
);
},
$forms
);
$formsAndMore
=
array_merge
(
$formsAndMore
,
$formsMap
);
// add bottom hardcoded forms from the template
$formsAndMore
[]
=
array
(
'anchor'
=>
'backgroundjobs'
,
'section-name'
=>
$l
->
t
(
'Cron'
));
$formsAndMore
[]
=
array
(
'anchor'
=>
'shareAPI'
,
'section-name'
=>
$l
->
t
(
'Sharing'
));
$formsAndMore
[]
=
array
(
'anchor'
=>
'security'
,
'section-name'
=>
$l
->
t
(
'Security'
));
$formsAndMore
[]
=
array
(
'anchor'
=>
'mail_general_settings'
,
'section-name'
=>
$l
->
t
(
'Email Server'
));
$formsAndMore
[]
=
array
(
'anchor'
=>
'log'
,
'section-name'
=>
$l
->
t
(
'Log'
));
$template
->
assign
(
'forms'
,
$formsAndMore
);
$tmpl
->
printPage
();
$t
e
mpl
ate
->
printPage
();
/**
* Try to find a program
m
* Try to find a program
*
* @param string $program
* @return null|string
...
...
settings/templates/admin.php
View file @
d9db791c
...
...
@@ -8,6 +8,16 @@
* @var array $_
* @var \OCP\IL10N $l
*/
style
(
'settings'
,
'settings'
);
script
(
'settings'
,
'settings'
);
script
(
"settings"
,
"admin"
);
script
(
"settings"
,
"log"
);
script
(
'core'
,
'multiselect'
);
script
(
'core'
,
'select2/select2'
);
style
(
'core'
,
'select2/select2'
);
script
(
'core'
,
'setupchecks'
);
$levels
=
array
(
'Debug'
,
'Info'
,
'Warning'
,
'Error'
,
'Fatal'
);
$levelLabels
=
array
(
$l
->
t
(
'Everything (fatal issues, errors, warnings, info, debug)'
),
...
...
@@ -40,9 +50,23 @@ if ($_['sendmail_is_available']) {
if
(
$_
[
'mail_smtpmode'
]
==
'qmail'
)
{
$mail_smtpmode
[]
=
'qmail'
;
}
?>
<div
id=
"app-navigation"
>
<ul>
<?php
foreach
(
$_
[
'forms'
]
as
$form
)
{
if
(
isset
(
$form
[
'anchor'
]))
{
$anchor
=
'#'
.
$form
[
'anchor'
];
$sectionName
=
$form
[
'section-name'
];
print_unescaped
(
sprintf
(
"<li><a href='%s'>%s</a></li>"
,
OC_Util
::
sanitizeHTML
(
$anchor
),
OC_Util
::
sanitizeHTML
(
$sectionName
)));
}
}
?>
</ul>
</div>
<div
id=
"app-content"
>
<div
id=
"security-warning"
>
<?php
// is ssl working ?
...
...
@@ -72,7 +96,6 @@ if (!$_['htaccessworking']) {
</div>
<?php
}
// Are doc blocks accessible?
if
(
!
$_
[
'isAnnotationsWorking'
])
{
?>
...
...
@@ -193,10 +216,12 @@ if ($_['suggestedOverwriteWebroot']) {
?>
</span>
</div>
</div>
<?php
foreach
(
$_
[
'forms'
]
as
$form
)
{
print_unescaped
(
$form
);
}
;
?>
</div>
<?php
foreach
(
$_
[
'forms'
]
as
$form
)
{
if
(
isset
(
$form
[
'form'
]))
{
?>
<div
id=
"
<?php
isset
(
$form
[
'anchor'
])
?
p
(
$form
[
'anchor'
])
:
p
(
''
);
?>
"
>
<?php
print_unescaped
(
$form
[
'form'
]);
?>
</div>
<?php
}
};
?>
<div
class=
"section"
id=
"backgroundjobs"
>
<h2
class=
"inlineblock"
>
<?php
p
(
$l
->
t
(
'Cron'
));
?>
</h2>
...
...
@@ -419,7 +444,7 @@ if ($_['suggestedOverwriteWebroot']) {
<span
id=
"sendtestmail_msg"
class=
"msg"
></span>
</div>
<div
class=
"section"
>
<div
class=
"section"
id=
"log"
>
<h2>
<?php
p
(
$l
->
t
(
'Log'
));
?>
</h2>
<?php
p
(
$l
->
t
(
'Log level'
));
?>
<select
name=
'loglevel'
id=
'loglevel'
>
<?php
for
(
$i
=
0
;
$i
<
5
;
$i
++
)
:
...
...
@@ -472,3 +497,4 @@ if ($_['suggestedOverwriteWebroot']) {
<div
class=
"section credits-footer"
>
<p>
<?php
print_unescaped
(
$theme
->
getShortFooter
());
?>
</p>
</div>
</div>
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment