From d5bbf222cd8334ffd9f856311f865df07c59466a Mon Sep 17 00:00:00 2001 From: Michael R Sweet Date: Mon, 17 May 2004 20:28:52 +0000 Subject: [PATCH] Account stuff. Skeleton pages. Updated database schema and STR pages. --- www/account.php | 91 +++++++++ www/articles.php | 20 ++ www/comment.php | 20 ++ www/data/mxml.sql | 7 +- www/docfiles/.htaccess | 2 + www/documentation.php | 20 ++ www/images/bottom-left.gif | Bin 0 -> 475 bytes www/images/bottom-right.gif | Bin 0 -> 477 bytes www/images/top-left.gif | Bin 0 -> 474 bytes www/images/top-right.gif | Bin 0 -> 475 bytes www/login.php | 48 +++++ www/phplib/auth.php | 124 +++++++++++ www/phplib/common.php | 64 +++++- www/phplib/db.php | 62 +----- www/phplib/html.php | 143 ++++++------- www/software.php | 20 ++ www/str.php | 396 ++++++++++++++++++------------------ www/style.css | 8 + 18 files changed, 693 insertions(+), 332 deletions(-) create mode 100644 www/account.php create mode 100644 www/articles.php create mode 100644 www/comment.php create mode 100644 www/docfiles/.htaccess create mode 100644 www/documentation.php create mode 100644 www/images/bottom-left.gif create mode 100644 www/images/bottom-right.gif create mode 100644 www/images/top-left.gif create mode 100644 www/images/top-right.gif create mode 100644 www/login.php create mode 100644 www/phplib/auth.php create mode 100644 www/software.php diff --git a/www/account.php b/www/account.php new file mode 100644 index 0000000..8130c67 --- /dev/null +++ b/www/account.php @@ -0,0 +1,91 @@ +New/Pending\n"); + + print("

New/Pending Articles:

\n"); + + print("

New/Pending STRs:

\n"); + + html_footer(); + break; + + case 'P' : + // Change password + html_header("Change Password"); + + html_start_links(1); + html_link("New/Pending", "$PHP_SELF?L"); + html_link("Change Password", "$PHP_SELF?P"); + html_link("Logout", "$PHP_SELF?X"); + html_end_links(); + + print("

Change Password

\n"); + + if ($REQUEST_METHOD == "POST" && + array_key_exists("PASSWORD", $_POST) && + array_key_exists("PASSWORD2", $_POST) && + $_POST["PASSWORD"] == $_POST["PASSWORD2"]) + { + // Store new password and re-login... + print("

Password changed successfully!

\n"); + } + else + { + print("
" + ."

\n" + ."" + ."\n" + ."" + ."\n" + ."\n" + ."
Password:
Password Again:
" + ."

\n"); + } + + html_footer(); + break; +} + + +// +// End of "$Id: account.php,v 1.1 2004/05/17 20:28:52 mike Exp $". +// +?> diff --git a/www/articles.php b/www/articles.php new file mode 100644 index 0000000..5303d43 --- /dev/null +++ b/www/articles.php @@ -0,0 +1,20 @@ + diff --git a/www/comment.php b/www/comment.php new file mode 100644 index 0000000..ad56438 --- /dev/null +++ b/www/comment.php @@ -0,0 +1,20 @@ + diff --git a/www/data/mxml.sql b/www/data/mxml.sql index 9d9a8db..3423598 100644 --- a/www/data/mxml.sql +++ b/www/data/mxml.sql @@ -1,5 +1,5 @@ -- --- "$Id: mxml.sql,v 1.1 2004/05/17 19:05:00 mike Exp $" +-- "$Id: mxml.sql,v 1.2 2004/05/17 20:28:52 mike Exp $" -- -- Database schema for the Mini-XML web pages. -- @@ -150,7 +150,10 @@ CREATE TABLE users ( modify_user VARCHAR(255) -- User that made the last change ); +INSERT INTO users VALUES(NULL, 1, 'mike', 'Michael Sweet ', + '195c416888c3151df53ae9f38c67afcc', 100, + 1084823565, 'mike', 1084823565, 'mike'); -- --- End of "$Id: mxml.sql,v 1.1 2004/05/17 19:05:00 mike Exp $". +-- End of "$Id: mxml.sql,v 1.2 2004/05/17 20:28:52 mike Exp $". -- diff --git a/www/docfiles/.htaccess b/www/docfiles/.htaccess new file mode 100644 index 0000000..6537b6a --- /dev/null +++ b/www/docfiles/.htaccess @@ -0,0 +1,2 @@ +DirectoryIndex off + diff --git a/www/documentation.php b/www/documentation.php new file mode 100644 index 0000000..ee422d4 --- /dev/null +++ b/www/documentation.php @@ -0,0 +1,20 @@ + diff --git a/www/images/bottom-left.gif b/www/images/bottom-left.gif new file mode 100644 index 0000000000000000000000000000000000000000..4fa5b894f2ad648441f5fa3c53aa0ea008559418 GIT binary patch literal 475 zcmci9Z)XB=0KoBI*RF1nA}JCPi6#+kiImbrA|ferL?j{+k+#;Y)*q|06eo9+xI~L1 z5s^5e=vmLA2R)14K(y>d?E4Zv-)Fb$=@AtH5nuthUa#l#`EWSwcDwC%yV-2k>-FVw zIUbLv(`moom&;|6Bqx(eC=`;(WB>rYUY|;(oKELzwPIOzxm+$5i}`#$o6V-vDZ?=1 z@pv>E4TnRTru+SVuh*j}s@v@n1kveqTCEn2UYPDLWQYn>6g+d{h%cWAOL?RK3#X_M_AP^u3 z0>dx_LDxT%8_WOna09)a5CI$C_5$lZFuID7W&nKNhp{Q2|r>C-oF-rT!) zucM=5{`~pdwrz`!jusaeXJBB^)6**|DspjgIeGHrv17*$A3l8W;K6TOXuwlcxb?a8IUcF+)ils}JE?&HN!GZ;I=gyryd-jYOGp0_RI%(3R2@@vt_V#vl zb+xy*x3;!6H8s`O*Voq8R#jD%mzS56l;r2<=j7yMWo4zOr>CT(Bqk=t$H&LS#6(6$ zhKGlTgoFeJ2KxE=`S|#FdV0FKxj8#KJ32br+1XiJTU%OMnwgmy8yg!K7-(y2YiMYw zsi`R|D=R1{$jZt}OG`^gNQjDx3JVJh2ng`<@^W!;ad2?3va&KUG5rUJ2{2gb19X4^ z3XBPU1_ySh2DYZ=mKN654mM5(hR#mLPL}STDSaKx(^@!sr*TbTU}a%uVw}Hh&des3 emCa0R*jQFfV`1Oa$uzZZ$NW|nj;+fZ8LR=59s*tf literal 0 HcmV?d00001 diff --git a/www/images/top-left.gif b/www/images/top-left.gif new file mode 100644 index 0000000000000000000000000000000000000000..43123cb806d20037cf05d69772aa738c8cd728be GIT binary patch literal 474 zcmci9VP^ty0D$rTuC8v8A}JCPi6#+kiMEuRNJJz>j)+7gBGPu15?3cnS<-RZqG{Q2 zA|eq{^saZ&i{3?FAa2=**z*y7&$AnSxW^jj2@1<#Mf7tL1XJSS;rA`D`|uPN$Q}gkhNR zcsv@7hQr}tFzEODG)+?!)$MjWold*mZZ?~ZMuQ|tf*`8ZYPno4l}b2{=kxhoE|<+_ zGnq^}olYi`i9{kEkH=!MXf%ppSR@h&hr_{OFc1j%{eGX%=kg(QZARvWHPB#Di(`HA`yZh zFbqQw#Qm9ES^lTHE9muv1Uv~JUjSYx-atG)3=jcPtJjJmlH|R$1V#Lo-|DpMHxvoe b^>lZFuID7W&nKNhp{Q2|r>C-oF-rT!) zucM=5{`~pdwrz`!jusaeXJBB^)6**|DspjgIeGHrv17*$A3l8W;K6TOXuwlcxb?a8IUcF+)ils}JE?&HN!GZ;I=gyryd-jYOGp0_RI%(3R2@@vt_V#vl zb+xy*x3;!6H8s`O*Voq8R#jD%mzS56l;r2<=j7yMWo4zOr>CT(Bqk=t$H&LS#6(6$ zhKGlTgoFeJ2KxE=`S|#FdV0FKxj8#KJ32br+1XiJTU%OMnwgmy8yg!K7-(y2YiMYw zsi`R|D=R1{$jZt}OG`^gNQjDx3JVJh2ng`<@^W!;ad2?3va&KUG5rUJ2{2gb19X4^ z3XBPU1_ySB238hkCPs$#j!w4jp57h~hQ2B67Vco$v9poE8UUPa1ET-{ literal 0 HcmV?d00001 diff --git a/www/login.php b/www/login.php new file mode 100644 index 0000000..9c015ca --- /dev/null +++ b/www/login.php @@ -0,0 +1,48 @@ +Login\n" + ."
" + ."

\n" + ."" + ."\n" + ."" + ."\n" + ."\n" + ."
Username:
Password:" + ."

\n"); + + html_footer(); +} + + +// +// End of "$Id: login.php,v 1.1 2004/05/17 20:28:52 mike Exp $". +// +?> diff --git a/www/phplib/auth.php b/www/phplib/auth.php new file mode 100644 index 0000000..af4c0bd --- /dev/null +++ b/www/phplib/auth.php @@ -0,0 +1,124 @@ + diff --git a/www/phplib/common.php b/www/phplib/common.php index dfc38be..e1b75e1 100644 --- a/www/phplib/common.php +++ b/www/phplib/common.php @@ -1,6 +1,6 @@ ' : + if ($inelement) + $inelement = 0; + else + { + $newtext .= ">"; + $len ++; + } + break; + + case '&' : + $len ++; + + while ($i < $textlen) + { + $newtext .= $text[$i]; + + if ($text[$i] == ';') + break; + + $i ++; + } + break; + + default : + if (!$inelement) + { + $newtext .= $text[$i]; + $len ++; + } + break; + } + + if ($i < $textlen) + return ($newtext . "..."); + else + return ($newtext); +} + + // // 'quote_text()' - Quote a string... // @@ -230,6 +290,6 @@ sanitize_text($text) // I - Original text // -// End of "$Id: common.php,v 1.1 2004/05/17 03:23:06 mike Exp $". +// End of "$Id: common.php,v 1.2 2004/05/17 20:28:52 mike Exp $". // ?> diff --git a/www/phplib/db.php b/www/phplib/db.php index 23425b8..384fb09 100644 --- a/www/phplib/db.php +++ b/www/phplib/db.php @@ -1,6 +1,6 @@ Database error $sqlerr

\n"); - print("

Please report the problem to " - ."webmaster@easysw.com.

\n"); + print("

Please report the problem to " + ."$DB_ADMIN.

\n"); exit(1); } @@ -207,6 +159,6 @@ db_seek($result, // I - Result of query // -// End of "$Id: db.php,v 1.2 2004/05/17 03:23:06 mike Exp $". +// End of "$Id: db.php,v 1.3 2004/05/17 20:28:52 mike Exp $". // ?> diff --git a/www/phplib/html.php b/www/phplib/html.php index e97752a..0efe2f5 100644 --- a/www/phplib/html.php +++ b/www/phplib/html.php @@ -1,6 +1,6 @@ \n"); @@ -89,20 +101,35 @@ html_header($title = "") // I - Additional document title ."\n"); // Standard navigation stuff... - print("

\n" - ."" - .""); + if ($classname == "") + $classname = "data$html_row"; + + print(""); } diff --git a/www/software.php b/www/software.php new file mode 100644 index 0000000..9a1a3ec --- /dev/null +++ b/www/software.php @@ -0,0 +1,20 @@ + diff --git a/www/str.php b/www/str.php index b281109..38e5fa5 100644 --- a/www/str.php +++ b/www/str.php @@ -3,10 +3,11 @@ // Standard stuff... include_once "phplib/html.php"; include_once "phplib/common.php"; -include_once "phplib/db.php"; // STR constants... -$STR_PAGE_MAX = 10; // Max STRs per page +$STR_PROJECT = "Mini-XML"; // Title of project +$STR_EMAIL = "mxml@easysw.com"; // Default notification address +$STR_PAGE_MAX = 10; // Max STRs per page $STR_STATUS_RESOLVED = 1; $STR_STATUS_UNRESOLVED = 2; @@ -99,7 +100,7 @@ $priority_long = array( ); $scope_text = array( - 1 => "M/P", + 1 => "M", 2 => "OS", 3 => "ALL" ); @@ -110,32 +111,21 @@ $scope_long = array( 3 => "3 - Applies to all machines and operating systems" ); -// Global web vars... -global $_COOKIE, $_FILES, $_POST, $_SERVER; -$argc = $_SERVER["argc"]; -$argv = $_SERVER["argv"]; -$PHP_SELF = $_SERVER["PHP_SELF"]; -$REMOTE_USER = $_SERVER["PHP_AUTH_USER"]; -$REQUEST_METHOD = $_SERVER["REQUEST_METHOD"]; -$SERVER_NAME = $_SERVER["SERVER_NAME"]; +// +// 'notify_creator()' - Notify creator of an STR of changes... +// -// Function to abbreviate long strings... -function abbreviate($text, $maxlen = 32) -{ - if (strlen($text) > $maxlen) - return (substr($text, 0, $maxlen) . "..."); - else - return ($text); -} - - -// Function to notify creator of an STR of changes... -function notify_creator($id, $what = "updated", $contents = "") +function +notify_creator($id, // I - STR # + $what = "updated", // I - Reason for notification + $contents = "") // I - Notification message { global $priority_long; global $scope_long; global $status_long; + global $PHP_SELF, $STR_EMAIL, $STR_PROJECT; + $result = db_query("SELECT * FROM str WHERE id = $id"); if ($result) @@ -158,12 +148,12 @@ function notify_creator($id, $what = "updated", $contents = "") if ($row['create_email'] != $row['modify_email'] && $row['create_email'] != $manager) - mail($row['create_email'], "Mini-XML STR #$id $what", + mail($row['create_email'], "$STR_PROJECT STR #$id $what", "Your software trouble report #$id has been $what. You can check\n" ."the status of the report and add additional comments and/or files\n" ."at the following URL:\n" ."\n" - ." http://www.easysw.com/str.php?L$id\n" + ." $PHP_SELF?L$id\n" ."\n" ." Summary: $row[summary]\n" ." Version: $row[str_version]\n" @@ -174,7 +164,7 @@ function notify_creator($id, $what = "updated", $contents = "") ."Fix Version: $fix_version\n" ."\n$contents" ."________________________________________________________________\n" - ."Thank you for using the Mini-XML Software Trouble Report page!", + ."Thank you for using the $STR_PROJECT Software Trouble Report page!", "From: noreply@easysw.com\r\n"); $ccresult = db_query("SELECT email FROM strcc WHERE str_id = $id"); @@ -182,12 +172,12 @@ function notify_creator($id, $what = "updated", $contents = "") { while ($ccrow = db_next($ccresult)) { - mail($ccrow->email, "Mini-XML STR #$id $what", + mail($ccrow->email, "$STR_PROJECT STR #$id $what", "Software trouble report #$id has been $what. You can check\n" ."the status of the report and add additional comments and/or files\n" ."at the following URL:\n" ."\n" - ." http://www.easysw.com/str.php?L$id\n" + ." $PHP_SELF?L$id\n" ."\n" ." Summary: $row[summary]\n" ." Version: $row[str_version]\n" @@ -198,7 +188,7 @@ function notify_creator($id, $what = "updated", $contents = "") ."Fix Version: $fix_version\n" ."\n$contents" ."________________________________________________________________\n" - ."Thank you for using the Mini-XML Software Trouble Report page!", + ."Thank you for using the $STR_PROJECT Software Trouble Report page!", "From: noreply@easysw.com\r\n"); } @@ -208,15 +198,15 @@ function notify_creator($id, $what = "updated", $contents = "") if ($row['manager_email'] != "") $manager = $row['manager_email']; else - $manager = "mxml"; + $manager = "$STR_EMAIL"; if ($row['modify_email'] != $manager) - mail($manager, "Mini-XML STR #$id $what", + mail($manager, "$STR_PROJECT STR #$id $what", "The software trouble report #$id assigned to you has been $what.\n" ."You can manage the report and add additional comments and/or files\n" ."at the following URL:\n" ."\n" - ." http://www.easysw.com/private/str.php?L$id\n" + ." $PHP_SELF?L$id\n" ."\n" ." Summary: $row[summary]\n" ." Version: $row[str_version]\n" @@ -277,7 +267,7 @@ if ($argc) exit(); } - if (($op == 'M' || $op == 'B') && !$REMOTE_USER) + if (($op == 'M' || $op == 'B') && !$LOGIN_USER) { html_header("STR Error"); print("

The '$op' command is not available to you!

\n"); @@ -390,7 +380,7 @@ switch ($op) { $time = time(); $manager_email = db_escape($_POST["MANAGER_EMAIL"]); - $modify_email = db_escape($managers[$REMOTE_USER]); + $modify_email = db_escape($managers[$LOGIN_USER]); $message = $_POST["MESSAGE"]; if ($message != "") @@ -413,6 +403,8 @@ switch ($op) if ($manager_email != "") $query .= ", manager_email = '$manager_email'"; + db_query("BEGIN TRANSACTION"); + reset($_POST); while (list($key, $val) = each($_POST)) if (substr($key, 0, 3) == "ID_") @@ -423,12 +415,14 @@ switch ($op) if ($contents != "") { - db_query("INSERT INTO strtext VALUES(NULL,$id,1,$time," - ."'$modify_email','$contents')"); + db_query("INSERT INTO strtext VALUES(NULL,$id,1,'$contents'," + ."$time,'$modify_email')"); notify_creator($id, "updated", $mailmsg); } } + + db_query("COMMIT TRANSACTION"); } header("Location: $PHP_SELF?L$options"); @@ -449,17 +443,19 @@ switch ($op) $row = db_next($result); - print("

" - ."[ Return to STR List"); + html_start_links(1); + html_link("Return to STR List", "$PHP_SELF?L$options"); if ($row['status'] >= $STR_STATUS_ACTIVE) - print(" | Post Text" - ." | Post File"); + { + html_link("Post Text", "$PHP_SELF?T$id$options"); + html_link("Post File", "$PHP_SELF?F$id$options"); + } - if ($REMOTE_USER) - print(" | Modify STR"); + if ($LOGIN_USER) + html_link("Modify STR", "$PHP_SELF?M$id$options"); - print(" ]


\n"); + html_end_links(); $create_email = sanitize_email($row['create_email']); $manager_email = sanitize_email($row['manager_email']); @@ -502,8 +498,8 @@ switch ($op) print("\n"); print("\n"); - if ($REMOTE_USER) - $email = htmlspecialchars($managers[$REMOTE_USER]); + if ($LOGIN_USER) + $email = htmlspecialchars($managers[$LOGIN_USER]); else if (array_key_exists("FROM", $_COOKIE)) $email = htmlspecialchars($_COOKIE["FROM"]); else @@ -521,10 +517,13 @@ switch ($op) db_free($result); - print("

Trouble Report Files:"); + print("


Trouble Report Files:

\n"); if ($row['status'] >= $STR_STATUS_ACTIVE) - print(" [ Post File ]"); - print("

\n"); + { + html_start_links(); + html_link("Post File", "$PHP_SELF?F$id$options"); + html_end_links(); + } $result = db_query("SELECT * FROM strfile WHERE " ."str_id = $id AND is_published = 1"); @@ -533,12 +532,8 @@ switch ($op) print("

No files

\n"); else { - print("

Mini-XML " - ."[ Home | " + print("

\n" + ."" + ."" + ."" + ."Support ]" + ."" + ."" ."\n"); - print("" - ."" + ."\n"); print("" - ."" + ."" + ."any later version.
 " + ."" ."\n"); print("
" + ."[ Home | " ."Documentation | " ."Download | " ."FAQ | " - ."Support ][ "); + + + if ($LOGIN_USER) + print("$LOGIN_USER"); + else + print("Login"); + + print(" ]
\n"); + print("
" + ."\n"); + print("
"); } @@ -113,14 +140,19 @@ html_header($title = "") // I - Additional document title function html_footer() { - print("
Copyright 2003-2004 by Michael Sweet. This library is free " + ."
" + ."Copyright 2003-2004 by Michael Sweet. This library is free " ."software; you can redistribute it and/or modify it " ."under the terms of the GNU Library General Public " ."License as published by the Free Software Foundation; " ."either version 2 of the License, or (at your option) " - ."any later version.

\n"); print("\n" @@ -140,7 +172,9 @@ html_start_links($center = 0) // I - 1 for centered, 0 for in-line $html_firstlink = 1; if ($center) - print("

"); + print("

[ "); + else + print("

[ "); } @@ -149,10 +183,9 @@ html_start_links($center = 0) // I - 1 for centered, 0 for in-line // function -html_end_links($center = 0) // I - 1 for centered, 0 for in-line +html_end_links() { - if ($center) - print("

\n"); + print(" ]

\n"); } @@ -182,48 +215,11 @@ html_link($text, // I - Text for hyperlink // function -html_links($links, // I - Associated array of hyperlinks - $path = "") // I - Relative path to add to root +html_links($links) // I - Associated array of hyperlinks { reset($links); while (list($key, $val) = each($links)) - html_link($key, $path . $val); -} - - -// -// 'html_start_box()' - Start a rounded, shaded box. -// - -function -html_start_box($title = "", // I - Title for box - $path = "") // I - Relative path to root -{ - print("

" - ."" - ."" - ."\n" - ."" - ."" - ."\n" - ."
" - ."$title
" - .""); -} - - -// -// 'html_end_box()' - End a rounded, shaded box. -// - -function -html_end_box($path = "") // I - Relative path to root -{ - print("

\n"); + html_link($key, $val); } @@ -232,17 +228,16 @@ html_end_box($path = "") // I - Relative path to root // function -html_start_table($headings, // I - Array of heading strings - $path = "") // I - Relative path to root +html_start_table($headings) // I - Array of heading strings { global $html_row, $html_cols; print("

" .""); - $add_html_cols; // Add to html_cols after display if colspan is used. + $add_html_cols = 0; // Add to html_cols after display if colspan is used. $html_row = 0; $html_cols = sizeof($headings); @@ -280,35 +275,38 @@ html_start_table($headings, // I - Array of heading strings $align = $data[1]; $s_align = "align=$align"; } + if ($data[2] > 0) { $colspan = $data[2]; $s_colspan = "colspan=$colspan"; if ($colspan > 1) - $add_html_cols += ($colspan-1); + $add_html_cols += ($colspan - 1); } + if ($data[3] > 0) { $width = $data[3]; $s_width = "width=$width%"; } } - else $s_header = $headings[$i]; + else + $s_header = $headings[$i]; if (strlen($s_header)) { - print(""); + print(""); } else { print(""); } } + $html_cols += $add_html_cols; print("\n"); } @@ -318,15 +316,15 @@ html_start_table($headings, // I - Array of heading strings // function -html_end_table($path = "") // I - Relative path to root +html_end_table() { global $html_cols; print("" ."" - ."\n" ."
" - ."" - ."$s_header$s_header " - ."
" - ." 

\n"); } @@ -337,11 +335,14 @@ html_end_table($path = "") // I - Relative path to root // function -html_start_row() +html_start_row($classname = "") // I - HTML class to use { global $html_row; - print("
 
 
Assigned To:$manager_email
Fix Version:$fix_version
\n" - ."" - ."\n"); + html_start_table(array("Name/Time/Date", "Filename")); - $line = 0; while ($row = db_next($result)) { $date = date("M d, Y", $row['date']); @@ -546,23 +541,25 @@ switch ($op) $email = sanitize_email($row['email']); $filename = htmlspecialchars($row['filename']); - print("" - ."" + html_start_row(); + print("" ."" - ."\n"); - - $line = 1 - $line; + ."$filename"); + html_end_row(); } - print("
Name/Time/DateFilename
$email
$time $date
$email
$time $date
" - ."$filename

\n"); + + html_end_table(); } db_free($result); - print("

Trouble Report Dialog:"); + print("


Trouble Report Dialog:

\n"); if ($row['status'] >= $STR_STATUS_ACTIVE) - print(" [ Post Text ]"); - print("

\n"); + { + html_start_links(); + html_link("Post Text", "$PHP_SELF?T$id$options"); + html_end_links(); + } $result = db_query("SELECT * FROM strtext WHERE " ."str_id = $id AND is_published = 1"); @@ -571,12 +568,7 @@ switch ($op) print("

No text

\n"); else { - print("

\n" - ."" - ."\n"); - - $line = 0; + html_start_table(array("Name/Time/Date", "Text")); while ($row = db_next($result)) { @@ -585,14 +577,13 @@ switch ($op) $email = sanitize_email($row['email']); $contents = quote_text($row['contents']); - print("" - ."" - ."" - ."\n"); - - $line = 1 - $line; + html_start_row(); + print("" + .""); + html_end_row(); } - print("
Name/Time/DateText
$email
$time $date
$contents
$email
$time $date
$contents

\n"); + + html_end_table(); } db_free($result); @@ -601,8 +592,9 @@ switch ($op) { html_header("STR List"); - print("

[ Post " - ."New Software Trouble Report ]

\n"); + html_start_links(1); + html_link("Post New Software Trouble Report", "$PHP_SELF?N$options'"); + html_end_links(); print("

" ."Search Words:  " @@ -649,7 +641,7 @@ switch ($op) } print("\n"); - if ($REMOTE_USER || array_key_exists("FROM", $_COOKIE)) + if ($LOGIN_USER || array_key_exists("FROM", $_COOKIE)) { print("Show: "); print("" ."$row[id]" @@ -877,18 +864,17 @@ switch ($op) ."alt='STR #$row[id]: $summary'>$summabbr" ."$row[str_version]" ."$date"); - if ($REMOTE_USER) - { - if ($row['manager_email'] != "") - $email = sanitize_email($row['manager_email']); - else - $email = "Unassigned"; - print("$email"); - } - print("\n"); + if ($row['manager_email'] != "") + $email = sanitize_email($row['manager_email']); + else + $email = "Unassigned"; - if ($REMOTE_USER && $row['status'] >= $STR_STATUS_PENDING) + print("$email"); + + html_end_row(); + + if ($row['status'] >= $STR_STATUS_PENDING) { $textresult = db_query("SELECT * FROM strtext " ."WHERE str_id = $row[id] " @@ -897,30 +883,28 @@ switch ($op) { $textrow = db_next($textresult); - if ($row['is_published']) - print(""); - else - print(""); + html_start_row(); - $email = sanitize_email($textrow->email); - $contents = quote_text(abbreviate($textrow->contents, 128)); + $email = sanitize_email($textrow['email']); + $contents = abbreviate(quote_text($textrow['contents']), 128); print("$email" - ."$contents" - ."\n"); + ."" + ."$contents"); + + html_end_row(); db_free($textresult); } } - - $line = 1 - $line; } db_free($result); - if ($REMOTE_USER) + if ($LOGIN_USER) { - print(""); + html_start_row("header"); + print(""); print("Status: \n"); print(""); - print("\n"); + print("\n"); + html_end_row(); } - else - print("" - ."\n"); + + html_end_table(); if ($count > $STR_PAGE_MAX) { - print(""); + print("

\n"); + + print("\n"); + print("
"); if ($index > 0) - print("[ Previous $STR_PAGE_MAX ]"); - if ($REMOTE_USER) - print(""); - else - print(""); + print("[ Previous $STR_PAGE_MAX ]"); + print(""); if ($end < $count) - print("[ Next $STR_PAGE_MAX ]"); + print("[ Next $STR_PAGE_MAX ]"); print("

\n"); } - print(""); - - if ($REMOTE_USER) + if ($LOGIN_USER) print("
"); print("

" @@ -1003,7 +990,7 @@ switch ($op) $subsystem = db_escape($_POST["SUBSYSTEM"]); $create_email = db_escape($_POST["CREATE_EMAIL"]); $manager_email = db_escape($_POST["MANAGER_EMAIL"]); - $modify_email = db_escape($managers[$REMOTE_USER]); + $modify_email = db_escape($managers[$LOGIN_USER]); $contents = db_escape(trim($_POST["CONTENTS"])); $message = $_POST["MESSAGE"]; @@ -1025,8 +1012,8 @@ switch ($op) if ($contents != "") { - db_query("INSERT INTO strtext VALUES(NULL,$id,1,$time," - ."'$modify_email','$contents')"); + db_query("INSERT INTO strtext VALUES(NULL,$id,1,'$contents'," + ."$time,'$modify_email')"); $contents = trim($_POST["CONTENTS"]) . "\n\n"; } @@ -1034,8 +1021,8 @@ switch ($op) { $contents = db_escape($messages[$message]); - db_query("INSERT INTO strtext VALUES(NULL,$id,1,$time," - ."'$modify_email','$contents')"); + db_query("INSERT INTO strtext VALUES(NULL,$id,1,'$contents'," + ."$time,'$modify_email')"); $contents = $messages[$message] . "\n\n"; } @@ -1067,12 +1054,12 @@ switch ($op) { html_header("STR #$id"); - print("

" - ."[ Return to STR List" - ." | Return to STR #$id" - ." | Post Text" - ." | Post File" - ." ]


\n"); + html_start_links(1); + html_link("Return to STR List", "$PHP_SELF?L$options"); + html_link("Return to STR #$id", "$PHP_SELF?L$id$options"); + html_link("Post Text", "$PHP_SELF?T$id$options"); + html_link("Post File", "$PHP_SELF?F$id$options"); + html_end_links(); $result = db_query("SELECT * FROM str WHERE id = $id"); if (db_count($result) != 1) @@ -1221,7 +1208,7 @@ switch ($op) ."\n"); print("

\n"); - print("

Trouble Report Files: " + print("


Trouble Report Files: " ."[ Post File ]" ."

\n"); @@ -1268,7 +1255,7 @@ switch ($op) db_free($result); - print("

Trouble Report Dialog: " + print("


Trouble Report Dialog: " ."[ Post Text ]" ."

\n"); @@ -1330,8 +1317,8 @@ switch ($op) $email = $_POST["EMAIL"]; setcookie("FROM", "$email", time() + 57600, $PHP_SELF, $SERVER_NAME); } - else if ($REMOTE_USER) - $email = $managers[$REMOTE_USER]; + else if ($LOGIN_USER) + $email = $managers[$LOGIN_USER]; else if (array_key_exists("FROM", $_COOKIE)) $email = $_COOKIE["FROM"]; else @@ -1345,8 +1332,8 @@ switch ($op) } else { - if ($REMOTE_USER) - $email = $managers[$REMOTE_USER]; + if ($LOGIN_USER) + $email = $managers[$LOGIN_USER]; else $email = $_COOKIE["FROM"]; @@ -1362,8 +1349,8 @@ switch ($op) $temail = db_escape($email); $tcontents = db_escape($contents); - db_query("INSERT INTO strtext VALUES(NULL,$id,1,$time,'$temail'," - ."'$tcontents')"); + db_query("INSERT INTO strtext VALUES(NULL,$id,1,'$tcontents'," + ."$time,'$temail')"); db_query("UPDATE str SET modify_date=$time, modify_email='$temail' " ."WHERE id = $id"); @@ -1379,21 +1366,22 @@ switch ($op) { html_header("Post Text For STR #$id"); - print("

[ Return to " - ."STR #$id ]

\n"); + html_start_links(1); + html_link("Return to STR #$id", "$PHP_SELF?L$id$options"); + html_end_links(); if ($REQUEST_METHOD == "POST") { print("

Error: Please fill in the fields marked in " ."bold red below and resubmit " - ."your trouble report.


\n"); + ."your trouble report.


\n"); $hstart = ""; $hend = ""; } else { - print("
\n"); + print("
\n"); $hstart = ""; $hend = ""; @@ -1437,8 +1425,8 @@ switch ($op) $email = $_POST["EMAIL"]; setcookie("FROM", "$email", time() + 57600, $PHP_SELF, $SERVER_NAME); } - else if ($REMOTE_USER) - $email = $managers[$REMOTE_USER]; + else if ($LOGIN_USER) + $email = $managers[$LOGIN_USER]; else if (array_key_exists("FROM", $_COOKIE)) $email = $_COOKIE["FROM"]; else @@ -1461,8 +1449,8 @@ switch ($op) } else { - if ($REMOTE_USER) - $email = $managers[$REMOTE_USER]; + if ($LOGIN_USER) + $email = $managers[$LOGIN_USER]; else $email = $_COOKIE["FROM"]; @@ -1507,8 +1495,8 @@ switch ($op) fclose($infile); fclose($outfile); - db_query("INSERT INTO strfile VALUES(NULL,$id,1,$time,'$temail'," - ."'$tname')"); + db_query("INSERT INTO strfile VALUES(NULL,$id,1,'$tname'," + ."$time,'$temail')"); db_query("UPDATE str SET modify_date=$time, modify_email='$temail' " ."WHERE id = $id"); @@ -1524,21 +1512,22 @@ switch ($op) { html_header("Post File For STR #$id"); - print("

[ Return to " - ."STR #$id ]

\n"); + html_start_links(1); + html_link("Return to STR #$id", "$PHP_SELF?L$id$options"); + html_end_links(); if ($REQUEST_METHOD == "POST") { print("

Error: Please fill in the fields marked in " ."bold red below and resubmit " - ."your trouble report.


\n"); + ."your trouble report.


\n"); $hstart = ""; $hend = ""; } else { - print("
\n"); + print("
\n"); $hstart = ""; $hend = ""; @@ -1590,10 +1579,8 @@ switch ($op) if (array_key_exists("EMAIL", $_POST)) { $email = $_POST["EMAIL"]; - setcookie("FROM", "$email", time() + 57600, $PHP_SELF, $SERVER_NAME); + setcookie("FROM", "$email", time() + 90 * 86400, "/"); } - else if ($REMOTE_USER) - $email = $managers[$REMOTE_USER]; else if (array_key_exists("FROM", $_COOKIE)) $email = $_COOKIE["FROM"]; else @@ -1614,10 +1601,10 @@ switch ($op) } else { - if ($REMOTE_USER) - $email = $managers[$REMOTE_USER]; + if (array_key_exists("FROM", $_COOKIE)) + $email = $_COOKIE["FROM"]; else - $email = $_COOKIE["FROM"]; + $email = ""; $npriority = 0; $nscope = 0; @@ -1644,8 +1631,8 @@ switch ($op) $id = db_insert_id(); - db_query("INSERT INTO strtext VALUES(NULL,$id,1,$time,'$temail'," - ."'$tcontents')"); + db_query("INSERT INTO strtext VALUES(NULL,$id,1,'$tcontents'," + ."$time,'$temail')"); if ($filename != "") { @@ -1680,8 +1667,8 @@ switch ($op) fclose($infile); fclose($outfile); - db_query("INSERT INTO strfile VALUES(NULL,$id,1,$time,'$temail'," - ."'$tname')"); + db_query("INSERT INTO strfile VALUES(NULL,$id,1,'$tname'," + ."$time,'$temail')"); } header("Location: $PHP_SELF?L$id$options"); @@ -1691,14 +1678,15 @@ switch ($op) { html_header("New STR"); - print("

[ Return to " - ."STR List ]

\n"); + html_start_links(1); + html_link("Return to STR List", "$PHP_SELF?L$options"); + html_end_links(); if ($REQUEST_METHOD == "POST") { print("

Error: Please fill in the fields marked in " ."bold red below and resubmit " - ."your trouble report.


\n"); + ."your trouble report.


\n"); $hstart = ""; $hend = ""; @@ -1706,11 +1694,11 @@ switch ($op) else { print("

Please use this form to report all bugs and request " - ."features in the Mini-XML software. Be sure to include " + ."features in the $STR_PROJECT software. Be sure to include " ."the operating system, compiler, sample programs and/or " ."files, and any other information you can about your " - ."problem. Thank you for helping us to make Mini-XML " - ."a better library!


\n"); + ."problem. Thank you for helping us to improve " + ."$STR_PROJECT!


\n"); $hstart = ""; $hend = ""; @@ -1852,7 +1840,8 @@ switch ($op) setcookie("FROM", "$email", time() + 57600, $PHP_SELF, $SERVER_NAME); - $result = db_query("SELECT * FROM strcc WHERE str_id = $id AND email = '$email'"); + $result = db_query("SELECT * FROM carboncopy WHERE " + ."url = 'str.php?L$id' AND email = '$email'"); html_header("STR #$id Notifications"); @@ -1863,7 +1852,7 @@ switch ($op) ."notification list for STR #$id!

\n"); else { - db_query("INSERT INTO strcc VALUES(NULL,$id,'$email')"); + db_query("INSERT INTO carboncopy VALUES(NULL,'str.php?L$id','$email')"); print("

Your email address has been added to the notification list " ."for STR #$id.

\n"); @@ -1871,7 +1860,8 @@ switch ($op) } else if ($result && db_count($result) > 0) { - db_query("DELETE FROM strcc WHERE str_id = $id AND email = '$email'"); + db_query("DELETE FROM carboncopy WHERE " + ."url = 'str.php?L$id' AND email = '$email'"); print("

Your email address has been removed from the notification list " ."for STR #$id.

\n"); @@ -1885,7 +1875,9 @@ switch ($op) if ($result) db_free($result); - print("

[ Return to STR #$id ]

\n"); + html_start_links(); + html_link("Return to STR #$id", "$PHP_SELF?L$id$options"); + html_end_links(); html_footer(); break; diff --git a/www/style.css b/www/style.css index 94eaea1..d32fd06 100644 --- a/www/style.css +++ b/www/style.css @@ -10,6 +10,10 @@ P, TD, TH { font-family: serif; } +P.center { + text-align: center; +} + H1, H2, H3, H4, H5, H6 { color: #000000; font-family: sans-serif; @@ -39,6 +43,10 @@ TR.header, TR.header TH, TH.header { background-color: #cccccc; } +TR.page { + background-color: #f8f8f8; +} + TR.data0, TD.data0 { background-color: #eeeeee; }