old Issue 51: Commits not following my account after email change, and email change back

master
Nathan Adams 2015-08-30 18:38:42 -05:00
parent 0601e7e447
commit 5c61ef6d52
1 changed files with 10 additions and 0 deletions

View File

@ -265,6 +265,16 @@ class IDF_Views_User
$mailaddress->address = $email; $mailaddress->address = $email;
$mailaddress->create(); $mailaddress->create();
} }
$sql = new Pluf_SQL('origauthor LIKE %s AND author is NULL', array("%" . $email . "%"));
$test = $sql->gen();
$commits = Pluf::factory("IDF_Commit")->getList(["filter" => $sql->gen()]);
foreach($commits as $commit) {
$commit->author = $request->user;
$commit->update();
}
$request->user->setMessage(sprintf(__('Your new email address "%s" has been validated. Thank you!'), Pluf_esc($email))); $request->user->setMessage(sprintf(__('Your new email address "%s" has been validated. Thank you!'), Pluf_esc($email)));
$url = Pluf_HTTP_URL_urlForView('IDF_Views_User::myAccount'); $url = Pluf_HTTP_URL_urlForView('IDF_Views_User::myAccount');
return new Pluf_HTTP_Response_Redirect($url); return new Pluf_HTTP_Response_Redirect($url);