]> git.ipfire.org Git - thirdparty/bacula.git/commitdiff
baculum: Tweak fix getting users in basic user endpoint
authorMarcin Haba <marcin.haba@bacula.pl>
Fri, 12 Nov 2021 20:20:17 +0000 (21:20 +0100)
committerMarcin Haba <marcin.haba@bacula.pl>
Fri, 12 Nov 2021 20:20:17 +0000 (21:20 +0100)
gui/baculum/protected/API/Pages/API/BasicUser.php

index a9e87cd32cbcbfd90809a7da8f7fea7701b507a9..3d0afe0f169523484901e600757ce49a554aaf0c 100644 (file)
@@ -31,11 +31,16 @@ class BasicUser extends BaculumAPIServer {
 
        public function get() {
                $user = $this->Request->contains('id') ? $this->Request['id'] : 0;
-               $username = $this->getModule('basic_apiuser')->validateUsername($user) ? $user : null;
+               $basic_apiuser = $this->getModule('basic_apiuser');
+               $username = $basic_apiuser->validateUsername($user) ? $user : null;
                if (is_string($username)) {
                        $basic_config = $this->getModule('basic_config')->getConfig($username);
-                       if (count($basic_config) > 0) {
-                               $this->output = array_merge($basic_config, ['username' => $username]);
+                       $basic_cfg = $basic_apiuser->getUserCfg($username);
+                       if (count($basic_cfg) > 0) {
+                               $this->output = array_merge([
+                                       'username' => $username,
+                                       'bconsole_cfg_path' => ''
+                               ], $basic_config);
                                $this->error = BasicUserError::ERROR_NO_ERRORS;
                        } else {
                                $this->output = BasicUserError::MSG_ERROR_BASIC_USER_DOES_NOT_EXIST;