@@ -20,4 +20,4 @@ |
||
20 | 20 | * |
21 | 21 | */ |
22 | 22 | |
23 | -require_once __DIR__ . '/v1.php'; |
|
23 | +require_once __DIR__.'/v1.php'; |
@@ -19,7 +19,7 @@ |
||
19 | 19 | * |
20 | 20 | */ |
21 | 21 | |
22 | -require_once __DIR__ . '/../lib/base.php'; |
|
22 | +require_once __DIR__.'/../lib/base.php'; |
|
23 | 23 | |
24 | 24 | header('Content-Type: application/json'); |
25 | 25 |
@@ -55,7 +55,7 @@ discard block |
||
55 | 55 | protected function execute(InputInterface $input, OutputInterface $output) { |
56 | 56 | $outputType = $input->getOption('output'); |
57 | 57 | if ($outputType === self::OUTPUT_FORMAT_JSON || $outputType === self::OUTPUT_FORMAT_JSON_PRETTY) { |
58 | - $certificates = array_map(function (ICertificate $certificate) { |
|
58 | + $certificates = array_map(function(ICertificate $certificate) { |
|
59 | 59 | return [ |
60 | 60 | 'name' => $certificate->getName(), |
61 | 61 | 'common_name' => $certificate->getCommonName(), |
@@ -81,7 +81,7 @@ discard block |
||
81 | 81 | 'Issued By' |
82 | 82 | ]); |
83 | 83 | |
84 | - $rows = array_map(function (ICertificate $certificate) { |
|
84 | + $rows = array_map(function(ICertificate $certificate) { |
|
85 | 85 | return [ |
86 | 86 | $certificate->getName(), |
87 | 87 | $certificate->getCommonName(), |
@@ -69,7 +69,7 @@ discard block |
||
69 | 69 | $privateKeyPath = $input->getOption('privateKey'); |
70 | 70 | $keyBundlePath = $input->getOption('certificate'); |
71 | 71 | $path = $input->getOption('path'); |
72 | - if(is_null($privateKeyPath) || is_null($keyBundlePath) || is_null($path)) { |
|
72 | + if (is_null($privateKeyPath) || is_null($keyBundlePath) || is_null($path)) { |
|
73 | 73 | $output->writeln('--privateKey, --certificate and --path are required.'); |
74 | 74 | return null; |
75 | 75 | } |
@@ -77,12 +77,12 @@ discard block |
||
77 | 77 | $privateKey = $this->fileAccessHelper->file_get_contents($privateKeyPath); |
78 | 78 | $keyBundle = $this->fileAccessHelper->file_get_contents($keyBundlePath); |
79 | 79 | |
80 | - if($privateKey === false) { |
|
80 | + if ($privateKey === false) { |
|
81 | 81 | $output->writeln(sprintf('Private key "%s" does not exists.', $privateKeyPath)); |
82 | 82 | return null; |
83 | 83 | } |
84 | 84 | |
85 | - if($keyBundle === false) { |
|
85 | + if ($keyBundle === false) { |
|
86 | 86 | $output->writeln(sprintf('Certificate "%s" does not exists.', $keyBundlePath)); |
87 | 87 | return null; |
88 | 88 | } |
@@ -96,8 +96,8 @@ discard block |
||
96 | 96 | try { |
97 | 97 | $this->checker->writeCoreSignature($x509, $rsa, $path); |
98 | 98 | $output->writeln('Successfully signed "core"'); |
99 | - } catch (\Exception $e){ |
|
100 | - $output->writeln('Error: ' . $e->getMessage()); |
|
99 | + } catch (\Exception $e) { |
|
100 | + $output->writeln('Error: '.$e->getMessage()); |
|
101 | 101 | return 1; |
102 | 102 | } |
103 | 103 | return 0; |
@@ -75,23 +75,23 @@ discard block |
||
75 | 75 | $path = $input->getOption('path'); |
76 | 76 | $privateKeyPath = $input->getOption('privateKey'); |
77 | 77 | $keyBundlePath = $input->getOption('certificate'); |
78 | - if(is_null($path) || is_null($privateKeyPath) || is_null($keyBundlePath)) { |
|
78 | + if (is_null($path) || is_null($privateKeyPath) || is_null($keyBundlePath)) { |
|
79 | 79 | $documentationUrl = $this->urlGenerator->linkToDocs('developer-code-integrity'); |
80 | 80 | $output->writeln('This command requires the --path, --privateKey and --certificate.'); |
81 | 81 | $output->writeln('Example: ./occ integrity:sign-app --path="/Users/lukasreschke/Programming/myapp/" --privateKey="/Users/lukasreschke/private/myapp.key" --certificate="/Users/lukasreschke/public/mycert.crt"'); |
82 | - $output->writeln('For more information please consult the documentation: '. $documentationUrl); |
|
82 | + $output->writeln('For more information please consult the documentation: '.$documentationUrl); |
|
83 | 83 | return null; |
84 | 84 | } |
85 | 85 | |
86 | 86 | $privateKey = $this->fileAccessHelper->file_get_contents($privateKeyPath); |
87 | 87 | $keyBundle = $this->fileAccessHelper->file_get_contents($keyBundlePath); |
88 | 88 | |
89 | - if($privateKey === false) { |
|
89 | + if ($privateKey === false) { |
|
90 | 90 | $output->writeln(sprintf('Private key "%s" does not exists.', $privateKeyPath)); |
91 | 91 | return null; |
92 | 92 | } |
93 | 93 | |
94 | - if($keyBundle === false) { |
|
94 | + if ($keyBundle === false) { |
|
95 | 95 | $output->writeln(sprintf('Certificate "%s" does not exists.', $keyBundlePath)); |
96 | 96 | return null; |
97 | 97 | } |
@@ -104,8 +104,8 @@ discard block |
||
104 | 104 | try { |
105 | 105 | $this->checker->writeAppSignature($path, $x509, $rsa); |
106 | 106 | $output->writeln('Successfully signed "'.$path.'"'); |
107 | - } catch (\Exception $e){ |
|
108 | - $output->writeln('Error: ' . $e->getMessage()); |
|
107 | + } catch (\Exception $e) { |
|
108 | + $output->writeln('Error: '.$e->getMessage()); |
|
109 | 109 | return 1; |
110 | 110 | } |
111 | 111 | return 0; |
@@ -60,7 +60,7 @@ |
||
60 | 60 | protected function execute(InputInterface $input, OutputInterface $output) { |
61 | 61 | $result = $this->checker->verifyCoreSignature(); |
62 | 62 | $this->writeArrayInOutputFormat($input, $output, $result); |
63 | - if (count($result)>0){ |
|
63 | + if (count($result) > 0) { |
|
64 | 64 | return 1; |
65 | 65 | } |
66 | 66 | } |
@@ -56,20 +56,20 @@ |
||
56 | 56 | |
57 | 57 | protected function execute(InputInterface $input, OutputInterface $output) { |
58 | 58 | $user = $this->userManager->get($input->getArgument('uid')); |
59 | - if(is_null($user)) { |
|
59 | + if (is_null($user)) { |
|
60 | 60 | $output->writeln('<error>User does not exist</error>'); |
61 | 61 | return; |
62 | 62 | } |
63 | 63 | |
64 | 64 | $lastLogin = $user->getLastLogin(); |
65 | - if($lastLogin === 0) { |
|
66 | - $output->writeln('User ' . $user->getUID() . |
|
65 | + if ($lastLogin === 0) { |
|
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 | } |
@@ -117,12 +117,12 @@ |
||
117 | 117 | try { |
118 | 118 | $success = $user->setPassword($password); |
119 | 119 | } catch (\Exception $e) { |
120 | - $output->writeln('<error>' . $e->getMessage() . '</error>'); |
|
120 | + $output->writeln('<error>'.$e->getMessage().'</error>'); |
|
121 | 121 | return 1; |
122 | 122 | } |
123 | 123 | |
124 | 124 | if ($success) { |
125 | - $output->writeln("<info>Successfully reset password for " . $username . "</info>"); |
|
125 | + $output->writeln("<info>Successfully reset password for ".$username."</info>"); |
|
126 | 126 | } else { |
127 | 127 | $output->writeln("<error>Error while resetting password!</error>"); |
128 | 128 | return 1; |
@@ -53,10 +53,10 @@ |
||
53 | 53 | $table = new Table($output); |
54 | 54 | $table->setHeaders(array('User Report', '')); |
55 | 55 | $userCountArray = $this->countUsers(); |
56 | - if(!empty($userCountArray)) { |
|
56 | + if (!empty($userCountArray)) { |
|
57 | 57 | $total = 0; |
58 | 58 | $rows = array(); |
59 | - foreach($userCountArray as $classname => $users) { |
|
59 | + foreach ($userCountArray as $classname => $users) { |
|
60 | 60 | $total += $users; |
61 | 61 | $rows[] = array($classname, $users); |
62 | 62 | } |