Skip to content
Snippets Groups Projects
Commit 486a31bf authored by Robin Appelman's avatar Robin Appelman
Browse files

minor changes to mysql setup

parent bf40691a
No related branches found
No related tags found
No related merge requests found
...@@ -158,8 +158,8 @@ class OC_Setup { ...@@ -158,8 +158,8 @@ class OC_Setup {
//add prefix to the postgresql user name to prevent collissions //add prefix to the postgresql user name to prevent collissions
$dbusername='oc_'.$username; $dbusername='oc_'.$username;
//hash the password so we don't need to store the admin config in the config file //create a new password so we don't need to store the admin config in the config file
$dbpassword=md5(time().$password); $dbpassword=md5(time());
self::pg_createDBUser($dbusername, $dbpassword, $connection); self::pg_createDBUser($dbusername, $dbpassword, $connection);
...@@ -219,7 +219,7 @@ class OC_Setup { ...@@ -219,7 +219,7 @@ class OC_Setup {
} }
public static function createDatabase($name,$user,$connection) { public static function createDatabase($name,$user,$connection) {
//we cant user OC_BD functions here because we need to connect as the administrative user. //we cant use OC_BD functions here because we need to connect as the administrative user.
$query = "CREATE DATABASE IF NOT EXISTS `$name`"; $query = "CREATE DATABASE IF NOT EXISTS `$name`";
$result = mysql_query($query, $connection); $result = mysql_query($query, $connection);
if(!$result) { if(!$result) {
...@@ -241,7 +241,7 @@ class OC_Setup { ...@@ -241,7 +241,7 @@ class OC_Setup {
} }
public static function pg_createDatabase($name,$user,$connection) { public static function pg_createDatabase($name,$user,$connection) {
//we cant user OC_BD functions here because we need to connect as the administrative user. //we cant use OC_BD functions here because we need to connect as the administrative user.
$query = "CREATE DATABASE $name OWNER $user"; $query = "CREATE DATABASE $name OWNER $user";
$result = pg_query($connection, $query); $result = pg_query($connection, $query);
if(!$result) { if(!$result) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment