@@ -24,7 +24,6 @@ |
||
24 | 24 | /** @var string */ |
25 | 25 | private $databaseName; |
26 | 26 | /** |
27 | - * @param array $info |
|
28 | 27 | * @param UserContext $context Context within which the object is valid. |
29 | 28 | */ |
30 | 29 | public function __construct($name, User $owner, UserContext $context) |
@@ -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); |
@@ -46,7 +46,7 @@ |
||
46 | 46 | public function getUsers() |
47 | 47 | { |
48 | 48 | return Object::toObjectArray($this->getContext()->invokeGet('SHOW_USERS', ['reseller' => $this->getUsername()]), |
49 | - User::class, $this->getContext()); |
|
49 | + User::class, $this->getContext()); |
|
50 | 50 | |
51 | 51 | } |
52 | 52 |