]> source.dussan.org Git - nextcloud-server.git/commitdiff
Fix found errors
authorBart Visscher <bartv@thisnet.nl>
Wed, 10 Apr 2013 22:08:53 +0000 (00:08 +0200)
committerBart Visscher <bartv@thisnet.nl>
Sat, 29 Jun 2013 19:15:06 +0000 (21:15 +0200)
lib/setup/abstractdatabase.php
lib/setup/mssql.php
lib/setup/mysql.php
lib/setup/oci.php
lib/setup/postgresql.php
lib/setup/sqlite.php

index c1b611e65545e1da0d0befcb2f23bfb195a83f76..66202251e975c0e735aede219c1fbeea77089879 100644 (file)
@@ -43,6 +43,6 @@ abstract class AbstractDatabase {
                $this->dbpassword = $dbpass;
                $this->dbname = $dbname;
                $this->dbhost = $dbhost;
-               $this->tableprefix = $tableprefix;
+               $this->tableprefix = $dbtableprefix;
        }
 }
index 74ac8f294a9817c9a7667910f1c3c1e736aaa357..5ed0d030c7c9917fe1e917577e1c959e608de5ea 100644 (file)
@@ -149,7 +149,7 @@ class MSSQL extends AbstractDatabase {
                //fill the database if needed
                $query = "SELECT * FROM INFORMATION_SCHEMA.TABLES"
                        ." WHERE TABLE_SCHEMA = '".$this->dbname."'"
-                       ." AND TABLE_NAME = '".$this->dbtableprefix."users'";
+                       ." AND TABLE_NAME = '".$this->tableprefix."users'";
                $result = sqlsrv_query($connection, $query);
                if ($result === false) {
                        if ( ($errors = sqlsrv_errors() ) != null) {
index aa0344f686ccfc7628d26e63197fd39d70206c34..1ab1b6ea8ae1b943f4ec640ba73da9f232348f81 100644 (file)
@@ -23,7 +23,7 @@ class MySQL extends AbstractDatabase {
                        $this->dbuser=substr('oc_'.$username, 0, 16);
                        if($this->dbuser!=$oldUser) {
                                //hash the password so we don't need to store the admin config in the config file
-                               $this->dbpassword=OC_Util::generate_random_bytes(30);
+                               $this->dbpassword=\OC_Util::generate_random_bytes(30);
 
                                $this->createDBUser($connection);
 
@@ -46,7 +46,7 @@ class MySQL extends AbstractDatabase {
 
                //fill the database if needed
                $query='select count(*) from information_schema.tables'
-                       ." where table_schema='".$this->dbname."' AND table_name = '".$this->dbtableprefix."users';";
+                       ." where table_schema='".$this->dbname."' AND table_name = '".$this->tableprefix."users';";
                $result = mysql_query($query, $connection);
                if($result) {
                        $row=mysql_fetch_row($result);
index 56452c65a59669630de8d9ac9d7c20f17382d58c..cda7ff7c50c98cf2b30aef14da6d190d7e390cc3 100644 (file)
@@ -65,14 +65,14 @@ class OCI extends AbstractDatabase {
                        //add prefix to the oracle user name to prevent collisions
                        $this->dbuser='oc_'.$username;
                        //create a new password so we don't need to store the admin config in the config file
-                       $this->dbpassword=OC_Util::generate_random_bytes(30);
+                       $this->dbpassword=\OC_Util::generate_random_bytes(30);
 
                        //oracle passwords are treated as identifiers:
                        //  must start with aphanumeric char
                        //  needs to be shortened to 30 bytes, as the two " needed to escape the identifier count towards the identifier length.
                        $this->dbpassword=substr($this->dbpassword, 0, 30);
 
-                       $this->createDBUser($this->dbtablespace, $connection);
+                       $this->createDBUser($connection);
 
                        \OC_Config::setValue('dbuser', $this->dbusername);
                        \OC_Config::setValue('dbname', $this->dbusername);
@@ -136,10 +136,9 @@ class OCI extends AbstractDatabase {
         *
         * @param String $name
         * @param String $password
-        * @param String $tablespace
         * @param resource $connection
         */
-       private function createDBUser($tablespace, $connection) {
+       private function createDBUser($connection) {
                $name = $this->dbuser;
                $password = $this->password;
                $query = "SELECT * FROM all_users WHERE USERNAME = :un";
index 67e4f901a9191ab53abdd17d639ad7fec4921120..d5b135a957790a5be3b19c0c6034ca3c96110b58 100644 (file)
@@ -33,7 +33,7 @@ class PostgreSQL extends AbstractDatabase {
                        //add prefix to the postgresql user name to prevent collisions
                        $this->dbuser='oc_'.$username;
                        //create a new password so we don't need to store the admin config in the config file
-                       $this->dbpassword=OC_Util::generate_random_bytes(30);
+                       $this->dbpassword=\OC_Util::generate_random_bytes(30);
 
                        $this->createDBUser($connection);
 
@@ -69,7 +69,7 @@ class PostgreSQL extends AbstractDatabase {
                        throw new \DatabaseSetupException($this->trans->t('PostgreSQL username and/or password not valid'),
                                        $this->trans->t('You need to enter either an existing account or the administrator.'));
                }
-               $query = "select count(*) FROM pg_class WHERE relname='".$this->dbtableprefix."users' limit 1";
+               $query = "select count(*) FROM pg_class WHERE relname='".$this->tableprefix."users' limit 1";
                $result = pg_query($connection, $query);
                if($result) {
                        $row = pg_fetch_row($result);
index 0b96ec6000930dab5cbc265c44c8258dcdb95774..4b0a572bb39d3bdca62225159a0beb4db5352a90 100644 (file)
@@ -6,6 +6,7 @@ class Sqlite extends AbstractDatabase {
        public $dbprettyname = 'Sqlite';
 
        public function validate($config) {
+               return array();
        }
 
        public function initialize($config) {