$this->dbpassword = $dbpass;
$this->dbname = $dbname;
$this->dbhost = $dbhost;
- $this->tableprefix = $tableprefix;
+ $this->tableprefix = $dbtableprefix;
}
}
//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) {
$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);
//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);
//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);
*
* @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";
//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);
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);
public $dbprettyname = 'Sqlite';
public function validate($config) {
+ return array();
}
public function initialize($config) {