From 8c31377933232ca4cf4495dde1537e2ccc19231d Mon Sep 17 00:00:00 2001
From: Michael R Sweet Article #$id does not exist!\n");
+ html_footer();
+ exit();
+ }
+
+ $row = db_next($result);
+
+ if ($row['create_user'] != $LOGIN_USER &&
+ $row['create_user'] != $LOGIN_EMAIL)
+ {
+ db_free($result);
+
+ html_header("Article Error");
+ print(" You don't have permission to use command '$op'!\n");
+ html_footer();
+ exit();
+ }
+
+ db_free($result);
+ }
+
if ($op == 'N' && $id)
{
html_header("Article Error");
@@ -183,7 +244,7 @@ switch ($op)
." This Article is currently hidden from "
- ."public view. This article is currently hidden from "
+ ."public view. $date $date by $create_user\n");
if (!$row['is_published'])
- print("
This Article is "
+ print(" \n");
$temp = htmlspecialchars($row["title"]);
@@ -215,17 +276,22 @@ switch ($op)
exit();
}
- $row = db_next($result);
- $title = htmlspecialchars($row['title']);
- $contents = format_text($row['contents']);
- $date = date("H:i M d, Y", $row['modify_date']);
+ $row = db_next($result);
+ $title = htmlspecialchars($row['title']);
+ $abstract = htmlspecialchars($row['abstract']);
+ $contents = format_text($row['contents']);
+ $create_user = sanitize_email($row['create_user']);
+ $date = date("H:i M d, Y", $row['modify_date']);
html_header("Article #$id: $title");
html_start_links(1);
html_link("Return to Articles", "$PHP_SELF?L$options");
html_link("Show Comments", "#_USER_COMMENTS");
- if ($LOGIN_LEVEL >= AUTH_DEVEL)
+ html_link("Submit Comment", "comment.php?r0+particles.php_L$id");
+
+ if ($LOGIN_LEVEL >= AUTH_DEVEL ||
+ $row['create_user'] == $LOGIN_USER)
{
html_link("Modify Article", "$PHP_SELF?M$id$options");
html_link("Delete Article", "$PHP_SELF?D$id$options");
@@ -233,21 +299,23 @@ switch ($op)
html_end_links();
if (!$row['is_published'])
- print("This article is "
."currently hidden from public view. Article #$id: $title
\n"
- ."
$abstract
\n"
+ ."$contents\n"
+ ."
\n"
+ ."Comments
\n");
- db_free($result);
-
- print("
\n"
- ."Comments "
- ."[ "
- ."Add Comment ]
\n");
+ html_start_links();
+ html_link("Submit Comment", "comment.php?r0+particles.php_L$id");
+ html_end_links();
show_comments("articles.php_L$id");
+
+ db_free($result);
}
else
{
@@ -271,7 +339,8 @@ switch ($op)
if ($LOGIN_LEVEL < AUTH_DEVEL)
{
- $query .= "${prefix}is_published = 1";
+ $query .= "${prefix}(is_published = 1 OR create_user = '"
+ . db_escape($LOGIN_USER) . "')";
$prefix = " AND ";
}
@@ -451,6 +520,9 @@ switch ($op)
print("\n");
print("
= hidden from public view
\n"); } html_footer(); @@ -459,7 +531,9 @@ switch ($op) case 'M' : // Modify Article if ($REQUEST_METHOD == "POST") { - if (array_key_exists("IS_PUBLISHED", $_POST)) + if ($LOGIN_LEVEL < AUTH_DEVEL) + $is_published = 0; + else if (array_key_exists("IS_PUBLISHED", $_POST)) $is_published = (int)$_POST["IS_PUBLISHED"]; else $is_published = 0; @@ -523,6 +597,9 @@ switch ($op) ."modify_user = '$LOGIN_USER' " ."WHERE id = $id"); + if (!$is_published) + notify_users($id, "modified"); + header("Location: $PHP_SELF?L$id$options"); } else @@ -536,31 +613,69 @@ switch ($op) print("Error: Please fill in the fields marked in " + ."bold red below and resubmit " + ."your article.
Please use this form to post announcements, how-to's, " - ."examples, and case studies showing how you use $PROJECT. " + ."examples, and case studies showing how you use $PROJECT_NAME. " ."We will proofread your article, and if we determine it is " ."appropriate for the site, we will make the article public " - ."on the site. Thank you for supporting $PROJECT!
\n" + ."on the site. Thank you for supporting $PROJECT_NAME!\n" ."$date, $count
$abstract [ "
+ ."
$date by $create_user, $count
$abstract [ "
."Read ]
" ."MACH = Machine, " ."OS = Operating System, " - ."STR = Software Trouble Report" - ."
\n"); + ."STR = Software Trouble Report, " + ." = hidden from public view\n"); } html_footer(); @@ -1553,7 +1556,9 @@ switch ($op) $version = $_POST["VERSION"]; $contents = $_POST["CONTENTS"]; - if (array_key_exists("EMAIL", $_POST)) + if ($LOGIN_USER != "" && $LOGIN_LEVEL < AUTH_DEVEL) + $email = $LOGIN_USER; + else if (array_key_exists("EMAIL", $_POST)) { $email = $_POST["EMAIL"]; setcookie("FROM", "$email", time() + 90 * 86400, "/"); @@ -1578,7 +1583,9 @@ switch ($op) } else { - if (array_key_exists("FROM", $_COOKIE)) + if ($LOGIN_USER != "") + $email = $LOGIN_USER; + else if (array_key_exists("FROM", $_COOKIE)) $email = $_COOKIE["FROM"]; else $email = ""; @@ -1673,11 +1680,11 @@ switch ($op) else { print("Please use this form to report all bugs and request " - ."features in the $PROJECT software. Be sure to include " + ."features in the $PROJECT_NAME 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 improve " - ."$PROJECT!