Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
mahara
mahara
Commits
6b651d0b
Commit
6b651d0b
authored
Apr 30, 2009
by
Nigel McNie
Browse files
Wrap temporary import stuff in a database transaction
parent
f178729a
Changes
1
Hide whitespace changes
Inline
Side-by-side
htdocs/import/index.php
View file @
6b651d0b
...
...
@@ -102,6 +102,7 @@ function import_submit(Pieform $form, $values) {
$filename
=
substr
(
$filename
,
strlen
(
get_config
(
'dataroot'
)));
require_once
(
dirname
(
dirname
(
__FILE__
))
.
'/import/lib.php'
);
safe_require
(
'import'
,
'leap'
);
db_begin
();
$importer
=
PluginImport
::
create_importer
(
null
,
(
object
)
array
(
'token'
=>
''
,
//'host' => '',
...
...
@@ -122,6 +123,7 @@ function import_submit(Pieform $form, $values) {
$email
=
artefact_instance_from_id
(
get_field
(
'artefact'
,
'id'
,
'title'
,
'imported@example.org'
,
'artefacttype'
,
'email'
,
'owner'
,
$userid
));
$email
->
delete
();
execute_sql
(
'UPDATE {artefact_internal_profile_email} SET principal = 1 WHERE "owner" = ?'
,
array
(
$userid
));
db_commit
();
echo
"
\n\n
"
;
echo
'Done. You can <a href="'
.
get_config
(
'wwwroot'
)
.
'/admin/users/changeuser.php?id='
.
$userid
.
'">change to this user</a> to inspect the result, '
;
...
...
Write
Preview
Supports
Markdown
0%
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!
Cancel
Please
register
or
sign in
to comment