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 @@ - 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 @@ - + - +
    Older News...
    - + 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 @@
    diff --git a/members.php b/members.php new file mode 100644 index 0000000..1f203d3 --- /dev/null +++ b/members.php @@ -0,0 +1,14 @@ + +

    Welcome to Developer Central, !

    +

    This is the area for developers to post news, edit your user information, +check on the server(s), and so on. Members with Admin-level access can modify +news items here as well.

    + diff --git a/news_add.php b/news_add.php new file mode 100644 index 0000000..36c5d4d --- /dev/null +++ b/news_add.php @@ -0,0 +1,68 @@ + +
    +

    Add News (Preview)

    +
    +
    (Will be) posted on by
    +
    + +
    + + +
    + +
    +
    + Your news item has been processed successfully.'; + } else { + echo '

    There was an error in your input. If you don\'t know what it is, I\'m not going to tell you.'; + } + } + mysql_close ($conn); + } else { + echo '

    You suck, butthead.'; + } + } else { + $date = strftime ('%d %b %Y', time ()); + $user = ucfirst ($REMOTE_USER); + + if ($newsItem) {?> +

    +

    Latest News

    +
    +
    Posted on by
    +
    +

    +
    +
    +
    + diff --git a/news_del.php b/news_del.php new file mode 100644 index 0000000..a0799b1 --- /dev/null +++ b/news_del.php @@ -0,0 +1,86 @@ +You don\'t have access to this page. Bug an admin to delete a news post.

    '); + + need ('sql'); + + function convertToHTML ($string) + { + $table = array_flip (get_html_translation_table (HTML_ENTITIES)); + + return strtr ($string, $table); + } + + function convertFromHTML ($string) + { + $table = get_html_translation_table (HTML_ENTITIES); + return strtr ($string, $table); + } + + function newsEntry ($array) + { + need ('date'); + + return + '' + .' ' . $array[n_id] . '' + .' ' . dateFromSQLDateTime ($array[n_date]) . '' + .' ' . $array[n_user] . '' + .' ' . substr (convertFromHTML (StripSlashes ($array[n_news])), 0, 60) . '…' + .''; + } + + $newsID = $_REQUEST['newsID']; + + if ($conn = mysql_pconnect (sqlHost, sqlRWUser, sqlRWPass)) { + if ($newsID) { + $query = "DELETE FROM news_main WHERE n_id='$newsID'"; + if ($result = mysql_db_query (sqlDB, $query, $conn)) { + if ($numRows = mysql_affected_rows ($conn)) { + echo "

    News entry $newsID has been deleted successfully."; + } else { + echo '

    There was an error in your input. If you don\'t know what it is, I\'m not going to tell you.'; + } + } + } + + ?> +

    +

    Edit News

    + + + + + + + + No matching news entries.

    '; + } + } else { + echo '

    Somebody screwed up, and MySQL said "' . mysql_error() . '". Bug a project admin or somethin\' eh?

    '; + } + ?> +
    IDDateUserText
    +
    + Couldn\'t connect to the SQL server with the password you gave. ("You suck, butthead.")

    '; + } + + require siteHome . "/parts/postamble.php"; // Finish this sucker up +?> diff --git a/news_edit.php b/news_edit.php new file mode 100644 index 0000000..bb54af7 --- /dev/null +++ b/news_edit.php @@ -0,0 +1,147 @@ +You don\'t have access to this page. Bug an admin to delete a news post.

    '); + + need ('sql'); + + function convertToHTML ($string) + { + $table = array_flip (get_html_translation_table (HTML_ENTITIES)); + + return strtr ($string, $table); + } + + function convertFromHTML ($string) + { + $table = get_html_translation_table (HTML_ENTITIES); + return strtr ($string, $table); + } + + function newsEntrySummary ($array) + { + need ("date"); + + return + '' + .' ' . $array[n_id] . '' + .' ' . dateFromSQLDateTime ($array[n_date]) . '' + .' ' . $array[n_user] . '' + .' ' . substr (convertFromHTML (StripSlashes ($array[n_news])), 0, 60) . '…' + .''; + } + + function newsEntryEditor ($array) + { + need ("date"); + + $id = $array[n_id]; + $usr = $array[n_user]; + $txt = convertFromHTML(stripSlashes($array[n_news])); + $date = dateFromSQLDateTime($array[n_date]); + + ?> +
    +
    +

    Edit News Entry #

    +
    +
    + + Posted on + + by + + + + + +
    +
    +
    +
    +
    +
    +
    + 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

    + + + + + + + + + + You suck, butthead.'; + } +?> + 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 @@ + +

    News: [ Post ]

    + +

    News: [ Add | Del | Edit ]

    +

    Users: [ Add | Del | Edit ]

    + \ 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 +π diff --git a/template.php b/template.php index 9b1184f..dd729d2 100644 --- a/template.php +++ b/template.php @@ -1,11 +1,9 @@ - -Page content goes here. Yes, it's that simple. - +Page content goes here.
    IDDateUserText