$this->setArg('output', 'json');
$this->execute();
- return json_decode($this->output);
+ return json_decode($this->getOutput(), true);
+ }
+
+ public function addUser($email, $userID = null, $name = '', $password = null)
+ {
+ // user:add [--password-from-env] [--generate-password] [--display-name [DISPLAY-NAME]] [-g|--group [GROUP]] [--email EMAIL] [--] <uid>
+ $this->setArg(null, 'user:add');
+ if (null === $password) {
+ $this->setArg('generate-password');
+ } else {
+ $this->setEnv('OCC_PASS', $password);
+ $this->setArg('password-from-env');
+ }
+ if ($name) {
+ $this->setArg('display-name', $name);
+ }
+ $this->setArg('email', $email);
+ $this->setArg(null, $userID ?? $email);
+ $this->execute();
+ $this->dd();
}
}
\ No newline at end of file