Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
O
our_own_cloud_project
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
die_coolen_jungs
our_own_cloud_project
Commits
daf742c0
Commit
daf742c0
authored
13 years ago
by
Tom Needham
Browse files
Options
Downloads
Patches
Plain Diff
Fix owncloud log
parent
d01b78a4
No related branches found
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
apps/contacts/appinfo/migrate.php
+68
-0
68 additions, 0 deletions
apps/contacts/appinfo/migrate.php
lib/log/owncloud.php
+1
-1
1 addition, 1 deletion
lib/log/owncloud.php
with
69 additions
and
1 deletion
apps/contacts/appinfo/migrate.php
0 → 100644
+
68
−
0
View file @
daf742c0
<?php
class
OC_Migration_Provider_Contacts
extends
OC_Migration_Provider
{
// Create the xml for the user supplied
function
export
(
){
$options
=
array
(
'table'
=>
'contacts_addressbooks'
,
'matchcol'
=>
'userid'
,
'matchval'
=>
$this
->
uid
,
'idcol'
=>
'id'
);
$ids
=
$this
->
content
->
copyRows
(
$options
);
$options
=
array
(
'table'
=>
'contacts_cards'
,
'matchcol'
=>
'addressbookid'
,
'matchval'
=>
$ids
);
// Export tags
$ids2
=
$this
->
content
->
copyRows
(
$options
);
// If both returned some ids then they worked
if
(
is_array
(
$ids
)
&&
is_array
(
$ids2
)
)
{
return
true
;
}
else
{
return
false
;
}
}
// Import function for bookmarks
function
import
(
){
switch
(
$this
->
appinfo
->
version
){
default
:
// All versions of the app have had the same db structure, so all can use the same import function
$query
=
$this
->
content
->
prepare
(
"SELECT * FROM contacts_addressbooks WHERE userid LIKE ?"
);
$results
=
$query
->
execute
(
array
(
$this
->
olduid
)
);
$idmap
=
array
();
while
(
$row
=
$results
->
fetchRow
()
){
// Import each bookmark, saving its id into the map
$query
=
OC_DB
::
prepare
(
"INSERT INTO *PREFIX*contacts_addressbooks (`userid`, `displayname`, `uri`, `description`, `ctag`) VALUES (?, ?, ?, ?, ?)"
);
$query
->
execute
(
array
(
$this
->
uid
,
$row
[
'displayname'
],
$row
[
'uri'
],
$row
[
'description'
],
$row
[
'ctag'
]
)
);
// Map the id
$idmap
[
$row
[
'id'
]]
=
OC_DB
::
insertid
();
}
// Now tags
foreach
(
$idmap
as
$oldid
=>
$newid
){
$query
=
$this
->
content
->
prepare
(
"SELECT * FROM contacts_cards WHERE addressbookid LIKE ?"
);
$results
=
$query
->
execute
(
array
(
$oldid
)
);
while
(
$row
=
$results
->
fetchRow
()
){
// Import the tags for this bookmark, using the new bookmark id
$query
=
OC_DB
::
prepare
(
"INSERT INTO *PREFIX*contacts_cards (`addressbookid`, `fullname`, `carddata`, `uri`, `lastmodified`) VALUES (?, ?, ?, ?, ?)"
);
$query
->
execute
(
array
(
$newid
,
$row
[
'fullname'
],
$row
[
'carddata'
],
$row
[
'uri'
],
$row
[
'lastmodified'
]
)
);
}
}
// All done!
break
;
}
return
true
;
}
}
// Load the provider
new
OC_Migration_Provider_Contacts
(
'contacts'
);
\ No newline at end of file
This diff is collapsed.
Click to expand it.
lib/log/owncloud.php
+
1
−
1
View file @
daf742c0
...
...
@@ -65,7 +65,7 @@ class OC_Log_Owncloud {
if
(
!
file_exists
(
self
::
$logFile
))
{
return
array
();
}
$contents
=
file
(
$logFile
);
$contents
=
file
(
self
::
$logFile
);
if
(
!
$contents
)
{
//error while reading log
return
array
();
}
...
...
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