Skip to content
GitLab
Menu
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
0adeb18c
Commit
0adeb18c
authored
Oct 19, 2006
by
Nigel McNie
Committed by
Nigel McNie
Oct 19, 2006
Browse files
Upgrade for inserting a root user and config option, and adding a field to
the usr table.
parent
5f808ffb
Changes
1
Hide whitespace changes
Inline
Side-by-side
htdocs/lib/db/upgrade.php
View file @
0adeb18c
...
@@ -49,6 +49,31 @@ function xmldb_core_upgrade($oldversion=0) {
...
@@ -49,6 +49,31 @@ function xmldb_core_upgrade($oldversion=0) {
$status
=
$status
&&
create_table
(
$table
);
$status
=
$status
&&
create_table
(
$table
);
}
}
if
(
$status
&&
$oldversion
<
2006101900
)
{
// Insert core configuration option
$status
=
$status
&&
set_config
(
'session_timeout'
,
1800
);
// Add password_change field
$table
=
new
XMLDBTable
(
'usr'
);
$field
=
new
XMLDBField
(
'password_change'
);
$field
->
setAttributes
(
XMLDB_TYPE_INTEGER
,
'1'
,
XMLDB_UNSIGNED
,
XMLDB_NOTNULL
,
null
,
null
,
null
,
0
,
null
);
$status
=
$status
&&
add_field
(
$table
,
$field
);
// Insert the root user
try
{
log_dbg
(
'trying to insert root user'
);
$root
=
new
StdClass
;
$root
->
username
=
'root'
;
$root
->
password
=
'mahara'
;
$root
->
password_change
=
1
;
insert_record
(
'usr'
,
$root
);
}
catch
(
DatalibException
$e
)
{
return
false
;
}
}
return
$status
;
return
$status
;
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a 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