Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
O
our_own_cloud_project
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
die_coolen_jungs
our_own_cloud_project
Commits
a7eedf01
Commit
a7eedf01
authored
10 years ago
by
Morris Jobke
Browse files
Options
Downloads
Patches
Plain Diff
Disallow disabling of files app
parent
1bb8d597
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
core/command/app/disable.php
+6
-2
6 additions, 2 deletions
core/command/app/disable.php
lib/private/app.php
+3
-0
3 additions, 0 deletions
lib/private/app.php
lib/private/app/appmanager.php
+4
-0
4 additions, 0 deletions
lib/private/app/appmanager.php
with
13 additions
and
2 deletions
core/command/app/disable.php
+
6
−
2
View file @
a7eedf01
...
...
@@ -28,8 +28,12 @@ class Disable extends Command {
protected
function
execute
(
InputInterface
$input
,
OutputInterface
$output
)
{
$appId
=
$input
->
getArgument
(
'app-id'
);
if
(
\OC_App
::
isEnabled
(
$appId
))
{
\OC_App
::
disable
(
$appId
);
$output
->
writeln
(
$appId
.
' disabled'
);
try
{
\OC_App
::
disable
(
$appId
);
$output
->
writeln
(
$appId
.
' disabled'
);
}
catch
(
\Exception
$e
)
{
$output
->
writeln
(
$e
->
getMessage
());
}
}
else
{
$output
->
writeln
(
'No such app enabled: '
.
$appId
);
}
...
...
This diff is collapsed.
Click to expand it.
lib/private/app.php
+
3
−
0
View file @
a7eedf01
...
...
@@ -321,6 +321,9 @@ class OC_App {
* @param string $app app
*/
public
static
function
disable
(
$app
)
{
if
(
$app
===
'files'
)
{
throw
new
\Exception
(
"App 'files' can't be disabled."
);
}
self
::
$enabledAppsCache
=
array
();
// flush
// check if app is a shipped app or not. if not delete
\OC_Hook
::
emit
(
'OC_App'
,
'pre_disable'
,
array
(
'app'
=>
$app
));
...
...
This diff is collapsed.
Click to expand it.
lib/private/app/appmanager.php
+
4
−
0
View file @
a7eedf01
...
...
@@ -131,8 +131,12 @@ class AppManager implements IAppManager {
* Disable an app for every user
*
* @param string $appId
* @throws \Exception if app can't be disabled
*/
public
function
disableApp
(
$appId
)
{
if
(
$appId
===
'files'
)
{
throw
new
\Exception
(
"App 'files' can't be disabled."
);
}
$this
->
appConfig
->
setValue
(
$appId
,
'enabled'
,
'no'
);
}
}
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment