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
311e012e
Commit
311e012e
authored
Mar 10, 2009
by
Richard Mansfield
Browse files
Ensure system user has id=0 when installing system profile view in upgrade from 1.0.x
parent
fcb4a05e
Changes
1
Hide whitespace changes
Inline
Side-by-side
htdocs/lib/db/upgrade.php
View file @
311e012e
...
...
@@ -557,6 +557,11 @@ function xmldb_core_upgrade($oldversion=0) {
}
}
if
(
!
get_record
(
'view'
,
'owner'
,
0
,
'type'
,
'profile'
))
{
// First ensure system user has id = 0; In older MySQL installations it may be > 0
$sysuser
=
get_record
(
'usr'
,
'username'
,
'root'
);
if
(
$sysuser
&&
$sysuser
->
id
>
0
&&
!
count_records
(
'usr'
,
'id'
,
0
))
{
set_field
(
'usr'
,
'id'
,
0
,
'id'
,
$sysuser
->
id
);
}
// Install system profile view
require_once
(
get_config
(
'libroot'
)
.
'view.php'
);
$dbtime
=
db_format_timestamp
(
time
());
...
...
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