diff --git a/contact.php b/contact.php
index 61bbd45..354ecab 100644
--- a/contact.php
+++ b/contact.php
@@ -13,7 +13,7 @@
// Preamble
$pageName = "Contact Us";
- $focused = "none"; // Dock icon name to gets a border
+
require "parts/preamble.php"; // Load most of document
?>
diff --git a/cur_news.php b/cur_news.php
deleted file mode 100644
index 61b87b3..0000000
--- a/cur_news.php
+++ /dev/null
@@ -1,27 +0,0 @@
-
- need('date sql');
-
- $conn = @mysql_pconnect (sqlHost, sqlUser, sqlPass);
- if ($conn) {
- $query = 'SELECT n_date, n_user, n_news FROM news_main' .
- ' ORDER BY n_date DESC';
- $result = @mysql_db_query (sqlDB, $query, $conn);
- if ($result) {
- $numRows = @mysql_num_rows ($result);
- if ($numRows) {
- if($numRows > 5) $numRows = 5;
- for ($i = 0 ; $i < $numRows ; $i++) {
- list ($n_date, $n_user, $n_news) = mysql_fetch_row ($result);
- newsItem (dateFromSQLDateTime ($n_date), $n_user, StripSlashes($n_news));
- }
- } else {
- newsItem ('now', 'Web Server', '
No current news!');
- }
- } else {
- newsItem ('now', 'Web Server', '
No news in database!');
- }
- mysql_close ($conn);
- } else {
- newsItem ('Now', 'Web Server', '
Error: Could not connect to SQL server to fetch news. Please notify the server administrator.');
- }
-?>
diff --git a/cmd.php b/doc_cmds.php
similarity index 100%
rename from cmd.php
rename to doc_cmds.php
diff --git a/cvar.php b/doc_cvars.php
similarity index 100%
rename from cvar.php
rename to doc_cvars.php
diff --git a/documentation.php b/documentation.php
index 5d29459..0f0833b 100644
--- a/documentation.php
+++ b/documentation.php
@@ -21,7 +21,7 @@
while (list (, $cdl) = each ($list)) {
if (is_file ('doc/' . $cdl . '-' . $type . '.txt')) {
echo '
';
- echo '' . $cdl . '';
echo '';
}
@@ -53,10 +53,10 @@
- doc_list ("Cvar Documentation", $list, "cvar"); ?>
+ doc_list ("Cvar Documentation", $list, "cvars"); ?>
|
- doc_list ("Command Documentation", $list, "cmd"); ?>
+ doc_list ("Command Documentation", $list, "cmds"); ?>
|
diff --git a/index.php b/index.php
index 699372f..0a190df 100644
--- a/index.php
+++ b/index.php
@@ -11,7 +11,7 @@
?>
-
+
require "parts/postamble.php"; // Finish this sucker up
?>
diff --git a/lib/auth.php b/lib/auth.php
index 13ecbde..95756e9 100644
--- a/lib/auth.php
+++ b/lib/auth.php
@@ -24,19 +24,8 @@
59 Temple Place - Suite 330
Boston, MA 02111-1307, USA.
*/
- have ('auth');
- need ('table');
- if (!defined ('_SQLCONSTS_')) {
- define ('_SQLCONSTS_', 1);
- require siteHome . '/../etc/sql.conf';
- }
-
- global $userInfo;
- global $authRealm;
- global $REMOTE_USER;
-
-/* SQL definition for member list table
+/* // SQL definition for member list table
CREATE TABLE members (
u_key INT NOT NULL auto_increment PRIMARY KEY,
u_admin CHAR DEFAULT 'N' NOT NULL,
@@ -53,22 +42,60 @@ CREATE TABLE members (
);
*/
+ have ('auth');
+ need ('table');
+
+ if (!defined ('_SQLCONSTS_')) {
+ define ('_SQLCONSTS_', 1);
+ require siteHome . '/../etc/sql.conf';
+ }
+
+ if (!defined ('authSplitChar')) {
+ define ('authSplitChar', '%');
+ }
+
+ global $userInfo;
+ global $authRealm;
+ global $REMOTE_USER;
+
+ if (!$authRealm) {
+ $authRealm = "Member Access";
+ }
+
/*
authProcess
- Authenticate user against SQL database
+ Authenticate user against SQL database.
+
+ If $split is nonzero, the provided password string is
+ split using the value of the authSplitChar definition
+ and the process will fail if no right-hand side
+ component is present. If there IS a right-hand side
+ component, sqlRWPass is defined.
*/
- function authProcess ($userName, $password)
+ function authProcess ($user, $password, $split)
{
+ if ($split) {
+ $pos = strrpos ($password, authSplitChar);
+ if ($pos !== FALSE) { // user gave an SQL read-write pass
+ $sqlRWPass = substr ($password, $pos + 1);
+ $password = substr ($password, 0, $pos);
+
+ /* We now have a read-write password, so set sqlRWPass */
+ define ('sqlRWPass', $sqlRWPass);
+ } else {
+ return FALSE;
+ }
+ }
$query = "SELECT u_password, 1 AS auth FROM members" .
- " WHERE u_username='$userName'" .
- " AND u_password=ENCRYPT('$password','$userName')";
+ " WHERE u_username='$user'" .
+ " AND u_password=ENCRYPT('$password','$user')";
$result = @mysql_fetch_array (@mysql_db_query (sqlDB, $query));
if ($result[auth]) {
- return 1;
+ return TRUE;
} else {
- return 0;
+ return FALSE;
}
}
@@ -85,10 +112,6 @@ CREATE TABLE members (
}
// Initialization
- if (!$authRealm) {
- $authRealm = "Secure Area";
- }
-
if (!isset ($_SERVER['PHP_AUTH_USER'])) {
authBasicChallenge ($authRealm, "Login required.");
} else {
@@ -99,7 +122,7 @@ CREATE TABLE members (
$db = @mysql_connect (sqlHost, sqlUser, sqlPass);
if ($userName && $password) {
- if (authProcess ($userName, $password) == 0) {
+ if (!authProcess ($userName, $password, TRUE)) {
authBasicChallenge ($authRealm, "Login incorrect.");
}
} else {
diff --git a/list_subscribe.php b/list_subscribe.php
index 94cc5e9..095de99 100644
--- a/list_subscribe.php
+++ b/list_subscribe.php
@@ -1,7 +1,5 @@
// Preamble
$pageName = "Mailing Lists";
- $focused = "none"; // Dock icon name to get a border
- $currPage = "none";
require "parts/preamble.php"; // Load most of document
if (!$list) {
@@ -11,7 +9,6 @@
} else {
$list = strToLower ($list);
}
-
?>
+
+ }
+
+ need ('sql');
+
+ global $newsID;
+ global $newsUser;
+ global $newsItem;
+
+ $newsID = $_GET['newsID'];
+ $newsItem = $_POST['newsItem'];
+ $newsUser = $_POST['newsUser'];
+
+ if ($conn = mysql_pconnect (sqlHost, sqlRWUser, sqlRWPass)) {
+ if ($newsID) {
+ if ($newsUser && $newsItem) {
+ $newsItem = AddSlashes ($newsItem);
+ $query = "UPDATE news_main SET n_user='$newsUser', n_news='$newsItem' WHERE n_id='$newsID'";
+ if ($result = mysql_db_query (sqlDB, $query, $conn)) {
+ if ($numRows = mysql_affected_rows ($conn)) {
+ echo 'Your modifications have been processed successfully.';
+ } else {
+ echo '
Your modifications were correctly formed, but had no effect on the database.';
+ }
+ } else {
+ echo "
There was an error in your input. If you don't know what it is, I'm not going to tell you.";
+ }
+ } else {
+ $query = "SELECT n_id, n_date, n_user, n_news FROM news_main "
+ . "WHERE n_id=$newsID";
+ $result = mysql_db_query (sqlDB, $query, $conn);
+ if ($result) {
+ $numRows = mysql_num_rows ($result);
+ if ($numRows == 1) {
+ $news = mysql_fetch_array ($result);
+ newsEntryEditor ($news);
+ } else {
+ echo "
MOOOOO! Rows = $numRows";
+ }
+ } else {
+ echo "
MOOOOO! No result.";
+ }
+ }
+ } else {?>
+
+
Edit News
+
+
+ $query = 'SELECT n_id, n_date, n_user, n_news FROM news_main' .
+ ' ORDER BY n_date DESC';
+ if ($result = mysql_db_query (sqlDB, $query, $conn)) {
+ if ($numRows = mysql_num_rows ($result)) {?>
+
+ ID |
+ Date |
+ User |
+ Text |
+
+
+ for ($i = 0; $i < $numRows; $i++) {
+ $news[$i] = mysql_fetch_array ($result);
+ echo newsEntrySummary ($news[$i]);
+ }
+ } else {
+ }
+ } else {
+ }
+
+ tableFooter ();
+ ?>
+
+
+ }
+ } else {
+ echo 'You suck, butthead.';
+ }
+?>
+
+ require siteHome . "/parts/postamble.php"; // Finish this sucker up
+?>
diff --git a/pages.txt b/pages.txt
new file mode 100644
index 0000000..baa1cb0
--- /dev/null
+++ b/pages.txt
@@ -0,0 +1,16 @@
+about About The Project
+bugs Bug Tracking System
+cvs Version Control System
+devtools Developer Tools
+docs Documentation
+files Downloads
+home Home Page
+lists Mailing Lists
+news News Archives
+patches Patch Manager
+plans Developer Plans
+progress Progress Report
+shots Screenshots
+support Support Manager
+surveys Surveys
+tasks Task Manager
diff --git a/sponsor_incl.html b/partners.inc
similarity index 100%
rename from sponsor_incl.html
rename to partners.inc
diff --git a/parts/library.php b/parts/library.php
index 50e639d..c6472f9 100644
--- a/parts/library.php
+++ b/parts/library.php
@@ -2,10 +2,13 @@
// helpful constants
if (!defined( '_COLORS_' )) {
define ('_COLORS_', 1);
- define ('black', "black");
- define ('white', "white");
+ define ('black', "black");
+ define ('white', "white");
- define ('thisURL', $_SERVER['SCRIPT_NAME']);
+ define ('thisURL', $_SERVER['SCRIPT_NAME']);
+
+ if (!$currPage)
+ $currPage = 'none';
if (!$theme && date ('m') == 12)
$theme = "christmas";
@@ -16,30 +19,18 @@
switch ($theme) {
case "christmas":
define ('bgColor', black);
- define ('textColor', white);
- define ('linkColor', '#aaffaa');
- define ('activeLinkColor', white);
- define ('visitedLinkColor', '#80ff80');
define ('tableHeadColor', '#7f000c');
define ('tableBgColor', black);
- define ('menuHeadColor', '#7f000c');
- define ('menuBgColor', '#084508');
- define ('featureHeadColor', tableHeadColor);
+ define ('featureHeadColor', '#7f000c');
define ('featureBgColor', '#083008');
break;
default:
define ('bgColor', black);
- define ('textColor', white);
- define ('linkColor', '#aaaaff');
- define ('activeLinkColor', white);
- define ('visitedLinkColor', '#8080ff');
define ('tableHeadColor', '#737b9c');
define ('tableBgColor', black);
- define ('menuHeadColor', '#737b9c');
- define ('menuBgColor', '#4b4f66');
- define ('featureHeadColor', tableHeadColor);
+ define ('featureHeadColor', '#737b9c');
define ('featureBgColor', '#262633');
}
}
@@ -61,7 +52,7 @@
Require a library module if it hasn't already been.
*/
- function reqIfNeeded( $libNames )
+ function reqIfNeeded ($libNames)
{
global $has, $needs;
@@ -86,7 +77,7 @@
addToArray ($libName, $has);
}
-
+
/*
need
@@ -103,6 +94,14 @@
}
reqIfNeeded ($libNames);
}
-
+
+ function bailout ($str)
+ {
+ if (strlen ($str))
+ echo $str;
+
+ require siteHome . '/parts/postamble.php'; // end page
+ die;
+ }
} // !_LIBFUNCS_
?>
diff --git a/parts/member_stuff.php b/parts/member_stuff.php
new file mode 100644
index 0000000..7685ad1
--- /dev/null
+++ b/parts/member_stuff.php
@@ -0,0 +1,18 @@
+
+ need ("feature");
+
+ @featureOpen ("News");
+ ?>
+
News: [ Post ]
+
+ @featureClose ();
+
+ if ($userInfo['u_admin']) {
+ @featureOpen ("Admin");
+ ?>
+ News: [ Add | Del | Edit ]
+ Users: [ Add | Del | Edit ]
+
+ @featureClose ();
+ }
+?>
\ No newline at end of file
diff --git a/parts/postamble.php b/parts/postamble.php
index bc42a28..6a0a6d9 100644
--- a/parts/postamble.php
+++ b/parts/postamble.php
@@ -6,4 +6,5 @@
Additional Copyright and Trademark Acknowledgements
+π