|
From: Benjamin C. <bc...@us...> - 2001-08-25 18:39:13
|
Update of /cvsroot/phpbt/phpbt
In directory usw-pr-cvs1:/tmp/cvs-serv13494
Modified Files:
bug.php newaccount.php query.php report.php user.php
Log Message:
Moving towards the new user schema -- still work to do on the email -> login conversion
Index: bug.php
===================================================================
RCS file: /cvsroot/phpbt/phpbt/bug.php,v
retrieving revision 1.29
retrieving revision 1.30
diff -u -r1.29 -r1.30
--- bug.php 2001/08/23 02:03:16 1.29
+++ bug.php 2001/08/25 18:39:11 1.30
@@ -34,7 +34,7 @@
return;
}
- $q->query("select bh.*, email from bug_history bh left join user on created_by = user_id where bug_id = $bugid");
+ $q->query("select bh.*, email from bug_history bh left join auth_user on created_by = user_id where bug_id = $bugid");
if (!$q->num_rows()) {
show_text($STRING['nobughistory']);
return;
@@ -97,14 +97,14 @@
}
// Reporter never changes;
- $reporter = $q->grab_field("select email from user where user_id = {$buginfo['created_by']}");
+ $reporter = $q->grab_field("select email from auth_user where user_id = {$buginfo['created_by']}");
$reporterstat = ' ';
- $assignedto = $q->grab_field("select email from user where user_id = ". ($cf['assigned_to'] ? $cf['assigned_to'] : $buginfo['assigned_to']));
+ $assignedto = $q->grab_field("select email from auth_user where user_id = ". ($cf['assigned_to'] ? $cf['assigned_to'] : $buginfo['assigned_to']));
$assignedtostat = $cf['assigned_to'] ? '!' : ' ';
// If there are new comments grab the comments immediately before the latest
if ($comments) {
- $q->query("select u.email, c.comment_text, c.created_date from comment c, user u where bug_id = {$buginfo['bug_id']} and c.created_by = u.user_id order by created_date desc limit 2");
+ $q->query("select u.email, c.comment_text, c.created_date from comment c, auth_user u where bug_id = {$buginfo['bug_id']} and c.created_by = u.user_id order by created_date desc limit 2");
$row = $q->grab();
$t->set_var(array(
'newpostedby' => $row['email'],
@@ -115,7 +115,7 @@
// If this comment is the first additional comment after the creation of the
// bug then we need to grab the bug's description as the previous comment
if ($q->num_rows() < 2) {
- list($by, $on, $comments) = $q->grab("select u.email, b.created_date, b.description from bug b, user u where b.created_by = u.user_id and bug_id = {$buginfo['bug_id']}");
+ list($by, $on, $comments) = $q->grab("select u.email, b.created_date, b.description from bug b, auth_user u where b.created_by = u.user_id and bug_id = {$buginfo['bug_id']}");
$t->set_var(array(
'oldpostedby' => $by,
'oldpostedon' => date(TIMEFORMAT,$on).' on '.date(DATEFORMAT,$on),
@@ -187,7 +187,7 @@
}
if ($outcome == 'reassign' and
- (!$assignedto = $q->grab_field("select user_id from user where email = '$reassignto'"))) {
+ (!$assignedto = $q->grab_field("select user_id from auth_user where email = '$reassignto'"))) {
show_bug($bugid,array('status' => $STRING['nouser']));
return;
}
@@ -201,7 +201,7 @@
case 'unchanged' : break;
case 'assign' : $assignedto = $u; $statusfield = 'Assigned'; break;
case 'reassign' :
- if (!$assignedto = $q->grab_field("select user_id from user where email = '$reassignto'")) {
+ if (!$assignedto = $q->grab_field("select user_id from auth_user where email = '$reassignto'")) {
show_bug($bugid,array('status' => $STRING['nouser']));
return;
} else {
@@ -345,7 +345,7 @@
function show_bug($bugid = 0, $error = '') {
global $q, $me, $t, $project, $STRING, $u, $perm;
- if (!ereg('^[0-9]+$',$bugid) or !$row = $q->grab("select b.*, reporter.email as reporter, owner.email as owner, status_name, resolution_name from bug b left join resolution r using(resolution_id), severity sv, status st left join user owner on b.assigned_to = owner.user_id left join user reporter on b.created_by = reporter.user_id where bug_id = '$bugid' and b.severity_id = sv.severity_id and b.status_id = st.status_id")) {
+ if (!ereg('^[0-9]+$',$bugid) or !$row = $q->grab("select b.*, reporter.email as reporter, owner.email as owner, status_name, resolution_name from bug b left join resolution r using(resolution_id), severity sv, status st left join auth_user owner on b.assigned_to = owner.user_id left join auth_user reporter on b.created_by = reporter.user_id where bug_id = '$bugid' and b.severity_id = sv.severity_id and b.status_id = st.status_id")) {
show_text($STRING['bugbadnum'],true);
return;
}
@@ -444,7 +444,7 @@
}
}
- $q->query("select comment_text, comment.created_date, email from comment, user where bug_id = $bugid and comment.created_by = user_id order by comment.created_date");
+ $q->query("select comment_text, comment.created_date, email from comment, auth_user where bug_id = $bugid and comment.created_by = user_id order by comment.created_date");
if (!$q->num_rows()) {
$t->set_var('rows','');
} else {
Index: newaccount.php
===================================================================
RCS file: /cvsroot/phpbt/phpbt/newaccount.php,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -r1.11 -r1.12
--- newaccount.php 2001/08/18 03:13:17 1.11
+++ newaccount.php 2001/08/25 18:39:11 1.12
@@ -28,7 +28,7 @@
if (!$email or !valid_email($email))
$error = $STRING['giveemail'];
- elseif ($q->grab_field("select user_id from user where email = '$email'"))
+ elseif ($q->grab_field("select user_id from auth_user where email = '$email'"))
$error = $STRING['loginused'];
if ($error) {
show_form($error);
@@ -42,7 +42,7 @@
} else {
$mpassword = $password;
}
- $q->query("insert into user (user_id, first_name, last_name, email, password, user_level, created_date, last_modified_date) values (".$q->nextid('user').", '$firstname', '$lastname', '$email', '$mpassword', 1, $now, $now)");
+ $q->query("insert into auth_user (user_id, first_name, last_name, email, password, user_level, created_date, last_modified_date) values (".$q->nextid('user').", '$firstname', '$lastname', '$email', '$mpassword', 1, $now, $now)");
mail($email, $STRING['newacctsubject'], sprintf($STRING['newacctmessage'],
$password), 'From: '.ADMINEMAIL);
$t->set_file('content','newaccountsuccess.html');
Index: query.php
===================================================================
RCS file: /cvsroot/phpbt/phpbt/query.php,v
retrieving revision 1.23
retrieving revision 1.24
diff -u -r1.23 -r1.24
--- query.php 2001/08/23 12:53:49 1.23
+++ query.php 2001/08/25 18:39:11 1.24
@@ -172,7 +172,7 @@
}
if (!$order) { $order = 'bug_id'; $sort = 'asc'; }
if (!$querystring or $op) build_query($assignedto, $reportedby, $open);
- $nr = $q->grab_field("select count(*) from bug left join user owner on bug.assigned_to = owner.user_id left join user reporter on bug.created_by = reporter.user_id ".($querystring != '' ? "where $querystring": ''));
+ $nr = $q->grab_field("select count(*) from bug left join auth_user owner on bug.assigned_to = owner.user_id left join auth_user reporter on bug.created_by = reporter.user_id ".($querystring != '' ? "where $querystring": ''));
list($selrange, $llimit, $npages, $pages) = multipages($nr,$page,
"order=$order&sort=$sort");
@@ -185,7 +185,7 @@
'project' => build_select('project'),
'TITLE' => $TITLE['buglist']));
- $q->query("select bug.*, reporter.email as reporter, owner.email as owner, lastmodifier.email as lastmodifier, project_name, severity_name, status_name, os_name, version_name, component_name, resolution_name, severity_color from bug left join resolution using (resolution_id), severity, status, os, version, component, project left join user owner on bug.assigned_to = owner.user_id left join user reporter on bug.created_by = reporter.user_id left join user lastmodifier on bug.last_modified_by = lastmodifier.user_id where bug.severity_id = severity.severity_id and bug.status_id = status.status_id and bug.os_id = os.os_id and bug.version_id = version.version_id and bug.component_id = component.component_id and bug.project_id = project.project_id ". ($querystring != '' ? "and $querystring " : ''). "order by $order $sort limit $llimit, $selrange");
+ $q->query("select bug.*, reporter.email as reporter, owner.email as owner, lastmodifier.email as lastmodifier, project_name, severity_name, status_name, os_name, version_name, component_name, resolution_name, severity_color from bug left join resolution using (resolution_id), severity, status, os, version, component, project left join auth_user owner on bug.assigned_to = owner.user_id left join auth_user reporter on bug.created_by = reporter.user_id left join auth_user lastmodifier on bug.last_modified_by = lastmodifier.user_id where bug.severity_id = severity.severity_id and bug.status_id = status.status_id and bug.os_id = os.os_id and bug.version_id = version.version_id and bug.component_id = component.component_id and bug.project_id = project.project_id ". ($querystring != '' ? "and $querystring " : ''). "order by $order $sort limit $llimit, $selrange");
$headers = array(
'bug_id' => 'bug_id',
Index: report.php
===================================================================
RCS file: /cvsroot/phpbt/phpbt/report.php,v
retrieving revision 1.13
retrieving revision 1.14
diff -u -r1.13 -r1.14
--- report.php 2001/08/17 02:56:22 1.13
+++ report.php 2001/08/25 18:39:11 1.14
@@ -47,7 +47,7 @@
$projectquery = '';
}
- $q->query("$querystring, count(bug_id) as 'Total' from bug b left join user u on assigned_to = user_id $projectquery group by assigned_to");
+ $q->query("$querystring, count(bug_id) as 'Total' from bug b left join auth_user u on assigned_to = user_id $projectquery group by assigned_to");
if (!$q->num_rows()) {
$t->set_var('rows', 'No data to display');
} else {
Index: user.php
===================================================================
RCS file: /cvsroot/phpbt/phpbt/user.php,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -r1.12 -r1.13
--- user.php 2001/08/21 16:43:23 1.12
+++ user.php 2001/08/25 18:39:11 1.13
@@ -28,7 +28,7 @@
$auth->auth['db_fields'] = $column_list;
$column_list = serialize($column_list);
- $q->query("update user set bug_list_fields = '$column_list' where user_id = $u");
+ $q->query("update auth_user set bug_list_fields = '$column_list' where user_id = $u");
//$t->set_file('content', 'columnlistchanged.html');
show_text('Your bug list column preferences have been saved');
}
@@ -50,7 +50,7 @@
$mpassword = $pass1;
}
- $q->query("update user set password = '$mpassword' where user_id = $u");
+ $q->query("update auth_user set password = '$mpassword' where user_id = $u");
$t->set_file('content', 'passwordchanged.html');
}
|