@@ -63,13 +63,13 @@ |
||
63 | 63 | |
64 | 64 | $lastLogin = $user->getLastLogin(); |
65 | 65 | if ($lastLogin === 0) { |
66 | - $output->writeln('User ' . $user->getUID() . |
|
66 | + $output->writeln('User '.$user->getUID(). |
|
67 | 67 | ' has never logged in, yet.'); |
68 | 68 | } else { |
69 | 69 | $date = new \DateTime(); |
70 | 70 | $date->setTimestamp($lastLogin); |
71 | - $output->writeln($user->getUID() . |
|
72 | - '`s last login: ' . $date->format('d.m.Y H:i')); |
|
71 | + $output->writeln($user->getUID(). |
|
72 | + '`s last login: '.$date->format('d.m.Y H:i')); |
|
73 | 73 | } |
74 | 74 | } |
75 | 75 | } |
@@ -33,44 +33,44 @@ |
||
33 | 33 | use Symfony\Component\Console\Output\OutputInterface; |
34 | 34 | |
35 | 35 | class LastSeen extends Command { |
36 | - /** @var IUserManager */ |
|
37 | - protected $userManager; |
|
36 | + /** @var IUserManager */ |
|
37 | + protected $userManager; |
|
38 | 38 | |
39 | - /** |
|
40 | - * @param IUserManager $userManager |
|
41 | - */ |
|
42 | - public function __construct(IUserManager $userManager) { |
|
43 | - $this->userManager = $userManager; |
|
44 | - parent::__construct(); |
|
45 | - } |
|
39 | + /** |
|
40 | + * @param IUserManager $userManager |
|
41 | + */ |
|
42 | + public function __construct(IUserManager $userManager) { |
|
43 | + $this->userManager = $userManager; |
|
44 | + parent::__construct(); |
|
45 | + } |
|
46 | 46 | |
47 | - protected function configure() { |
|
48 | - $this |
|
49 | - ->setName('user:lastseen') |
|
50 | - ->setDescription('shows when the user was logged in last time') |
|
51 | - ->addArgument( |
|
52 | - 'uid', |
|
53 | - InputArgument::REQUIRED, |
|
54 | - 'the username' |
|
55 | - ); |
|
56 | - } |
|
47 | + protected function configure() { |
|
48 | + $this |
|
49 | + ->setName('user:lastseen') |
|
50 | + ->setDescription('shows when the user was logged in last time') |
|
51 | + ->addArgument( |
|
52 | + 'uid', |
|
53 | + InputArgument::REQUIRED, |
|
54 | + 'the username' |
|
55 | + ); |
|
56 | + } |
|
57 | 57 | |
58 | - protected function execute(InputInterface $input, OutputInterface $output) { |
|
59 | - $user = $this->userManager->get($input->getArgument('uid')); |
|
60 | - if (is_null($user)) { |
|
61 | - $output->writeln('<error>User does not exist</error>'); |
|
62 | - return; |
|
63 | - } |
|
58 | + protected function execute(InputInterface $input, OutputInterface $output) { |
|
59 | + $user = $this->userManager->get($input->getArgument('uid')); |
|
60 | + if (is_null($user)) { |
|
61 | + $output->writeln('<error>User does not exist</error>'); |
|
62 | + return; |
|
63 | + } |
|
64 | 64 | |
65 | - $lastLogin = $user->getLastLogin(); |
|
66 | - if ($lastLogin === 0) { |
|
67 | - $output->writeln('User ' . $user->getUID() . |
|
68 | - ' has never logged in, yet.'); |
|
69 | - } else { |
|
70 | - $date = new \DateTime(); |
|
71 | - $date->setTimestamp($lastLogin); |
|
72 | - $output->writeln($user->getUID() . |
|
73 | - '`s last login: ' . $date->format('d.m.Y H:i')); |
|
74 | - } |
|
75 | - } |
|
65 | + $lastLogin = $user->getLastLogin(); |
|
66 | + if ($lastLogin === 0) { |
|
67 | + $output->writeln('User ' . $user->getUID() . |
|
68 | + ' has never logged in, yet.'); |
|
69 | + } else { |
|
70 | + $date = new \DateTime(); |
|
71 | + $date->setTimestamp($lastLogin); |
|
72 | + $output->writeln($user->getUID() . |
|
73 | + '`s last login: ' . $date->format('d.m.Y H:i')); |
|
74 | + } |
|
75 | + } |
|
76 | 76 | } |
@@ -32,56 +32,56 @@ |
||
32 | 32 | use Symfony\Component\Console\Output\OutputInterface; |
33 | 33 | |
34 | 34 | class Report extends Command { |
35 | - /** @var IUserManager */ |
|
36 | - protected $userManager; |
|
35 | + /** @var IUserManager */ |
|
36 | + protected $userManager; |
|
37 | 37 | |
38 | - /** |
|
39 | - * @param IUserManager $userManager |
|
40 | - */ |
|
41 | - public function __construct(IUserManager $userManager) { |
|
42 | - $this->userManager = $userManager; |
|
43 | - parent::__construct(); |
|
44 | - } |
|
38 | + /** |
|
39 | + * @param IUserManager $userManager |
|
40 | + */ |
|
41 | + public function __construct(IUserManager $userManager) { |
|
42 | + $this->userManager = $userManager; |
|
43 | + parent::__construct(); |
|
44 | + } |
|
45 | 45 | |
46 | - protected function configure() { |
|
47 | - $this |
|
48 | - ->setName('user:report') |
|
49 | - ->setDescription('shows how many users have access'); |
|
50 | - } |
|
46 | + protected function configure() { |
|
47 | + $this |
|
48 | + ->setName('user:report') |
|
49 | + ->setDescription('shows how many users have access'); |
|
50 | + } |
|
51 | 51 | |
52 | - protected function execute(InputInterface $input, OutputInterface $output) { |
|
53 | - $table = new Table($output); |
|
54 | - $table->setHeaders(['User Report', '']); |
|
55 | - $userCountArray = $this->countUsers(); |
|
56 | - if (!empty($userCountArray)) { |
|
57 | - $total = 0; |
|
58 | - $rows = []; |
|
59 | - foreach ($userCountArray as $classname => $users) { |
|
60 | - $total += $users; |
|
61 | - $rows[] = [$classname, $users]; |
|
62 | - } |
|
52 | + protected function execute(InputInterface $input, OutputInterface $output) { |
|
53 | + $table = new Table($output); |
|
54 | + $table->setHeaders(['User Report', '']); |
|
55 | + $userCountArray = $this->countUsers(); |
|
56 | + if (!empty($userCountArray)) { |
|
57 | + $total = 0; |
|
58 | + $rows = []; |
|
59 | + foreach ($userCountArray as $classname => $users) { |
|
60 | + $total += $users; |
|
61 | + $rows[] = [$classname, $users]; |
|
62 | + } |
|
63 | 63 | |
64 | - $rows[] = [' ']; |
|
65 | - $rows[] = ['total users', $total]; |
|
66 | - } else { |
|
67 | - $rows[] = ['No backend enabled that supports user counting', '']; |
|
68 | - } |
|
64 | + $rows[] = [' ']; |
|
65 | + $rows[] = ['total users', $total]; |
|
66 | + } else { |
|
67 | + $rows[] = ['No backend enabled that supports user counting', '']; |
|
68 | + } |
|
69 | 69 | |
70 | - $userDirectoryCount = $this->countUserDirectories(); |
|
71 | - $rows[] = [' ']; |
|
72 | - $rows[] = ['user directories', $userDirectoryCount]; |
|
70 | + $userDirectoryCount = $this->countUserDirectories(); |
|
71 | + $rows[] = [' ']; |
|
72 | + $rows[] = ['user directories', $userDirectoryCount]; |
|
73 | 73 | |
74 | - $table->setRows($rows); |
|
75 | - $table->render(); |
|
76 | - } |
|
74 | + $table->setRows($rows); |
|
75 | + $table->render(); |
|
76 | + } |
|
77 | 77 | |
78 | - private function countUsers() { |
|
79 | - return $this->userManager->countUsers(); |
|
80 | - } |
|
78 | + private function countUsers() { |
|
79 | + return $this->userManager->countUsers(); |
|
80 | + } |
|
81 | 81 | |
82 | - private function countUserDirectories() { |
|
83 | - $dataview = new \OC\Files\View('/'); |
|
84 | - $userDirectories = $dataview->getDirectoryContent('/', 'httpd/unix-directory'); |
|
85 | - return count($userDirectories); |
|
86 | - } |
|
82 | + private function countUserDirectories() { |
|
83 | + $dataview = new \OC\Files\View('/'); |
|
84 | + $userDirectories = $dataview->getDirectoryContent('/', 'httpd/unix-directory'); |
|
85 | + return count($userDirectories); |
|
86 | + } |
|
87 | 87 | } |
@@ -28,35 +28,35 @@ |
||
28 | 28 | use Symfony\Component\Console\Output\OutputInterface; |
29 | 29 | |
30 | 30 | class Check extends Base { |
31 | - /** |
|
32 | - * @var SystemConfig |
|
33 | - */ |
|
34 | - private $config; |
|
31 | + /** |
|
32 | + * @var SystemConfig |
|
33 | + */ |
|
34 | + private $config; |
|
35 | 35 | |
36 | - public function __construct(SystemConfig $config) { |
|
37 | - parent::__construct(); |
|
38 | - $this->config = $config; |
|
39 | - } |
|
36 | + public function __construct(SystemConfig $config) { |
|
37 | + parent::__construct(); |
|
38 | + $this->config = $config; |
|
39 | + } |
|
40 | 40 | |
41 | - protected function configure() { |
|
42 | - parent::configure(); |
|
41 | + protected function configure() { |
|
42 | + parent::configure(); |
|
43 | 43 | |
44 | - $this |
|
45 | - ->setName('check') |
|
46 | - ->setDescription('check dependencies of the server environment') |
|
47 | - ; |
|
48 | - } |
|
44 | + $this |
|
45 | + ->setName('check') |
|
46 | + ->setDescription('check dependencies of the server environment') |
|
47 | + ; |
|
48 | + } |
|
49 | 49 | |
50 | - protected function execute(InputInterface $input, OutputInterface $output) { |
|
51 | - $errors = \OC_Util::checkServer($this->config); |
|
52 | - if (!empty($errors)) { |
|
53 | - $errors = array_map(function ($item) { |
|
54 | - return (string) $item['error']; |
|
55 | - }, $errors); |
|
50 | + protected function execute(InputInterface $input, OutputInterface $output) { |
|
51 | + $errors = \OC_Util::checkServer($this->config); |
|
52 | + if (!empty($errors)) { |
|
53 | + $errors = array_map(function ($item) { |
|
54 | + return (string) $item['error']; |
|
55 | + }, $errors); |
|
56 | 56 | |
57 | - $this->writeArrayInOutputFormat($input, $output, $errors); |
|
58 | - return 1; |
|
59 | - } |
|
60 | - return 0; |
|
61 | - } |
|
57 | + $this->writeArrayInOutputFormat($input, $output, $errors); |
|
58 | + return 1; |
|
59 | + } |
|
60 | + return 0; |
|
61 | + } |
|
62 | 62 | } |
@@ -50,7 +50,7 @@ |
||
50 | 50 | protected function execute(InputInterface $input, OutputInterface $output) { |
51 | 51 | $errors = \OC_Util::checkServer($this->config); |
52 | 52 | if (!empty($errors)) { |
53 | - $errors = array_map(function ($item) { |
|
53 | + $errors = array_map(function($item) { |
|
54 | 54 | return (string) $item['error']; |
55 | 55 | }, $errors); |
56 | 56 |
@@ -30,29 +30,29 @@ |
||
30 | 30 | |
31 | 31 | class ShowKeyStorageRoot extends Command { |
32 | 32 | |
33 | - /** @var Util */ |
|
34 | - protected $util; |
|
35 | - |
|
36 | - /** |
|
37 | - * @param Util $util |
|
38 | - */ |
|
39 | - public function __construct(Util $util) { |
|
40 | - parent::__construct(); |
|
41 | - $this->util = $util; |
|
42 | - } |
|
43 | - |
|
44 | - protected function configure() { |
|
45 | - parent::configure(); |
|
46 | - $this |
|
47 | - ->setName('encryption:show-key-storage-root') |
|
48 | - ->setDescription('Show current key storage root'); |
|
49 | - } |
|
50 | - |
|
51 | - protected function execute(InputInterface $input, OutputInterface $output) { |
|
52 | - $currentRoot = $this->util->getKeyStorageRoot(); |
|
53 | - |
|
54 | - $rootDescription = $currentRoot !== '' ? $currentRoot : 'default storage location (data/)'; |
|
55 | - |
|
56 | - $output->writeln("Current key storage root: <info>$rootDescription</info>"); |
|
57 | - } |
|
33 | + /** @var Util */ |
|
34 | + protected $util; |
|
35 | + |
|
36 | + /** |
|
37 | + * @param Util $util |
|
38 | + */ |
|
39 | + public function __construct(Util $util) { |
|
40 | + parent::__construct(); |
|
41 | + $this->util = $util; |
|
42 | + } |
|
43 | + |
|
44 | + protected function configure() { |
|
45 | + parent::configure(); |
|
46 | + $this |
|
47 | + ->setName('encryption:show-key-storage-root') |
|
48 | + ->setDescription('Show current key storage root'); |
|
49 | + } |
|
50 | + |
|
51 | + protected function execute(InputInterface $input, OutputInterface $output) { |
|
52 | + $currentRoot = $this->util->getKeyStorageRoot(); |
|
53 | + |
|
54 | + $rootDescription = $currentRoot !== '' ? $currentRoot : 'default storage location (data/)'; |
|
55 | + |
|
56 | + $output->writeln("Current key storage root: <info>$rootDescription</info>"); |
|
57 | + } |
|
58 | 58 | } |
@@ -67,11 +67,11 @@ |
||
67 | 67 | */ |
68 | 68 | protected function writeModuleList(InputInterface $input, OutputInterface $output, $items) { |
69 | 69 | if ($input->getOption('output') === self::OUTPUT_FORMAT_PLAIN) { |
70 | - array_walk($items, function (&$item) { |
|
70 | + array_walk($items, function(&$item) { |
|
71 | 71 | if (!$item['default']) { |
72 | 72 | $item = $item['displayName']; |
73 | 73 | } else { |
74 | - $item = $item['displayName'] . ' [default*]'; |
|
74 | + $item = $item['displayName'].' [default*]'; |
|
75 | 75 | } |
76 | 76 | }); |
77 | 77 | } |
@@ -31,69 +31,69 @@ |
||
31 | 31 | use Symfony\Component\Console\Output\OutputInterface; |
32 | 32 | |
33 | 33 | class ListModules extends Base { |
34 | - /** @var IManager */ |
|
35 | - protected $encryptionManager; |
|
34 | + /** @var IManager */ |
|
35 | + protected $encryptionManager; |
|
36 | 36 | |
37 | - /** @var IConfig */ |
|
38 | - protected $config; |
|
37 | + /** @var IConfig */ |
|
38 | + protected $config; |
|
39 | 39 | |
40 | - /** |
|
41 | - * @param IManager $encryptionManager |
|
42 | - * @param IConfig $config |
|
43 | - */ |
|
44 | - public function __construct( |
|
45 | - IManager $encryptionManager, |
|
46 | - IConfig $config |
|
47 | - ) { |
|
48 | - parent::__construct(); |
|
49 | - $this->encryptionManager = $encryptionManager; |
|
50 | - $this->config = $config; |
|
51 | - } |
|
40 | + /** |
|
41 | + * @param IManager $encryptionManager |
|
42 | + * @param IConfig $config |
|
43 | + */ |
|
44 | + public function __construct( |
|
45 | + IManager $encryptionManager, |
|
46 | + IConfig $config |
|
47 | + ) { |
|
48 | + parent::__construct(); |
|
49 | + $this->encryptionManager = $encryptionManager; |
|
50 | + $this->config = $config; |
|
51 | + } |
|
52 | 52 | |
53 | - protected function configure() { |
|
54 | - parent::configure(); |
|
53 | + protected function configure() { |
|
54 | + parent::configure(); |
|
55 | 55 | |
56 | - $this |
|
57 | - ->setName('encryption:list-modules') |
|
58 | - ->setDescription('List all available encryption modules') |
|
59 | - ; |
|
60 | - } |
|
56 | + $this |
|
57 | + ->setName('encryption:list-modules') |
|
58 | + ->setDescription('List all available encryption modules') |
|
59 | + ; |
|
60 | + } |
|
61 | 61 | |
62 | - protected function execute(InputInterface $input, OutputInterface $output) { |
|
63 | - $isMaintenanceModeEnabled = $this->config->getSystemValue('maintenance', false); |
|
64 | - if ($isMaintenanceModeEnabled) { |
|
65 | - $output->writeln("Maintenance mode must be disabled when listing modules"); |
|
66 | - $output->writeln("in order to list the relevant encryption modules correctly."); |
|
67 | - return; |
|
68 | - } |
|
62 | + protected function execute(InputInterface $input, OutputInterface $output) { |
|
63 | + $isMaintenanceModeEnabled = $this->config->getSystemValue('maintenance', false); |
|
64 | + if ($isMaintenanceModeEnabled) { |
|
65 | + $output->writeln("Maintenance mode must be disabled when listing modules"); |
|
66 | + $output->writeln("in order to list the relevant encryption modules correctly."); |
|
67 | + return; |
|
68 | + } |
|
69 | 69 | |
70 | - $encryptionModules = $this->encryptionManager->getEncryptionModules(); |
|
71 | - $defaultEncryptionModuleId = $this->encryptionManager->getDefaultEncryptionModuleId(); |
|
70 | + $encryptionModules = $this->encryptionManager->getEncryptionModules(); |
|
71 | + $defaultEncryptionModuleId = $this->encryptionManager->getDefaultEncryptionModuleId(); |
|
72 | 72 | |
73 | - $encModules = []; |
|
74 | - foreach ($encryptionModules as $module) { |
|
75 | - $encModules[$module['id']]['displayName'] = $module['displayName']; |
|
76 | - $encModules[$module['id']]['default'] = $module['id'] === $defaultEncryptionModuleId; |
|
77 | - } |
|
78 | - $this->writeModuleList($input, $output, $encModules); |
|
79 | - } |
|
73 | + $encModules = []; |
|
74 | + foreach ($encryptionModules as $module) { |
|
75 | + $encModules[$module['id']]['displayName'] = $module['displayName']; |
|
76 | + $encModules[$module['id']]['default'] = $module['id'] === $defaultEncryptionModuleId; |
|
77 | + } |
|
78 | + $this->writeModuleList($input, $output, $encModules); |
|
79 | + } |
|
80 | 80 | |
81 | - /** |
|
82 | - * @param InputInterface $input |
|
83 | - * @param OutputInterface $output |
|
84 | - * @param array $items |
|
85 | - */ |
|
86 | - protected function writeModuleList(InputInterface $input, OutputInterface $output, $items) { |
|
87 | - if ($input->getOption('output') === self::OUTPUT_FORMAT_PLAIN) { |
|
88 | - array_walk($items, function (&$item) { |
|
89 | - if (!$item['default']) { |
|
90 | - $item = $item['displayName']; |
|
91 | - } else { |
|
92 | - $item = $item['displayName'] . ' [default*]'; |
|
93 | - } |
|
94 | - }); |
|
95 | - } |
|
81 | + /** |
|
82 | + * @param InputInterface $input |
|
83 | + * @param OutputInterface $output |
|
84 | + * @param array $items |
|
85 | + */ |
|
86 | + protected function writeModuleList(InputInterface $input, OutputInterface $output, $items) { |
|
87 | + if ($input->getOption('output') === self::OUTPUT_FORMAT_PLAIN) { |
|
88 | + array_walk($items, function (&$item) { |
|
89 | + if (!$item['default']) { |
|
90 | + $item = $item['displayName']; |
|
91 | + } else { |
|
92 | + $item = $item['displayName'] . ' [default*]'; |
|
93 | + } |
|
94 | + }); |
|
95 | + } |
|
96 | 96 | |
97 | - $this->writeArrayInOutputFormat($input, $output, $items); |
|
98 | - } |
|
97 | + $this->writeArrayInOutputFormat($input, $output, $items); |
|
98 | + } |
|
99 | 99 | } |
@@ -29,51 +29,51 @@ |
||
29 | 29 | use Symfony\Component\Console\Output\OutputInterface; |
30 | 30 | |
31 | 31 | class Enable extends Command { |
32 | - /** @var IConfig */ |
|
33 | - protected $config; |
|
32 | + /** @var IConfig */ |
|
33 | + protected $config; |
|
34 | 34 | |
35 | - /** @var IManager */ |
|
36 | - protected $encryptionManager; |
|
35 | + /** @var IManager */ |
|
36 | + protected $encryptionManager; |
|
37 | 37 | |
38 | - /** |
|
39 | - * @param IConfig $config |
|
40 | - * @param IManager $encryptionManager |
|
41 | - */ |
|
42 | - public function __construct(IConfig $config, IManager $encryptionManager) { |
|
43 | - parent::__construct(); |
|
38 | + /** |
|
39 | + * @param IConfig $config |
|
40 | + * @param IManager $encryptionManager |
|
41 | + */ |
|
42 | + public function __construct(IConfig $config, IManager $encryptionManager) { |
|
43 | + parent::__construct(); |
|
44 | 44 | |
45 | - $this->encryptionManager = $encryptionManager; |
|
46 | - $this->config = $config; |
|
47 | - } |
|
45 | + $this->encryptionManager = $encryptionManager; |
|
46 | + $this->config = $config; |
|
47 | + } |
|
48 | 48 | |
49 | - protected function configure() { |
|
50 | - $this |
|
51 | - ->setName('encryption:enable') |
|
52 | - ->setDescription('Enable encryption') |
|
53 | - ; |
|
54 | - } |
|
49 | + protected function configure() { |
|
50 | + $this |
|
51 | + ->setName('encryption:enable') |
|
52 | + ->setDescription('Enable encryption') |
|
53 | + ; |
|
54 | + } |
|
55 | 55 | |
56 | - protected function execute(InputInterface $input, OutputInterface $output) { |
|
57 | - if ($this->config->getAppValue('core', 'encryption_enabled', 'no') === 'yes') { |
|
58 | - $output->writeln('Encryption is already enabled'); |
|
59 | - } else { |
|
60 | - $this->config->setAppValue('core', 'encryption_enabled', 'yes'); |
|
61 | - $output->writeln('<info>Encryption enabled</info>'); |
|
62 | - } |
|
63 | - $output->writeln(''); |
|
56 | + protected function execute(InputInterface $input, OutputInterface $output) { |
|
57 | + if ($this->config->getAppValue('core', 'encryption_enabled', 'no') === 'yes') { |
|
58 | + $output->writeln('Encryption is already enabled'); |
|
59 | + } else { |
|
60 | + $this->config->setAppValue('core', 'encryption_enabled', 'yes'); |
|
61 | + $output->writeln('<info>Encryption enabled</info>'); |
|
62 | + } |
|
63 | + $output->writeln(''); |
|
64 | 64 | |
65 | - $modules = $this->encryptionManager->getEncryptionModules(); |
|
66 | - if (empty($modules)) { |
|
67 | - $output->writeln('<error>No encryption module is loaded</error>'); |
|
68 | - } else { |
|
69 | - $defaultModule = $this->config->getAppValue('core', 'default_encryption_module', null); |
|
70 | - if ($defaultModule === null) { |
|
71 | - $output->writeln('<error>No default module is set</error>'); |
|
72 | - } elseif (!isset($modules[$defaultModule])) { |
|
73 | - $output->writeln('<error>The current default module does not exist: ' . $defaultModule . '</error>'); |
|
74 | - } else { |
|
75 | - $output->writeln('Default module: ' . $defaultModule); |
|
76 | - } |
|
77 | - } |
|
78 | - } |
|
65 | + $modules = $this->encryptionManager->getEncryptionModules(); |
|
66 | + if (empty($modules)) { |
|
67 | + $output->writeln('<error>No encryption module is loaded</error>'); |
|
68 | + } else { |
|
69 | + $defaultModule = $this->config->getAppValue('core', 'default_encryption_module', null); |
|
70 | + if ($defaultModule === null) { |
|
71 | + $output->writeln('<error>No default module is set</error>'); |
|
72 | + } elseif (!isset($modules[$defaultModule])) { |
|
73 | + $output->writeln('<error>The current default module does not exist: ' . $defaultModule . '</error>'); |
|
74 | + } else { |
|
75 | + $output->writeln('Default module: ' . $defaultModule); |
|
76 | + } |
|
77 | + } |
|
78 | + } |
|
79 | 79 | } |
@@ -70,9 +70,9 @@ |
||
70 | 70 | if ($defaultModule === null) { |
71 | 71 | $output->writeln('<error>No default module is set</error>'); |
72 | 72 | } elseif (!isset($modules[$defaultModule])) { |
73 | - $output->writeln('<error>The current default module does not exist: ' . $defaultModule . '</error>'); |
|
73 | + $output->writeln('<error>The current default module does not exist: '.$defaultModule.'</error>'); |
|
74 | 74 | } else { |
75 | - $output->writeln('Default module: ' . $defaultModule); |
|
75 | + $output->writeln('Default module: '.$defaultModule); |
|
76 | 76 | } |
77 | 77 | } |
78 | 78 | } |
@@ -58,11 +58,11 @@ |
||
58 | 58 | $moduleId = $input->getArgument('module'); |
59 | 59 | |
60 | 60 | if ($moduleId === $this->encryptionManager->getDefaultEncryptionModuleId()) { |
61 | - $output->writeln('"' . $moduleId . '"" is already the default module'); |
|
61 | + $output->writeln('"'.$moduleId.'"" is already the default module'); |
|
62 | 62 | } elseif ($this->encryptionManager->setDefaultEncryptionModule($moduleId)) { |
63 | - $output->writeln('<info>Set default module to "' . $moduleId . '"</info>'); |
|
63 | + $output->writeln('<info>Set default module to "'.$moduleId.'"</info>'); |
|
64 | 64 | } else { |
65 | - $output->writeln('<error>The specified module "' . $moduleId . '" does not exist</error>'); |
|
65 | + $output->writeln('<error>The specified module "'.$moduleId.'" does not exist</error>'); |
|
66 | 66 | } |
67 | 67 | } |
68 | 68 | } |
@@ -31,55 +31,55 @@ |
||
31 | 31 | use Symfony\Component\Console\Output\OutputInterface; |
32 | 32 | |
33 | 33 | class SetDefaultModule extends Command { |
34 | - /** @var IManager */ |
|
35 | - protected $encryptionManager; |
|
34 | + /** @var IManager */ |
|
35 | + protected $encryptionManager; |
|
36 | 36 | |
37 | - /** @var IConfig */ |
|
38 | - protected $config; |
|
37 | + /** @var IConfig */ |
|
38 | + protected $config; |
|
39 | 39 | |
40 | - /** |
|
41 | - * @param IManager $encryptionManager |
|
42 | - * @param IConfig $config |
|
43 | - */ |
|
44 | - public function __construct( |
|
45 | - IManager $encryptionManager, |
|
46 | - IConfig $config |
|
47 | - ) { |
|
48 | - parent::__construct(); |
|
49 | - $this->encryptionManager = $encryptionManager; |
|
50 | - $this->config = $config; |
|
51 | - } |
|
40 | + /** |
|
41 | + * @param IManager $encryptionManager |
|
42 | + * @param IConfig $config |
|
43 | + */ |
|
44 | + public function __construct( |
|
45 | + IManager $encryptionManager, |
|
46 | + IConfig $config |
|
47 | + ) { |
|
48 | + parent::__construct(); |
|
49 | + $this->encryptionManager = $encryptionManager; |
|
50 | + $this->config = $config; |
|
51 | + } |
|
52 | 52 | |
53 | - protected function configure() { |
|
54 | - parent::configure(); |
|
53 | + protected function configure() { |
|
54 | + parent::configure(); |
|
55 | 55 | |
56 | - $this |
|
57 | - ->setName('encryption:set-default-module') |
|
58 | - ->setDescription('Set the encryption default module') |
|
59 | - ->addArgument( |
|
60 | - 'module', |
|
61 | - InputArgument::REQUIRED, |
|
62 | - 'ID of the encryption module that should be used' |
|
63 | - ) |
|
64 | - ; |
|
65 | - } |
|
56 | + $this |
|
57 | + ->setName('encryption:set-default-module') |
|
58 | + ->setDescription('Set the encryption default module') |
|
59 | + ->addArgument( |
|
60 | + 'module', |
|
61 | + InputArgument::REQUIRED, |
|
62 | + 'ID of the encryption module that should be used' |
|
63 | + ) |
|
64 | + ; |
|
65 | + } |
|
66 | 66 | |
67 | - protected function execute(InputInterface $input, OutputInterface $output) { |
|
68 | - $isMaintenanceModeEnabled = $this->config->getSystemValue('maintenance', false); |
|
69 | - if ($isMaintenanceModeEnabled) { |
|
70 | - $output->writeln("Maintenance mode must be disabled when setting default module,"); |
|
71 | - $output->writeln("in order to load the relevant encryption modules correctly."); |
|
72 | - return; |
|
73 | - } |
|
67 | + protected function execute(InputInterface $input, OutputInterface $output) { |
|
68 | + $isMaintenanceModeEnabled = $this->config->getSystemValue('maintenance', false); |
|
69 | + if ($isMaintenanceModeEnabled) { |
|
70 | + $output->writeln("Maintenance mode must be disabled when setting default module,"); |
|
71 | + $output->writeln("in order to load the relevant encryption modules correctly."); |
|
72 | + return; |
|
73 | + } |
|
74 | 74 | |
75 | - $moduleId = $input->getArgument('module'); |
|
75 | + $moduleId = $input->getArgument('module'); |
|
76 | 76 | |
77 | - if ($moduleId === $this->encryptionManager->getDefaultEncryptionModuleId()) { |
|
78 | - $output->writeln('"' . $moduleId . '"" is already the default module'); |
|
79 | - } elseif ($this->encryptionManager->setDefaultEncryptionModule($moduleId)) { |
|
80 | - $output->writeln('<info>Set default module to "' . $moduleId . '"</info>'); |
|
81 | - } else { |
|
82 | - $output->writeln('<error>The specified module "' . $moduleId . '" does not exist</error>'); |
|
83 | - } |
|
84 | - } |
|
77 | + if ($moduleId === $this->encryptionManager->getDefaultEncryptionModuleId()) { |
|
78 | + $output->writeln('"' . $moduleId . '"" is already the default module'); |
|
79 | + } elseif ($this->encryptionManager->setDefaultEncryptionModule($moduleId)) { |
|
80 | + $output->writeln('<info>Set default module to "' . $moduleId . '"</info>'); |
|
81 | + } else { |
|
82 | + $output->writeln('<error>The specified module "' . $moduleId . '" does not exist</error>'); |
|
83 | + } |
|
84 | + } |
|
85 | 85 | } |
@@ -16,8 +16,11 @@ |
||
16 | 16 | <?php if ($error): ?> |
17 | 17 | <?php if ($error_message): ?> |
18 | 18 | <p><strong><?php p($error_message); ?></strong></p> |
19 | - <?php else: ?> |
|
20 | - <p><strong><?php p($l->t('Error while validating your second factor')); ?></strong></p> |
|
19 | + <?php else { |
|
20 | + : ?> |
|
21 | + <p><strong><?php p($l->t('Error while validating your second factor')); |
|
22 | +} |
|
23 | +?></strong></p> |
|
21 | 24 | <?php endif; ?> |
22 | 25 | <?php endif; ?> |
23 | 26 | <?php print_unescaped($template); ?> |
@@ -24,11 +24,11 @@ |
||
24 | 24 | <?php if (!is_null($_['backupProvider'])): ?> |
25 | 25 | <p> |
26 | 26 | <a class="two-factor-secondary" href="<?php p(\OC::$server->getURLGenerator()->linkToRoute('core.TwoFactorChallenge.showChallenge', |
27 | - [ |
|
28 | - 'challengeProviderId' => $_['backupProvider']->getId(), |
|
29 | - 'redirect_url' => $_['redirect_url'], |
|
30 | - ] |
|
31 | - )) ?>"> |
|
27 | + [ |
|
28 | + 'challengeProviderId' => $_['backupProvider']->getId(), |
|
29 | + 'redirect_url' => $_['redirect_url'], |
|
30 | + ] |
|
31 | + )) ?>"> |
|
32 | 32 | <?php p($l->t('Use backup code')) ?> |
33 | 33 | </a> |
34 | 34 | </p> |
@@ -29,7 +29,7 @@ |
||
29 | 29 | <?php p($theme->getName()); ?> |
30 | 30 | </h1> |
31 | 31 | <?php if (\OC::$server->getConfig()->getSystemValue('installed', false) |
32 | - && \OC::$server->getConfig()->getAppValue('theming', 'logoMime', false)): ?> |
|
32 | + && \OC::$server->getConfig()->getAppValue('theming', 'logoMime', false)): ?> |
|
33 | 33 | <img src="<?php p($theme->getLogo()); ?>"/> |
34 | 34 | <?php endif; ?> |
35 | 35 | </div> |
@@ -23,7 +23,7 @@ |
||
23 | 23 | <?php emit_script_loading_tags($_); ?> |
24 | 24 | <?php print_unescaped($_['headers']); ?> |
25 | 25 | </head> |
26 | - <body id="<?php p($_['bodyid']);?>"> |
|
26 | + <body id="<?php p($_['bodyid']); ?>"> |
|
27 | 27 | <?php include 'layout.noscript.warning.php'; ?> |
28 | 28 | <?php foreach ($_['initialStates'] as $app => $initialState) { ?> |
29 | 29 | <input type="hidden" id="initial-state-<?php p($app); ?>" value="<?php p(base64_encode($initialState)); ?>"> |