]> src.bluestatic.org Git - bugdar.git/blob - docs/update_bug_names.php
Fix an issue where after creating a Bugdar user in _fetchBugdarUserFromAuthUser(...
[bugdar.git] / docs / update_bug_names.php
1 <?php
2
3 // SVN $Id$
4
5 chdir('./../');
6 require_once('./global.php');
7
8 $userlist = array();
9 $users = $db->query("SELECT userid, displayname FROM " . TABLE_PREFIX . "user");
10 foreach ($users as $user)
11 {
12 $userlist["$user[userid]"] = $user['displayname'];
13 }
14
15 $bugs = $db->query("SELECT * FROM " . TABLE_PREFIX . "bug");
16 foreach ($bugs as $bug)
17 {
18 $db->query("
19 UPDATE " . TABLE_PREFIX . "bug
20 SET username = '" . $db->escape_string($userlist["$bug[userid]"]) . "',
21 lastpostbyname = '" . $db->escape_string($userlist["$bug[lastpostby]"]) . "',
22 hiddenlastpostbyname = '" . $db->escape_string($userlist["$bug[hiddenlastpostby]"]) . "'
23 WHERE bugid = $bug[bugid]
24 ");
25 }
26
27 ?>