From: Bart Visscher Date: Wed, 10 Apr 2013 22:08:53 +0000 (+0200) Subject: Fix found errors X-Git-Tag: v6.0.0alpha2~564^2~1 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=e93ce26f27fa8c2c364696a7a7ce5122eb4a91e2;p=nextcloud-server.git Fix found errors --- diff --git a/lib/setup/abstractdatabase.php b/lib/setup/abstractdatabase.php index c1b611e6554..66202251e97 100644 --- a/lib/setup/abstractdatabase.php +++ b/lib/setup/abstractdatabase.php @@ -43,6 +43,6 @@ abstract class AbstractDatabase { $this->dbpassword = $dbpass; $this->dbname = $dbname; $this->dbhost = $dbhost; - $this->tableprefix = $tableprefix; + $this->tableprefix = $dbtableprefix; } } diff --git a/lib/setup/mssql.php b/lib/setup/mssql.php index 74ac8f294a9..5ed0d030c7c 100644 --- a/lib/setup/mssql.php +++ b/lib/setup/mssql.php @@ -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) { diff --git a/lib/setup/mysql.php b/lib/setup/mysql.php index aa0344f686c..1ab1b6ea8ae 100644 --- a/lib/setup/mysql.php +++ b/lib/setup/mysql.php @@ -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); diff --git a/lib/setup/oci.php b/lib/setup/oci.php index 56452c65a59..cda7ff7c50c 100644 --- a/lib/setup/oci.php +++ b/lib/setup/oci.php @@ -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"; diff --git a/lib/setup/postgresql.php b/lib/setup/postgresql.php index 67e4f901a91..d5b135a9577 100644 --- a/lib/setup/postgresql.php +++ b/lib/setup/postgresql.php @@ -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); diff --git a/lib/setup/sqlite.php b/lib/setup/sqlite.php index 0b96ec60009..4b0a572bb39 100644 --- a/lib/setup/sqlite.php +++ b/lib/setup/sqlite.php @@ -6,6 +6,7 @@ class Sqlite extends AbstractDatabase { public $dbprettyname = 'Sqlite'; public function validate($config) { + return array(); } public function initialize($config) {