Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Nextcloud
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Monitor
Service Desk
Analyze
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
TeDomum
Nextcloud
Commits
486a31bf
Commit
486a31bf
authored
13 years ago
by
Robin Appelman
Browse files
Options
Downloads
Patches
Plain Diff
minor changes to mysql setup
parent
bf40691a
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
lib/setup.php
+4
-4
4 additions, 4 deletions
lib/setup.php
with
4 additions
and
4 deletions
lib/setup.php
+
4
−
4
View file @
486a31bf
...
@@ -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 use
r
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 use
r
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
)
{
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment