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
5a5e9bde
Commit
5a5e9bde
authored
Nov 20, 2006
by
Nigel McNie
Committed by
Nigel McNie
Nov 20, 2006
Browse files
Set profile fields email, firstname and lastname correctly.
parent
45d275ea
Changes
1
Hide whitespace changes
Inline
Side-by-side
htdocs/register.php
View file @
5a5e9bde
...
...
@@ -64,11 +64,20 @@ if (isset($_REQUEST['key'])) {
function
register_profile_submit
(
$values
)
{
global
$registration
,
$SESSION
;
db_begin
();
// Move the user record to the usr table from the registration table
$registrationid
=
$registration
->
id
;
unset
(
$registration
->
id
);
$registration
->
id
=
insert_record
(
'usr'
,
$registration
,
'id'
,
true
);
log_debug
(
$registration
);
// Insert standard stuff as artefacts
set_profile_field
(
$registration
->
id
,
'email'
,
$registration
->
email
);
set_profile_field
(
$registration
->
id
,
'firstname'
,
$registration
->
firstname
);
set_profile_field
(
$registration
->
id
,
'lastname'
,
$registration
->
lastname
);
// Delete the old registration record
delete_records
(
'usr_registration'
,
'id'
,
$registrationid
);
// Set mandatory profile fields
...
...
@@ -80,6 +89,8 @@ if (isset($_REQUEST['key'])) {
set_profile_field
(
$registration
->
id
,
$field
,
$values
[
$field
]);
}
db_commit
();
// Log the user in and send them to the homepage
$SESSION
->
login
(
$registration
);
redirect
(
get_config
(
'wwwroot'
));
...
...
@@ -312,9 +323,11 @@ function register_submit($values) {
get_string
(
'registeredemailmessagehtml'
,
'auth.internal'
,
$values
[
'key'
],
$values
[
'key'
]));
}
catch
(
EmailException
$e
)
{
log_warn
(
$e
);
die_info
(
get_string
(
'registrationunsuccessful'
,
'auth.internal'
));
}
catch
(
SQLException
$e
)
{
log_warn
(
$e
);
die_info
(
get_string
(
'registrationunsuccessful'
,
'auth.internal'
));
}
...
...
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