Disallow disabling of files app
This commit is contained in:
parent
1bb8d5978c
commit
a7eedf0149
|
@ -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);
|
||||
}
|
||||
|
|
|
@ -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));
|
||||
|
|
|
@ -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');
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue