@@ -49,9 +49,12 @@ |
||
49 | 49 | 'action' => 'create', |
50 | 50 | 'name' => $name, |
51 | 51 | ]; |
52 | - if(!empty($password)) { |
|
52 | + if(!empty($password)) |
|
53 | + { |
|
53 | 54 | $options += ['user' => $username, 'passwd' => $password, 'passwd2' => $password]; |
54 | - } else { |
|
55 | + } |
|
56 | + else |
|
57 | + { |
|
55 | 58 | $options += ['userlist' => $username]; |
56 | 59 | } |
57 | 60 | $user->getContext()->invokePost('DATABASES', $options); |
@@ -204,7 +204,8 @@ |
||
204 | 204 | { |
205 | 205 | return $this->getCache(self::CACHE_DATABASES, function() { |
206 | 206 | $databases = []; |
207 | - foreach($this->getSelfManagedContext()->invokeGet('DATABASES') as $fullName) { |
|
207 | + foreach($this->getSelfManagedContext()->invokeGet('DATABASES') as $fullName) |
|
208 | + { |
|
208 | 209 | list($user, $db) = explode('_', $fullName, 2); |
209 | 210 | if($this->getUsername() != $user) |
210 | 211 | throw new DirectAdminException('Username incorrect on database ' . $fullName); |