You can subscribe to this list here.
| 2001 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
(34) |
Aug
(215) |
Sep
(180) |
Oct
(135) |
Nov
(105) |
Dec
(81) |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 2002 |
Jan
(76) |
Feb
(22) |
Mar
(154) |
Apr
(149) |
May
(128) |
Jun
(94) |
Jul
(14) |
Aug
(24) |
Sep
(77) |
Oct
(52) |
Nov
(22) |
Dec
(6) |
| 2003 |
Jan
(4) |
Feb
(10) |
Mar
(6) |
Apr
(29) |
May
(10) |
Jun
(37) |
Jul
(39) |
Aug
(13) |
Sep
(23) |
Oct
(3) |
Nov
(7) |
Dec
(2) |
| 2004 |
Jan
|
Feb
(10) |
Mar
(4) |
Apr
|
May
(35) |
Jun
(4) |
Jul
(17) |
Aug
(6) |
Sep
(14) |
Oct
(18) |
Nov
(2) |
Dec
(14) |
| 2005 |
Jan
(9) |
Feb
(30) |
Mar
(6) |
Apr
|
May
(38) |
Jun
(23) |
Jul
(21) |
Aug
(76) |
Sep
(50) |
Oct
(51) |
Nov
(13) |
Dec
|
|
From: Benjamin C. <bc...@us...> - 2001-08-13 13:34:54
|
Update of /cvsroot/phpbt/phpbt/admin/templates/default
In directory usw-pr-cvs1:/tmp/cvs-serv6680/admin/templates/default
Modified Files:
wrap.html
Log Message:
Added counts of and links to bugs reported by and assigned to user to the bottom nav
Index: wrap.html
===================================================================
RCS file: /cvsroot/phpbt/phpbt/admin/templates/default/wrap.html,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- wrap.html 2001/08/08 04:27:33 1.5
+++ wrap.html 2001/08/13 13:34:49 1.6
@@ -55,7 +55,9 @@
<!-- BEGIN logoutblock -->
<td>
<font class="navfont"><b>
- [ <a href="user.php">Personal Page</a>
+ [ Bugs assigned to me: <a href="../query.php?op=mybugs&assignedto=1&open=1" title="Open">{owner_open}</a> / <a href="query.php?op=mybugs&assignedto=1&open=0" title="Closed">{owner_closed}</a>
+ | Bugs reported by me: <a href="../query.php?op=mybugs&reportedby=1&open=1" title="Open">{reporter_open}</a> / <a href="query.php?op=mybugs&reportedby=1&open=0" title="Closed">{reporter_closed}</a>
+ | <a href="../user.php">Personal Page</a>
| <a href="../logout.php">Logout {loggedinas}</a>
]
</b></font>
|
|
From: Benjamin C. <bc...@us...> - 2001-08-13 13:34:54
|
Update of /cvsroot/phpbt/phpbt
In directory usw-pr-cvs1:/tmp/cvs-serv6680
Modified Files:
TODO global.css include.php query.php
Log Message:
Added counts of and links to bugs reported by and assigned to user to the bottom nav
Index: TODO
===================================================================
RCS file: /cvsroot/phpbt/phpbt/TODO,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- TODO 2001/08/11 17:31:23 1.5
+++ TODO 2001/08/13 13:34:49 1.6
@@ -1,9 +1,6 @@
Bugs:
- Create bugs via email
-Bottom Nav:
-- Counts of and links to bugs reported by and assigned to user
-
Personal Page:
- Choose columns to display in bug list
Index: global.css
===================================================================
RCS file: /cvsroot/phpbt/phpbt/global.css,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- global.css 2001/08/10 13:51:06 1.4
+++ global.css 2001/08/13 13:34:49 1.5
@@ -36,6 +36,10 @@
font-family: "Arial","Helvetica","MS Sans Serif","Sans-Serif";
}
+input[type="reset"] {
+ font-family: "Arial","Helvetica","MS Sans Serif","Sans-Serif";
+ }
+
textarea {
font-size: 12px;
}
Index: include.php
===================================================================
RCS file: /cvsroot/phpbt/phpbt/include.php,v
retrieving revision 1.27
retrieving revision 1.28
diff -u -r1.27 -r1.28
--- include.php 2001/08/11 17:09:24 1.27
+++ include.php 2001/08/13 13:34:49 1.28
@@ -157,15 +157,24 @@
class templateclass extends Template {
function pparse($target, $handle, $append = false) {
- global $auth, $perm;
+ global $auth, $perm, $q;
+ $u = $auth->auth['uid'];
$this->set_block('wrap', 'logoutblock', 'loblock');
$this->set_block('wrap', 'loginblock', 'liblock');
$this->set_block('wrap', 'adminnavblock', 'anblock');
- if ($auth->auth['uid'] && $auth->auth['uid'] != 'nobody') {
+ if ($u && $u != 'nobody') {
+ list($owner_open, $owner_closed) =
+ $q->grab("select sum(if(s.Name in ('Unconfirmed','New','Assigned','Reopened'),1,0)) as Open, sum(if(s.Name not in ('Unconfirmed','New','Assigned','Reopened'),1,0)) as Closed from Bug b left join Status s on Status = StatusID where AssignedTo = $u");
+ list($reporter_open, $reporter_closed) =
+ $q->grab("select sum(if(s.Name in ('Unconfirmed','New','Assigned','Reopened'),1,0)) as Open, sum(if(s.Name not in ('Unconfirmed','New','Assigned','Reopened'),1,0)) as Closed from Bug b left join Status s on Status = StatusID where CreatedBy = $u");
$this->set_var(array(
'loggedinas' => $auth->auth['email'],
- 'liblock' => ''
+ 'liblock' => '',
+ 'owner_open' => $owner_open,
+ 'owner_closed' => $owner_closed,
+ 'reporter_open' => $reporter_open,
+ 'reporter_closed' => $reporter_closed
));
$this->parse('loblock', 'logoutblock', true);
} else {
Index: query.php
===================================================================
RCS file: /cvsroot/phpbt/phpbt/query.php,v
retrieving revision 1.13
retrieving revision 1.14
diff -u -r1.13 -r1.14
--- query.php 2001/08/09 22:17:02 1.13
+++ query.php 2001/08/13 13:34:49 1.14
@@ -94,17 +94,21 @@
}
-function build_query($showmybugs = false) {
+function build_query($assignedto, $reportedby, $open) {
global $q, $sess, $auth, $querystring, $status, $resolution, $os, $priority,
$severity, $email1, $emailtype1, $emailfield1, $Title, $Description, $URL,
$Title_type, $Description_type, $URL_type, $projects, $versions, $components;
// Open bugs assigned to the user -- a hit list
- if ($showmybugs) {
- $q->query("select StatusID from Status where Name in ('Unconfirmed', 'New', 'Assigned', 'Reopened')");
+ if ($assignedto || $reportedby) {
+ $q->query("select StatusID from Status where Name ".($open ? '' : 'not ')."in ('Unconfirmed', 'New', 'Assigned', 'Reopened')");
while ($statusid = $q->grab_field()) $status[] = $statusid;
$query[] = 'Status in ('.delimit_list(',',$status).')';
- $query[] = "AssignedTo = {$auth->auth['uid']}";
+ if ($assignedto) {
+ $query[] = "AssignedTo = {$auth->auth['uid']}";
+ } else {
+ $query[] = "Bug.CreatedBy = {$auth->auth['uid']}";
+ }
} else {
// Select boxes
if ($status) $flags[] = 'Status in ('.delimit_list(',',$status).')';
@@ -152,7 +156,7 @@
if (!$sess->is_registered('querystring')) $sess->register('querystring');
}
-function list_items($showmybugs = false) {
+function list_items($assignedto = 0, $reportedby = 0, $open = 0) {
global $querystring, $me, $q, $t, $selrange, $order, $sort, $query,
$page, $op, $select, $TITLE, $STRING, $savedqueryname, $u;
@@ -165,7 +169,7 @@
$q->query("insert into SavedQuery (UserID, SavedQueryName, SavedQueryString) values ($u, '$savedqueryname', '$savedquerystring')");
}
if (!$order) { $order = 'BugID'; $sort = 'asc'; }
- if (!$querystring or $op) build_query($showmybugs);
+ if (!$querystring or $op) build_query($assignedto, $reportedby, $open);
$nr = $q->grab_field("select count(*) from Bug left join User Owner on Bug.AssignedTo = Owner.UserID left join User Reporter on Bug.CreatedBy = Reporter.UserID ".($querystring != '' ? "where $querystring": ''));
list($selrange, $llimit, $npages, $pages) = multipages($nr,$page,
@@ -234,10 +238,10 @@
case 'query' : show_query(); break;
case 'doquery' : list_items(); break;
case 'delquery' : delete_saved_query($queryid); break;
- case 'mybugs' : list_items(true); break;
+ case 'mybugs' : list_items($assignedto, $reportedby, $open); break;
default : show_query(); break;
}
-else list_items();
+else list_items($assignedto, $reportedby, $open);
$t->pparse('main',array('content','wrap','main'));
|
|
From: Benjamin C. <bc...@us...> - 2001-08-13 13:34:53
|
Update of /cvsroot/phpbt/phpbt/templates/default
In directory usw-pr-cvs1:/tmp/cvs-serv6680/templates/default
Modified Files:
queryform.html wrap.html
Log Message:
Added counts of and links to bugs reported by and assigned to user to the bottom nav
Index: queryform.html
===================================================================
RCS file: /cvsroot/phpbt/phpbt/templates/default/queryform.html,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- queryform.html 2001/08/08 04:01:46 1.3
+++ queryform.html 2001/08/13 13:34:49 1.4
@@ -216,8 +216,6 @@
<hr align="left" size="1" width="640">
<b>Saved Queries</b>
<br>
- <a href="{me}?op=mybugs">List bugs assigned to me</a>
- <br>
<!-- BEGIN row -->
<a href="{me}?{savedquerystring}">{savedqueryname}</a> (<a href="{me}?op=delquery&queryid={savedqueryid}" onClick="return confirm('Are you sure you want to delete this saved query?');">Delete</a>)<br>
<!-- END row -->
Index: wrap.html
===================================================================
RCS file: /cvsroot/phpbt/phpbt/templates/default/wrap.html,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- wrap.html 2001/08/08 04:27:33 1.5
+++ wrap.html 2001/08/13 13:34:49 1.6
@@ -56,8 +56,10 @@
<!-- END loginblock -->
<!-- BEGIN logoutblock -->
<td>
- <font class="navfont"><b>
- [ <a href="user.php">Personal Page</a>
+ <font class="navfont"> <b>
+ [ Bugs assigned to me: <a href="query.php?op=mybugs&assignedto=1&open=1" title="Open">{owner_open}</a> / <a href="query.php?op=mybugs&assignedto=1&open=0" title="Closed">{owner_closed}</a>
+ | Bugs reported by me: <a href="query.php?op=mybugs&reportedby=1&open=1" title="Open">{reporter_open}</a> / <a href="query.php?op=mybugs&reportedby=1&open=0" title="Closed">{reporter_closed}</a>
+ | <a href="user.php">Personal Page</a>
| <a href="logout.php">Logout {loggedinas}</a>
]
</b></font>
|
|
From: Benjamin C. <bc...@us...> - 2001-08-13 12:33:14
|
Update of /cvsroot/phpbt/phpbt
In directory usw-pr-cvs1:/tmp/cvs-serv21229
Modified Files:
configure
Log Message:
Not all dialog versions support the --menuitem option
Index: configure
===================================================================
RCS file: /cvsroot/phpbt/phpbt/configure,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- configure 2001/08/11 02:35:22 1.4
+++ configure 2001/08/13 12:33:11 1.5
@@ -3,8 +3,6 @@
tempfile=`tempfile 2>/dev/null` || tempfile=/tmp/test$$
trap "rm -f $tempfile" 0 1 2 5 15
-menuitem='Administrivia'
-
# Strings
ADMINEMAIL=phpbt@`hostname -d`
INSTALLPATH=`pwd`
@@ -71,7 +69,6 @@
fi
PHPLIBPATH=`<$tempfile`
- menuitem='Features'
}
change_features() {
@@ -145,13 +142,11 @@
fi
fi
- menuitem='Save'
}
show_menu() {
$DIALOG --clear --backtitle "phpBT Configuration" \
--title "Configuration Menu" \
- --default-item $menuitem \
--menu "Choose from the options below to configure your phpBugTracker installation." 15 68 4 \
"Administrivia" "Parameters that must be configured" \
"Features" "Optional features" \
|
|
From: Benjamin C. <bc...@us...> - 2001-08-12 23:04:54
|
Update of /cvsroot/phpbt/phpbt
In directory usw-pr-cvs1:/tmp/cvs-serv30322
Modified Files:
report.php
Log Message:
Added email hiding/masking
Index: report.php
===================================================================
RCS file: /cvsroot/phpbt/phpbt/report.php,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -r1.10 -r1.11
--- report.php 2001/08/09 12:54:47 1.10
+++ report.php 2001/08/12 23:04:51 1.11
@@ -62,8 +62,7 @@
if ($row[$col] == '') {
$coldata = 'Unassigned';
} elseif ($col == 'Assigned To') {
- $coldata = sprintf("<a href='mailto:%s'>%s</a>",
- stripslashes($row[$col]), stripslashes($row[$col]));
+ $coldata = maskemail($row[$col]);
} else {
$coldata = stripslashes($row[$col]);
}
|
|
From: Benjamin C. <bc...@us...> - 2001-08-11 17:31:27
|
Update of /cvsroot/phpbt/phpbt In directory usw-pr-cvs1:/tmp/cvs-serv1179 Modified Files: CHANGELOG TODO Log Message: Updated for v0.2.0 Index: CHANGELOG =================================================================== RCS file: /cvsroot/phpbt/phpbt/CHANGELOG,v retrieving revision 1.9 retrieving revision 1.10 diff -u -r1.9 -r1.10 --- CHANGELOG 2001/08/09 22:51:21 1.9 +++ CHANGELOG 2001/08/11 17:31:23 1.10 @@ -1,9 +1,10 @@ --- 0.2.0 -- -: Allow for browsing the bugs without logging in -: Started reporting -: Started using jpgraph (optional) for showing summary charts -: Added options for hiding and masking email addresses to avoid spambots +-- 0.2.0 -- 11 Aug 2001 +: Allow for browsing the bugs without logging in. +: Started reporting. +: Started using jpgraph (optional) for showing summary charts. +: Added options for hiding and masking email addresses to avoid spambots. : Added a dialog-based configure script. +: Added file attachments to bugs. -- 0.1.7 -- 31 July 2001 : Fixed bugs with valid_email() in admin/user.php Index: TODO =================================================================== RCS file: /cvsroot/phpbt/phpbt/TODO,v retrieving revision 1.4 retrieving revision 1.5 diff -u -r1.4 -r1.5 --- TODO 2001/08/10 15:54:54 1.4 +++ TODO 2001/08/11 17:31:23 1.5 @@ -1,5 +1,4 @@ Bugs: -- File attachments for bugs - Create bugs via email Bottom Nav: |
|
From: Benjamin C. <bc...@us...> - 2001-08-11 17:28:47
|
Update of /cvsroot/phpbt/phpbt
In directory usw-pr-cvs1:/tmp/cvs-serv684
Modified Files:
bug.php
Log Message:
heh, you were sure, weren't you?
Index: bug.php
===================================================================
RCS file: /cvsroot/phpbt/phpbt/bug.php,v
retrieving revision 1.25
retrieving revision 1.26
diff -u -r1.25 -r1.26
--- bug.php 2001/08/11 17:27:22 1.25
+++ bug.php 2001/08/11 17:28:43 1.26
@@ -418,7 +418,7 @@
if (is_readable(INSTALLPATH.'/'.ATTACHMENT_PATH."/{$row['Project']}/$bugid-{$att['FileName']}")) {
$action = "<a href='attachment.php?attachid={$att['AttachmentID']}'>View</a>";
if ($perm->have_perm('Administrator')) {
- $action .= " | <a href='attachment.php?del={$att['AttachmentID']}' onClick=\"return alert('Are you sure you want to delete this attachment?');\">Delete</a>";
+ $action .= " | <a href='attachment.php?del={$att['AttachmentID']}' onClick=\"return confirm('Are you sure you want to delete this attachment?');\">Delete</a>";
}
if ($att['FileSize'] > 1024) {
$attsize = number_format((round($att['FileSize']) / 1024 * 100) / 100).'k';
|
|
From: Benjamin C. <bc...@us...> - 2001-08-11 17:27:25
|
Update of /cvsroot/phpbt/phpbt
In directory usw-pr-cvs1:/tmp/cvs-serv477
Modified Files:
bug.php
Log Message:
Are you sure?
Index: bug.php
===================================================================
RCS file: /cvsroot/phpbt/phpbt/bug.php,v
retrieving revision 1.24
retrieving revision 1.25
diff -u -r1.24 -r1.25
--- bug.php 2001/08/11 17:24:30 1.24
+++ bug.php 2001/08/11 17:27:22 1.25
@@ -418,7 +418,7 @@
if (is_readable(INSTALLPATH.'/'.ATTACHMENT_PATH."/{$row['Project']}/$bugid-{$att['FileName']}")) {
$action = "<a href='attachment.php?attachid={$att['AttachmentID']}'>View</a>";
if ($perm->have_perm('Administrator')) {
- $action .= " | <a href='attachment.php?del={$att['AttachmentID']}'>Delete</a>";
+ $action .= " | <a href='attachment.php?del={$att['AttachmentID']}' onClick=\"return alert('Are you sure you want to delete this attachment?');\">Delete</a>";
}
if ($att['FileSize'] > 1024) {
$attsize = number_format((round($att['FileSize']) / 1024 * 100) / 100).'k';
|
|
From: Benjamin C. <bc...@us...> - 2001-08-11 17:24:34
|
Update of /cvsroot/phpbt/phpbt
In directory usw-pr-cvs1:/tmp/cvs-serv32484
Modified Files:
bug.php attachment.php
Log Message:
Slight tweaks
Index: bug.php
===================================================================
RCS file: /cvsroot/phpbt/phpbt/bug.php,v
retrieving revision 1.23
retrieving revision 1.24
diff -u -r1.23 -r1.24
--- bug.php 2001/08/11 17:09:24 1.23
+++ bug.php 2001/08/11 17:24:30 1.24
@@ -420,12 +420,17 @@
if ($perm->have_perm('Administrator')) {
$action .= " | <a href='attachment.php?del={$att['AttachmentID']}'>Delete</a>";
}
+ if ($att['FileSize'] > 1024) {
+ $attsize = number_format((round($att['FileSize']) / 1024 * 100) / 100).'k';
+ } else {
+ $attsize = number_format($att['FileSize']).'b';
+ }
$t->set_var(array(
'bgcolor' => (++$j % 2 == 0) ? '#dddddd' : '#ffffff',
'attid' => $att['AttachmentID'],
'attname' => stripslashes($att['FileName']),
'attdesc' => stripslashes($att['Description']),
- 'attsize' => number_format($att['FileSize']).'k',
+ 'attsize' => $attsize,
'atttype' => $att['MimeType'],
'attdate' => date(DATEFORMAT, $att['CreatedDate']),
'attaction' => $action
Index: attachment.php
===================================================================
RCS file: /cvsroot/phpbt/phpbt/attachment.php,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- attachment.php 2001/08/11 17:09:24 1.3
+++ attachment.php 2001/08/11 17:24:31 1.4
@@ -155,6 +155,7 @@
if (list($filename, $mimetype) = grab_attachment($_gv['attachid'])) {
header("Content-type: $mimetype");
@readfile($filename);
+ exit;
}
} else {
$perm->check('User');
|
|
From: Benjamin C. <bc...@us...> - 2001-08-11 17:09:27
|
Update of /cvsroot/phpbt/phpbt/templates/default
In directory usw-pr-cvs1:/tmp/cvs-serv30042/templates/default
Modified Files:
bugdisplay.html
Added Files:
bugattachmentform.html bugattachmentsuccess.html
Log Message:
Attachments should be working now
--- NEW FILE: bugattachmentform.html ---
<form enctype="multipart/form-data" action="{me}" method="post">
<input type="hidden" name="bugid" value="{bugid}">
<input type="hidden" name="projectid" value="{projectid}">
<table border="0" width="640">
<tr>
<td colspan="2">
Please choose a file to upload and enter a one-line description.
Maximum file size: {max_size} bytes
</td>
</tr>
<tr>
<td colspan="2" align="center">
<font color="#ff0000">{error}</font>
</td>
</tr>
<tr>
<td>
File:
</td>
<td>
<input type="file" name="attachment">
</td>
</tr>
<tr>
<td>
Description:
</td>
<td>
<input type="text" name="description" maxlength="255" value="{description}">
</td>
</tr>
<tr>
<td colspan="2">
<input type="submit" value="Upload attachment">
</td>
</tr>
</table>
</form>
--- NEW FILE: bugattachmentsuccess.html ---
<table width="640">
<tr>
<td align="center">
The attachment has been created for <a href="bug.php?op=show&bugid={bugid}">bug #{bugid}</a>.
<br>
<br>
</td>
</tr>
</table>
Index: bugdisplay.html
===================================================================
RCS file: /cvsroot/phpbt/phpbt/templates/default/bugdisplay.html,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- bugdisplay.html 2001/08/09 22:17:02 1.3
+++ bugdisplay.html 2001/08/11 17:09:24 1.4
@@ -65,7 +65,9 @@
<tr>
<td>Assigned To:</td>
<td><b>{owner}</td>
- <td colspan="2"> </td>
+ <td colspan="2">
+ <a href="attachment.php?bugid={bugid}">Create attachment</a>
+ </td>
</tr>
<tr>
<td>Status:</td>
@@ -129,6 +131,47 @@
<div align="right">
{submit}
</div>
+ </td>
+ </tr>
+</table>
+<table border="0" cellpadding="2" cellspacing="0" width="640">
+ <tr>
+ <td>
+ Attachments:
+ <table border="0" cellpadding="0">
+ <tr><td colspan="4" height="2" bgcolor="#ffffff"><spacer type="block" height="2" width="2"></td></tr>
+ <tr>
+ <td width="250" bgcolor="#cccccc" align="center"><b>Name</b></td>
+ <td width="60" bgcolor="#cccccc" align="center"><b>Size</b></a></td>
+ <td width="150" bgcolor="#cccccc" align="center"><b>Type</b></a></td>
+ <td width="80" bgcolor="#cccccc" align="center"><b>Created</b></a></td>
+ <td width="80" bgcolor="#cccccc" align="center"> </a></td>
+ </tr>
+ <tr>
+ <td bgcolor="#000000" height="1"><spacer type="block" height="1" width="1"></td>
+ <td bgcolor="#000000" height="1"><spacer type="block" height="1" width="1"></td>
+ <td bgcolor="#000000" height="1"><spacer type="block" height="1" width="1"></td>
+ <td bgcolor="#000000" height="1"><spacer type="block" height="1" width="1"></td>
+ <td bgcolor="#000000" height="1"><spacer type="block" height="1" width="1"></td>
+ </tr>
+ <!-- BEGIN attrow -->
+ <tr title="{attdesc}">
+ <td bgcolor="{bgcolor}">{attname}</td>
+ <td bgcolor="{bgcolor}" align="right">{attsize}</td>
+ <td bgcolor="{bgcolor}" align="center">{atttype}</td>
+ <td bgcolor="{bgcolor}" align="center">{attdate}</td>
+ <td bgcolor="{bgcolor}" align="center">{attaction}</td>
+ </tr>
+ <!-- END attrow -->
+ <tr>
+ <td bgcolor="#000000" height="1"><spacer type="block" height="1" width="1"></td>
+ <td bgcolor="#000000" height="1"><spacer type="block" height="1" width="1"></td>
+ <td bgcolor="#000000" height="1"><spacer type="block" height="1" width="1"></td>
+ <td bgcolor="#000000" height="1"><spacer type="block" height="1" width="1"></td>
+ <td bgcolor="#000000" height="1"><spacer type="block" height="1" width="1"></td>
+ </tr>
+ <tr><td colspan="4" height="2" bgcolor="#ffffff"><spacer type="block" height="2" width="2"></td></tr>
+ </table>
</td>
</tr>
</table>
|
|
From: Benjamin C. <bc...@us...> - 2001-08-11 17:09:27
|
Update of /cvsroot/phpbt/phpbt
In directory usw-pr-cvs1:/tmp/cvs-serv30042
Modified Files:
attachment.php bug.php include.php strings-en.php
Log Message:
Attachments should be working now
Index: attachment.php
===================================================================
RCS file: /cvsroot/phpbt/phpbt/attachment.php,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- attachment.php 2001/08/10 23:21:13 1.2
+++ attachment.php 2001/08/11 17:09:24 1.3
@@ -23,30 +23,39 @@
include 'include.php';
-function show_attachment($attachid) {
+function del_attachment($attachid) {
global $q;
+ if (list($filename, $mimetype) = grab_attachment($attachid)) {
+ $q->query("delete from Attachment where AttachmentID = $attachid");
+ unlink($filename);
+ header("Location: bug.php?op=show&bugid=$attachid");
+ }
+}
+
+function grab_attachment($attachid) {
+ global $q, $STRING;
+
if (!is_numeric($attachid)) {
show_text($STRING['bad_attachment'], true);
- return;
+ return false;
}
$ainfo = $q->grab("select a.BugID, FileName, MimeType, Project from Attachment a, Bug b where AttachmentID = $attachid and a.BugID = b.BugID");
if ($q->num_rows() != 1) {
show_text($STRING['bad_attachment'], true);
- return;
+ return false;
}
$filename = join('/',array(INSTALLPATH, ATTACHMENT_PATH,
$ainfo['Project'], "{$ainfo['BugID']}-{$ainfo['FileName']}"));
if (!is_readable($filename)) {
show_text($STRING['bad_attachment'], true);
- return;
+ return false;
}
- header("Content-type: {$ainfo['MimeType']}");
- @readfile($filename);
+ return array($filename, $ainfo['MimeType']);
}
-function add_attachment($projectid, $bugid, $description) {
- global $q, $HTTP_POST_FILES, $now, $u, $STRING;
+function add_attachment($bugid, $description) {
+ global $q, $HTTP_POST_FILES, $now, $u, $STRING, $t;
if (!isset($HTTP_POST_FILES['attachment']) ||
$HTTP_POST_FILES['attachment']['tmp_name'] == 'none') {
@@ -54,6 +63,28 @@
return;
}
+ // Check the upload size. If the size was greater than the max in
+ // php.ini, the file won't even be set and will fail at the check above
+ if ($HTTP_POST_FILES['attachment']['size'] > ATTACHMENT_MAX_SIZE) {
+ show_attachment_form($bugid, $STRING['attachment_too_large']);
+ return;
+ }
+
+ $projectid = $q->grab_field("select Project from Bug where BugID = $bugid");
+ if (!$projectid) {
+ show_text($STRING['nobug'], true);
+ return;
+ }
+
+ // Check for a previously-uploaded attachment with the same name, bug, and project
+ $q->query("select a.BugID, Project from Attachment a, Bug b where FileName = '{$HTTP_POST_FILES['attachment']['name']}' and a.BugID = b.BugID");
+ while ($ainfo = $q->grab()) {
+ if ($bugid == $ainfo['BugID'] && $projectid == $ainfo['Project']) {
+ show_attachment_form($bugid, $STRING['dupe_attachment']);
+ return;
+ }
+ }
+
$filepath = INSTALLPATH.'/'.ATTACHMENT_PATH;
$tmpfilename = $HTTP_POST_FILES['attachment']['tmp_name'];
$filename = "$bugid-{$HTTP_POST_FILES['attachment']['name']}";
@@ -85,27 +116,50 @@
}
function show_attachment_form($bugid, $error = '') {
- global $q, $t;
+ global $q, $t, $STRING;
$t->set_file('content', 'bugattachmentform.html');
- if (!is_numeric($bugid) || !$projectid = $q->grab_field("select Project from Bug where BugID = $bugid")) {
+ if (!is_numeric($bugid)) {
show_text($STRING['nobug'], true);
return;
}
+
+ $bugexists = $q->grab_field("select count(*) from Bug where BugID = $bugid");
+ if (!$bugexists) {
+ show_text($STRING['nobug'], true);
+ return;
+ }
+
$t->set_var(array(
'error' => $error,
'bugid' => $bugid,
- 'projectid' => $projectid
- 'description' => stripslashes($description),
+ 'projectid' => $projectid,
+ 'description' => htmlspecialchars(stripslashes($description)),
+ 'max_size' => ini_get('upload_max_filesize') < ATTACHMENT_MAX_SIZE
+ ? number_format(ini_get('upload_max_filesize'))
+ : number_format(ATTACHMENT_MAX_SIZE)
));
}
$t->set_file('wrap','wrap.html');
-
-if (isset($HTTP_POST_FILES)) add_attachment($_pv['projectid'], $_pv['bugid'],
- $_pv['description']);
-elseif (isset($_gv['attachid'])) show_attachment($_gv['attachid']);
-else function show_attachment_form($_gv['bugid']);
+if (isset($_gv['del'])) {
+ if (!$perm->have_perm('Administrator')) {
+ show_text($STRING['bad_permission']);
+ } else {
+ del_attachment($_gv['del']);
+ }
+} elseif (isset($HTTP_POST_FILES['attachment'])) {
+ $perm->check('User');
+ add_attachment($_pv['bugid'], $_pv['description']);
+} elseif (isset($_gv['attachid'])) {
+ if (list($filename, $mimetype) = grab_attachment($_gv['attachid'])) {
+ header("Content-type: $mimetype");
+ @readfile($filename);
+ }
+} else {
+ $perm->check('User');
+ show_attachment_form($_gv['bugid']);
+}
$t->pparse('main',array('content','wrap','main'));
Index: bug.php
===================================================================
RCS file: /cvsroot/phpbt/phpbt/bug.php,v
retrieving revision 1.22
retrieving revision 1.23
diff -u -r1.22 -r1.23
--- bug.php 2001/08/10 13:50:53 1.22
+++ bug.php 2001/08/11 17:09:24 1.23
@@ -343,7 +343,7 @@
}
function show_bug($bugid = 0, $error = '') {
- global $q, $me, $t, $project, $STRING, $u;
+ global $q, $me, $t, $project, $STRING, $u, $perm;
if (!ereg('^[0-9]+$',$bugid) or !$row = $q->grab("select BugID, Title, Reporter.Email as Reporter, Owner.Email as Owner, Project, Version, Severity, Bug.CreatedDate, Bug.LastModifiedDate, Status.Name as Status, Priority, Bug.Description, Resolution.Name as Resolution, URL, Component, OS from Bug, Severity, Status left join User Owner on Bug.AssignedTo = Owner.UserID left join User Reporter on Bug.CreatedBy = Reporter.UserID left join Resolution on Resolution = ResolutionID where BugID = '$bugid' and Severity = SeverityID and Status = StatusID")) {
show_text($STRING['bugbadnum'],true);
@@ -356,6 +356,7 @@
$t->set_block('content','rerow','reopenrow');
$t->set_block('content','vrow','verifyrow');
$t->set_block('content','crow','closerow');
+ $t->set_block('content','attrow','attrows');
$t->set_unknowns('remove');
$t->set_var(array(
'statuserr' => $error['status'] ? $error['status'].'<br><br>' : '',
@@ -406,6 +407,36 @@
case 'Closed' :
$t->parse('reopenrow','rerow',true);
break;
+ }
+
+ // Show the attachments
+ $q->query("select * from Attachment where BugID = $bugid");
+ if (!$q->num_rows()) {
+ $t->set_var('attrows', '<tr><td colspan="5" align="center">No attachments</td></tr>');
+ } else {
+ while ($att = $q->grab()) {
+ if (is_readable(INSTALLPATH.'/'.ATTACHMENT_PATH."/{$row['Project']}/$bugid-{$att['FileName']}")) {
+ $action = "<a href='attachment.php?attachid={$att['AttachmentID']}'>View</a>";
+ if ($perm->have_perm('Administrator')) {
+ $action .= " | <a href='attachment.php?del={$att['AttachmentID']}'>Delete</a>";
+ }
+ $t->set_var(array(
+ 'bgcolor' => (++$j % 2 == 0) ? '#dddddd' : '#ffffff',
+ 'attid' => $att['AttachmentID'],
+ 'attname' => stripslashes($att['FileName']),
+ 'attdesc' => stripslashes($att['Description']),
+ 'attsize' => number_format($att['FileSize']).'k',
+ 'atttype' => $att['MimeType'],
+ 'attdate' => date(DATEFORMAT, $att['CreatedDate']),
+ 'attaction' => $action
+ ));
+ $t->parse('attrows', 'attrow', true);
+ }
+ }
+ // If there were attachments in the db but not on disk...
+ if (!$j) {
+ $t->set_var('attrows', '<tr><td colspan="5" align="center">No attachments</td></tr>');
+ }
}
$q->query("select Text, Comment.CreatedDate, Email from Comment, User where BugID = $bugid and CreatedBy = UserID order by CreatedDate");
Index: include.php
===================================================================
RCS file: /cvsroot/phpbt/phpbt/include.php,v
retrieving revision 1.26
retrieving revision 1.27
diff -u -r1.26 -r1.27
--- include.php 2001/08/10 13:51:17 1.26
+++ include.php 2001/08/11 17:09:24 1.27
@@ -37,6 +37,10 @@
define ('HIDE_EMAIL', 1); // Should email addresses be hidden for those not logged in?
// Sub-dir of the INSTALLPATH - Needs to be writeable by the web process
define ('ATTACHMENT_PATH', 'attachments');
+// Maximum size (in bytes) of an attachment
+// This will not override the settings in php.ini if php.ini has a lower limit
+define ('ATTACHMENT_MAX_SIZE', 2097152);
+
require PHPLIBPATH.'db_mysql.inc';
require PHPLIBPATH.'ct_sql.inc';
require PHPLIBPATH.'session.inc';
Index: strings-en.php
===================================================================
RCS file: /cvsroot/phpbt/phpbt/strings-en.php,v
retrieving revision 1.14
retrieving revision 1.15
diff -u -r1.14 -r1.15
--- strings-en.php 2001/08/10 23:21:13 1.14
+++ strings-en.php 2001/08/11 17:09:24 1.15
@@ -51,11 +51,14 @@
'passwordmatch' => 'Those passwords don\'t match -- please try again',
'nobughistory' => 'There is no history for that bug',
'logintomodify' => 'You must be logged in to modify this bug',
+ 'dupe_attachment' => 'That attachment already exists for this bug',
'give_attachment' => 'Please specify a file to upload',
'no_attachment_save_path' => 'Couldn\'t find where to save the file!',
'attachment_path_not_writeable' => 'Couldn\'t create a file in the save path',
'attachment_move_error' => 'There was an error moving the uploaded file',
- 'bad_attachment' => 'That attachment does not exist'
+ 'bad_attachment' => 'That attachment does not exist',
+ 'attachment_too_large' => 'The file you specified is larger than '.number_format(ATTACHMENT_MAX_SIZE).' bytes',
+ 'bad_permission' => 'You do not have the permissions required for that function'
);
// Page titles
|
|
From: Benjamin C. <bc...@us...> - 2001-08-11 02:35:25
|
Update of /cvsroot/phpbt/phpbt
In directory usw-pr-cvs1:/tmp/cvs-serv5389
Modified Files:
configure
Log Message:
heh
Index: configure
===================================================================
RCS file: /cvsroot/phpbt/phpbt/configure,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- configure 2001/08/10 21:54:59 1.3
+++ configure 2001/08/11 02:35:22 1.4
@@ -21,7 +21,7 @@
administrivia() {
$DIALOG --backtitle "phpBT Configuration" \
- --title "Admin Email (1 of 4)" \
+ --title "Admin Email (1 of 5)" \
--inputbox "Enter the email address of the administrator of this installation. \
All emails from phpBugTracker will come from this address" 0 0 $ADMINEMAIL \
2> $tempfile
@@ -31,7 +31,7 @@
ADMINEMAIL=`<$tempfile`
$DIALOG --backtitle "phpBT Configuration" \
- --title "Installation Path (2 of 4)" \
+ --title "Installation Path (2 of 5)" \
--inputbox "Enter the directory where the files will be stored.\n\n\
NOTE -- This does not move the files to the directory you specify; it only changes include.php. \
If you specify a directory other than the current one, you'll need to move the files there yourself!\n\n" 0 0 $INSTALLPATH \
@@ -42,7 +42,7 @@
INSTALLPATH=`<$tempfile`
$DIALOG --backtitle "phpBT Configuration" \
- --title "Attachment Path (2 of 4)" \
+ --title "Attachment Path (3 of 5)" \
--inputbox "Enter the sub-directory where the attachments will be stored.\n\n\
NOTE -- This does not create the directory you specify; it only changes include.php. \
If you don't use the default directory, you must make sure the permissions on
@@ -54,7 +54,7 @@
ATTACHMENT_PATH=`<$tempfile`
$DIALOG --backtitle "phpBT Configuration" \
- --title "Installation URL (3 of 4)" \
+ --title "Installation URL (4 of 5)" \
--inputbox "Enter the web site where phpBugTracker will be accessable" 0 0 $INSTALLURL \
2> $tempfile
if [ $? -gt 0 ]; then
@@ -63,7 +63,7 @@
INSTALLURL=`<$tempfile`
$DIALOG --backtitle "phpBT Configuration" \
- --title "PHPlib Path (4 of 4)" \
+ --title "PHPlib Path (5 of 5)" \
--inputbox "If PHPlib is not in PHP's include path, specify the location of PHPlib." 0 0 $PHPLIBPATH \
2> $tempfile
if [ $? -gt 0 ]; then
|
|
From: Benjamin C. <bc...@us...> - 2001-08-10 23:21:17
|
Update of /cvsroot/phpbt/phpbt
In directory usw-pr-cvs1:/tmp/cvs-serv6954
Modified Files:
attachment.php strings-en.php
Log Message:
Getting the attachments a little closer to working
Index: attachment.php
===================================================================
RCS file: /cvsroot/phpbt/phpbt/attachment.php,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- attachment.php 2001/08/10 13:51:48 1.1
+++ attachment.php 2001/08/10 23:21:13 1.2
@@ -23,33 +23,65 @@
include 'include.php';
+function show_attachment($attachid) {
+ global $q;
+
+ if (!is_numeric($attachid)) {
+ show_text($STRING['bad_attachment'], true);
+ return;
+ }
+ $ainfo = $q->grab("select a.BugID, FileName, MimeType, Project from Attachment a, Bug b where AttachmentID = $attachid and a.BugID = b.BugID");
+ if ($q->num_rows() != 1) {
+ show_text($STRING['bad_attachment'], true);
+ return;
+ }
+ $filename = join('/',array(INSTALLPATH, ATTACHMENT_PATH,
+ $ainfo['Project'], "{$ainfo['BugID']}-{$ainfo['FileName']}"));
+ if (!is_readable($filename)) {
+ show_text($STRING['bad_attachment'], true);
+ return;
+ }
+ header("Content-type: {$ainfo['MimeType']}");
+ @readfile($filename);
+}
+
function add_attachment($projectid, $bugid, $description) {
global $q, $HTTP_POST_FILES, $now, $u, $STRING;
if (!isset($HTTP_POST_FILES['attachment']) ||
$HTTP_POST_FILES['attachment']['tmp_name'] == 'none') {
- return false;
+ show_attachment_form($bugid, $STRING['give_attachment']);
+ return;
}
+
$filepath = INSTALLPATH.'/'.ATTACHMENT_PATH;
$tmpfilename = $HTTP_POST_FILES['attachment']['tmp_name'];
$filename = "$bugid-{$HTTP_POST_FILES['attachment']['name']}";
+
if (!is_dir($filepath)) {
show_attachment_form($bugid, $STRING['no_attachment_save_path']);
+ return;
}
+
if (!is_writeable($filepath)) {
show_attachment_form($bugid, $STRING['attachment_path_not_writeable']);
+ return;
}
+
if (!is_dir("$filepath/$projectid")) {
- #umask(011);
@mkdir("$filepath/$projectid", 0775);
}
+
if (!@move_uploaded_file($HTTP_POST_FILES['attachment']['tmp_name'],
"$filepath/$projectid/$filename")) {
show_attachment_form($bugid, $STRING['attachment_move_error']);
+ return;
}
- chmod("$filepath/$projectid/$filename", 0766);
+
+ @chmod("$filepath/$projectid/$filename", 0766);
$q->query("insert into Attachment (AttachmentID, BugID, FileName, Description, FileSize, MimeType, CreatedBy, CreatedDate) values (".$q->nextid('Attachment').", $bugid, '{$HTTP_POST_FILES['attachment']['name']}', '$description', {$HTTP_POST_FILES['attachment']['size']}, '{$HTTP_POST_FILES['attachment']['type']}', $u, $now)");
- return true;
+ $t->set_file('content', 'bugattachmentsuccess.html');
+ $t->set_var('bugid', $bugid);
}
function show_attachment_form($bugid, $error = '') {
Index: strings-en.php
===================================================================
RCS file: /cvsroot/phpbt/phpbt/strings-en.php,v
retrieving revision 1.13
retrieving revision 1.14
diff -u -r1.13 -r1.14
--- strings-en.php 2001/08/10 13:51:17 1.13
+++ strings-en.php 2001/08/10 23:21:13 1.14
@@ -51,9 +51,11 @@
'passwordmatch' => 'Those passwords don\'t match -- please try again',
'nobughistory' => 'There is no history for that bug',
'logintomodify' => 'You must be logged in to modify this bug',
+ 'give_attachment' => 'Please specify a file to upload',
'no_attachment_save_path' => 'Couldn\'t find where to save the file!',
'attachment_path_not_writeable' => 'Couldn\'t create a file in the save path',
- 'attachment_move_error' => 'There was an error moving the uploaded file'
+ 'attachment_move_error' => 'There was an error moving the uploaded file',
+ 'bad_attachment' => 'That attachment does not exist'
);
// Page titles
|
|
From: Benjamin C. <bc...@us...> - 2001-08-10 21:55:02
|
Update of /cvsroot/phpbt/phpbt
In directory usw-pr-cvs1:/tmp/cvs-serv21648
Modified Files:
configure
Log Message:
Changed for the new configuration options
Index: configure
===================================================================
RCS file: /cvsroot/phpbt/phpbt/configure,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- configure 2001/08/08 20:29:45 1.2
+++ configure 2001/08/10 21:54:59 1.3
@@ -11,10 +11,13 @@
INSTALLURL=http://`hostname -f`/phpbt
PHPLIBPATH=''
JPGRAPH_PATH=''
+ATTACHMENT_PATH='attachments'
# Booleans
ENCRYPTPASS=1
USE_JPGRAPH=0
+MASK_EMAIL=0
+HIDE_EMAIL=1
administrivia() {
$DIALOG --backtitle "phpBT Configuration" \
@@ -39,6 +42,18 @@
INSTALLPATH=`<$tempfile`
$DIALOG --backtitle "phpBT Configuration" \
+ --title "Attachment Path (2 of 4)" \
+ --inputbox "Enter the sub-directory where the attachments will be stored.\n\n\
+NOTE -- This does not create the directory you specify; it only changes include.php. \
+If you don't use the default directory, you must make sure the permissions on
+that directory allow the web server to create and read files in it!\n\n" 0 0 $ATTACHMENT_PATH \
+ 2> $tempfile
+ if [ $? -gt 0 ]; then
+ return
+ fi
+ ATTACHMENT_PATH=`<$tempfile`
+
+ $DIALOG --backtitle "phpBT Configuration" \
--title "Installation URL (3 of 4)" \
--inputbox "Enter the web site where phpBugTracker will be accessable" 0 0 $INSTALLURL \
2> $tempfile
@@ -70,16 +85,30 @@
else
OLD_USE_JPGRAPH=off
fi
+ if [ $MASK_EMAIL -eq 1 ]; then
+ OLD_MASK_EMAIL=on
+ else
+ OLD_MASK_EMAIL=off
+ fi
+ if [ $HIDE_EMAIL -eq 1 ]; then
+ OLD_HIDE_EMAIL=on
+ else
+ OLD_HIDE_EMAIL=off
+ fi
NEW_ENCRYPTPASS=0
NEW_USE_JPGRAPH=0
+ NEW_MASK_EMAIL=0
+ NEW_HIDE_EMAIL=0
$DIALOG --backtitle "phpBT Configuration" \
--title "Optional Features" \
--separate-output \
- --checklist "Choose the features below you would like to enable" 10 72 3 \
+ --checklist "Choose the features below you would like to enable" 12 72 5 \
"ENCRYPTPASS" "Store passwords encrypted in the database" $OLD_ENCRYPTPASS \
"USE_JPGRAPH" "Use the JP Graph class for charting some reports" $OLD_USE_JPGRAPH \
+ "MASK_EMAIL" "Replace @ with at and . with dot when showing emails" $OLD_MASK_EMAIL \
+ "HIDE_EMAIL" "Completely hide emails when not logged in" $OLD_HIDE_EMAIL \
2> $tempfile
retval=$?
@@ -93,11 +122,17 @@
NEW_ENCRYPTPASS=1;;
USE_JPGRAPH)
NEW_USE_JPGRAPH=1;;
+ MASK_EMAIL)
+ NEW_MASK_EMAIL=1;;
+ HIDE_EMAIL)
+ NEW_HIDE_EMAIL=1;;
esac
done
ENCRYPTPASS=${NEW_ENCRYPTPASS:-0}
USE_JPGRAPH=${NEW_USE_JPGRAPH:-0}
+ MASK_EMAIL=${NEW_MASK_EMAIL:-0}
+ HIDE_EMAIL=${NEW_HIDE_EMAIL:-0}
fi
if [ $USE_JPGRAPH -eq 1 ]; then
@@ -136,16 +171,20 @@
;;
Save)
mv include.php include.php.bak
- echo "/ENCRYPTPASS/s/0/$ENCRYPTPASS/" > $tempfile
- echo "/USE_JPGRAPH/s/0/$USE_JPGRAPH/" >> $tempfile
+ echo "/ENCRYPTPASS/s/[[:digit:]]/$ENCRYPTPASS/" > $tempfile
+ echo "/USE_JPGRAPH/s/[[:digit:]]/$USE_JPGRAPH/" >> $tempfile
+ echo "/MASK_EMAIL/s/[[:digit:]]/$MASK_EMAIL/" >> $tempfile
+ echo "/HIDE_EMAIL/s/[[:digit:]]/$HIDE_EMAIL/" >> $tempfile
echo "/ADMINEMAIL/s|,'.*'|,'$ADMINEMAIL'|" >> $tempfile
echo "/INSTALLPATH/s|,'.*'|,'$INSTALLPATH'|" >> $tempfile
+ echo "/ATTACHMENT_PATH/s|, '.*'|, '$ATTACHMENT_PATH'|" >> $tempfile
echo "/INSTALLURL/s|,'.*'|,'$INSTALLURL'|" >> $tempfile
echo "/PHPLIBPATH/s|,'.*'|,'$PHPLIBPATH'|" >> $tempfile
echo "/JPGRAPH_PATH/s|,'.*'|,'$JPGRAPH_PATH'|" >> $tempfile
sed -f $tempfile include.php.bak > include.php
$DIALOG --backtitle "phpBT Configuration" \
--infobox "Your changes have been saved" 5 36
+ exit
;;
esac
else
|
|
From: Benjamin C. <bc...@us...> - 2001-08-10 15:54:58
|
Update of /cvsroot/phpbt/phpbt In directory usw-pr-cvs1:/tmp/cvs-serv22040 Modified Files: TODO Log Message: Index: TODO =================================================================== RCS file: /cvsroot/phpbt/phpbt/TODO,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- TODO 2001/08/09 16:19:35 1.3 +++ TODO 2001/08/10 15:54:54 1.4 @@ -1,5 +1,6 @@ Bugs: - File attachments for bugs +- Create bugs via email Bottom Nav: - Counts of and links to bugs reported by and assigned to user |
|
From: Benjamin C. <bc...@us...> - 2001-08-10 13:51:52
|
Update of /cvsroot/phpbt/phpbt
In directory usw-pr-cvs1:/tmp/cvs-serv25057
Added Files:
attachment.php
Log Message:
Not working yet -- got pulled out of bug.php
--- NEW FILE: attachment.php ---
<?php
// attachment.php - Adding, deleting, and displaying attachments
// ------------------------------------------------------------------------
// Copyright (c) 2001 The phpBugTracker Group
// ------------------------------------------------------------------------
// This file is part of phpBugTracker
//
// phpBugTracker is free software; you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation; either version 2 of the License, or
// (at your option) any later version.
//
// phpBugTracker is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with phpBugTracker; if not, write to the Free Software Foundation,
// Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
// ------------------------------------------------------------------------
include 'include.php';
function add_attachment($projectid, $bugid, $description) {
global $q, $HTTP_POST_FILES, $now, $u, $STRING;
if (!isset($HTTP_POST_FILES['attachment']) ||
$HTTP_POST_FILES['attachment']['tmp_name'] == 'none') {
return false;
}
$filepath = INSTALLPATH.'/'.ATTACHMENT_PATH;
$tmpfilename = $HTTP_POST_FILES['attachment']['tmp_name'];
$filename = "$bugid-{$HTTP_POST_FILES['attachment']['name']}";
if (!is_dir($filepath)) {
show_attachment_form($bugid, $STRING['no_attachment_save_path']);
}
if (!is_writeable($filepath)) {
show_attachment_form($bugid, $STRING['attachment_path_not_writeable']);
}
if (!is_dir("$filepath/$projectid")) {
#umask(011);
@mkdir("$filepath/$projectid", 0775);
}
if (!@move_uploaded_file($HTTP_POST_FILES['attachment']['tmp_name'],
"$filepath/$projectid/$filename")) {
show_attachment_form($bugid, $STRING['attachment_move_error']);
}
chmod("$filepath/$projectid/$filename", 0766);
$q->query("insert into Attachment (AttachmentID, BugID, FileName, Description, FileSize, MimeType, CreatedBy, CreatedDate) values (".$q->nextid('Attachment').", $bugid, '{$HTTP_POST_FILES['attachment']['name']}', '$description', {$HTTP_POST_FILES['attachment']['size']}, '{$HTTP_POST_FILES['attachment']['type']}', $u, $now)");
return true;
}
function show_attachment_form($bugid, $error = '') {
global $q, $t;
$t->set_file('content', 'bugattachmentform.html');
if (!is_numeric($bugid) || !$projectid = $q->grab_field("select Project from Bug where BugID = $bugid")) {
show_text($STRING['nobug'], true);
return;
}
$t->set_var(array(
'error' => $error,
'bugid' => $bugid,
'projectid' => $projectid
'description' => stripslashes($description),
));
}
$t->set_file('wrap','wrap.html');
if (isset($HTTP_POST_FILES)) add_attachment($_pv['projectid'], $_pv['bugid'],
$_pv['description']);
elseif (isset($_gv['attachid'])) show_attachment($_gv['attachid']);
else function show_attachment_form($_gv['bugid']);
$t->pparse('main',array('content','wrap','main'));
page_close();
?>
|
|
From: Benjamin C. <bc...@us...> - 2001-08-10 13:51:21
|
Update of /cvsroot/phpbt/phpbt
In directory usw-pr-cvs1:/tmp/cvs-serv24900
Modified Files:
createdb.sql include.php strings-en.php
Log Message:
Ooh, attachments
Index: createdb.sql
===================================================================
RCS file: /cvsroot/phpbt/phpbt/createdb.sql,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- createdb.sql 2001/08/03 13:30:43 1.5
+++ createdb.sql 2001/08/10 13:51:17 1.6
@@ -283,11 +283,23 @@
KEY changed (changed)
);
-CREATE TABLE `BugHistory` (
- `BugID` int(10) unsigned NOT NULL default '0',
- `ChangedField` char(20) NOT NULL default '',
- `OldValue` char(255) NOT NULL default '',
- `NewValue` char(255) NOT NULL default '',
- `CreatedBy` int(10) unsigned NOT NULL default '0',
- `CreatedDate` bigint(20) unsigned NOT NULL default '0'
+CREATE TABLE BugHistory (
+ BugID int(10) unsigned NOT NULL default '0',
+ ChangedField char(20) NOT NULL default '',
+ OldValue char(255) NOT NULL default '',
+ NewValue char(255) NOT NULL default '',
+ CreatedBy int(10) unsigned NOT NULL default '0',
+ CreatedDate bigint(20) unsigned NOT NULL default '0'
+);
+
+CREATE TABLE Attachment (
+ AttachmentID int(10) unsigned NOT NULL default '0',
+ BugID int(10) unsigned NOT NULL default '0',
+ FileName char(255) NOT NULL default '',
+ Description char(255) NOT NULL default '',
+ FileSize bigint(20) unsigned NOT NULL default '0',
+ MimeType char(30) NOT NULL default '',
+ CreatedBy int(10) unsigned NOT NULL default '0',
+ CreatedDate bigint(20) unsigned NOT NULL default '0',
+ PRIMARY KEY (AttachmentID)
);
Index: include.php
===================================================================
RCS file: /cvsroot/phpbt/phpbt/include.php,v
retrieving revision 1.25
retrieving revision 1.26
diff -u -r1.25 -r1.26
--- include.php 2001/08/09 22:22:54 1.25
+++ include.php 2001/08/10 13:51:17 1.26
@@ -35,7 +35,8 @@
define ('JPGRAPH_PATH', '/home/bcurtis/public_html/jp/'); // If it's not in the include path
define ('MASK_EMAIL', 1); // Should email addresses be plainly visible?
define ('HIDE_EMAIL', 1); // Should email addresses be hidden for those not logged in?
-
+// Sub-dir of the INSTALLPATH - Needs to be writeable by the web process
+define ('ATTACHMENT_PATH', 'attachments');
require PHPLIBPATH.'db_mysql.inc';
require PHPLIBPATH.'ct_sql.inc';
require PHPLIBPATH.'session.inc';
Index: strings-en.php
===================================================================
RCS file: /cvsroot/phpbt/phpbt/strings-en.php,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -r1.12 -r1.13
--- strings-en.php 2001/08/09 12:54:47 1.12
+++ strings-en.php 2001/08/10 13:51:17 1.13
@@ -50,7 +50,10 @@
'datecollision' => 'Someone has updated this bug since you viewed it. The bug info has been reloaded with the latest changes.',
'passwordmatch' => 'Those passwords don\'t match -- please try again',
'nobughistory' => 'There is no history for that bug',
- 'logintomodify' => 'You must be logged in to modify this bug'
+ 'logintomodify' => 'You must be logged in to modify this bug',
+ 'no_attachment_save_path' => 'Couldn\'t find where to save the file!',
+ 'attachment_path_not_writeable' => 'Couldn\'t create a file in the save path',
+ 'attachment_move_error' => 'There was an error moving the uploaded file'
);
// Page titles
|
|
From: Benjamin C. <bc...@us...> - 2001-08-10 13:51:10
|
Update of /cvsroot/phpbt/phpbt
In directory usw-pr-cvs1:/tmp/cvs-serv24865
Modified Files:
global.css
Log Message:
Minor tweaks
Index: global.css
===================================================================
RCS file: /cvsroot/phpbt/phpbt/global.css,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- global.css 2001/08/08 04:27:33 1.3
+++ global.css 2001/08/10 13:51:06 1.4
@@ -26,6 +26,15 @@
input {
font-size: 12px;
}
+
+input[type="file"] {
+ font-family: "Arial","Helvetica","MS Sans Serif","Sans-Serif";
+ font-size: 12px;
+ }
+
+input[type="submit"] {
+ font-family: "Arial","Helvetica","MS Sans Serif","Sans-Serif";
+ }
textarea {
font-size: 12px;
|
|
From: Benjamin C. <bc...@us...> - 2001-08-10 13:50:57
|
Update of /cvsroot/phpbt/phpbt
In directory usw-pr-cvs1:/tmp/cvs-serv24747
Modified Files:
bug.php
Log Message:
Minor tweaks
Index: bug.php
===================================================================
RCS file: /cvsroot/phpbt/phpbt/bug.php,v
retrieving revision 1.21
retrieving revision 1.22
diff -u -r1.21 -r1.22
--- bug.php 2001/08/09 22:17:02 1.21
+++ bug.php 2001/08/10 13:50:53 1.22
@@ -163,7 +163,7 @@
}
function update_bug($bugid = 0) {
- global $q, $t, $u, $STRING, $perm;
+ global $q, $t, $u, $STRING, $perm, $now;
// Pull bug from database to determine changed fields and for user validation
$buginfo = $q->grab("select * from Bug where BugID = $bugid");
@@ -197,11 +197,6 @@
return;
}
- $now = time();
- if ($comments) {
- $comments = htmlspecialchars($comments);
- $q->query("insert into Comment (CommentID, BugID, Text, CreatedBy, CreatedDate) values (".$q->nextid('Comment').", $bugid, '$comments', $u, $now)");
- }
switch($outcome) {
case 'unchanged' : break;
case 'assign' : $assignedto = $u; $statusfield = 'Assigned'; break;
@@ -253,6 +248,11 @@
$changedfields['Status'] = $status;
}
+ if ($comments) {
+ $comments = htmlspecialchars($comments);
+ $q->query("insert into Comment (CommentID, BugID, Text, CreatedBy, CreatedDate) values (".$q->nextid('Comment').", $bugid, '$comments', $u, $now)");
+ }
+
$q->query("update Bug set Title = '$Title', URL = '$URL', Severity = $Severity, Priority = $Priority, ".($status ? "Status = $status, " : ''). ($changeresolution ? "Resolution = $bugresolution, " : ''). ($assignedto ? "AssignedTo = $assignedto, " : '')." Project = $Project, Version = $Version, Component = $Component, OS = $OS, LastModifiedBy = $u, LastModifiedDate = $now where BugID = $bugid");
if ($changedfields or $comments) {
|
|
From: Benjamin C. <bc...@us...> - 2001-08-10 13:48:41
|
Update of /cvsroot/phpbt/phpbt/attachments In directory usw-pr-cvs1:/tmp/cvs-serv24266/attachments Log Message: Directory /cvsroot/phpbt/phpbt/attachments added to the repository |
|
From: Benjamin C. <bc...@us...> - 2001-08-09 22:51:23
|
Update of /cvsroot/phpbt/phpbt In directory usw-pr-cvs1:/tmp/cvs-serv2407 Modified Files: CHANGELOG Log Message: Index: CHANGELOG =================================================================== RCS file: /cvsroot/phpbt/phpbt/CHANGELOG,v retrieving revision 1.8 retrieving revision 1.9 diff -u -r1.8 -r1.9 --- CHANGELOG 2001/08/07 13:53:32 1.8 +++ CHANGELOG 2001/08/09 22:51:21 1.9 @@ -2,6 +2,8 @@ : Allow for browsing the bugs without logging in : Started reporting : Started using jpgraph (optional) for showing summary charts +: Added options for hiding and masking email addresses to avoid spambots +: Added a dialog-based configure script. -- 0.1.7 -- 31 July 2001 : Fixed bugs with valid_email() in admin/user.php |
|
From: Benjamin C. <bc...@us...> - 2001-08-09 22:22:57
|
Update of /cvsroot/phpbt/phpbt
In directory usw-pr-cvs1:/tmp/cvs-serv29048
Modified Files:
include.php
Log Message:
Added option to completely hide emails from people not logged in
Index: include.php
===================================================================
RCS file: /cvsroot/phpbt/phpbt/include.php,v
retrieving revision 1.24
retrieving revision 1.25
diff -u -r1.24 -r1.25
--- include.php 2001/08/09 22:17:02 1.24
+++ include.php 2001/08/09 22:22:54 1.25
@@ -33,7 +33,8 @@
define ('THEME','default/'); // Which set of templates to use
define ('USE_JPGRAPH',0); // Whether to show images or not
define ('JPGRAPH_PATH', '/home/bcurtis/public_html/jp/'); // If it's not in the include path
-define ('MASKEMAIL', 1); // Should email addresses be plainly visible?
+define ('MASK_EMAIL', 1); // Should email addresses be plainly visible?
+define ('HIDE_EMAIL', 1); // Should email addresses be hidden for those not logged in?
require PHPLIBPATH.'db_mysql.inc';
require PHPLIBPATH.'ct_sql.inc';
@@ -407,7 +408,11 @@
///
/// If the constant is set do a little email masking to make harvesting a little harder
function maskemail($email) {
- if (MASKEMAIL) {
+ global $auth;
+
+ if (HIDE_EMAIL && $auth->auth['uid'] == 'nobody') {
+ return '******';
+ } elseif (MASK_EMAIL) {
return str_replace('@', ' at ', str_replace('.', ' dot ', $email));
} else {
return $email;
|
|
From: Benjamin C. <bc...@us...> - 2001-08-09 22:17:05
|
Update of /cvsroot/phpbt/phpbt/templates/default
In directory usw-pr-cvs1:/tmp/cvs-serv27902/templates/default
Modified Files:
bugdisplay.html
Log Message:
Add an option for masking email addresses
Index: bugdisplay.html
===================================================================
RCS file: /cvsroot/phpbt/phpbt/templates/default/bugdisplay.html,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- bugdisplay.html 2001/08/08 04:01:46 1.2
+++ bugdisplay.html 2001/08/09 22:17:02 1.3
@@ -63,15 +63,20 @@
</table>
<table border="0" cellpadding="2" cellspacing="0" width="640">
<tr>
- <td align="right">Status:</td>
- <td><b>{status}</b> {owner}</td>
- <td align="right">Resolution:</td>
- <td><b>{resolution}</b></td>
+ <td>Assigned To:</td>
+ <td><b>{owner}</td>
+ <td colspan="2"> </td>
</tr>
<tr>
- <td align="right">Summary:</td>
+ <td>Status:</td>
+ <td><b>{status}</b></td>
+ <td>Summary:</td>
<td><input type="text" size="30" maxlength="30" name="Title" value="{title}"></td>
- <td align="right">{urllabel}:</td>
+ </tr>
+ <tr>
+ <td>Resolution:</td>
+ <td><b>{resolution}</b></td>
+ <td>{urllabel}:</td>
<td><input type="text" size="30" maxlength="255" name="URL" value="{url}"></td>
</tr>
<tr>
@@ -79,16 +84,14 @@
</td>
</tr>
-</table>
-<table border="0" cellpadding="2" cellspacing="0" width="640">
<tr>
- <td valign="top">
+ <td valign="top" colspan="2">
Additional Comments:
<br>
<br>
<textarea name="comments" rows="10" cols="35" wrap="virtual"></textarea>
</td>
- <td valign="top">
+ <td valign="top" colspan="2">
Update Bug Status:
<br>
<br>
|
|
From: Benjamin C. <bc...@us...> - 2001-08-09 22:17:05
|
Update of /cvsroot/phpbt/phpbt
In directory usw-pr-cvs1:/tmp/cvs-serv27902
Modified Files:
bug.php include.php query.php
Log Message:
Add an option for masking email addresses
Index: bug.php
===================================================================
RCS file: /cvsroot/phpbt/phpbt/bug.php,v
retrieving revision 1.20
retrieving revision 1.21
diff -u -r1.20 -r1.21
--- bug.php 2001/08/09 13:21:58 1.20
+++ bug.php 2001/08/09 22:17:02 1.21
@@ -48,7 +48,7 @@
'field' => stripslashes($row['ChangedField']),
'oldvalue' => stripslashes($row['OldValue']),
'newvalue' => stripslashes($row['NewValue']),
- 'createdby' => stripslashes($row['Email']),
+ 'createdby' => stripslashes(maskemail($row['Email'])),
'date' => date(DATEFORMAT.' '.TIMEFORMAT, $row['CreatedDate'])
));
$t->parse('rows', 'row', true);
@@ -369,8 +369,8 @@
'priority' => build_select('priority',$row['Priority']),
'status' => $row['Status'],
'resolution' => $row['Resolution'],
- 'owner' => $row['Owner'] ? "to <a href='mailto:{$row['Owner']}'>{$row['Owner']}</a>" : '',
- 'reporter' => $row['Reporter'],
+ 'owner' => maskemail($row['Owner']),
+ 'reporter' => maskemail($row['Reporter']),
'createddate' => date(DATEFORMAT,$row['CreatedDate']),
'createdtime' => date(TIMEFORMAT,$row['CreatedDate']),
'lastmodifieddate' => $row['LastModifiedDate'],
@@ -417,7 +417,7 @@
'bgcolor' => (++$i % 2 == 0) ? '#dddddd' : '#ffffff',
'rdescription' => eregi_replace('(bug)[[:space:]]*(#?)([0-9]+)',
"\\1 <a href='$me?op=show&bugid=\\3'>\\2\\3</a>",nl2br($row['Text'])),
- 'rreporter' => $row['Email'],
+ 'rreporter' => maskemail($row['Email']),
'rcreateddate' => date(TIMEFORMAT,$row['CreatedDate']).' on '.
date(DATEFORMAT,$row['CreatedDate'])
));
Index: include.php
===================================================================
RCS file: /cvsroot/phpbt/phpbt/include.php,v
retrieving revision 1.23
retrieving revision 1.24
diff -u -r1.23 -r1.24
--- include.php 2001/08/09 13:03:03 1.23
+++ include.php 2001/08/09 22:17:02 1.24
@@ -33,6 +33,7 @@
define ('THEME','default/'); // Which set of templates to use
define ('USE_JPGRAPH',0); // Whether to show images or not
define ('JPGRAPH_PATH', '/home/bcurtis/public_html/jp/'); // If it's not in the include path
+define ('MASKEMAIL', 1); // Should email addresses be plainly visible?
require PHPLIBPATH.'db_mysql.inc';
require PHPLIBPATH.'ct_sql.inc';
@@ -401,6 +402,16 @@
/// (From zend.com user russIndr)
function valid_email($email) {
return eregi('^[_a-z0-9-]+(\.[_a-z0-9-]+)*@[a-z0-9-]+(\.[a-z0-9-]+)*(\.[a-z]{2,3})$', $email);
+}
+
+///
+/// If the constant is set do a little email masking to make harvesting a little harder
+function maskemail($email) {
+ if (MASKEMAIL) {
+ return str_replace('@', ' at ', str_replace('.', ' dot ', $email));
+ } else {
+ return $email;
+ }
}
// Begin every page with a page_open
Index: query.php
===================================================================
RCS file: /cvsroot/phpbt/phpbt/query.php,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -r1.12 -r1.13
--- query.php 2001/08/09 12:54:47 1.12
+++ query.php 2001/08/09 22:17:02 1.13
@@ -216,8 +216,8 @@
'priority' => $select['priority'][$row['Priority']],
'status' => $row['Status'],
'assignedto' => $row['AssignedTo'],
- 'reporter' => $row['Reporter'],
- 'owner' => $row['Owner'],
+ 'reporter' => maskemail($row['Reporter']),
+ 'owner' => maskemail($row['Owner']),
'createddate' => date(DATEFORMAT,$row['CreatedDate']),
'project' => $row['Project'],
'component' => $row['Component'],
|
|
From: Benjamin C. <bc...@us...> - 2001-08-09 16:19:38
|
Update of /cvsroot/phpbt/phpbt In directory usw-pr-cvs1:/tmp/cvs-serv856 Modified Files: TODO Log Message: Index: TODO =================================================================== RCS file: /cvsroot/phpbt/phpbt/TODO,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- TODO 2001/08/08 14:19:10 1.2 +++ TODO 2001/08/09 16:19:35 1.3 @@ -1,3 +1,6 @@ +Bugs: +- File attachments for bugs + Bottom Nav: - Counts of and links to bugs reported by and assigned to user |