Commit d6cd9242 authored by Jono Mingard's avatar Jono Mingard Committed by Son Nguyen
Browse files

Ensure dummy admin email is changed on install (Bug #1378581)

Email is now changed in all three tables it's stored in during both
web and cli install

Change-Id: I952e0cbc1d573acdacecad00a4a7eddf2251ede2
parent fe7a0634
......@@ -80,6 +80,10 @@ $userobj = $userobj->find_by_username('admin');
$userobj->email = $adminemail;
$userobj->commit();
// Ensure that the dummy admin email is changed
update_record('artefact_internal_profile_email', array('email' => $adminemail), array('owner' => $userobj->id));
update_record('artefact', array('title' => $adminemail), array('owner' => $userobj->id, 'artefacttype' => 'email'));
// Password changes should be performed by the authfactory
$authobj = AuthFactory::create($userobj->authinstance);
$authobj->change_password($userobj, $adminpassword, true);
......
......@@ -1023,6 +1023,7 @@ function requiredfields_submit(Pieform $form, $values) {
// 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')));
update_record('artefact', array('title' => $email), array('owner' => $USER->get('id'), 'artefacttype' => 'email'));
}
}
// Check if a validation email has been sent, if not send one
......
Supports Markdown
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