@@ -63,9 +63,9 @@ discard block |
||
63 | 63 | //use the admin login data for the new database user |
64 | 64 | |
65 | 65 | //add prefix to the postgresql user name to prevent collisions |
66 | - $this->dbUser = 'oc_' . strtolower($username); |
|
66 | + $this->dbUser = 'oc_'.strtolower($username); |
|
67 | 67 | //create a new password so we don't need to store the admin config in the config file |
68 | - $this->dbPassword = \OC::$server->getSecureRandom()->generate(30, \OCP\Security\ISecureRandom::CHAR_LOWER . \OCP\Security\ISecureRandom::CHAR_DIGITS); |
|
68 | + $this->dbPassword = \OC::$server->getSecureRandom()->generate(30, \OCP\Security\ISecureRandom::CHAR_LOWER.\OCP\Security\ISecureRandom::CHAR_DIGITS); |
|
69 | 69 | |
70 | 70 | $this->createDBUser($connection); |
71 | 71 | } |
@@ -104,7 +104,7 @@ discard block |
||
104 | 104 | private function createDatabase(IDBConnection $connection) { |
105 | 105 | if (!$this->databaseExists($connection)) { |
106 | 106 | //The database does not exists... let's create it |
107 | - $query = $connection->prepare("CREATE DATABASE " . addslashes($this->dbName) . " OWNER " . addslashes($this->dbUser)); |
|
107 | + $query = $connection->prepare("CREATE DATABASE ".addslashes($this->dbName)." OWNER ".addslashes($this->dbUser)); |
|
108 | 108 | try { |
109 | 109 | $query->execute(); |
110 | 110 | } catch (DatabaseException $e) { |
@@ -112,7 +112,7 @@ discard block |
||
112 | 112 | $this->logger->logException($e); |
113 | 113 | } |
114 | 114 | } else { |
115 | - $query = $connection->prepare("REVOKE ALL PRIVILEGES ON DATABASE " . addslashes($this->dbName) . " FROM PUBLIC"); |
|
115 | + $query = $connection->prepare("REVOKE ALL PRIVILEGES ON DATABASE ".addslashes($this->dbName)." FROM PUBLIC"); |
|
116 | 116 | try { |
117 | 117 | $query->execute(); |
118 | 118 | } catch (DatabaseException $e) { |
@@ -148,14 +148,14 @@ discard block |
||
148 | 148 | $i = 1; |
149 | 149 | while ($this->userExists($connection)) { |
150 | 150 | $i++; |
151 | - $this->dbUser = $dbUser . $i; |
|
151 | + $this->dbUser = $dbUser.$i; |
|
152 | 152 | } |
153 | 153 | |
154 | 154 | // create the user |
155 | - $query = $connection->prepare("CREATE USER " . addslashes($this->dbUser) . " CREATEDB PASSWORD '" . addslashes($this->dbPassword) . "'"); |
|
155 | + $query = $connection->prepare("CREATE USER ".addslashes($this->dbUser)." CREATEDB PASSWORD '".addslashes($this->dbPassword)."'"); |
|
156 | 156 | $query->execute(); |
157 | 157 | if ($this->databaseExists($connection)) { |
158 | - $query = $connection->prepare('GRANT CONNECT ON DATABASE ' . addslashes($this->dbName) . ' TO '.addslashes($this->dbUser)); |
|
158 | + $query = $connection->prepare('GRANT CONNECT ON DATABASE '.addslashes($this->dbName).' TO '.addslashes($this->dbUser)); |
|
159 | 159 | $query->execute(); |
160 | 160 | } |
161 | 161 | } catch (DatabaseException $e) { |