mirror of
https://github.com/MrUnknownDE/panel.git
synced 2026-04-19 06:43:45 +02:00
Allow Null = 0
Allow Value to be nullable, will autofill 0 if value is null or 0, to facilitate "unlimited" connections.
This commit is contained in:
@@ -135,12 +135,16 @@ class DatabaseRepository extends EloquentRepository implements DatabaseRepositor
|
||||
* @param string $username
|
||||
* @param string $remote
|
||||
* @param string $password
|
||||
* @param string $max_connections
|
||||
* @param $max_connections
|
||||
* @return bool
|
||||
*/
|
||||
public function createUser(string $username, string $remote, string $password, string $max_connections): bool
|
||||
public function createUser(string $username, string $remote, string $password, $max_connections): bool
|
||||
{
|
||||
return $this->run(sprintf('CREATE USER `%s`@`%s` IDENTIFIED BY \'%s\' WITH MAX_USER_CONNECTIONS %s', $username, $remote, $password, $max_connections));
|
||||
if (!$max_connections) {
|
||||
return $this->run(sprintf('CREATE USER `%s`@`%s` IDENTIFIED BY \'%s\'', $username, $remote, $password));
|
||||
} else {
|
||||
return $this->run(sprintf('CREATE USER `%s`@`%s` IDENTIFIED BY \'%s\' WITH MAX_USER_CONNECTIONS %s', $username, $remote, $password, $max_connections));
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user