Commit 8ff3e3f7 authored by Robert Lyon's avatar Robert Lyon

Installation doesn't save email address (Bug #1300741)

This is a regression that has crept in during v1.8
The installation doesn't update the admin's email address from the
dummy one.

Change-Id: If2b74121e6799c3f2c3745802c2aa0e856b2fd69
Signed-off-by: Robert Lyon's avatarRobert Lyon <robertl@catalyst.net.nz>
parent 1577d5b2
......@@ -999,6 +999,15 @@ function requiredfields_submit(Pieform $form, $values) {
}
if ($field == 'email') {
$email = $values['email'];
// Need to update the admin email on installation
if ($USER->get('id') == '1') {
$oldemail = get_field('usr', 'email', 'id', $USER->get('id'));
if ($oldemail == 'admin@example.org') {
// we are dealing with the dummy email that is set on install
update_record('usr', array('email' => $email), array('id' => $USER->get('id')));
update_record('artefact_internal_profile_email', array('email' => $email), array('owner' => $USER->get('id')));
}
}
// Check if a validation email has been sent, if not send one
if (!record_exists('artefact_internal_profile_email', 'owner', $USER->get('id'))) {
$key = get_random_key();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment