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
ae711168
Commit
ae711168
authored
13 years ago
by
Robin Appelman
Browse files
Options
Downloads
Patches
Plain Diff
improve detection for mysql databases
parent
4d1ed7e0
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
+6
-3
6 additions, 3 deletions
lib/setup.php
with
6 additions
and
3 deletions
lib/setup.php
+
6
−
3
View file @
ae711168
...
...
@@ -103,7 +103,7 @@ class OC_Setup {
//use the admin login data for the new database user
//add prefix to the mysql user name to prevent collissions
$dbusername
=
substr
(
'oc_
mysql_
'
.
$username
,
0
,
16
);
$dbusername
=
substr
(
'oc_'
.
$username
,
0
,
16
);
//hash the password so we don't need to store the admin config in the config file
$dbpassword
=
md5
(
time
()
.
$password
);
...
...
@@ -124,9 +124,12 @@ class OC_Setup {
}
//fill the database if needed
$query
=
"
SELECT * FROM
$dbname
.
{
$dbtableprefix
}
users"
;
$query
=
"
select count(*) from information_schema.tables where table_schema='
$dbname
' AND table_name = '
{
$dbtableprefix
}
users
';
"
;
$result
=
mysql_query
(
$query
,
$connection
);
if
(
!
$result
)
{
if
(
$result
){
$row
=
mysql_fetch_row
(
$result
);
}
if
(
!
$result
or
$row
[
0
]
==
0
)
{
OC_DB
::
createDbFromStructure
(
'db_structure.xml'
);
}
mysql_close
(
$connection
);
...
...
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