Home Projects Redmine Issues

interos gitweb

Initial commit master
authorBrent Angeline <brent@interos.(none)>
Sat, 1 May 2010 01:02:29 +0000 (21:02 -0400)
committerBrent Angeline <brent@interos.(none)>
Sat, 1 May 2010 01:02:29 +0000 (21:02 -0400)
295 files changed:
c/access_interos.com_ssl.c [new file with mode: 0644]
c/bottom_interos.com_ssl.c [new file with mode: 0644]
c/browse_interos.com_ssl.c [new file with mode: 0644]
c/content_interos.com_ssl.c [new file with mode: 0644]
c/interos.c [new symlink]
c/interos.h [new symlink]
c/interos.org.h [new symlink]
c/interos.org_interos.org_ssl.h [new file with mode: 0644]
c/interos_interos.com_ssl.c [new file with mode: 0644]
c/interos_interos.com_ssl.h [new file with mode: 0644]
c/login_interos.com_ssl.c [new file with mode: 0644]
c/logout_interos.com_ssl.c [new file with mode: 0644]
c/main_interos.com_ssl.c [new file with mode: 0644]
c/menu_interos.com_ssl.c [new file with mode: 0644]
c/new_interos.com_ssl.c [new file with mode: 0644]
c/new_user_interos.com_ssl.c [new file with mode: 0644]
c/next_interos.com_ssl.c [new file with mode: 0644]
c/open_interos.com_ssl.c [new file with mode: 0644]
c/settings_interos.com_ssl.c [new file with mode: 0644]
c/template.c [new file with mode: 0644]
c/top_interos.com_ssl.c [new file with mode: 0644]
c/upload_interos.com_ssl.c [new file with mode: 0644]
c/user_interos.com_ssl.c [new file with mode: 0644]
c/welcome_back_interos.com_ssl.c [new file with mode: 0644]
c/welcome_interos.com_ssl.c [new file with mode: 0644]
c/xml/append_interos.com_ssl.c [new file with mode: 0644]
c/xml/copy_interos.com_ssl.c [new file with mode: 0644]
c/xml/delete_interos.com_ssl.c [new file with mode: 0644]
c/xml/files_interos.com_ssl.c [new file with mode: 0644]
c/xml/interos.h [new symlink]
c/xml/move_interos.com_ssl.c [new file with mode: 0644]
c/xml/new_folder_interos.com_ssl.c [new file with mode: 0644]
c/xml/persist_interos.com_ssl.c [new file with mode: 0644]
c/xml/save_interos.com_ssl.c [new file with mode: 0644]
c/xml/template_interos.com_ssl.c [new file with mode: 0644]
c/xml/user_interos.com_ssl.c [new file with mode: 0644]
conf/httpd.conf [new file with mode: 0644]
dtd/xhtml1-borderless-frameset.dtd [new file with mode: 0644]
images/buttons/new.gif [new file with mode: 0644]
images/buttons/new_down.gif [new file with mode: 0644]
images/buttons/new_faded.gif [new file with mode: 0644]
images/buttons/new_up.gif [new file with mode: 0644]
images/buttons/next.gif [new file with mode: 0644]
images/buttons/next_faded.gif [new file with mode: 0644]
images/buttons/next_up.gif [new file with mode: 0644]
images/buttons/open.gif [new file with mode: 0644]
images/buttons/open_down.gif [new file with mode: 0644]
images/buttons/open_faded.gif [new file with mode: 0644]
images/buttons/open_up.gif [new file with mode: 0644]
images/buttons/settings.gif [new file with mode: 0644]
images/buttons/settings_down.gif [new file with mode: 0644]
images/buttons/settings_faded.gif [new file with mode: 0644]
images/buttons/settings_up.gif [new file with mode: 0644]
images/docs/flash/text_editor/spec/1.gif [new file with mode: 0644]
images/docs/flash/text_editor/spec/2a-i.gif [new file with mode: 0644]
images/docs/flash/text_editor/spec/2a-ii.gif [new file with mode: 0644]
images/docs/flash/text_editor/spec/2a-iii.gif [new file with mode: 0644]
images/docs/flash/text_editor/spec/2a-iv.gif [new file with mode: 0644]
images/docs/flash/text_editor/spec/2b-i.gif [new file with mode: 0644]
images/docs/flash/text_editor/spec/2b-ii.gif [new file with mode: 0644]
images/favicon.gif-moved [new file with mode: 0755]
images/favicon.ico [new file with mode: 0644]
images/favicon.ico-moved [new symlink]
images/icons/browse/go.png [new file with mode: 0644]
images/icons/browse/home.png [new file with mode: 0644]
images/icons/browse/reload.png [new file with mode: 0644]
images/icons/browse/stop.png [new file with mode: 0644]
images/icons/new/alarm.png [new file with mode: 0644]
images/icons/new/application.png [new file with mode: 0644]
images/icons/new/bookmark.png [new file with mode: 0644]
images/icons/new/chat.png [new file with mode: 0644]
images/icons/new/copy.png [new file with mode: 0644]
images/icons/new/document.png [new file with mode: 0644]
images/icons/new/download.png [new file with mode: 0644]
images/icons/new/e-mail.png [new file with mode: 0644]
images/icons/new/folder.png [new file with mode: 0644]
images/icons/new/image.png [new file with mode: 0644]
images/icons/new/music.png [new file with mode: 0644]
images/icons/new/phone_call.png [new file with mode: 0644]
images/icons/new/search.png [new file with mode: 0644]
images/icons/new/share.png [new file with mode: 0644]
images/icons/new/text_file.png [new file with mode: 0644]
images/icons/new/upload.png [new file with mode: 0644]
images/icons/new/video.png [new file with mode: 0644]
images/icons/new/web_page.png [new file with mode: 0644]
images/icons/next/bookmark.png [new file with mode: 0644]
images/icons/next/close.png [new file with mode: 0644]
images/icons/next/logout.png [new file with mode: 0644]
images/icons/next/save.png [new file with mode: 0644]
images/icons/next/save_as.png [new file with mode: 0644]
images/icons/open/alarm.png [new file with mode: 0644]
images/icons/open/bookmark.png [new file with mode: 0644]
images/icons/open/document.png [new file with mode: 0644]
images/icons/open/e-mail.png [new file with mode: 0644]
images/icons/open/image.png [new file with mode: 0644]
images/icons/open/incoming.png [new file with mode: 0644]
images/icons/open/music.png [new file with mode: 0644]
images/icons/open/shared.png [new file with mode: 0644]
images/icons/open/text_file.png [new file with mode: 0644]
images/icons/open/video.png [new file with mode: 0644]
images/icons/settings/audio.png [new file with mode: 0644]
images/icons/settings/buttons.png [new file with mode: 0644]
images/icons/settings/chat.png [new file with mode: 0644]
images/icons/settings/clock.png [new file with mode: 0644]
images/icons/settings/downloads.png [new file with mode: 0644]
images/icons/settings/e-mail.png [new file with mode: 0644]
images/icons/settings/images.png [new file with mode: 0644]
images/icons/settings/phone.png [new file with mode: 0644]
images/icons/settings/search.png [new file with mode: 0644]
images/icons/settings/video.png [new file with mode: 0644]
images/interos.org_logo.gif [new file with mode: 0644]
images/interos.org_logo.png [new file with mode: 0644]
images/login/arrow.gif [new file with mode: 0644]
images/login/arrow_down.gif [new file with mode: 0644]
images/login/i.gif [new file with mode: 0644]
images/login/new.gif [new file with mode: 0644]
images/login/new_faded.gif [new file with mode: 0644]
images/login/next.gif [new file with mode: 0644]
images/login/next_faded.gif [new file with mode: 0644]
images/login/nteros.gif [new file with mode: 0644]
images/login/open.gif [new file with mode: 0644]
images/login/open_faded.gif [new file with mode: 0644]
images/login/settings.gif [new file with mode: 0644]
images/login/settings_faded.gif [new file with mode: 0644]
images/menu/new_bottom.gif [new file with mode: 0644]
images/menu/new_top.gif [new file with mode: 0644]
images/menu/next_bottom.gif [new file with mode: 0644]
images/menu/next_top.gif [new file with mode: 0644]
images/menu/open_bottom.gif [new file with mode: 0644]
images/menu/open_top.gif [new file with mode: 0644]
images/menu/settings_bottom.gif [new file with mode: 0644]
images/menu/settings_top.gif [new file with mode: 0644]
images/panel/bottom.gif [new file with mode: 0644]
images/panel/bottom_left.gif [new file with mode: 0644]
images/panel/bottom_right.gif [new file with mode: 0644]
images/panel/left.gif [new file with mode: 0644]
images/panel/login.gif [new file with mode: 0644]
images/panel/login/top.gif [new file with mode: 0644]
images/panel/login/top_left.gif [new file with mode: 0644]
images/panel/login/top_right.gif [new file with mode: 0644]
images/panel/main/top.gif [new file with mode: 0644]
images/panel/main/top_left.gif [new file with mode: 0644]
images/panel/main/top_right.gif [new file with mode: 0644]
images/panel/right.gif [new file with mode: 0644]
images/panel/title/top.gif [new file with mode: 0644]
images/panel/title/top_left.gif [new file with mode: 0644]
images/panel/title/top_right.gif [new file with mode: 0644]
images/panel/welcome/bottom.gif [new file with mode: 0644]
images/panel/welcome/bottom_left.gif [new file with mode: 0644]
images/panel/welcome/bottom_right.gif [new file with mode: 0644]
images/panel/welcome/left.gif [new file with mode: 0644]
images/panel/welcome/right.gif [new file with mode: 0644]
images/panel/welcome/top.gif [new file with mode: 0644]
images/panel/welcome/top_left.gif [new file with mode: 0644]
images/panel/welcome/top_right.gif [new file with mode: 0644]
images/toolbar.gif [new file with mode: 0644]
js/bottom_interos.com_ssl.js [new file with mode: 0644]
js/content_interos.com_ssl.js [new file with mode: 0644]
js/default_interos.com.js [new file with mode: 0644]
js/default_interos.com_ssl.js [new file with mode: 0644]
js/default_interos.org.js [new file with mode: 0644]
js/default_interos.org_ssl.js [new file with mode: 0644]
js/home_interos.com.js [new file with mode: 0644]
js/home_interos.com_ssl.js [new file with mode: 0644]
js/login_interos.com_ssl.js [new file with mode: 0644]
js/main_interos.com_ssl.js [new file with mode: 0644]
js/menu_interos.com_ssl.js [new file with mode: 0644]
js/new_interos.com_ssl.js [new file with mode: 0644]
js/next_interos.com_ssl.js [new file with mode: 0644]
js/open_interos.com_ssl.js [new file with mode: 0644]
js/settings_interos.com_ssl.js [new file with mode: 0644]
js/top_interos.com_ssl.js [new file with mode: 0644]
js/welcome_interos.com_ssl.js [new file with mode: 0644]
style/content_interos.com_ssl.css [new file with mode: 0644]
style/default_interos.com.css [new file with mode: 0644]
style/default_interos.com_ssl.css [new file with mode: 0644]
style/default_interos.org.css [new file with mode: 0644]
style/default_interos.org_ssl.css [new file with mode: 0644]
style/images/box/head.gif [new file with mode: 0644]
style/images/box/highlight.gif [new file with mode: 0644]
style/images/buttons/new.gif [new file with mode: 0644]
style/images/buttons/new_down.gif [new file with mode: 0644]
style/images/buttons/new_faded.gif [new file with mode: 0644]
style/images/buttons/new_up.gif [new file with mode: 0644]
style/images/buttons/new_up_faded.gif [new file with mode: 0644]
style/images/buttons/next.gif [new file with mode: 0644]
style/images/buttons/next_down.gif [new file with mode: 0644]
style/images/buttons/next_faded.gif [new file with mode: 0644]
style/images/buttons/next_up.gif [new file with mode: 0644]
style/images/buttons/next_up_faded.gif [new file with mode: 0644]
style/images/buttons/open.gif [new file with mode: 0644]
style/images/buttons/open_down.gif [new file with mode: 0644]
style/images/buttons/open_faded.gif [new file with mode: 0644]
style/images/buttons/open_up.gif [new file with mode: 0644]
style/images/buttons/open_up_faded.gif [new file with mode: 0644]
style/images/buttons/settings.gif [new file with mode: 0644]
style/images/buttons/settings_down.gif [new file with mode: 0644]
style/images/buttons/settings_faded.gif [new file with mode: 0644]
style/images/buttons/settings_up.gif [new file with mode: 0644]
style/images/buttons/settings_up_faded.gif [new file with mode: 0644]
style/images/menu/active.gif [new file with mode: 0644]
style/images/menu/new_hover.gif [new file with mode: 0644]
style/images/menu/new_top.gif [new file with mode: 0644]
style/images/menu/next_hover.gif [new file with mode: 0644]
style/images/menu/next_top.gif [new file with mode: 0644]
style/images/menu/open_hover.gif [new file with mode: 0644]
style/images/menu/open_top.gif [new file with mode: 0644]
style/images/menu/settings_hover.gif [new file with mode: 0644]
style/images/menu/settings_top.gif [new file with mode: 0644]
style/images/panel/main.gif [new file with mode: 0644]
style/images/panel/title.gif [new file with mode: 0644]
style/images/panel/welcome.gif [new file with mode: 0644]
style/images/toolbar.gif [new file with mode: 0644]
style/images/toolbar_shaded.gif [new file with mode: 0644]
style/login_interos.com_ssl.css [new file with mode: 0644]
style/main_interos.com_ssl.css [new file with mode: 0644]
style/menu_interos.com_ssl.css [new file with mode: 0644]
xhtml/cgi/bottom_interos.com_ssl.xhtml [new file with mode: 0644]
xhtml/cgi/bottom_js_interos.com_ssl.xhtml [new file with mode: 0644]
xhtml/cgi/bottom_new_interos.com_ssl.xhtml [new file with mode: 0644]
xhtml/cgi/bottom_settings_interos.com_ssl.xhtml [new file with mode: 0644]
xhtml/cgi/browse_interos.com_ssl.xhtml [new file with mode: 0644]
xhtml/cgi/content_interos.com_ssl.xhtml [new file with mode: 0644]
xhtml/cgi/login_interos.com_ssl.xhtml [new file with mode: 0644]
xhtml/cgi/main_interos.com_ssl.xhtml [new file with mode: 0644]
xhtml/cgi/main_js_interos.com_ssl.xhtml [new file with mode: 0644]
xhtml/cgi/main_new_interos.com_ssl.xhtml [new file with mode: 0644]
xhtml/cgi/main_next_interos.com_ssl.xhtml [new file with mode: 0644]
xhtml/cgi/main_open_interos.com_ssl.xhtml [new file with mode: 0644]
xhtml/cgi/main_settings_interos.com_ssl.xhtml [new file with mode: 0644]
xhtml/cgi/menu_new_interos.com_ssl.xhtml [new file with mode: 0644]
xhtml/cgi/menu_next_interos.com_ssl.xhtml [new file with mode: 0644]
xhtml/cgi/menu_open_interos.com_ssl.xhtml [new file with mode: 0644]
xhtml/cgi/menu_settings_interos.com_ssl.xhtml [new file with mode: 0644]
xhtml/cgi/new_interos.com_ssl.xhtml [new file with mode: 0644]
xhtml/cgi/new_js_interos.com_ssl.xhtml [new file with mode: 0644]
xhtml/cgi/new_user_interos.com_ssl.xhtml [new file with mode: 0644]
xhtml/cgi/next_interos.com_ssl.xhtml [new file with mode: 0644]
xhtml/cgi/next_js_interos.com_ssl.xhtml [new file with mode: 0644]
xhtml/cgi/open_interos.com_ssl.xhtml [new file with mode: 0644]
xhtml/cgi/open_js_interos.com_ssl.xhtml [new file with mode: 0644]
xhtml/cgi/settings_interos.com_ssl.xhtml [new file with mode: 0644]
xhtml/cgi/settings_js_interos.com_ssl.xhtml [new file with mode: 0644]
xhtml/cgi/top_interos.com_ssl.xhtml [new file with mode: 0644]
xhtml/cgi/top_js_interos.com_ssl.xhtml [new file with mode: 0644]
xhtml/cgi/top_next_interos.com_ssl.xhtml [new file with mode: 0644]
xhtml/cgi/top_open_interos.com_ssl.xhtml [new file with mode: 0644]
xhtml/cgi/welcome_back_interos.com_ssl.xhtml [new file with mode: 0644]
xhtml/cgi/welcome_interos.com_ssl.xhtml [new file with mode: 0644]
xhtml/cgi/welcome_js_interos.com_ssl.xhtml [new file with mode: 0644]
xhtml/docs/flash/text_editor/spec_interos.org.xhtml [new file with mode: 0644]
xhtml/page/about_interos.com.xhtml [new file with mode: 0644]
xhtml/page/about_interos.com_ssl.xhtml [new file with mode: 0644]
xhtml/page/about_interos.org.xhtml [new file with mode: 0644]
xhtml/page/about_interos.org_ssl.xhtml [new file with mode: 0644]
xhtml/page/blog_interos.com.xhtml [new file with mode: 0644]
xhtml/page/blog_interos.com_ssl.xhtml [new file with mode: 0644]
xhtml/page/blog_interos.org.xhtml [new file with mode: 0644]
xhtml/page/blog_interos.org_ssl.xhtml [new file with mode: 0644]
xhtml/page/code_interos.com.xhtml [new file with mode: 0644]
xhtml/page/code_interos.com_ssl.xhtml [new file with mode: 0644]
xhtml/page/code_interos.org.xhtml [new file with mode: 0644]
xhtml/page/code_interos.org_ssl.xhtml [new file with mode: 0644]
xhtml/page/default.xhtml [new file with mode: 0644]
xhtml/page/default_ssl.xhtml [new file with mode: 0644]
xhtml/page/demo_interos.com.xhtml [new file with mode: 0644]
xhtml/page/demo_interos.com_ssl.xhtml [new file with mode: 0644]
xhtml/page/e-mail_interos.com.xhtml [new file with mode: 0644]
xhtml/page/e-mail_interos.com_ssl.xhtml [new file with mode: 0644]
xhtml/page/e-mail_interos.org.xhtml [new file with mode: 0644]
xhtml/page/e-mail_interos.org_ssl.xhtml [new file with mode: 0644]
xhtml/page/faq_interos.com.xhtml [new file with mode: 0644]
xhtml/page/faq_interos.com_ssl.xhtml [new file with mode: 0644]
xhtml/page/faq_interos.org.xhtml [new file with mode: 0644]
xhtml/page/faq_interos.org_ssl.xhtml [new file with mode: 0644]
xhtml/page/gear_interos.com.xhtml [new file with mode: 0644]
xhtml/page/gear_interos.com_ssl.xhtml [new file with mode: 0644]
xhtml/page/gear_interos.org.xhtml [new file with mode: 0644]
xhtml/page/gear_interos.org_ssl.xhtml [new file with mode: 0644]
xhtml/page/help_interos.com.xhtml [new file with mode: 0644]
xhtml/page/help_interos.com_ssl.xhtml [new file with mode: 0644]
xhtml/page/help_interos.org.xhtml [new file with mode: 0644]
xhtml/page/help_interos.org_ssl.xhtml [new file with mode: 0644]
xhtml/page/home_interos.com.xhtml [new file with mode: 0644]
xhtml/page/home_interos.com_ssl.xhtml [new file with mode: 0644]
xhtml/page/home_interos.org.xhtml [new file with mode: 0755]
xhtml/page/home_interos.org_old.xhtml [new file with mode: 0644]
xhtml/page/home_interos.org_ssl.xhtml [new file with mode: 0755]
xhtml/page/home_interos.org_ssl_old.xhtml [new file with mode: 0644]
xhtml/template.xhtml [new file with mode: 0644]
xml/confirmation_interos.com_ssl.xml [new file with mode: 0644]
xml/error_interos.com_ssl.xml [new file with mode: 0644]
xml/files_interos.com_ssl.xml [new file with mode: 0644]
xml/state_interos.com_ssl.xml [new file with mode: 0644]
xml/user_interos.com_ssl.xml [new file with mode: 0644]

diff --git a/c/access_interos.com_ssl.c b/c/access_interos.com_ssl.c
new file mode 100644 (file)
index 0000000..3ab371e
--- /dev/null
@@ -0,0 +1,315 @@
+/******************************************************/
+/*    interos Standard Document Header - CGI in C     */
+/******************************************************/
+/*         File:  access                              */
+/*       Source:  access.c                            */
+/*  Description:  FastCGI for interos access checker  */
+/*       Author:  Brent Angeline                      */
+/*          CGI:  FastCGI in ISO/ANSI C               */
+/******************************************************/
+
+/* PREPROCESSOR DIRECTIVES */
+#include "fcgi_stdio.h"     /*  FCGI_Accept(), fclose(), fgetc(), fopen()                                */
+#include "interos.h"        /*  DIRECTORY, INT, MAX_PASSWORD_SIZE, PASSWORD_FILE_NAME, SYSTEM_DIRECTORY  */
+#include <stdlib.h>         /*  free(), getenv(), malloc()                                               */
+#include <string.h>         /*  strcat(), strcmp(), strcpy(), strlen(), strncmp()                        */
+#include <unistd.h>         /*  F_OK, access()                                                           */
+
+/* FUNCTION PROTOTYPE DECLARATIONS */
+static void DenyAccess(void);
+static void GrantAccess(void);
+
+/* BEGIN MAIN PROGRAM */
+int main(void) {
+
+  /* BEGIN FASTCGI */
+  while (FCGI_Accept() >= 0) {
+
+    /* IF A URI REQUEST DOESN'T EXIST OR IS TOO LONG... */
+    if (!getenv("REQUEST_URI") || (sizeof(strlen(getenv("REQUEST_URI"))) > sizeof(INT))) {
+      /** ERROR | A URI REQUEST DOES NOT EXIST OR IS TOO LONG > DENY ACCESS AND REDIRECT TO LOGIN PANEL **/
+      DenyAccess();
+
+    /* OTHERWISE, IF A URI REQUEST DOES EXIST AND IS OF ACCEPTABLE LENGTH... */
+    } else {
+
+      /* IF THE URI REQUEST IS FOR A PUBLIC FILE IN THE SERVER ROOT... */
+      if (!(strcmp(getenv("REQUEST_URI"), "/") && strcmp(getenv("REQUEST_URI"), "/favicon.ico") &&
+            strcmp(getenv("REQUEST_URI"), "/index.html") && strcmp(getenv("REQUEST_URI"), "/index.xhtml") &&
+            strcmp(getenv("REQUEST_URI"), "/about") && strcmp(getenv("REQUEST_URI"), "/about/") &&
+            strcmp(getenv("REQUEST_URI"), "/blog") && strcmp(getenv("REQUEST_URI"), "/blog/") &&
+            strcmp(getenv("REQUEST_URI"), "/code") && strcmp(getenv("REQUEST_URI"), "/code/") &&
+            strcmp(getenv("REQUEST_URI"), "/demo") && strcmp(getenv("REQUEST_URI"), "/demo/") &&
+            strcmp(getenv("REQUEST_URI"), "/e-mail") && strcmp(getenv("REQUEST_URI"), "/e-mail/") &&
+            strcmp(getenv("REQUEST_URI"), "/email") && strcmp(getenv("REQUEST_URI"), "/email/") &&
+            strcmp(getenv("REQUEST_URI"), "/f.a.q.") && strcmp(getenv("REQUEST_URI"), "/f.a.q./") &&
+            strcmp(getenv("REQUEST_URI"), "/faq") && strcmp(getenv("REQUEST_URI"), "/faq/") &&
+            strcmp(getenv("REQUEST_URI"), "/gear") && strcmp(getenv("REQUEST_URI"), "/gear/") &&
+            strcmp(getenv("REQUEST_URI"), "/help") && strcmp(getenv("REQUEST_URI"), "/help/") &&
+            strcmp(getenv("REQUEST_URI"), "/home") && strcmp(getenv("REQUEST_URI"), "/home/") &&
+            strcmp(getenv("REQUEST_URI"), "/bottom") && strcmp(getenv("REQUEST_URI"), "/bottom/") &&
+            strcmp(getenv("REQUEST_URI"), "/browse") && strcmp(getenv("REQUEST_URI"), "/browse/") &&
+            strcmp(getenv("REQUEST_URI"), "/content") && strcmp(getenv("REQUEST_URI"), "/content/") &&
+            strcmp(getenv("REQUEST_URI"), "/login") && strcmp(getenv("REQUEST_URI"), "/login/") &&
+            strcmp(getenv("REQUEST_URI"), "/logout") && strcmp(getenv("REQUEST_URI"), "/logout/") &&
+            strcmp(getenv("REQUEST_URI"), "/main") && strcmp(getenv("REQUEST_URI"), "/main/") &&
+            strcmp(getenv("REQUEST_URI"), "/interos") && strcmp(getenv("REQUEST_URI"), "/interos/") &&
+            strcmp(getenv("REQUEST_URI"), "/menu") && strcmp(getenv("REQUEST_URI"), "/menu/") &&
+            strcmp(getenv("REQUEST_URI"), "/new") && strcmp(getenv("REQUEST_URI"), "/new/") &&
+            strcmp(getenv("REQUEST_URI"), "/new_user") && strcmp(getenv("REQUEST_URI"), "/new_user/") &&
+            strcmp(getenv("REQUEST_URI"), "/newuser") && strcmp(getenv("REQUEST_URI"), "/newuser/") &&
+            strcmp(getenv("REQUEST_URI"), "/next") && strcmp(getenv("REQUEST_URI"), "/next/") &&
+            strcmp(getenv("REQUEST_URI"), "/open") && strcmp(getenv("REQUEST_URI"), "/open/") &&
+            strcmp(getenv("REQUEST_URI"), "/settings") && strcmp(getenv("REQUEST_URI"), "/settings/") &&
+            strcmp(getenv("REQUEST_URI"), "/top") && strcmp(getenv("REQUEST_URI"), "/top/") &&
+            strcmp(getenv("REQUEST_URI"), "/upload") && strcmp(getenv("REQUEST_URI"), "/upload/") &&
+            strcmp(getenv("REQUEST_URI"), "/user") && strcmp(getenv("REQUEST_URI"), "/user/") &&
+            strcmp(getenv("REQUEST_URI"), "/welcome") && strcmp(getenv("REQUEST_URI"), "/welcome/") &&
+            strcmp(getenv("REQUEST_URI"), "/welcome_back") && strcmp(getenv("REQUEST_URI"), "/welcome_back/") &&
+            strcmp(getenv("REQUEST_URI"), "/welcomeback") && strcmp(getenv("REQUEST_URI"), "/welcomeback/"))) {
+        /** STATUS | PUBLIC FILE > GRANT ACCESS **/
+        GrantAccess();
+
+      /* OTHERWISE, IF THE URI REQUEST IS FOR A PUBLIC SYSTEM FILE... */
+      } else if (!(strncmp(getenv("REQUEST_URI"), "/dtd/", 5) &&
+                   strncmp(getenv("REQUEST_URI"), "/flash/", 7) &&
+                   strncmp(getenv("REQUEST_URI"), "/flex/", 6) &&
+                   strncmp(getenv("REQUEST_URI"), "/html/", 6) &&
+                   strncmp(getenv("REQUEST_URI"), "/icons/", 7) &&
+                   strncmp(getenv("REQUEST_URI"), "/images/", 8) &&
+                   strncmp(getenv("REQUEST_URI"), "/java/", 6) &&
+                   strncmp(getenv("REQUEST_URI"), "/javafx/", 8) &&
+                   strncmp(getenv("REQUEST_URI"), "/js/", 4) &&
+                   strncmp(getenv("REQUEST_URI"), "/markup/", 8) &&
+                   strncmp(getenv("REQUEST_URI"), "/style/", 7) &&
+                   strncmp(getenv("REQUEST_URI"), "/sys/", 5) &&
+                   strncmp(getenv("REQUEST_URI"), "/xhtml/", 7) &&
+                   strncmp(getenv("REQUEST_URI"), "/xml/", 5))) {
+        /** STATUS | PUBLIC SYSTEM FILE > GRANT ACCESS **/
+        GrantAccess();
+
+      /* OTHERWISE, THE PROPER COOKIES ARE REQUIRED FOR ACCESS... */
+      } else {
+
+        /* IF COOKIE DATA DOESN'T EXIST OR IS TOO LONG... */
+        if (!getenv("HTTP_COOKIE") || (sizeof(strlen(getenv("HTTP_COOKIE"))) > sizeof(INT))) {
+          /** ERROR | COOKIE DATA DOES NOT EXIST OR IS TOO LONG > REDIRECT TO LOGIN PANEL **/
+          DenyAccess();
+
+        /* OTHERWISE, IF COOKIE DATA DOES EXIST AND IS OF ACCEPTABLE LENGTH... */
+        } else {
+
+          /* ATTEMPT TO ALLOCATE MEMORY FOR COOKIE VARIABLES */
+          char *cookie;
+          INT cookieLength = strlen(getenv("HTTP_COOKIE"));
+          if ((cookieLength < 1) || !(cookie = malloc(cookieLength + 1))) {
+            /** ERROR | CRUCIAL MEMORY ALLOCATION ERROR FOR COOKIE DATA! > DENY ACCESS AND REDIRECT TO LOGIN PANEL **/
+            DenyAccess();
+          } else {
+            char *variableName;
+            if (!(variableName = malloc(cookieLength + 1))) {
+              /** ERROR | CANNOT ALLOCATE MEMORY FOR COOKIE VARIABLE NAME > DENY ACCESS AND REDIRECT TO LOGIN PANEL **/
+              DenyAccess();
+            } else {
+              char *variableValue;
+              if (!(variableValue = malloc(cookieLength + 1))) {
+                /** ERROR | CANNOT ALLOCATE MEMORY FOR COOKIE VARIABLE VALUE > DENY ACCESS AND REDIRECT TO LOGIN PANEL **/
+                DenyAccess();
+
+              /* IF SUFFICIENT MEMORY FOR COOKIE VARIABLES... */
+              } else {
+
+                /* PROCESS COOKIE DATA */
+                char *login, *password;
+                INT c, i;
+                login = password = NULL;
+                c = 0;
+                strcpy(cookie, getenv("HTTP_COOKIE"));
+                while ((c < cookieLength) && (cookie[c] != '\0')) {
+                  i = 0;
+                  while ((c < cookieLength) && (cookie[c] != '=') && (cookie[c] != '\0')) {
+                    variableName[i] = cookie[c];
+                    ++c;
+                    ++i;
+                  }
+                  variableName[i] = '\0';
+                  ++c;
+                  i = 0;
+                  while ((c < cookieLength) && (cookie[c] != ';') && (cookie[c] != '\0')) {
+                    variableValue[i] = cookie[c];
+                    ++c;
+                    ++i;
+                  }
+                  variableValue[i] = '\0';
+                  ++c;
+                  while ((c < cookieLength) && (cookie[c] == ' ')) {
+                    ++c;
+                  }
+                  if (!login && !strcmp(variableName, "login")) {
+                    if ((login = malloc(strlen(variableValue) + 1)) != 0) {
+                      strcpy(login, variableValue);
+                    }
+                  } else if (!password && !strcmp(variableName, "password")) {
+                    if ((password = malloc(strlen(variableValue) + 1)) != 0) {
+                      strcpy(password, variableValue);
+                    }
+                  }
+                }
+
+                /* IF LOGIN VALUE IS MISSING... */
+                if (!login) {
+                  /** ERROR | LOGIN VALUE IS MISSING > DENY ACCESS AND REDIRECT TO LOGIN PANEL **/
+                  DenyAccess();
+
+                /* OTHERWISE, IF LOGIN VALUE EXISTS... */
+                } else {
+
+                  /* VERIFY LOGIN AND PASSWORD */
+                  char *directory;
+                  if (!(directory = malloc(strlen(login) + strlen(DIRECTORY) + 1))) {
+                    /** ERROR | CANNOT ALLOCATE MEMORY FOR DIRECTORY NAME > DENY ACCESS AND REDIRECT TO LOGIN PANEL **/
+                    DenyAccess();
+                  } else {
+                    char *systemDirectory;
+                    if (!(systemDirectory = malloc(strlen(login) + strlen(SYSTEM_DIRECTORY) + 1))) {
+                      /** ERROR | CANNOT ALLOCATE MEMORY FOR SYSTEM DIRECTORY NAME > DENY ACCESS AND REDIRECT TO LOGIN PANEL **/
+                      DenyAccess();
+                    } else {
+                      strcpy(directory, DIRECTORY);
+                      strcat(directory, login);
+                      strcpy(systemDirectory, SYSTEM_DIRECTORY);
+                      strcat(systemDirectory, login);
+
+                      /* IF DIRECTORY CAN'T BE ACCESSED... */
+                      if (access(directory, F_OK) || access(systemDirectory, F_OK)) {
+                        /** ERROR | CANNOT ACCESS DIRECTORY > DENY ACCESS AND REDIRECT TO LOGIN PANEL **/
+                        DenyAccess();
+
+                      /* OTHERWISE, IF DIRECTORY CAN BE ACCESSED... */
+                      } else {
+
+                        /* ATTEMPT TO ACCESS PASSWORD FILE */
+                        char *passwordFileName;
+                        if (!(passwordFileName = malloc(strlen(systemDirectory) + strlen(PASSWORD_FILE_NAME) + 1))) {
+                          /** ERROR | CANNOT ALLOCATE MEMORY FOR FILE NAME > DENY ACCESS AND REDIRECT TO LOGIN PANEL **/
+                          DenyAccess();
+                        } else {
+                          strcpy(passwordFileName, systemDirectory);
+                          strcat(passwordFileName, PASSWORD_FILE_NAME);
+
+                          /* IF PASSWORD FILE CAN'T BE ACCESSED... */
+                          if (access(passwordFileName, F_OK)) {
+                            /** ERROR | CANNOT ACCESS FILE > DENY ACCESS AND REDIRECT TO LOGIN PANEL **/
+                            DenyAccess();
+
+                          /* OTHERWISE, IF PASSWORD FILE CAN BE ACCESSED... */
+                          } else {
+
+                            /* ATTEMPT TO OPEN PASSWORD FILE FOR READING */
+                            FILE *passwordFile;
+
+                            /* IF PASSWORD FILE CAN'T BE OPENED FOR READING... */
+                            if (!(passwordFile = fopen(passwordFileName, "r"))) {
+                              /** ERROR | CANNOT READ FILE > DENY ACCESS AND REDIRECT TO LOGIN PANEL **/
+                              DenyAccess();
+
+                            /* OTHERWISE, IF PASSWORD FILE CAN BE OPENED FOR READING... */
+                            } else {
+                              char *filePassword;
+                              if (!(filePassword = malloc(MAX_PASSWORD_SIZE + 1))) {
+                                /** ERROR | CANNOT ALLOCATE MEMORY FOR PASSWORD FROM FILE **/
+                                /**       > DENY ACCESS AND REDIRECT TO LOGIN PANEL       **/
+                                DenyAccess();
+                              } else {
+                                char c;
+                                i = 0;
+
+                                /* READ PASSWORD FROM PASSWORD FILE */
+                                while (((c = fgetc(passwordFile)) != '\n') && (i < MAX_PASSWORD_SIZE)) {
+                                  filePassword[i] = c;
+                                  ++i;
+                                }
+                                filePassword[i] = '\0';
+                                fclose(passwordFile);
+
+                                /* IF PASSWORD FAILS COMPARISON... */
+                                if (strcmp(filePassword, password)) {
+                                  /** ERROR | PASSWORD FAILED > DENY ACCESS AND REDIRECT TO LOGIN PANEL **/
+                                  DenyAccess();
+
+                                /* OTHERWISE, IF PASSWORD PASSES COMPARISON... */
+                                } else {
+                                  char *loginDirectory;
+                                  if (!(loginDirectory = malloc(strlen(login) + 3))) {
+                                    /** ERROR | CANNOT ALLOCATE MEMORY FOR LOGIN DIRECTORY NAME **/
+                                    /**       > DENY ACCESS AND REDIRECT TO LOGIN PANEL         **/
+                                    DenyAccess();
+                                  } else {
+                                    strcpy(loginDirectory, "/");
+                                    strcat(loginDirectory, login);
+                                    strcat(loginDirectory, "/");
+                                    if (strncmp(loginDirectory, getenv("REQUEST_URI"), (strlen(login) + 2))) {
+                                      /** STATUS | FILE DOES NOT BELONG TO USER > DENY ACCESS AND REDIRECT TO LOGIN PANEL **/
+                                      DenyAccess();
+                                    } else {
+                                      /** STATUS | FILE DOES BELONG TO USER > GRANT ACCESS **/
+                                      GrantAccess();
+                                    }
+                                    free(loginDirectory);
+                                  }
+                                }
+                                free(filePassword);
+                              }
+                            }
+                          }
+                          free(passwordFileName);
+                        }
+                      }
+                      free(systemDirectory);
+                    }
+                    free(directory);
+                  }
+                  free(login);
+                }
+                free(password);
+                free(variableValue);
+              }
+              free(variableName);
+            }
+            free(cookie);
+          }
+        }
+      }
+    }
+  }
+  return 0;
+}
+
+/* FUNCTION | DENY ACCESS */
+static void DenyAccess(void) {
+  printf("Status: 403\r\n\r\n");
+}
+
+/* FUNCTION | GRANT ACCESS */
+static void GrantAccess(void) {
+  printf("Status: 200\r\n\r\n");
+}
+
+/***********************************************************************/
+/*                  Copyright and Trademark Statement                  */
+/***********************************************************************/
+/*                                                                     */
+/*          All original textual and graphical site content:           */
+/*                                                                     */
+/*  Copyright 2001-2010 Brent Angeline and interos LLC.  All rights    */
+/*  reserved.  Reproduction in whole or in part without written        */
+/*  permission is prohibited.  interos and the interos logos are       */
+/*  trademarks of Brent Angeline and interos LLC.  All other company,  */
+/*  product, and service names mentioned herein may be the properties  */
+/*  of their respective owners.  Comments in the interos.org forums    */
+/*  are the properties of their respective authors.  All software      */
+/*  developed in the forums is open source and belongs to everyone.    */
+/*                                                                     */
+/***********************************************************************/
+/*                      e-mail: info@interos.com                       */
+/***********************************************************************/
diff --git a/c/bottom_interos.com_ssl.c b/c/bottom_interos.com_ssl.c
new file mode 100644 (file)
index 0000000..7b54415
--- /dev/null
@@ -0,0 +1,514 @@
+/******************************************************/
+/*    interos Standard Document Header - CGI in C     */
+/******************************************************/
+/*         URIs:  https://interos.com/bottom          */
+/*                https://www.interos.com/bottom      */
+/*       Source:  bottom.c                            */
+/*  Description:  FastCGI for interos bottom toolbar  */
+/*       Author:  Brent Angeline                      */
+/*          CGI:  FastCGI in ISO/ANSI C               */
+/******************************************************/
+
+/* PREPROCESSOR DIRECTIVES */
+#include "fcgi_stdio.h"     /*  FCGI_Accept(), fclose(), fgetc(), fopen(), printf()                      */
+#include "interos.h"        /*  DIRECTORY, INT, MAX_PASSWORD_SIZE, PASSWORD_FILE_NAME, SYSTEM_DIRECTORY  */
+#include <stdlib.h>         /*  free(), getenv(), malloc()                                               */
+#include <string.h>         /*  strcat(), strcmp(), strcpy(), strlen()                                   */
+#include <unistd.h>         /*  F_OK, access()                                                           */
+
+/* FUNCTION PROTOTYPE DECLARATIONS */
+static void RedirectToLoginPanel(void);
+static void OutputBottom(char *status);
+static void OutputNewMenuButton(void);
+static void OutputSettingsMenuButton(void);
+static void BeginXHTMLOutput(void);
+static void BeginBottomOutput(void);
+static void FinishXHTMLOutput(void);
+
+/* BEGIN MAIN PROGRAM */
+int main(void) {
+
+  /* BEGIN FASTCGI */
+  while (FCGI_Accept() >= 0) {
+
+    /* IF COOKIE DATA DOESN'T EXIST OR IS TOO LONG... */
+    if (!getenv("HTTP_COOKIE") || (sizeof(strlen(getenv("HTTP_COOKIE"))) > sizeof(INT))) {
+      /** ERROR | COOKIE DATA DOES NOT EXIST OR IS TOO LONG > REDIRECT TO LOGIN PANEL **/
+      RedirectToLoginPanel();
+
+    /* OTHERWISE, IF COOKIE DATA DOES EXIST AND IS OF ACCEPTABLE LENGTH... */
+    } else {
+
+      /* ATTEMPT TO ALLOCATE MEMORY FOR COOKIE VARIABLES */
+      char *cookie;
+      INT cookieLength = strlen(getenv("HTTP_COOKIE"));
+      if ((cookieLength < 1) || !(cookie = malloc(cookieLength + 1))) {
+        /** ERROR | CRUCIAL MEMORY ALLOCATION ERROR FOR COOKIE DATA! > REDIRECT TO LOGIN PANEL **/
+        RedirectToLoginPanel();
+      } else {
+        char *variableName;
+        if (!(variableName = malloc(cookieLength + 1))) {
+          /** ERROR | CANNOT ALLOCATE MEMORY FOR COOKIE VARIABLE NAME > REDIRECT TO LOGIN PANEL **/
+          RedirectToLoginPanel();
+        } else {
+          char *variableValue;
+          if (!(variableValue = malloc(cookieLength + 1))) {
+            /** ERROR | CANNOT ALLOCATE MEMORY FOR COOKIE VARIABLE VALUE > REDIRECT TO LOGIN PANEL **/
+            RedirectToLoginPanel();
+
+          /* IF SUFFICIENT MEMORY FOR COOKIE VARIABLES... */
+          } else {
+
+            /* PROCESS COOKIE DATA */
+            char *login, *password;
+            INT c, i;
+            login = password = NULL;
+            c = 0;
+            strcpy(cookie, getenv("HTTP_COOKIE"));
+            while ((c < cookieLength) && (cookie[c] != '\0')) {
+              i = 0;
+              while ((c < cookieLength) && (cookie[c] != '=') && (cookie[c] != '\0')) {
+                variableName[i] = cookie[c];
+                ++c;
+                ++i;
+              }
+              variableName[i] = '\0';
+              ++c;
+              i = 0;
+              while ((c < cookieLength) && (cookie[c] != ';') && (cookie[c] != '\0')) {
+                variableValue[i] = cookie[c];
+                ++c;
+                ++i;
+              }
+              variableValue[i] = '\0';
+              ++c;
+              while ((c < cookieLength) && (cookie[c] == ' ')) {
+                ++c;
+              }
+              if (!login && !strcmp(variableName, "login")) {
+                if ((login = malloc(strlen(variableValue) + 1)) != 0) {
+                  strcpy(login, variableValue);
+                }
+              } else if (!password && !strcmp(variableName, "password")) {
+                if ((password = malloc(strlen(variableValue) + 1)) != 0) {
+                  strcpy(password, variableValue);
+                }
+              }
+            }
+
+            /* IF LOGIN VALUE IS MISSING... */
+            if (!login) {
+              /** ERROR | LOGIN VALUE IS MISSING > REDIRECT TO LOGIN PANEL **/
+              RedirectToLoginPanel();
+
+            /* OTHERWISE, IF LOGIN VALUE EXISTS... */
+            } else {
+
+              /* VERIFY LOGIN AND PASSWORD */
+              char *directory;
+              if (!(directory = malloc(strlen(login) + strlen(DIRECTORY) + 1))) {
+                /** ERROR | CANNOT ALLOCATE MEMORY FOR DIRECTORY NAME > REDIRECT TO LOGIN PANEL **/
+                RedirectToLoginPanel();
+              } else {
+                char *systemDirectory;
+                if (!(systemDirectory = malloc(strlen(login) + strlen(SYSTEM_DIRECTORY) + 1))) {
+                  /** ERROR | CANNOT ALLOCATE MEMORY FOR SYSTEM DIRECTORY NAME > REDIRECT TO LOGIN PANEL **/
+                  RedirectToLoginPanel();
+                } else {
+                  strcpy(directory, DIRECTORY);
+                  strcat(directory, login);
+                  strcpy(systemDirectory, SYSTEM_DIRECTORY);
+                  strcat(systemDirectory, login);
+
+                  /* IF DIRECTORY CAN'T BE ACCESSED... */
+                  if (access(directory, F_OK) || access(systemDirectory, F_OK)) {
+                    /** ERROR | CANNOT ACCESS DIRECTORY > REDIRECT TO LOGIN PANEL **/
+                    RedirectToLoginPanel();
+
+                  /* OTHERWISE, IF DIRECTORY CAN BE ACCESSED... */
+                  } else {
+
+                    /* ATTEMPT TO ACCESS PASSWORD FILE */
+                    char *passwordFileName;
+                    if (!(passwordFileName = malloc(strlen(systemDirectory) + strlen(PASSWORD_FILE_NAME) + 1))) {
+                      /** ERROR | CANNOT ALLOCATE MEMORY FOR FILE NAME > REDIRECT TO LOGIN PANEL **/
+                      RedirectToLoginPanel();
+                    } else {
+                      strcpy(passwordFileName, systemDirectory);
+                      strcat(passwordFileName, PASSWORD_FILE_NAME);
+
+                      /* IF PASSWORD FILE CAN'T BE ACCESSED... */
+                      if (access(passwordFileName, F_OK)) {
+                        /** ERROR | CANNOT ACCESS FILE > REDIRECT TO LOGIN PANEL **/
+                        RedirectToLoginPanel();
+
+                      /* OTHERWISE, IF PASSWORD FILE CAN BE ACCESSED... */
+                      } else {
+
+                        /* ATTEMPT TO OPEN PASSWORD FILE FOR READING */
+                        FILE *passwordFile;
+
+                        /* IF PASSWORD FILE CAN'T BE OPENED FOR READING... */
+                        if (!(passwordFile = fopen(passwordFileName, "r"))) {
+                          /** ERROR | CANNOT READ FILE > REDIRECT TO LOGIN PANEL **/
+                          RedirectToLoginPanel();
+
+                        /* OTHERWISE, IF PASSWORD FILE CAN BE OPENED FOR READING... */
+                        } else {
+                          char *filePassword;
+                          if (!(filePassword = malloc(MAX_PASSWORD_SIZE + 1))) {
+                            /** ERROR | CANNOT ALLOCATE MEMORY FOR PASSWORD FROM FILE > REDIRECT TO LOGIN PANEL **/
+                            RedirectToLoginPanel();
+                          } else {
+                            char c;
+                            i = 0;
+
+                            /* READ PASSWORD FROM PASSWORD FILE */
+                            while (((c = fgetc(passwordFile)) != '\n') && (i < MAX_PASSWORD_SIZE)) {
+                              filePassword[i] = c;
+                              ++i;
+                            }
+                            filePassword[i] = '\0';
+                            fclose(passwordFile);
+
+                            /* IF PASSWORD FAILS COMPARISON... */
+                            if (strcmp(filePassword, password)) {
+                              /** ERROR | PASSWORD FAILED > REDIRECT TO LOGIN PANEL **/
+                              RedirectToLoginPanel();
+
+                            /* OTHERWISE, IF PASSWORD PASSES COMPARISON... */
+                            } else {
+
+                              /* LOAD SETTINGS VALUES FROM FILES */
+
+                              /* LOAD interos BOTTOM COMPONENTS FROM FILES */
+
+                              /* DECLARE AND INITIALIZE QUERY VARIABLES */
+                              char *status, *button;
+                              status = button = NULL;
+
+                              /* IF QUERY DATA EXISTS AND IS OF ACCEPTABLE LENGTH... */
+                              if (getenv("QUERY_STRING") && (sizeof(strlen(getenv("QUERY_STRING"))) <= sizeof(INT))) {
+                                char *query;
+                                INT queryLength = strlen(getenv("QUERY_STRING"));
+                                if ((queryLength < 1) || !(query = malloc(queryLength + 1))) {
+                                  /** ERROR | CRUCIAL MEMORY ALLOCATION ERROR FOR QUERY DATA! > CONTINUE WITHOUT QUERY **/
+                                } else {
+                                  strcpy(query, getenv("QUERY_STRING"));
+                                  free(variableName);
+                                  if (!(variableName = malloc(queryLength + 1))) {
+                                    /** ERROR | CANNOT ALLOCATE MEMORY FOR VARIABLE NAME > CONTINUE WITHOUT QUERY **/
+                                  } else {
+                                    free(variableValue);
+                                    if (!(variableValue = malloc(queryLength + 1))) {
+                                      /** ERROR | CANNOT ALLOCATE MEMORY FOR VARIABLE VALUE > CONTINUE WITHOUT QUERY **/
+
+                                    /* IF SUFFICIENT MEMORY FOR QUERY VARIABLES... */
+                                    } else {
+
+                                      /* PROCESS QUERY DATA */
+                                      INT q = 0;
+                                      i = 0;
+                                      while ((q < queryLength) && (query[q] != '\0')) {
+                                        while ((q < queryLength) && (query[q] != '=') && (query[q] != '\0')) {
+                                          variableName[i] = query[q];
+                                          ++q;
+                                          ++i;
+                                        }
+                                        variableName[i] = '\0';
+                                        ++q;
+                                        i = 0;
+                                        while ((query[q] != '&') && (query[q] != '\0')) {
+                                          variableValue[i] = query[q];
+                                          ++q;
+                                          ++i;
+                                        }
+                                        variableValue[i] = '\0';
+                                        if (query[q] != '\0') {
+                                          ++q;
+                                        }
+                                        if (!status && !strcmp(variableName, "status")) {
+                                          if ((status = malloc(strlen(variableValue) + 1)) != 0) {
+                                            strcpy(status, variableValue);
+                                          }
+                                        } else if (!button && !strcmp(variableName, "button")) {
+                                          if ((button = malloc(strlen(variableValue) + 1)) != 0) {
+                                            strcpy(button, variableValue);
+                                          }
+                                        }
+                                      }
+                                    }
+                                  }
+                                  free(query);
+                                }
+                              }
+
+                              /* OUTPUT GUI COMPONENT(S) BASED ON VARIABLES */
+                              if (button) {
+                                if (!strcmp(button, "new")) {
+                                  OutputNewMenuButton();
+                                } else if (!strcmp(button, "settings")) {
+                                  OutputSettingsMenuButton();
+                                } else {
+
+                                  /* OUTPUT XHTML FOR interos BOTTOM BAR */
+                                  OutputBottom(status);
+                                }
+                              } else {
+
+                                /* OUTPUT XHTML FOR interos BOTTOM BAR */
+                                OutputBottom(status);
+                              }
+                              free(button);
+                              free(status);
+                            }
+                            free(filePassword);
+                          }
+                        }
+                      }
+                      free(passwordFileName);
+                    }
+                  }
+                  free(systemDirectory);
+                }
+                free(directory);
+              }
+              free(login);
+            }
+            free(password);
+            free(variableValue);
+          }
+          free(variableName);
+        }
+        free(cookie);
+      }
+    }
+  }
+  return 0;
+}
+
+/* FUNCTION | REDIRECT TO LOGIN PANEL */
+static void RedirectToLoginPanel(void) {
+  BeginXHTMLOutput();
+  BeginBottomOutput();
+  printf("      <a href=\"/login\" \n");
+  printf("         target=\"_top\">click here to login for interos bottom toolbar</a>\n");
+  FinishXHTMLOutput();
+}
+
+/* FUNCTION | OUTPUT XHTML FOR interos BOTTOM TOOLBAR */
+static void OutputBottom(char *status) {
+  BeginXHTMLOutput();
+  BeginBottomOutput();
+  printf("      <table id=\"bottomToolbar\" width=\"100%%\" \n");
+  printf("             border=\"0\" cellpadding=\"0\" cellspacing=\"0\">\n");
+  printf("        <tr>\n");
+  printf("          <td width=\"72\" \n");
+  printf("              height=\"72\"><center>\n");
+  printf("                            <a id=\"newButton\" \n");
+  printf("                               href=\"/interos?menu=new\" \n");
+  printf("                               style=\"padding: 26px 0 27px\" \n");
+  printf("                               target=\"_top\"><strong>new</strong></a>\n");
+  printf("                          </center></td>\n");
+  printf("          <td><center>\n");
+  printf("                &nbsp;<span class=\"hidden\">|</span>&nbsp;\n");
+  printf("              </center></td>\n");
+  printf("          <td width=\"72\" \n");
+  printf("              height=\"72\"><center>\n");
+  printf("                            <a id=\"settingsButton\" \n");
+  printf("                               href=\"/interos?menu=settings\" \n");
+  printf("                               style=\"padding: 26px 0 27px\" \n");
+  printf("                               target=\"_top\"><strong>settings</strong></a>\n");
+  printf("                          </center></td>\n");
+  printf("        </tr>\n");
+  printf("      </table>\n");
+  FinishXHTMLOutput();
+}
+
+/* FUNCTION | OUTPUT XHTML FOR NEW MENU BUTTON */
+static void OutputNewMenuButton(void) {
+  BeginXHTMLOutput();
+  printf("  <!--======================================================-->\n");
+  printf("  <!--      interos Standard Document Header - Markup       -->\n");
+  printf("  <!--======================================================-->\n");
+  printf("  <!--    URIs:  https://interos.com/bottom?button=new      -->\n");
+  printf("  <!--           https://www.interos.com/bottom?button=new  -->\n");
+  printf("  <!--   Title:  interos new menu button                    -->\n");
+  printf("  <!--  Author:  Brent Angeline                             -->\n");
+  printf("  <!--  Markup:  W3C-Validated XHTML 1.0 Transitional       -->\n");
+  printf("  <!--======================================================-->\n");
+  printf("  <head>\n");
+  printf("    <meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\" />\n");
+  printf("    <meta name=\"title\" content=\"interos new menu button\" />\n");
+  printf("    <meta name=\"description\" content=\"button for interos new menu\" />\n");
+  printf("    <meta name=\"author\" content=\"Brent Angeline\" />\n");
+  printf("    <meta name=\"copyright\" \n");
+  printf("          content=\"Copyright &copy; 2001-2010 Brent Angeline and interos LLC\" />\n");
+  printf("    <meta name=\"robots\" content=\"noindex, nofollow, noarchive\" />\n");
+  printf("    <title>interos new menu button</title>\n");
+  printf("    <link rel=\"shortcut icon\" type=\"image/x-icon\" href=\"/favicon.ico\" />\n");
+  printf("    <link rel=\"icon\" type=\"image/gif\" href=\"/images/favicon.gif\" />\n");
+  printf("    <link rel=\"stylesheet\" type=\"text/css\" href=\"/style/main.css\" \n");
+  printf("          media=\"screen, projection\" />\n");
+  printf("    <script type=\"text/javascript\" src=\"/js/bottom.js\"></script>\n");
+  printf("  </head>\n");
+  printf("  <body id=\"body\">\n");
+  printf("    <center>\n");
+  printf("      <table id=\"bottomToolbarFaded\" width=\"100%%\" \n");
+  printf("             border=\"0\" cellpadding=\"0\" cellspacing=\"0\">\n");
+  printf("        <tr>\n");
+  printf("          <td width=\"72\" \n");
+  printf("              height=\"72\"><center>\n");
+  printf("                            <a id=\"newMenuButton\" \n");
+  printf("                               href=\"/main\" \n");
+  printf("                               style=\"padding: 26px 0 27px\" \n");
+  printf("                               target=\"_top\"><strong>&laquo; back</strong></a>\n");
+  printf("                          </center></td>\n");
+  printf("          <td><center>\n");
+  printf("                &nbsp;<span class=\"hidden\">|</span>&nbsp;\n");
+  printf("              </center></td>\n");
+  printf("          <td id=\"bottomToolbarCornerFaded\" \n");
+  printf("              width=\"72\" \n");
+  printf("              height=\"72\"><p>\n");
+  printf("                            <br />\n");
+  printf("                          </p></td>\n");
+  printf("        </tr>\n");
+  printf("      </table>\n");
+  FinishXHTMLOutput();
+}
+
+/* FUNCTION | OUTPUT XHTML FOR SETTINGS MENU BUTTON */
+static void OutputSettingsMenuButton(void) {
+  BeginXHTMLOutput();
+  printf("  <!--===========================================================-->\n");
+  printf("  <!--         interos Standard Document Header - Markup         -->\n");
+  printf("  <!--===========================================================-->\n");
+  printf("  <!--    URIs:  https://interos.com/bottom?button=settings      -->\n");
+  printf("  <!--           https://www.interos.com/bottom?button=settings  -->\n");
+  printf("  <!--   Title:  interos settings menu button                    -->\n");
+  printf("  <!--  Author:  Brent Angeline                                  -->\n");
+  printf("  <!--  Markup:  W3C-Validated XHTML 1.0 Transitional            -->\n");
+  printf("  <!--===========================================================-->\n");
+  printf("  <head>\n");
+  printf("    <meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\" />\n");
+  printf("    <meta name=\"title\" content=\"interos settings menu button\" />\n");
+  printf("    <meta name=\"description\" content=\"button for interos settings menu\" />\n");
+  printf("    <meta name=\"author\" content=\"Brent Angeline\" />\n");
+  printf("    <meta name=\"copyright\" \n");
+  printf("          content=\"Copyright &copy; 2001-2010 Brent Angeline and interos LLC\" />\n");
+  printf("    <meta name=\"robots\" content=\"noindex, nofollow, noarchive\" />\n");
+  printf("    <title>interos settings menu button</title>\n");
+  printf("    <link rel=\"shortcut icon\" type=\"image/x-icon\" href=\"/favicon.ico\" />\n");
+  printf("    <link rel=\"icon\" type=\"image/gif\" href=\"/images/favicon.gif\" />\n");
+  printf("    <link rel=\"stylesheet\" type=\"text/css\" href=\"/style/main.css\" \n");
+  printf("          media=\"screen, projection\" />\n");
+  printf("    <script type=\"text/javascript\" src=\"/js/bottom.js\"></script>\n");
+  printf("  </head>\n");
+  printf("  <body id=\"body\">\n");
+  printf("    <center>\n");
+  printf("      <table id=\"bottomToolbarFaded\" width=\"100%%\" \n");
+  printf("             border=\"0\" cellpadding=\"0\" cellspacing=\"0\">\n");
+  printf("        <tr>\n");
+  printf("          <td id=\"bottomToolbarCornerFaded\" \n");
+  printf("              width=\"72\" \n");
+  printf("              height=\"72\"><p>\n");
+  printf("                            <br />\n");
+  printf("                          </p></td>\n");
+  printf("          <td><center>\n");
+  printf("               &nbsp;<span class=\"hidden\">|</span>&nbsp;\n");
+  printf("              </center></td>\n");
+  printf("          <td width=\"72\" \n");
+  printf("              height=\"72\"><center>\n");
+  printf("                            <a id=\"settingsMenuButton\" \n");
+  printf("                               href=\"/main\" \n");
+  printf("                               style=\"padding: 26px 0 27px\" \n");
+  printf("                               target=\"_top\"><strong>&laquo; back</strong></a>\n");
+  printf("                          </center></td>\n");
+  printf("        </tr>\n");
+  printf("      </table>\n");
+  FinishXHTMLOutput();
+}
+
+/* FUNCTION | BEGIN XHTML OUTPUT */
+static void BeginXHTMLOutput(void) {
+  printf("Content-Type: text/html; charset=utf-8\r\n\r\n");
+  printf("<?xml version=\"1.0\" encoding=\"utf-8\"?>\n");
+  printf("<?xml-stylesheet type=\"text/css\" href=\"/style/main.css\"?>\n");
+  printf("<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \n");
+  printf("                      \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">\n");
+  printf("<html xmlns=\"http://www.w3.org/1999/xhtml\" xml:lang=\"en-US\" lang=\"en-US\">\n");
+}
+
+/* FUNCTION | BEGIN interos BOTTOM TOOLBAR OUTPUT */
+static void BeginBottomOutput(void) {
+  printf("  <!--=================================================-->\n");
+  printf("  <!--    interos Standard Document Header - Markup    -->\n");
+  printf("  <!--=================================================-->\n");
+  printf("  <!--    URIs:  https://interos.com/bottom            -->\n");
+  printf("  <!--           https://www.interos.com/bottom        -->\n");
+  printf("  <!--   Title:  interos bottom toolbar                 -->\n");
+  printf("  <!--  Author:  Brent Angeline                        -->\n");
+  printf("  <!--  Markup:  W3C-Validated XHTML 1.0 Transitional  -->\n");
+  printf("  <!--=================================================-->\n");
+  printf("  <head>\n");
+  printf("    <meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\" />\n");
+  printf("    <meta name=\"title\" content=\"interos bottom toolbar\" />\n");
+  printf("    <meta name=\"description\" content=\"bottom toolbar for interos\" />\n");
+  printf("    <meta name=\"author\" content=\"Brent Angeline\" />\n");
+  printf("    <meta name=\"copyright\" \n");
+  printf("          content=\"Copyright &copy; 2001-2010 Brent Angeline and interos LLC\" />\n");
+  printf("    <meta name=\"robots\" content=\"noindex, nofollow, noarchive\" />\n");
+  printf("    <title>interos bottom</title>\n");
+  printf("    <link rel=\"shortcut icon\" type=\"image/x-icon\" href=\"/favicon.ico\" />\n");
+  printf("    <link rel=\"icon\" type=\"image/gif\" href=\"/images/favicon.gif\" />\n");
+  printf("    <link rel=\"stylesheet\" type=\"text/css\" href=\"/style/main.css\" \n");
+  printf("          media=\"screen, projection\" />\n");
+  printf("    <script type=\"text/javascript\" src=\"/js/bottom.js\"></script>\n");
+  printf("  </head>\n");
+  printf("  <body id=\"body\">\n");
+  printf("    <center>\n");
+}
+
+/* FUNCTION | FINISH XHTML OUTPUT */
+static void FinishXHTMLOutput(void) {
+  printf("    </center>\n");
+  printf("  </body>\n");
+  printf("  <!--=====================================================================-->\n");
+  printf("  <!--                  Copyright and Trademark Statement                  -->\n");
+  printf("  <!--=====================================================================-->\n");
+  printf("  <!--                                                                     -->\n");
+  printf("  <!--          All original textual and graphical site content:           -->\n");
+  printf("  <!--                                                                     -->\n");
+  printf("  <!--  Copyright 2001-2010 Brent Angeline and interos LLC.  All rights    -->\n");
+  printf("  <!--  reserved.  Reproduction in whole or in part without written        -->\n");
+  printf("  <!--  permission is prohibited.  interos and the interos logos are       -->\n");
+  printf("  <!--  trademarks of Brent Angeline and interos LLC.  All other company,  -->\n");
+  printf("  <!--  product, and service names mentioned herein may be the properties  -->\n");
+  printf("  <!--  of their respective owners.  Comments in the interos.org forums    -->\n");
+  printf("  <!--  are the properties of their respective authors.  All software      -->\n");
+  printf("  <!--  developed in the forums is open source and belongs to everyone.    -->\n");
+  printf("  <!--                                                                     -->\n");
+  printf("  <!--=====================================================================-->\n");
+  printf("  <!--                      e-mail: info@interos.com                       -->\n");
+  printf("  <!--=====================================================================-->\n");
+  printf("</html>");
+}
+
+/***********************************************************************/
+/*                  Copyright and Trademark Statement                  */
+/***********************************************************************/
+/*                                                                     */
+/*          All original textual and graphical site content:           */
+/*                                                                     */
+/*  Copyright 2001-2010 Brent Angeline and interos LLC.  All rights    */
+/*  reserved.  Reproduction in whole or in part without written        */
+/*  permission is prohibited.  interos and the interos logos are       */
+/*  trademarks of Brent Angeline and interos LLC.  All other company,  */
+/*  product, and service names mentioned herein may be the properties  */
+/*  of their respective owners.  Comments in the interos.org forums    */
+/*  are the properties of their respective authors.  All software      */
+/*  developed in the forums is open source and belongs to everyone.    */
+/*                                                                     */
+/***********************************************************************/
+/*                      e-mail: info@interos.com                       */
+/***********************************************************************/
diff --git a/c/browse_interos.com_ssl.c b/c/browse_interos.com_ssl.c
new file mode 100644 (file)
index 0000000..34e4e69
--- /dev/null
@@ -0,0 +1,374 @@
+/**************************************************/
+/*  interos Standard Document Header - CGI in C   */
+/**************************************************/
+/*         URIs:  https://interos.com/browse      */
+/*                https://www.interos.com/browse  */
+/*       Source:  browse.c                        */
+/*  Description:  FastCGI for interos browse      */
+/*       Author:  Brent Angeline                  */
+/*          CGI:  FastCGI in ISO/ANSI C           */
+/**************************************************/
+
+/* PREPROCESSOR DIRECTIVES */
+#include "fcgi_stdio.h"     /*  EOF, FCGI_Accept(), fclose(), fgetc(), fopen(), fread(), printf()        */
+#include "interos.h"        /*  DIRECTORY, INT, MAX_PASSWORD_SIZE, PASSWORD_FILE_NAME, SYSTEM_DIRECTORY  */
+#include <stdlib.h>         /*  free(), getenv(), malloc()                                               */
+#include <string.h>         /*  strcat(), strcmp(), strcpy(), strlen()                                   */
+#include <unistd.h>         /*  F_OK, access()                                                           */
+
+/* FUNCTION PROTOTYPE DECLARATIONS */
+static void RedirectToLoginPanel(void);
+static void BeginXHTMLOutput(void);
+static void FinishXHTMLOutput(void);
+
+/* BEGIN MAIN PROGRAM */
+int main(void) {
+
+  /* BEGIN FASTCGI */
+  while (FCGI_Accept() >= 0) {
+
+    /* IF COOKIE DATA DOESN'T EXIST OR IS TOO LONG... */
+    if (!getenv("HTTP_COOKIE") || (sizeof(strlen(getenv("HTTP_COOKIE"))) > sizeof(INT))) {
+      /** ERROR | COOKIE DATA DOES NOT EXIST OR IS TOO LONG > REDIRECT TO LOGIN PANEL **/
+      RedirectToLoginPanel();
+
+    /* OTHERWISE, IF COOKIE DATA DOES EXIST AND IS OF ACCEPTABLE LENGTH... */
+    } else {
+
+      /* ATTEMPT TO ALLOCATE MEMORY FOR COOKIE VARIABLES */
+      char *cookie;
+      INT cookieLength = strlen(getenv("HTTP_COOKIE"));
+      if ((cookieLength < 1) || !(cookie = malloc(cookieLength + 1))) {
+        /** ERROR | CRUCIAL MEMORY ALLOCATION ERROR FOR COOKIE DATA! > REDIRECT TO LOGIN PANEL **/
+        RedirectToLoginPanel();
+      } else {
+        char *variableName;
+        if (!(variableName = malloc(cookieLength + 1))) {
+          /** ERROR | CANNOT ALLOCATE MEMORY FOR COOKIE VARIABLE NAME > REDIRECT TO LOGIN PANEL **/
+          RedirectToLoginPanel();
+        } else {
+          char *variableValue;
+          if (!(variableValue = malloc(cookieLength + 1))) {
+            /** ERROR | CANNOT ALLOCATE MEMORY FOR COOKIE VARIABLE VALUE > REDIRECT TO LOGIN PANEL **/
+            RedirectToLoginPanel();
+
+          /* IF SUFFICIENT MEMORY FOR COOKIE VARIABLES... */
+          } else {
+
+            /* PROCESS COOKIE DATA */
+            char *login, *password;
+            INT c, i;
+            login = password = NULL;
+            c = 0;
+            strcpy(cookie, getenv("HTTP_COOKIE"));
+            while ((c < cookieLength) && (cookie[c] != '\0')) {
+              i = 0;
+              while ((c < cookieLength) && (cookie[c] != '=') && (cookie[c] != '\0')) {
+                variableName[i] = cookie[c];
+                ++c;
+                ++i;
+              }
+              variableName[i] = '\0';
+              ++c;
+              i = 0;
+              while ((c < cookieLength) && (cookie[c] != ';') && (cookie[c] != '\0')) {
+                variableValue[i] = cookie[c];
+                ++c;
+                ++i;
+              }
+              variableValue[i] = '\0';
+              ++c;
+              while ((c < cookieLength) && (cookie[c] == ' ')) {
+                ++c;
+              }
+              if (!login && !strcmp(variableName, "login")) {
+                if ((login = malloc(strlen(variableValue) + 1)) != 0) {
+                  strcpy(login, variableValue);
+                }
+              } else if (!password && !strcmp(variableName, "password")) {
+                if ((password = malloc(strlen(variableValue) + 1)) != 0) {
+                  strcpy(password, variableValue);
+                }
+              }
+            }
+
+            /* IF LOGIN VALUE IS MISSING... */
+            if (!login) {
+              /** ERROR | LOGIN VALUE IS MISSING > REDIRECT TO LOGIN PANEL **/
+              RedirectToLoginPanel();
+
+              /* OTHERWISE, IF LOGIN VALUE EXISTS... */
+              } else {
+
+              /* VERIFY LOGIN AND PASSWORD */
+              char *directory;
+              if (!(directory = malloc(strlen(login) + strlen(DIRECTORY) + 1))) {
+                /** ERROR | CANNOT ALLOCATE MEMORY FOR DIRECTORY NAME > REDIRECT TO LOGIN PANEL **/
+                RedirectToLoginPanel();
+              } else {
+                char *systemDirectory;
+                if (!(systemDirectory = malloc(strlen(login) + strlen(SYSTEM_DIRECTORY) + 1))) {
+                  /** ERROR | CANNOT ALLOCATE MEMORY FOR SYSTEM DIRECTORY NAME > REDIRECT TO LOGIN PANEL **/
+                  RedirectToLoginPanel();
+                } else {
+                  strcpy(directory, DIRECTORY);
+                  strcat(directory, login);
+                  strcpy(systemDirectory, SYSTEM_DIRECTORY);
+                  strcat(systemDirectory, login);
+
+                  /* IF DIRECTORY CAN'T BE ACCESSED... */
+                  if (access(directory, F_OK) || access(systemDirectory, F_OK)) {
+                    /** ERROR | CANNOT ACCESS DIRECTORY > REDIRECT TO LOGIN PANEL **/
+                    RedirectToLoginPanel();
+
+                  /* OTHERWISE, IF DIRECTORY CAN BE ACCESSED... */
+                  } else {
+
+                    /* ATTEMPT TO ACCESS PASSWORD FILE */
+                    char *passwordFileName;
+                    if (!(passwordFileName = malloc(strlen(systemDirectory) + strlen(PASSWORD_FILE_NAME) + 1))) {
+                      /** ERROR | CANNOT ALLOCATE MEMORY FOR FILE NAME > REDIRECT TO LOGIN PANEL **/
+                      RedirectToLoginPanel();
+                    } else {
+                      strcpy(passwordFileName, systemDirectory);
+                      strcat(passwordFileName, PASSWORD_FILE_NAME);
+
+                      /* IF PASSWORD FILE CAN'T BE ACCESSED... */
+                      if (access(passwordFileName, F_OK)) {
+                        /** ERROR | CANNOT ACCESS FILE > REDIRECT TO LOGIN PANEL **/
+                        RedirectToLoginPanel();
+
+                      /* OTHERWISE, IF PASSWORD FILE CAN BE ACCESSED... */
+                      } else {
+
+                        /* ATTEMPT TO OPEN PASSWORD FILE FOR READING */
+                        FILE *passwordFile;
+
+                        /* IF PASSWORD FILE CAN'T BE OPENED FOR READING... */
+                        if (!(passwordFile = fopen(passwordFileName, "r"))) {
+                          /** ERROR | CANNOT READ FILE > REDIRECT TO LOGIN PANEL **/
+                          RedirectToLoginPanel();
+
+                        /* OTHERWISE, IF PASSWORD FILE CAN BE OPENED FOR READING... */
+                        } else {
+                          char *filePassword;
+                          if (!(filePassword = malloc(MAX_PASSWORD_SIZE + 1))) {
+                            /** ERROR | CANNOT ALLOCATE MEMORY FOR PASSWORD FROM FILE > REDIRECT TO LOGIN PANEL **/
+                            RedirectToLoginPanel();
+                          } else {
+                            char c;
+                            i = 0;
+
+                            /* READ PASSWORD FROM PASSWORD FILE */
+                            while (((c = fgetc(passwordFile)) != '\n') && (i < MAX_PASSWORD_SIZE)) {
+                              filePassword[i] = c;
+                              ++i;
+                            }
+                            filePassword[i] = '\0';
+                            fclose(passwordFile);
+
+                            /* IF PASSWORD FAILS COMPARISON... */
+                            if (strcmp(filePassword, password)) {
+                              /** ERROR | PASSWORD FAILED > REDIRECT TO LOGIN PANEL **/
+                              RedirectToLoginPanel();
+
+                            /* OTHERWISE, IF PASSWORD PASSES COMPARISON... */
+                            } else {
+
+                              /* LOAD SETTINGS VALUES FROM FILE(S) */
+
+                              /* DECLARE AND INITIALIZE QUERY VARIABLES */
+                              char *address, *search;
+                              address = search = NULL;
+
+                              /* IF QUERY DATA EXISTS AND IS OF ACCEPTABLE LENGTH... */
+                              if (getenv("QUERY_STRING") && (sizeof(strlen(getenv("QUERY_STRING"))) <= sizeof(INT))) {
+                                char *query;
+                                INT queryLength = strlen(getenv("QUERY_STRING"));
+                                if ((queryLength < 1) || !(query = malloc(queryLength + 1))) {
+                                  /** ERROR | CRUCIAL MEMORY ALLOCATION ERROR FOR QUERY DATA! > CONTINUE WITHOUT QUERY **/
+                                } else {
+                                  strcpy(query, getenv("QUERY_STRING"));
+                                  free(variableName);
+                                  if (!(variableName = malloc(queryLength + 1))) {
+                                    /** ERROR | CANNOT ALLOCATE MEMORY FOR VARIABLE NAME > CONTINUE WITHOUT QUERY **/
+                                  } else {
+                                    free(variableValue);
+                                    if (!(variableValue = malloc(queryLength + 1))) {
+                                      /** ERROR | CANNOT ALLOCATE MEMORY FOR VARIABLE VALUE > CONTINUE WITHOUT QUERY **/
+
+                                    /* IF SUFFICIENT MEMORY FOR QUERY VARIABLES... */
+                                    } else {
+
+                                      /* PROCESS QUERY DATA */
+                                      INT q = 0;
+                                      i = 0;
+                                      while ((q < queryLength) && (query[q] != '\0')) {
+                                        while ((q < queryLength) && (query[q] != '=') && (query[q] != '\0')) {
+                                          variableName[i] = query[q];
+                                          ++q;
+                                          ++i;
+                                        }
+                                        variableName[i] = '\0';
+                                        ++q;
+                                        i = 0;
+                                        while ((query[q] != '&') && (query[q] != '\0')) {
+                                          variableValue[i] = query[q];
+                                          ++q;
+                                          ++i;
+                                        }
+                                        variableValue[i] = '\0';
+                                        if (query[q] != '\0') {
+                                          ++q;
+                                        }
+                                        if (!address && !strcmp(variableName, "address")) {
+                                          if ((address = malloc(strlen(variableValue) + 1)) != 0) {
+                                            strcpy(address, variableValue);
+                                          }
+                                        } else if (!search && !strcmp(variableName, "search")) {
+                                          if ((search = malloc(strlen(variableValue) + 1)) != 0) {
+                                            strcpy(search, variableValue);
+                                            for (c = 0; c < strlen(search); ++c) {
+                                              if (search[c] == ' ') {
+                                                search[c] = '+';
+                                              }
+                                            }
+                                          }
+                                        }
+                                      }
+                                      free(variableValue);
+                                      variableValue = NULL;
+                                    }
+                                    free(variableName);
+                                    variableName = NULL;
+                                  }
+                                  free(query);
+                                }
+                              }
+
+                              /* IF THIS IS A CONTINUED SESSION... */
+
+                                /* LOAD SESSION FROM FILE */
+
+                              /* OUTPUT GUI COMPONENTS BASED ON VARIABLES */
+                              printf("Content-type: text/html\n\n");
+                              printf("<!--=======================================================-->\n");
+                              printf("<!--  interos.com Standard Document Model Header - Markup  -->\n");
+                              printf("<!--=======================================================-->\n");
+                              printf("<!--      URIs:   https://www.interos.com/sys/browser      -->\n");
+                              printf("<!--              interos.com/sys/browser                  -->\n");
+                              printf("<!--      Title:  interos browser                          -->\n");
+                              printf("<!--     Author:  Brent Angeline                           -->\n");
+                              printf("<!--     Markup:  Dynamic XHTML                            -->\n");
+                              printf("<!--=======================================================-->\n");
+                              printf("<html>");
+                                printf("<head>");
+                                  printf("<title>interos > %s > browser</title>", login);
+                                printf("</head>");
+                                printf("<frameset rows=\"72,*,72\" border=\"0\">");
+                                  printf("<frame name=\"top\" src=\"top\" scrolling=\"no\" noresize=\"noresize\">");
+                                  if (address != NULL) {
+                                    printf("<frame name=\"content\" src=\"http://%s\" scrolling=\"yes\" noresize=\"noresize\">", address);
+                                  } else {
+                                    printf("<frame name=\"content\" src=\"http://www.google.com/search?hl=en&q=%s&btnG=Google+Search\" scrolling=\"yes\" noresize=\"noresize\">", search);
+                                  }
+                                  printf("<frame name=\"bottom\" src=\"bottom\" scrolling=\"no\" noresize=\"noresize\">");
+                                printf("</frameset>");
+                                printf("<noframes>");
+                                printf("</noframes>");
+                              printf("</html>\n");
+                              printf("<!--===========================================================================-->\n");
+                              printf("<!--                   Copyright and Trademark Legal Notice                    -->\n");
+                              printf("<!--===========================================================================-->\n");
+                              printf("<!--                                                                           -->\n");
+                              printf("<!--                  All textual and graphical site content:                  -->\n");
+                              printf("<!--                                                                           -->\n");
+                              printf("<!--  Copyright (C) 2001 - 2010 Brent Angeline / interos.com / interos.        -->\n");
+                              printf("<!--  Reproduction in whole or part without written permission is prohibited.  -->\n");
+                              printf("<!--  All rights reserved.  interos.com and the interos logos are              -->\n");
+                              printf("<!--  trademarks of Brent Angeline / interos.com / interos.                    -->\n");
+                              printf("<!--  All other company names, product names and services mentioned herein     -->\n");
+                              printf("<!--  may be the property of their respective owners.                          -->\n");
+                              printf("<!--                                                                           -->\n");
+                              printf("<!--===========================================================================-->\n");
+                              printf("<!--                         e-mail: info@interos.com                          -->\n");
+                              printf("<!--===========================================================================-->");
+
+                              free(address);
+                              free(search);
+                            }
+                            free(filePassword);
+                          }
+                        }
+                      }
+                      free(passwordFileName);
+                    }
+                  }
+                  free(systemDirectory);
+                }
+                free(directory);
+              }
+              free(login);
+            }
+            free(password);
+            free(variableValue);
+          }
+          free(variableName);
+        }
+        free(cookie);
+      }
+    }
+  }
+  return 0;
+}
+
+/* FUNCTION | REDIRECT TO LOGIN PANEL */
+static void RedirectToLoginPanel(void) {
+  printf("Location: login\r\n\r\n");
+}
+
+static void BeginXHTMLOutput(void) {
+  printf("Content-Type: text/html; charset=utf-8\r\n\r\n");
+  printf("<?xml version=\"1.0\" encoding=\"utf-8\"?>\n");
+}
+
+static void FinishXHTMLOutput(void) {
+  printf("  <!--=====================================================================-->\n");
+  printf("  <!--                  Copyright and Trademark Statement                  -->\n");
+  printf("  <!--=====================================================================-->\n");
+  printf("  <!--                                                                     -->\n");
+  printf("  <!--          All original textual and graphical site content:           -->\n");
+  printf("  <!--                                                                     -->\n");
+  printf("  <!--  Copyright 2001-2010 Brent Angeline and interos LLC.  All rights    -->\n");
+  printf("  <!--  reserved.  Reproduction in whole or in part without written        -->\n");
+  printf("  <!--  permission is prohibited.  interos and the interos logos are       -->\n");
+  printf("  <!--  trademarks of Brent Angeline and interos LLC.  All other company,  -->\n");
+  printf("  <!--  product, and service names mentioned herein may be the properties  -->\n");
+  printf("  <!--  of their respective owners.  Comments in the interos.org forums    -->\n");
+  printf("  <!--  are the properties of their respective authors.  All software      -->\n");
+  printf("  <!--  developed in the forums is open source and belongs to everyone.    -->\n");
+  printf("  <!--                                                                     -->\n");
+  printf("  <!--=====================================================================-->\n");
+  printf("  <!--                      e-mail: info@interos.com                       -->\n");
+  printf("  <!--=====================================================================-->\n");
+  printf("</html>");
+}
+
+/***********************************************************************/
+/*                  Copyright and Trademark Statement                  */
+/***********************************************************************/
+/*                                                                     */
+/*          All original textual and graphical site content:           */
+/*                                                                     */
+/*  Copyright 2001-2010 Brent Angeline and interos LLC.  All rights    */
+/*  reserved.  Reproduction in whole or in part without written        */
+/*  permission is prohibited.  interos and the interos logos are       */
+/*  trademarks of Brent Angeline and interos LLC.  All other company,  */
+/*  product, and service names mentioned herein may be the properties  */
+/*  of their respective owners.  Comments in the interos.org forums    */
+/*  are the properties of their respective authors.  All software      */
+/*  developed in the forums is open source and belongs to everyone.    */
+/*                                                                     */
+/***********************************************************************/
+/*                      e-mail: info@interos.com                       */
+/***********************************************************************/
diff --git a/c/content_interos.com_ssl.c b/c/content_interos.com_ssl.c
new file mode 100644 (file)
index 0000000..5cc4065
--- /dev/null
@@ -0,0 +1,390 @@
+/***************************************************/
+/*   interos Standard Document Header - CGI in C   */
+/***************************************************/
+/*         URIs:  https://interos.com/content      */
+/*                https://www.interos.com/content  */
+/*       Source:  content.c                        */
+/*  Description:  FastCGI for interos content      */
+/*       Author:  Brent Angeline                   */
+/*          CGI:  FastCGI in ISO/ANSI C            */
+/***************************************************/
+
+/* PREPROCESSOR DIRECTIVES */
+#include "fcgi_stdio.h"     /*  FCGI_Accept(), fclose(), fgetc(), fopen(), printf()                      */
+#include "interos.h"        /*  DIRECTORY, INT, MAX_PASSWORD_SIZE, PASSWORD_FILE_NAME, SYSTEM_DIRECTORY  */
+#include <stdlib.h>         /*  free(), getenv(), malloc()                                               */
+#include <string.h>         /*  strcat(), strcmp(), strcpy(), strlen()                                   */
+#include <unistd.h>         /*  F_OK, access()                                                           */
+
+/* FUNCTION PROTOTYPE DECLARATIONS */
+static void RedirectToLoginPanel(void);
+static void OutputContent(const char *variableName, char *variableValue);
+
+/* BEGIN MAIN PROGRAM */
+int main(void) {
+
+  /* BEGIN FASTCGI */
+  while (FCGI_Accept() >= 0) {
+
+    /* IF COOKIE DATA DOESN'T EXIST OR IS TOO LONG... */
+    if (!getenv("HTTP_COOKIE") || (sizeof(strlen(getenv("HTTP_COOKIE"))) > sizeof(INT))) {
+      /** ERROR | COOKIE DATA DOES NOT EXIST OR IS TOO LONG > REDIRECT TO LOGIN PANEL **/
+      RedirectToLoginPanel();
+
+    /* OTHERWISE, IF COOKIE DATA DOES EXIST AND IS OF ACCEPTABLE LENGTH... */
+    } else {
+
+      /* ATTEMPT TO ALLOCATE MEMORY FOR COOKIE VARIABLES */
+      char *cookie;
+      INT cookieLength = strlen(getenv("HTTP_COOKIE"));
+      if ((cookieLength < 1) || !(cookie = malloc(cookieLength + 1))) {
+        /** ERROR | CRUCIAL MEMORY ALLOCATION ERROR FOR COOKIE DATA! > REDIRECT TO LOGIN PANEL **/
+        RedirectToLoginPanel();
+      } else {
+        char *variableName;
+        if (!(variableName = malloc(cookieLength + 1))) {
+          /** ERROR | CANNOT ALLOCATE MEMORY FOR COOKIE VARIABLE NAME > REDIRECT TO LOGIN PANEL **/
+          RedirectToLoginPanel();
+        } else {
+          char *variableValue;
+          if (!(variableValue = malloc(cookieLength + 1))) {
+            /** ERROR | CANNOT ALLOCATE MEMORY FOR COOKIE VARIABLE VALUE > REDIRECT TO LOGIN PANEL **/
+            RedirectToLoginPanel();
+
+          /* IF SUFFICIENT MEMORY FOR COOKIE VARIABLES... */
+          } else {
+
+            /* PROCESS COOKIE DATA */
+            char *login, *password;
+            INT c, i;
+            login = password = NULL;
+            c = 0;
+            strcpy(cookie, getenv("HTTP_COOKIE"));
+            while ((c < cookieLength) && (cookie[c] != '\0')) {
+              i = 0;
+              while ((c < cookieLength) && (cookie[c] != '=') && (cookie[c] != '\0')) {
+                variableName[i] = cookie[c];
+                ++c;
+                ++i;
+              }
+              variableName[i] = '\0';
+              ++c;
+              i = 0;
+              while ((c < cookieLength) && (cookie[c] != ';') && (cookie[c] != '\0')) {
+                variableValue[i] = cookie[c];
+                ++c;
+                ++i;
+              }
+              variableValue[i] = '\0';
+              ++c;
+              while ((c < cookieLength) && (cookie[c] == ' ')) {
+                ++c;
+              }
+              if (!login && !strcmp(variableName, "login")) {
+                if ((login = malloc(strlen(variableValue) + 1)) != 0) {
+                  strcpy(login, variableValue);
+                }
+              } else if (!password && !strcmp(variableName, "password")) {
+                if ((password = malloc(strlen(variableValue) + 1)) != 0) {
+                  strcpy(password, variableValue);
+                }
+              }
+            }
+
+            /* IF LOGIN VALUE IS MISSING... */
+            if (!login) {
+              /** ERROR | LOGIN VALUE IS MISSING > REDIRECT TO LOGIN PANEL **/
+              RedirectToLoginPanel();
+
+            /* OTHERWISE, IF LOGIN VALUE EXISTS... */
+            } else {
+
+              /* VERIFY LOGIN AND PASSWORD */
+              char *directory;
+              if (!(directory = malloc(strlen(login) + strlen(DIRECTORY) + 1))) {
+                /** ERROR | CANNOT ALLOCATE MEMORY FOR DIRECTORY NAME > REDIRECT TO LOGIN PANEL **/
+                RedirectToLoginPanel();
+              } else {
+                char *systemDirectory;
+                if (!(systemDirectory = malloc(strlen(login) + strlen(SYSTEM_DIRECTORY) + 1))) {
+                  /** ERROR | CANNOT ALLOCATE MEMORY FOR SYSTEM DIRECTORY NAME > REDIRECT TO LOGIN PANEL **/
+                  RedirectToLoginPanel();
+                } else {
+                  strcpy(directory, DIRECTORY);
+                  strcat(directory, login);
+                  strcpy(systemDirectory, SYSTEM_DIRECTORY);
+                  strcat(systemDirectory, login);
+
+                  /* IF DIRECTORY CAN'T BE ACCESSED... */
+                  if (access(directory, F_OK) || access(systemDirectory, F_OK)) {
+                    /** ERROR | CANNOT ACCESS DIRECTORY > REDIRECT TO LOGIN PANEL **/
+                    RedirectToLoginPanel();
+
+                  /* OTHERWISE, IF DIRECTORY CAN BE ACCESSED... */
+                  } else {
+
+                    /* ATTEMPT TO ACCESS PASSWORD FILE */
+                    char *passwordFileName;
+                    if (!(passwordFileName = malloc(strlen(systemDirectory) + strlen(PASSWORD_FILE_NAME) + 1))) {
+                      /** ERROR | CANNOT ALLOCATE MEMORY FOR FILE NAME > REDIRECT TO LOGIN PANEL **/
+                      RedirectToLoginPanel();
+                    } else {
+                      strcpy(passwordFileName, systemDirectory);
+                      strcat(passwordFileName, PASSWORD_FILE_NAME);
+
+                      /* IF PASSWORD FILE CAN'T BE ACCESSED... */
+                      if (access(passwordFileName, F_OK)) {
+                        /** ERROR | CANNOT ACCESS FILE > REDIRECT TO LOGIN PANEL **/
+                        RedirectToLoginPanel();
+
+                      /* OTHERWISE, IF PASSWORD FILE CAN BE ACCESSED... */
+                      } else {
+
+                        /* ATTEMPT TO OPEN PASSWORD FILE FOR READING */
+                        FILE *passwordFile;
+
+                        /* IF PASSWORD FILE CAN'T BE OPENED FOR READING... */
+                        if (!(passwordFile = fopen(passwordFileName, "r"))) {
+                          /** ERROR | CANNOT READ FILE > REDIRECT TO LOGIN PANEL **/
+                          RedirectToLoginPanel();
+
+                        /* OTHERWISE, IF PASSWORD FILE CAN BE OPENED FOR READING... */
+                        } else {
+                          char *filePassword;
+                          if (!(filePassword = malloc(MAX_PASSWORD_SIZE + 1))) {
+                            /** ERROR | CANNOT ALLOCATE MEMORY FOR PASSWORD FROM FILE > REDIRECT TO LOGIN PANEL **/
+                            RedirectToLoginPanel();
+                          } else {
+                            char c;
+                            i = 0;
+
+                            /* READ PASSWORD FROM PASSWORD FILE */
+                            while (((c = fgetc(passwordFile)) != '\n') && (i < MAX_PASSWORD_SIZE)) {
+                              filePassword[i] = c;
+                              ++i;
+                            }
+                            filePassword[i] = '\0';
+                            fclose(passwordFile);
+
+                            /* IF PASSWORD FAILS COMPARISON... */
+                            if (strcmp(filePassword, password)) {
+                              /** ERROR | PASSWORD FAILED > REDIRECT TO LOGIN PANEL **/
+                              RedirectToLoginPanel();
+
+                            /* OTHERWISE, IF PASSWORD PASSES COMPARISON... */
+                            } else {
+
+                              /* LOAD SETTINGS VALUES FROM FILES */
+
+                              /* LOAD interos CONTENT COMPONENTS FROM FILES */
+
+                              /* DECLARE AND INITIALIZE QUERY VARIABLES */
+                              char *new, *open, *text_file, *status;
+                              new = open = text_file = status = NULL;
+
+                              /* IF QUERY DATA EXISTS AND IS OF ACCEPTABLE LENGTH... */
+                              if (getenv("QUERY_STRING") && (sizeof(strlen(getenv("QUERY_STRING"))) <= sizeof(INT))) {
+                                char *query;
+                                INT queryLength = strlen(getenv("QUERY_STRING"));
+                                if ((queryLength < 1) || !(query = malloc(queryLength + 1))) {
+                                  /** ERROR | CRUCIAL MEMORY ALLOCATION ERROR FOR QUERY DATA! > CONTINUE WITHOUT QUERY **/
+                                } else {
+                                  free(variableName);
+                                  strcpy(query, getenv("QUERY_STRING"));
+                                  if (!(variableName = malloc(queryLength + 1))) {
+                                    /** ERROR | CANNOT ALLOCATE MEMORY FOR VARIABLE NAME > CONTINUE WITHOUT QUERY **/
+                                  } else {
+                                    free(variableValue);
+                                    if (!(variableValue = malloc(queryLength + 1))) {
+                                      /** ERROR | CANNOT ALLOCATE MEMORY FOR VARIABLE VALUE > CONTINUE WITHOUT QUERY **/
+
+                                    /* IF SUFFICIENT MEMORY FOR QUERY VARIABLES... */
+                                    } else {
+
+                                      /* PROCESS QUERY DATA */
+                                      INT q = 0;
+                                      i = 0;
+                                      while ((q < queryLength) && (query[q] != '\0')) {
+                                        while ((q < queryLength) && (query[q] != '=') && (query[q] != '\0')) {
+                                          variableName[i] = query[q];
+                                          ++q;
+                                          ++i;
+                                        }
+                                        variableName[i] = '\0';
+                                        ++q;
+                                        i = 0;
+                                        while ((query[q] != '&') && (query[q] != '\0')) {
+                                          variableValue[i] = query[q];
+                                          ++q;
+                                          ++i;
+                                        }
+                                        variableValue[i] = '\0';
+                                        if (query[q] != '\0') {
+                                          ++q;
+                                        }
+                                        if (!new && !strcmp(variableName, "new")) {
+                                          if ((new = malloc(strlen(variableValue) + 1)) != 0) {
+                                            strcpy(new, variableValue);
+                                          }
+                                        } else if (!open && !strcmp(variableName, "open")) {
+                                          if ((open = malloc(strlen(variableValue) + 1)) != 0) {
+                                            strcpy(open, variableValue);
+                                          }
+                                        } else if (!text_file && !strcmp(variableName, "text_file")) {
+                                          if ((text_file = malloc(strlen(variableValue) + 1)) != 0) {
+                                            strcpy(text_file, variableValue);
+                                          }
+                                        } else if (!status && !strcmp(variableName, "status")) {
+                                          if ((status = malloc(strlen(variableValue) + 1)) != 0) {
+                                            strcpy(status, variableValue);
+                                          }
+                                        }
+                                      }
+                                      free(variableValue);
+                                      variableValue = NULL;
+                                    }
+                                    free(variableName);
+                                    variableName = NULL;
+                                  }
+                                  free(query);
+                                }
+                              }
+
+                              /* OUTPUT XHTML FOR interos CONTENT */
+                              if (new) {
+                                OutputContent("new", new);
+                              } else if (open) {
+                                OutputContent("open", open);
+                              } else if (text_file) {
+                                OutputContent("text_file", text_file);
+                              } else if (status) {
+                                OutputContent("status", status);
+                              } else {
+                                OutputContent(NULL, NULL);
+                              }
+                              free(status);
+                              free(text_file);
+                              free(open);
+                              free(new);
+                            }
+                            free(filePassword);
+                          }
+                        }
+                      }
+                      free(passwordFileName);
+                    }
+                  }
+                  free(systemDirectory);
+                }
+                free(directory);
+              }
+              free(login);
+            }
+            free(password);
+            free(variableValue);
+          }
+          free(variableName);
+        }
+        free(cookie);
+      }
+    }
+  }
+  return 0;
+}
+
+/* FUNCTION | REDIRECT TO LOGIN PANEL */
+static void RedirectToLoginPanel(void) {
+  printf("Location: login\r\n\r\n");
+}
+
+/* FUNCTION | OUTPUT XHTML FOR interos CONTENT */
+static void OutputContent(const char *variableName, char *variableValue) {
+  printf("Content-Type: text/html\r\n\r\n");
+  printf("<?xml version=\"1.0\" encoding=\"utf-8\"?>\n");
+  printf("<?xml-stylesheet type=\"text/css\" href=\"/style/content.css\"?>\n");
+  printf("<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \n");
+  printf("                      \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">\n");
+  printf("<html xmlns=\"http://www.w3.org/1999/xhtml\" xml:lang=\"en-US\" lang=\"en-US\">\n");
+  printf("  <!--=================================================-->\n");
+  printf("  <!--    interos Standard Document Header - Markup    -->\n");
+  printf("  <!--=================================================-->\n");
+  printf("  <!--    URIs:  https://interos.com/content           -->\n");
+  printf("  <!--           https://www.interos.com/content       -->\n");
+  printf("  <!--   Title:  interos content                       -->\n");
+  printf("  <!--  Author:  Brent Angeline                        -->\n");
+  printf("  <!--  Markup:  W3C-Validated XHTML 1.0 Transitional  -->\n");
+  printf("  <!--=================================================-->\n");
+  printf("  <head>\n");
+  printf("    <meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\" />\n");
+  printf("    <meta name=\"title\" content=\"interos content\" />\n");
+  printf("    <meta name=\"description\" content=\"middle frame for interos content\" />\n");
+  printf("    <meta name=\"author\" content=\"Brent Angeline\" />\n");
+  printf("    <meta name=\"copyright\" \n");
+  printf("          content=\"Copyright &copy; 2001-2010 Brent Angeline and interos LLC\" />\n");
+  printf("    <meta name=\"robots\" content=\"noindex,nofollow,noarchive\" />\n");
+  printf("    <title>interos content</title>\n");
+  printf("    <link rel=\"shortcut icon\" type=\"image/x-icon\" href=\"/favicon.ico\" />\n");
+  printf("    <link rel=\"icon\" type=\"image/gif\" href=\"/images/favicon.gif\" />\n");
+  printf("    <link rel=\"stylesheet\" type=\"text/css\" href=\"/style/content.css\" />\n");
+  printf("    <script type=\"text/javascript\" src=\"/js/content.js\"></script>\n");
+  printf("  </head>\n");
+  printf("  <body>\n");
+  printf("    <div id=\"content\">\n");
+  if (variableName && variableValue) {
+    if (!strcmp(variableName, "new")) {
+      if (!strcmp(variableValue, "text_file")) {
+        printf("      <applet code=\"text_editor\" \n");
+        printf("              archive=\"/java/text_editor.jar,/java/interos_connect.jar\" \n");
+        printf("              width=\"100%%\" \n");
+        printf("              height=\"100%%\"></applet>\n");
+      }
+    } else if (!strcmp(variableName, "text_file")) {
+        printf("      <applet code=\"text_editor\" \n");
+        printf("              archive=\"/java/text_editor.jar,/java/interos_connect.jar\" \n");
+        printf("              width=\"100%%\" \n");
+        printf("              height=\"100%%\">\n");
+        printf("        <param name=\"text_file\" value=\"%s\" />\n", variableValue);
+        printf("      </applet>\n");
+    }
+  }
+  printf("    </div>\n");
+  printf("  </body>\n");
+  printf("  <!--=====================================================================-->\n");
+  printf("  <!--                  Copyright and Trademark Statement                  -->\n");
+  printf("  <!--=====================================================================-->\n");
+  printf("  <!--                                                                     -->\n");
+  printf("  <!--          All original textual and graphical site content:           -->\n");
+  printf("  <!--                                                                     -->\n");
+  printf("  <!--  Copyright 2001-2010 Brent Angeline and interos LLC.  All rights    -->\n");
+  printf("  <!--  reserved.  Reproduction in whole or in part without written        -->\n");
+  printf("  <!--  permission is prohibited.  interos and the interos logos are       -->\n");
+  printf("  <!--  trademarks of Brent Angeline and interos LLC.  All other company,  -->\n");
+  printf("  <!--  product, and service names mentioned herein may be the properties  -->\n");
+  printf("  <!--  of their respective owners.  Comments in the interos.org forums    -->\n");
+  printf("  <!--  are the properties of their respective authors.  All software      -->\n");
+  printf("  <!--  developed in the forums is open source and belongs to everyone.    -->\n");
+  printf("  <!--                                                                     -->\n");
+  printf("  <!--=====================================================================-->\n");
+  printf("  <!--                      e-mail: info@interos.com                       -->\n");
+  printf("  <!--=====================================================================-->\n");
+  printf("</html>");
+}
+
+/***********************************************************************/
+/*                  Copyright and Trademark Statement                  */
+/***********************************************************************/
+/*                                                                     */
+/*          All original textual and graphical site content:           */
+/*                                                                     */
+/*  Copyright 2001-2010 Brent Angeline and interos LLC.  All rights    */
+/*  reserved.  Reproduction in whole or in part without written        */
+/*  permission is prohibited.  interos and the interos logos are       */
+/*  trademarks of Brent Angeline and interos LLC.  All other company,  */
+/*  product, and service names mentioned herein may be the properties  */
+/*  of their respective owners.  Comments in the interos.org forums    */
+/*  are the properties of their respective authors.  All software      */
+/*  developed in the forums is open source and belongs to everyone.    */
+/*                                                                     */
+/***********************************************************************/
+/*                      e-mail: info@interos.com                       */
+/***********************************************************************/
diff --git a/c/interos.c b/c/interos.c
new file mode 120000 (symlink)
index 0000000..6a6c72b
--- /dev/null
@@ -0,0 +1 @@
+interos_interos.com_ssl.c
\ No newline at end of file
diff --git a/c/interos.h b/c/interos.h
new file mode 120000 (symlink)
index 0000000..52c22c3
--- /dev/null
@@ -0,0 +1 @@
+interos_interos.com_ssl.h
\ No newline at end of file
diff --git a/c/interos.org.h b/c/interos.org.h
new file mode 120000 (symlink)
index 0000000..de02454
--- /dev/null
@@ -0,0 +1 @@
+interos.org_interos.org_ssl.h
\ No newline at end of file
diff --git a/c/interos.org_interos.org_ssl.h b/c/interos.org_interos.org_ssl.h
new file mode 100644 (file)
index 0000000..e69de29
diff --git a/c/interos_interos.com_ssl.c b/c/interos_interos.com_ssl.c
new file mode 100644 (file)
index 0000000..3be9cf7
--- /dev/null
@@ -0,0 +1,229 @@
+#include "fcgi_stdio.h"
+#include "interos.h"
+#include <stdlib.h>
+#include <string.h>
+#include <dirent.h>
+#include <langinfo.h>
+#include <sys/stat.h>
+#include <unistd.h>
+
+/*  */
+void outputErrorXML(const char *errorMessage) {
+  printf("Content-Type: text/xml\r\n\r\n");
+  printf("<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n");
+  printf("<directory>\n");
+  printf("  <errorCode error=\"true\">\n");
+  printf("    <description>%s</description>\n", errorMessage);
+  printf("  </errorCode>\n");
+  printf("</directory>");
+}
+
+POSTDATA *getPostData(){
+    POSTDATA* postdata = (POSTDATA*)(malloc(sizeof(POSTDATA)));
+       postdata->postData = NULL;
+       postdata->length = 0;
+       /* IF POST DATA DOESN'T EXIST OR IS TOO LONG... */
+       if (!getenv("CONTENT_LENGTH") || (sizeof(STRING_TO_INT(getenv("CONTENT_LENGTH"), (char **) NULL, 10)) > sizeof(INT))) {
+       /** ERROR | POST DATA DOES NOT EXIST OR IS TOO LONG > OUTPUT ERROR XML **/
+       outputErrorXML("No post data was received by the web server.");
+       free(postdata);
+       postdata = NULL;
+
+       /* OTHERWISE, IF POST DATA DOES EXIST AND IS OF ACCEPTABLE LENGTH... */
+       } else {
+
+               /* ATTEMPT TO ALLOCATE MEMORY FOR POST VARIABLES */
+               void* post;
+               INT postLength = STRING_TO_INT(getenv("CONTENT_LENGTH"), (char **) NULL, 10);
+               if ((postLength < 1) || !(post = malloc(postLength + 1))) {
+                 /** ERROR | CRUCIAL MEMORY ALLOCATION ERROR FOR POST DATA! > OUTPUT ERROR XML **/
+                 outputErrorXML("The length of the post data string received by the web server was indicated to be less than 1 byte.");
+                 free(postdata);
+                 postdata = NULL;
+               } else {
+                       /* PROCESS POST DATA */
+                       fread(post, postLength, 1, stdin);
+                       postdata->postData = post;
+                       postdata->length = postLength;
+               }
+       }
+       return postdata;
+}
+
+char* validateCookie() {
+       char *username = NULL;
+
+    /* IF COOKIE DATA DOESN'T EXIST OR IS TOO LONG... */
+    if (!getenv("HTTP_COOKIE") || (sizeof(strlen(getenv("HTTP_COOKIE"))) > sizeof(INT))) {
+      /** ERROR | COOKIE DATA DOES NOT EXIST OR IS TOO LONG > OUTPUT ERROR XML **/
+      outputErrorXML("No cookie data was received by the web server.");
+
+    /* OTHERWISE, IF COOKIE DATA DOES EXIST AND IS OF ACCEPTABLE LENGTH... */
+    } else {
+
+      /* ATTEMPT TO ALLOCATE MEMORY FOR COOKIE VARIABLES */
+      char *cookie;
+      INT cookieLength = strlen(getenv("HTTP_COOKIE"));
+      if ((cookieLength < 1) || !(cookie = malloc(cookieLength + 1))) {
+        /** ERROR | CRUCIAL MEMORY ALLOCATION ERROR FOR COOKIE DATA! > OUTPUT ERROR XML **/
+        outputErrorXML("The length of the cookie data string received by the web server was indicated to be less than 1 byte.");
+      } else {
+        char *variableName;
+        if (!(variableName = malloc(cookieLength + 1))) {
+          /** ERROR | CANNOT ALLOCATE MEMORY FOR COOKIE VARIABLE NAME > OUTPUT ERROR XML **/
+          outputErrorXML("Sufficient memory could not be allocated on the server for cookie variable names.");
+        } else {
+          char *variableValue;
+          if (!(variableValue = malloc(cookieLength + 1))) {
+            /** ERROR | CANNOT ALLOCATE MEMORY FOR COOKIE VARIABLE VALUE > OUTPUT ERROR XML **/
+            outputErrorXML("Sufficient memory could not be allocated on the server for cookie variable values.");
+
+          /* IF SUFFICIENT MEMORY FOR COOKIE VARIABLES... */
+          } else {
+
+            /* PROCESS COOKIE DATA */
+            char *login, *password;
+            INT i, c;
+            login = password = NULL;
+            c = 0;
+            strcpy(cookie, getenv("HTTP_COOKIE"));
+            while ((c < cookieLength) && (cookie[c] != '\0')) {
+              i = 0;
+              while ((c < cookieLength) && (cookie[c] != '=') && (cookie[c] != '\0')) {
+                variableName[i] = cookie[c];
+                ++c;
+                ++i;
+              }
+              variableName[i] = '\0';
+              ++c;
+              i = 0;
+              while ((c < cookieLength) && (cookie[c] != ';') && (cookie[c] != '\0')) {
+                variableValue[i] = cookie[c];
+                ++c;
+                ++i;
+              }
+              variableValue[i] = '\0';
+              ++c;
+              while ((c < cookieLength) && (cookie[c] == ' ')) {
+                ++c;
+              }
+              if (!login && !strcmp(variableName, "login")) {
+                if ((login = malloc(strlen(variableValue) + 1)) != 0) {
+                  strcpy(login, variableValue);
+                }
+              } else if (!password && !strcmp(variableName, "password")) {
+                if ((password = malloc(strlen(variableValue) + 1)) != 0) {
+                  strcpy(password, variableValue);
+                }
+              }
+            }
+
+            /* IF LOGIN VALUE IS MISSING... */
+            if (!login) {
+              /** ERROR | LOGIN VALUE IS MISSING > OUTPUT ERROR XML */
+              outputErrorXML("No login value was received.");
+
+            /* OTHERWISE, IF LOGIN VALUE EXISTS... */
+            } else {
+
+              /* VERIFY LOGIN AND PASSWORD */
+              char *directory;
+              if (!(directory = malloc(strlen(login) + strlen(DIRECTORY) + 1))) {
+                /** ERROR | CANNOT ALLOCATE MEMORY FOR DIRECTORY NAME > OUTPUT ERROR XML **/
+                outputErrorXML("Sufficient memory could not be allocated on the server for the user's home directory name.");
+              } else {
+                char *systemDirectory;
+                if (!(systemDirectory = malloc(strlen(login) + strlen(SYSTEM_DIRECTORY) + 1))) {
+                  /** ERROR | CANNOT ALLOCATE MEMORY FOR SYSTEM DIRECTORY NAME > OUTPUT ERROR XML **/
+                  outputErrorXML("Sufficient memory could not be allocated on the server for the user's system directory name.");
+                } else {
+                  strcpy(directory, DIRECTORY);
+                  strcat(directory, login);
+                  strcpy(systemDirectory, SYSTEM_DIRECTORY);
+                  strcat(systemDirectory, login);
+
+                  /* IF DIRECTORY CAN'T BE ACCESSED... */
+                  if (access(directory, F_OK) || access(systemDirectory, F_OK)) {
+                    /** ERROR | CANNOT ACCESS DIRECTORY > OUTPUT ERROR XML **/
+                    outputErrorXML("The user's home directory on the server could not be accessed.");
+
+                  /* OTHERWISE, IF DIRECTORY CAN BE ACCESSED... */
+                  } else {
+
+                    /* ATTEMPT TO ACCESS PASSWORD FILE */
+                    char *passwordFileName;
+                    if (!(passwordFileName = malloc(strlen(systemDirectory) + strlen(PASSWORD_FILE_NAME) + 1))) {
+                      /** ERROR | CANNOT ALLOCATE MEMORY FOR FILE NAME > OUTPUT ERROR XML **/
+                      outputErrorXML("Sufficient memory could not be allocated on the server for the name of the user's password file.");
+                    } else {
+                      strcpy(passwordFileName, systemDirectory);
+                      strcat(passwordFileName, PASSWORD_FILE_NAME);
+
+                      /* IF PASSWORD FILE CAN'T BE ACCESSED... */
+                      if (access(passwordFileName, F_OK)) {
+                        /** ERROR | CANNOT ACCESS FILE > OUTPUT ERROR XML **/
+                        outputErrorXML("The user's password file on the server cannot be accessed.");
+
+                      /* OTHERWISE, IF PASSWORD FILE CAN BE ACCESSED... */
+                      } else {
+
+                        /* ATTEMPT TO OPEN PASSWORD FILE FOR READING */
+                        FILE *passwordFile;
+
+                        /* IF PASSWORD FILE CAN'T BE OPENED FOR READING... */
+                        if (!(passwordFile = fopen(passwordFileName, "r"))) {
+                          /** ERROR | CANNOT READ FILE > OUTPUT ERROR XML **/
+                          outputErrorXML("The user's password file on the server cannot be opened for reading.");
+
+                        /* OTHERWISE, IF PASSWORD FILE CAN BE OPENED FOR READING... */
+                        } else {
+                          char *filePassword;
+                          if (!(filePassword = malloc(MAX_PASSWORD_SIZE + 1))) {
+                            /** ERROR | CANNOT ALLOCATE MEMORY FOR PASSWORD FROM FILE > OUTPUT ERROR XML **/
+                            outputErrorXML("Sufficient memory could not be allocated on the server for reading the user's password.");
+                          } else {
+                            char c;
+                            i = 0;
+
+                            /* READ PASSWORD FROM PASSWORD FILE */
+                            while (((c = fgetc(passwordFile)) != '\n') && (i < MAX_PASSWORD_SIZE)) {
+                              filePassword[i] = c;
+                              ++i;
+                            }
+                            filePassword[i] = '\0';
+                            fclose(passwordFile);
+
+                            /* IF PASSWORD FAILS COMPARISON... */
+                            if (strcmp(filePassword, password)) {
+                              /** ERROR | PASSWORD FAILED > OUTPUT ERROR XML **/
+                              outputErrorXML("The password provided failed comparison with the password stored on the server.");
+
+                            /* OTHERWISE, IF PASSWORD PASSES COMPARISON... */
+                            } else {
+                                                               username = login;
+                            }
+                            free(filePassword);
+                          }
+                        }
+                      }
+                      free(passwordFileName);
+                    }
+                  }
+                  free(systemDirectory);
+                }
+                free(directory);
+              }
+                         if(!username && login)
+                               free(login);
+
+            }
+            free(password);
+            free(variableValue);
+          }
+          free(variableName);
+        }
+        free(cookie);
+      }
+    }
+  return username;
+}
diff --git a/c/interos_interos.com_ssl.h b/c/interos_interos.com_ssl.h
new file mode 100644 (file)
index 0000000..2860f73
--- /dev/null
@@ -0,0 +1,117 @@
+/*************************************************************/
+/*  interos Standard Document Header - CGI in C Header File  */
+/*************************************************************/
+/*              Source:  interos.h                           */
+/*         Description:  FastCGI Header for interos          */
+/*              Author:  Brent Angeline                      */
+/*                 CGI:  FastCGI in ISO/ANSI C               */
+/*************************************************************/
+
+/* PREPROCESSOR DIRECTIVES */
+# ifndef INTEROS_H
+
+#   define INTEROS_H
+
+  /* HEADER FILES INCLUDED BY C SOURCE */
+#   ifndef INTEROS_H
+
+#     include "fcgi_stdio.h"            /*  FCGI_Accept(), fclose(), fgetc(), fopen(), fread(), printf()  */
+#     include <ctype.h>                 /*  tolower()                                                     */
+#     include <stdlib.h>                /*  free(), getenv(), malloc(), strtoul()                         */
+#     include <string.h>                /*  strcat(), strcmp(), strcpy(), strlen()                        */
+#     include <unistd.h>                /*  F_OK, access()                                                */
+
+#   endif
+
+  /* DEFINITION DIRECTIVES */
+#   define INT                          unsigned long
+#   define STRING_TO_INT                strtoul
+#   define DIRECTORY                    "/srv/https/interos.com/"
+#   define SYSTEM_DIRECTORY             "/srv/data/interos/"
+#   define PASSWORD_FILE_NAME           "/.htpasswd"
+#   define MAX_PASSWORD_SIZE            16
+
+  /* NEW USER DEFINITION DIRECTIVES */
+#   define SYSTEM_DIRECTORY_COMMAND     "cp -pRP /srv/data/interos/sys/data /srv/data/interos/"
+#   define DIRECTORY_COMMAND            "cp -pRP /srv/data/interos/sys/user /srv/https/interos.com/"
+#   define ECHO_COMMAND                 "echo "
+#   define PASSWORD_OUT                 " > /srv/data/interos/"
+
+  /* TYPE DEFINITION */
+  typedef struct {
+    char *name;
+    char *link;
+    char *icon;
+    struct MENU_ITEM *next;
+  } MENU_ITEM;
+
+  /**
+    Used by getPOSTData for storage of the POST data.
+
+
+    length: The number of bytes allocated for postData.
+
+    postData: Allocated chunk of memory containing the POST data. The interpretation of that data
+              depends on what the CGI program getting the data is expecting.
+  */
+  typedef struct{
+      void *postData;
+      INT length;
+  }POSTDATA;
+
+  /**
+    Obtains the POST data that was sent by the client connecting to the HTTP(S) server and stores it
+    in POSTDATA struct. The POSTDATA->postData is a chunk of memory copied from the client. If the data
+    is to be interpreted as a string, one should not expect it to be null terminated, which is why length
+    is part of the POSTDATA struct.
+
+    One more byte of memory is allocated for POSTDATA->postData for conveniance. In the event that the
+    POST data is interpreted as a string, one may set POSTDATA->postData[POSTDATA->length] = '\0' without
+    having to use realloc.
+
+    @return An allocated struct POSTDATA with allocated postData of size length+1. If there is no POST data,
+            it will return an allocated struct POSTDATA with length 0 and postData NULL. If there was an error
+            getting the post data, it will call outputErrorXML() with the apropriate error and return NULL.
+  */
+  POSTDATA *getPOSTData();
+
+  /**
+    Obtains cookie data from the HTTP header and validates it with the appropriate login.
+    If the cookie data has the correct username and password, the function will return
+    the username. If validation fails, it will automatically call outputErrorXML with
+    the appropriate error information and return NULL.
+
+    @return An allocated string containing the username from the cookie data, or NULL
+            if validation failed.
+
+  */
+  char *validateCookie();
+
+  /**
+    Prints an error XML.
+
+    @param errorMessage A string that contains the description of the error.
+  */
+  void outputErrorXML(const char *errorMessage);
+
+
+# endif
+
+/***********************************************************************/
+/*                  Copyright and Trademark Statement                  */
+/***********************************************************************/
+/*                                                                     */
+/*          All original textual and graphical site content:           */
+/*                                                                     */
+/*  Copyright 2001-2010 Brent Angeline and interos LLC.  All rights    */
+/*  reserved.  Reproduction in whole or in part without written        */
+/*  permission is prohibited.  interos and the interos logos are       */
+/*  trademarks of Brent Angeline and interos LLC.  All other company,  */
+/*  product, and service names mentioned herein may be the properties  */
+/*  of their respective owners.  Comments in the interos.org forums    */
+/*  are the properties of their respective authors.  All software      */
+/*  developed in the forums is open source and belongs to everyone.    */
+/*                                                                     */
+/***********************************************************************/
+/*                      e-mail: info@interos.com                       */
+/***********************************************************************/
diff --git a/c/login_interos.com_ssl.c b/c/login_interos.com_ssl.c
new file mode 100644 (file)
index 0000000..08b7604
--- /dev/null
@@ -0,0 +1,359 @@
+/*************************************************/
+/*  interos Standard Document Header - CGI in C  */
+/*************************************************/
+/*         URIs:  https://interos.com/login      */
+/*                https://www.interos.com/login  */
+/*       Source:  login.c                        */
+/*  Description:  FastCGI for interos login      */
+/*       Author:  Brent Angeline                 */
+/*          CGI:  FastCGI in ISO/ANSI C          */
+/*************************************************/
+
+/* PREPROCESSOR DIRECTIVES */
+#include "fcgi_stdio.h"     /*  FCGI_Accept(), fclose(), fgetc(), fopen(), fread(), printf()                            */
+#include "interos.h"        /*  DIRECTORY, INT, MAX_PASSWORD_SIZE, PASSWORD_FILE_NAME, STRING_TO_INT, SYSTEM_DIRECTORY  */
+#include <ctype.h>          /*  tolower()                                                                               */
+#include <stdlib.h>         /*  free(), getenv(), malloc(), strtoul()                                                   */
+#include <string.h>         /*  strcat(), strcmp(), strcpy(), strlen()                                                  */
+#include <unistd.h>         /*  F_OK, access()                                                                          */
+
+/* FUNCTION PROTOTYPE DECLARATION */
+static void OutputLoginPanel(void);
+
+/* BEGIN MAIN PROGRAM */
+int main(void) {
+
+  /* BEGIN FASTCGI */
+  while (FCGI_Accept() >= 0) {
+
+    /* IF POST DATA DOESN'T EXIST OR IS TOO LONG... */
+    if (!getenv("CONTENT_LENGTH") || (sizeof(STRING_TO_INT(getenv("CONTENT_LENGTH"), (char **) NULL, 10)) > sizeof(INT))) {
+
+      /* OUTPUT XHTML FOR LOGIN PANEL */
+      OutputLoginPanel();
+
+    /* OTHERWISE, IF POST DATA DOES EXIST AND IS OF ACCEPTABLE LENGTH... */
+    } else {
+
+      /* ATTEMPT TO ALLOCATE MEMORY FOR POST VARIABLES */
+      char *post;
+      INT postLength = STRING_TO_INT(getenv("CONTENT_LENGTH"), (char **) NULL, 10);
+      if ((postLength < 1) || !(post = malloc(postLength + 1))) {
+        /** ERROR | CRUCIAL MEMORY ALLOCATION ERROR FOR POST DATA! > OUTPUT XHTML FOR LOGIN PANEL **/
+        OutputLoginPanel();
+      } else {
+        char *variableName;
+        if (!(variableName = malloc(postLength + 1))) {
+          /** ERROR | CANNOT ALLOCATE MEMORY FOR POST VARIABLE NAME > OUTPUT XHTML FOR LOGIN PANEL **/
+          OutputLoginPanel();
+        } else {
+          char *variableValue;
+          if (!(variableValue = malloc(postLength + 1))) {
+            /** ERROR | CANNOT ALLOCATE MEMORY FOR POST VARIABLE VALUE > OUTPUT XHTML FOR LOGIN PANEL **/
+            OutputLoginPanel();
+
+          /* IF SUFFICIENT MEMORY FOR POST VARIABLES... */
+          } else {
+
+            /* PROCESS POST DATA */
+            char *login, *password;
+            INT p, i;
+            login = password = NULL;
+            p = 0;
+            fread(post, postLength, 1, stdin);
+            post[postLength] = '\0';
+            while ((p < postLength) && (post[p] != '\0')) {
+              i = 0;
+              while ((p < postLength) && (post[p] != '=') && (post[p] != '\0')) {
+                variableName[i] = post[p];
+                ++p;
+                ++i;
+              }
+              variableName[i] = '\0';
+              ++p;
+              i = 0;
+              while ((p < postLength) && (post[p] != '&') && (post[p] != '\0')) {
+                variableValue[i] = post[p];
+                ++p;
+                ++i;
+              }
+              variableValue[i] = '\0';
+              if (post[p] != '\0') {
+                ++p;
+              }
+              if (!login && !strcmp(variableName, "login")) {
+                if ((login = malloc(strlen(variableValue) + 1)) != 0) {
+                  strcpy(login, variableValue);
+                  for (i = 0; i < strlen(login); ++i) {
+                    login[i] = tolower(login[i]);
+                  }
+                }
+              } else if (!password && !strcmp(variableName, "password")) {
+                if ((password = malloc(strlen(variableValue) + 1)) != 0) {
+                  strcpy(password, variableValue);
+                }
+              }
+            }
+
+            /* IF LOGIN VALUE IS MISSING... */
+            if (!login) {
+              /** ERROR | LOGIN VALUE IS MISSING > OUTPUT XHTML FOR LOGIN PANEL **/
+              OutputLoginPanel();
+
+            /* OTHERWISE, IF LOGIN VALUE EXISTS... */
+            } else {
+
+              /* VERIFY LOGIN AND PASSWORD */
+              char *directory;
+              if (!(directory = malloc(strlen(login) + strlen(DIRECTORY) + 1))) {
+                /** ERROR | CANNOT ALLOCATE MEMORY FOR DIRECTORY NAME > OUTPUT XHTML FOR LOGIN PANEL **/
+                OutputLoginPanel();
+              } else {
+                char *systemDirectory;
+                if (!(systemDirectory = malloc(strlen(login) + strlen(SYSTEM_DIRECTORY) + 1))) {
+                  /** ERROR | CANNOT ALLOCATE MEMORY FOR SYSTEM DIRECTORY NAME > OUTPUT XHTML FOR LOGIN PANEL **/
+                  OutputLoginPanel();
+                } else {
+                  strcpy(directory, DIRECTORY);
+                  strcat(directory, login);
+                  strcpy(systemDirectory, SYSTEM_DIRECTORY);
+                  strcat(systemDirectory, login);
+
+                  /* IF DIRECTORY CAN'T BE ACCESSED... */
+                  if (access(directory, F_OK) || access(systemDirectory, F_OK)) {
+                    /** ERROR | CANNOT ACCESS DIRECTORY > OUTPUT XHTML FOR LOGIN PANEL **/
+                    OutputLoginPanel();
+
+                  /* OTHERWISE, IF DIRECTORY CAN BE ACCESSED... */
+                  } else {
+
+                    /* ATTEMPT TO ACCESS PASSWORD FILE */
+                    char *passwordFileName;
+                    if (!(passwordFileName = malloc(strlen(systemDirectory) + strlen(PASSWORD_FILE_NAME) + 1))) {
+                      /** ERROR | CANNOT ALLOCATE MEMORY FOR FILE NAME > OUTPUT XHTML FOR LOGIN PANEL **/
+                      OutputLoginPanel();
+                    } else {
+                      strcpy(passwordFileName, systemDirectory);
+                      strcat(passwordFileName, PASSWORD_FILE_NAME);
+
+                      /* IF PASSWORD FILE CAN'T BE ACCESSED... */
+                      if (access(passwordFileName, F_OK)) {
+                        /** ERROR | CANNOT ACCESS FILE > OUTPUT XHTML FOR LOGIN PANEL **/
+                        OutputLoginPanel();
+
+                      /* OTHERWISE, IF PASSWORD FILE CAN BE ACCESSED... */
+                      } else {
+
+                        /* ATTEMPT TO OPEN PASSWORD FILE FOR READING */
+                        FILE *passwordFile;
+
+                        /* IF PASSWORD FILE CAN'T BE OPENED FOR READING... */
+                        if (!(passwordFile = fopen(passwordFileName, "r"))) {
+                          /** ERROR | CANNOT READ FILE > OUTPUT XHTML FOR LOGIN PANEL **/
+                          OutputLoginPanel();
+
+                        /* OTHERWISE, IF PASSWORD FILE CAN BE OPENED FOR READING... */
+                        } else {
+                          char *filePassword;
+                          if (!(filePassword = malloc(MAX_PASSWORD_SIZE + 1))) {
+                            /** ERROR | CANNOT ALLOCATE MEMORY FOR PASSWORD FROM FILE > OUTPUT XHTML FOR LOGIN PANEL **/
+                            OutputLoginPanel();
+                          } else {
+                            char c;
+                            i = 0;
+
+                            /* READ PASSWORD FROM PASSWORD FILE */
+                            while (((c = fgetc(passwordFile)) != '\n') && (i < MAX_PASSWORD_SIZE)) {
+                              filePassword[i] = c;
+                              ++i;
+                            }
+                            filePassword[i] = '\0';
+                            fclose(passwordFile);
+
+                            /* IF NO PASSWORD FROM POST VARIABLES... */
+                            if (!password) {
+                              password = malloc(1);
+                              password[0] = '\0';
+                            }
+
+                            /* IF PASSWORD FAILS COMPARISON... */
+                            if (strcmp(filePassword, password)) {
+                              /** ERROR | PASSWORD FAILED > OUTPUT XHTML FOR LOGIN PANEL **/
+                              OutputLoginPanel();
+
+                            /* OTHERWISE, IF PASSWORD PASSES COMPARISON... */
+                            } else {
+
+                              /* SET COOKIES */
+                              printf("Set-Cookie: login=%s; path=/; secure\r\n", login);
+                              printf("Set-Cookie: password=%s; path=/; secure\r\n", password);
+
+                              /* REDIRECT LOGGED INTO interos */
+                              printf("Location: welcome\r\n\r\n");
+                            }
+                            free(filePassword);
+                          }
+                        }
+                      }
+                      free(passwordFileName);
+                    }
+                  }
+                  free(systemDirectory);
+                }
+                free(directory);
+              }
+              free(login);
+            }
+            free(password);
+            free(variableValue);
+          }
+          free(variableName);
+        }
+        free(post);
+      }
+    }
+  }
+  return 0;
+}
+
+/* FUNCTION | OUTPUT XHTML FOR LOGIN PANEL */
+static void OutputLoginPanel(void) {
+  printf("Content-Type: text/html; charset=utf-8\r\n\r\n");
+  printf("<?xml version=\"1.0\" encoding=\"utf-8\"?>\n");
+  printf("<?xml-stylesheet type=\"text/css\" href=\"/style/login.css\"?>\n");
+  printf("<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \n");
+  printf("                      \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">\n");
+  printf("<html xmlns=\"http://www.w3.org/1999/xhtml\" xml:lang=\"en-US\" lang=\"en-US\">\n");
+  printf("  <!--=================================================-->\n");
+  printf("  <!--    interos Standard Document Header - Markup    -->\n");
+  printf("  <!--=================================================-->\n");
+  printf("  <!--    URIs:  https://interos.com/login             -->\n");
+  printf("  <!--           https://www.interos.com/login         -->\n");
+  printf("  <!--   Title:  interos login                         -->\n");
+  printf("  <!--  Author:  Brent Angeline                        -->\n");
+  printf("  <!--  Markup:  W3C-Validated XHTML 1.0 Transitional  -->\n");
+  printf("  <!--=================================================-->\n");
+  printf("  <head>\n");
+  printf("    <meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\" />\n");
+  printf("    <meta name=\"title\" content=\"interos login\" />\n");
+  printf("    <meta name=\"description\" content=\"enter into interos\" />\n");
+  printf("    <meta name=\"author\" content=\"Brent Angeline\" />\n");
+  printf("    <meta name=\"copyright\" \n");
+  printf("          content=\"Copyright &copy; 2001-2010 Brent Angeline and interos LLC\" />\n");
+  printf("    <meta name=\"robots\" content=\"index, nofollow, noarchive\" />\n");
+  printf("    <title>interos login</title>\n");
+  printf("    <link rel=\"shortcut icon\" type=\"image/x-icon\" href=\"/favicon.ico\" />\n");
+  printf("    <link rel=\"icon\" type=\"image/gif\" href=\"/images/favicon.gif\" />\n");
+  printf("    <link rel=\"stylesheet\" type=\"text/css\" href=\"/style/login.css\" \n");
+  printf("          media=\"screen, projection\" />\n");
+  printf("    <script type=\"text/javascript\" src=\"/js/login.js\"></script>\n");
+  printf("  </head>\n");
+  printf("  <body id=\"body\">\n");
+  printf("    <center>\n");
+  printf("      <p id=\"navigation\">\n");
+  printf("        <a href=\"/about\">about</a> | \n");
+  printf("        <a href=\"/blog\">blog</a> | \n");
+  printf("        <a href=\"/code\">code</a> | \n");
+  printf("        <a href=\"https://interos.org/\">develop</a> | \n");
+  printf("        <a href=\"/e-mail\">e-mail</a> | \n");
+  printf("        <a href=\"/f.a.q.\">f.a.q.</a> | \n");
+  printf("        <a href=\"/gear\">gear</a> | \n");
+  printf("        <a href=\"/help\">help</a>\n");
+  printf("      </p>\n");
+  printf("      <form id=\"loginForm\" name=\"loginForm\" action=\"/login\" method=\"post\">\n");
+  printf("        <table id=\"mainPanel\">\n");
+  printf("          <thead>\n");
+  printf("            <tr>\n");
+  printf("              <th colspan=\"3\"><center>\n");
+  printf("                                <div id=\"title\">\n");
+  printf("                                  <h1>\n");
+  printf("                                    <a href=\"/\">interos</a>\n");
+  printf("                                  </h1>\n");
+  printf("                                </div>\n");
+  printf("                                <h2>\n");
+  printf("                                  internet operating system\n");
+  printf("                                </h2>\n");
+  printf("                              </center></th>\n");
+  printf("            </tr>\n");
+  printf("          </thead>\n");
+  printf("          <tfoot>\n");
+  printf("            <tr>\n");
+  printf("              <td colspan=\"3\"><br /></td>\n");
+  printf("            </tr>\n");
+  printf("          </tfoot>\n");
+  printf("          <tbody>\n");
+  printf("            <tr>\n");
+  printf("              <td><label for=\"login\">login:</label>&nbsp;</td>\n");
+  printf("              <td><input id=\"login\" name=\"login\" \n");
+/*
+  printf("                         value=\"guest\" readonly=\"readonly\" \n");
+*/
+  printf("                         value=\"guest\" \n");
+  printf("                         size=\"16\" maxlength=\"16\" \n");
+  printf("                         type=\"text\" /></td>\n");
+  printf("            </tr>\n");
+  printf("            <tr>\n");
+  printf("              <td><label for=\"password\">password:</label>&nbsp;</td>\n");
+  printf("              <td><input id=\"password\" name=\"password\" \n");
+  printf("                         disabled=\"disabled\" \n");
+  printf("                         size=\"16\" maxlength=\"16\" \n");
+  printf("                         type=\"password\" /></td>\n");
+  printf("              <td rowspan=\"2\"><div id=\"submitButton\">\n");
+  printf("                                &nbsp;<input type=\"submit\" \n");
+  printf("                                             value=\"login &raquo;\" />\n");
+  printf("                              </div></td>\n");
+  printf("            </tr>\n");
+  printf("          </tbody>\n");
+  printf("        </table>\n");
+  printf("      </form>\n");
+  printf("      <p id=\"newUser\">\n");
+  printf("        <a href=\"/new_user\"><strong>new users click here</strong><br />\n");
+  printf("        to create your login</a>\n");
+  printf("      </p>\n");
+  printf("      <p>\n");
+  printf("        <br />\n");
+  printf("      </p>\n");
+  printf("      <p id=\"copyrightDates\">\n");
+  printf("        &copy; 2001&#8211;2010 interos\n");
+  printf("      </p>\n");
+  printf("    </center>\n");
+  printf("  </body>\n");
+  printf("  <!--=====================================================================-->\n");
+  printf("  <!--                  Copyright and Trademark Statement                  -->\n");
+  printf("  <!--=====================================================================-->\n");
+  printf("  <!--                                                                     -->\n");
+  printf("  <!--          All original textual and graphical site content:           -->\n");
+  printf("  <!--                                                                     -->\n");
+  printf("  <!--  Copyright 2001-2010 Brent Angeline and interos LLC.  All rights    -->\n");
+  printf("  <!--  reserved.  Reproduction in whole or in part without written        -->\n");
+  printf("  <!--  permission is prohibited.  interos and the interos logos are       -->\n");
+  printf("  <!--  trademarks of Brent Angeline and interos LLC.  All other company,  -->\n");
+  printf("  <!--  product, and service names mentioned herein may be the properties  -->\n");
+  printf("  <!--  of their respective owners.  Comments in the interos.org forums    -->\n");
+  printf("  <!--  are the properties of their respective authors.  All software      -->\n");
+  printf("  <!--  developed in the forums is open source and belongs to everyone.    -->\n");
+  printf("  <!--                                                                     -->\n");
+  printf("  <!--=====================================================================-->\n");
+  printf("  <!--                      e-mail: info@interos.com                       -->\n");
+  printf("  <!--=====================================================================-->\n");
+  printf("</html>");
+}
+
+/***********************************************************************/
+/*                  Copyright and Trademark Statement                  */
+/***********************************************************************/
+/*                                                                     */
+/*          All original textual and graphical site content:           */
+/*                                                                     */
+/*  Copyright 2001-2010 Brent Angeline and interos LLC.  All rights    */
+/*  reserved.  Reproduction in whole or in part without written        */
+/*  permission is prohibited.  interos and the interos logos are       */
+/*  trademarks of Brent Angeline and interos LLC.  All other company,  */
+/*  product, and service names mentioned herein may be the properties  */
+/*  of their respective owners.  Comments in the interos.org forums    */
+/*  are the properties of their respective authors.  All software      */
+/*  developed in the forums is open source and belongs to everyone.    */
+/*                                                                     */
+/***********************************************************************/
+/*                      e-mail: info@interos.com                       */
+/***********************************************************************/
diff --git a/c/logout_interos.com_ssl.c b/c/logout_interos.com_ssl.c
new file mode 100644 (file)
index 0000000..13cd7d6
--- /dev/null
@@ -0,0 +1,48 @@
+/**************************************************/
+/*  interos Standard Document Header - CGI in C   */
+/**************************************************/
+/*         URIs:  https://interos.com/logout      */
+/*                https://www.interos.com/logout  */
+/*       Source:  logout.c                        */
+/*  Description:  FastCGI for interos logout      */
+/*       Author:  Brent Angeline                  */
+/*          CGI:  FastCGI in ISO/ANSI C           */
+/**************************************************/
+
+/* PREPROCESSOR DIRECTIVE */
+#include "fcgi_stdio.h"     /*  FCGI_Accept(), printf()  */
+
+/* BEGIN MAIN PROGRAM */
+int main(void) {
+
+  /* BEGIN FASTCGI */
+  while (FCGI_Accept() >= 0) {
+
+    /* SET COOKIES */
+    printf("Set-Cookie: login=; path=/; secure\r\n");
+    printf("Set-Cookie: password=; path=/; secure\r\n");
+
+    /* REDIRECT TO LOGIN PANEL */
+    printf("Location: login\r\n\r\n");
+  }
+  return 0;
+}
+
+/***********************************************************************/
+/*                  Copyright and Trademark Statement                  */
+/***********************************************************************/
+/*                                                                     */
+/*          All original textual and graphical site content:           */
+/*                                                                     */
+/*  Copyright 2001-2010 Brent Angeline and interos LLC.  All rights    */
+/*  reserved.  Reproduction in whole or in part without written        */
+/*  permission is prohibited.  interos and the interos logos are       */
+/*  trademarks of Brent Angeline and interos LLC.  All other company,  */
+/*  product, and service names mentioned herein may be the properties  */
+/*  of their respective owners.  Comments in the interos.org forums    */
+/*  are the properties of their respective authors.  All software      */
+/*  developed in the forums is open source and belongs to everyone.    */
+/*                                                                     */
+/***********************************************************************/
+/*                      e-mail: info@interos.com                       */
+/***********************************************************************/
diff --git a/c/main_interos.com_ssl.c b/c/main_interos.com_ssl.c
new file mode 100644 (file)
index 0000000..a140e49
--- /dev/null
@@ -0,0 +1,724 @@
+/*************************************************/
+/*  interos Standard Document Header - CGI in C  */
+/*************************************************/
+/*         URIs:  https://interos.com/           */
+/*                https://interos.com/main       */
+/*                https://www.interos.com/       */
+/*                https://www.interos.com/main   */
+/*       Source:  main.c                         */
+/*  Description:  FastCGI for interos main       */
+/*       Author:  Brent Angeline                 */
+/*          CGI:  FastCGI in ISO/ANSI C          */
+/*************************************************/
+
+/* PREPROCESSOR DIRECTIVES */
+#include "fcgi_stdio.h"     /*  FCGI_Accept(), fclose(), fgetc(), fopen(), printf()                                 */
+#include "interos.h"        /*  DIRECTORY, INT, MAX_PASSWORD_SIZE, MENU_ITEM, PASSWORD_FILE_NAME, SYSTEM_DIRECTORY  */
+#include <stdlib.h>         /*  free(), getenv(), malloc()                                                          */
+#include <string.h>         /*  strcat(), strcmp(), strcpy(), strlen()                                              */
+#include <unistd.h>         /*  F_OK, access()                                                                      */
+
+#ifndef INTEROS_H
+
+  /* TYPE DEFINITION */
+  typedef struct {
+    char *name;
+    char *link;
+    char *icon;
+    struct MENU_ITEM *next;
+  } MENU_ITEM;
+
+#endif
+
+/* FUNCTION PROTOTYPE DECLARATIONS */
+static void RedirectToLoginPanel(void);
+static void OutputGUI(const char *variableName, char *variableValue);
+static void OutputNewMenu(void);
+static void OutputOpenMenu(char *open);
+static void OutputNextMenu(char *next);
+static void OutputSettingsMenu(char *settings);
+static void BeginXHTMLOutput(void);
+static void FinishXHTMLOutput(void);
+
+/* BEGIN MAIN PROGRAM */
+int main(void) {
+
+  /* BEGIN FASTCGI */
+  while (FCGI_Accept() >= 0) {
+
+    /* IF COOKIE DATA DOESN'T EXIST OR IS TOO LONG... */
+    if (!getenv("HTTP_COOKIE") || (sizeof(strlen(getenv("HTTP_COOKIE"))) > sizeof(INT))) {
+      /** ERROR | COOKIE DATA DOES NOT EXIST OR IS TOO LONG > REDIRECT TO LOGIN PANEL **/
+      RedirectToLoginPanel();
+
+    /* OTHERWISE, IF COOKIE DATA DOES EXIST AND IS OF ACCEPTABLE LENGTH... */
+    } else {
+
+      /* ATTEMPT TO ALLOCATE MEMORY FOR COOKIE VARIABLES */
+      char *cookie;
+      INT cookieLength = strlen(getenv("HTTP_COOKIE"));
+      if ((cookieLength < 1) || !(cookie = malloc(cookieLength + 1))) {
+        /** ERROR | CRUCIAL MEMORY ALLOCATION ERROR FOR COOKIE DATA! > REDIRECT TO LOGIN PANEL **/
+        RedirectToLoginPanel();
+      } else {
+        char *variableName;
+        if (!(variableName = malloc(cookieLength + 1))) {
+          /** ERROR | CANNOT ALLOCATE MEMORY FOR COOKIE VARIABLE NAME > REDIRECT TO LOGIN PANEL **/
+          RedirectToLoginPanel();
+        } else {
+          char *variableValue;
+          if (!(variableValue = malloc(cookieLength + 1))) {
+            /** ERROR | CANNOT ALLOCATE MEMORY FOR COOKIE VARIABLE VALUE > REDIRECT TO LOGIN PANEL **/
+            RedirectToLoginPanel();
+
+          /* IF SUFFICIENT MEMORY FOR COOKIE VARIABLES... */
+          } else {
+
+            /* PROCESS COOKIE DATA */
+            char *login, *password;
+            INT c, i;
+            login = password = NULL;
+            c = 0;
+            strcpy(cookie, getenv("HTTP_COOKIE"));
+            while ((c < cookieLength) && (cookie[c] != '\0')) {
+              i = 0;
+              while ((c < cookieLength) && (cookie[c] != '=') && (cookie[c] != '\0')) {
+                variableName[i] = cookie[c];
+                ++c;
+                ++i;
+              }
+              variableName[i] = '\0';
+              ++c;
+              i = 0;
+              while ((c < cookieLength) && (cookie[c] != ';') && (cookie[c] != '\0')) {
+                variableValue[i] = cookie[c];
+                ++c;
+                ++i;
+              }
+              variableValue[i] = '\0';
+              ++c;
+              while ((c < cookieLength) && (cookie[c] == ' ')) {
+                ++c;
+              }
+              if (!login && !strcmp(variableName, "login")) {
+                if ((login = malloc(strlen(variableValue) + 1)) != 0) {
+                  strcpy(login, variableValue);
+                }
+              } else if (!password && !strcmp(variableName, "password")) {
+                if ((password = malloc(strlen(variableValue) + 1)) != 0) {
+                  strcpy(password, variableValue);
+                }
+              }
+            }
+
+            /* IF LOGIN VALUE IS MISSING... */
+            if (!login) {
+              /** ERROR | LOGIN VALUE IS MISSING > REDIRECT TO LOGIN PANEL **/
+              RedirectToLoginPanel();
+
+            /* OTHERWISE, IF LOGIN VALUE EXISTS... */
+            } else {
+
+              /* VERIFY LOGIN AND PASSWORD */
+              char *directory;
+              if (!(directory = malloc(strlen(login) + strlen(DIRECTORY) + 1))) {
+                /** ERROR | CANNOT ALLOCATE MEMORY FOR DIRECTORY NAME > REDIRECT TO LOGIN PANEL **/
+                RedirectToLoginPanel();
+              } else {
+                char *systemDirectory;
+                if (!(systemDirectory = malloc(strlen(login) + strlen(SYSTEM_DIRECTORY) + 1))) {
+                  /** ERROR | CANNOT ALLOCATE MEMORY FOR SYSTEM DIRECTORY NAME > REDIRECT TO LOGIN PANEL **/
+                  RedirectToLoginPanel();
+                } else {
+                  strcpy(directory, DIRECTORY);
+                  strcat(directory, login);
+                  strcpy(systemDirectory, SYSTEM_DIRECTORY);
+                  strcat(systemDirectory, login);
+
+                  /* IF DIRECTORY CAN'T BE ACCESSED... */
+                  if (access(directory, F_OK) || access(systemDirectory, F_OK)) {
+                    /** ERROR | CANNOT ACCESS DIRECTORY > REDIRECT TO LOGIN PANEL **/
+                    RedirectToLoginPanel();
+
+                  /* OTHERWISE, IF DIRECTORY CAN BE ACCESSED... */
+                  } else {
+
+                    /* ATTEMPT TO ACCESS PASSWORD FILE */
+                    char *passwordFileName;
+                    if (!(passwordFileName = malloc(strlen(systemDirectory) + strlen(PASSWORD_FILE_NAME) + 1))) {
+                      /** ERROR | CANNOT ALLOCATE MEMORY FOR FILE NAME > REDIRECT TO LOGIN PANEL **/
+                      RedirectToLoginPanel();
+                    } else {
+                      strcpy(passwordFileName, systemDirectory);
+                      strcat(passwordFileName, PASSWORD_FILE_NAME);
+
+                      /* IF PASSWORD FILE CAN'T BE ACCESSED... */
+                      if (access(passwordFileName, F_OK)) {
+                        /** ERROR | CANNOT ACCESS FILE > REDIRECT TO LOGIN PANEL **/
+                        RedirectToLoginPanel();
+
+                      /* OTHERWISE, IF PASSWORD FILE CAN BE ACCESSED... */
+                      } else {
+
+                        /* ATTEMPT TO OPEN PASSWORD FILE FOR READING */
+                        FILE *passwordFile;
+
+                        /* IF PASSWORD FILE CAN'T BE OPENED FOR READING... */
+                        if (!(passwordFile = fopen(passwordFileName, "r"))) {
+                          /** ERROR | CANNOT READ FILE > REDIRECT TO LOGIN PANEL **/
+                          RedirectToLoginPanel();
+
+                        /* OTHERWISE, IF PASSWORD FILE CAN BE OPENED FOR READING... */
+                        } else {
+                          char *filePassword;
+                          if (!(filePassword = malloc(MAX_PASSWORD_SIZE + 1))) {
+                            /** ERROR | CANNOT ALLOCATE MEMORY FOR PASSWORD FROM FILE > REDIRECT TO LOGIN PANEL **/
+                            RedirectToLoginPanel();
+                          } else {
+                            char c;
+                            i = 0;
+
+                            /* READ PASSWORD FROM PASSWORD FILE */
+                            while (((c = fgetc(passwordFile)) != '\n') && (i < MAX_PASSWORD_SIZE)) {
+                              filePassword[i] = c;
+                              ++i;
+                            }
+                            filePassword[i] = '\0';
+                            fclose(passwordFile);
+
+                            /* IF PASSWORD FAILS COMPARISON... */
+                            if (strcmp(filePassword, password)) {
+                              /** ERROR | PASSWORD FAILED > REDIRECT TO LOGIN PANEL **/
+                              RedirectToLoginPanel();
+
+                            /* OTHERWISE, IF PASSWORD PASSES COMPARISON... */
+                            } else {
+
+                              /* LOAD SETTINGS VALUES FROM FILE(S) */
+
+                              /* LOAD MENU ITEMS FROM FILES */
+
+                              /* READ NEW MENU FILE */
+
+                              /* READ OPEN MENU FILE */
+
+                              /* READ NEXT MENU FILE */
+
+                              /* READ SETTINGS MENU FILE */
+
+                              /* DECLARE AND INITIALIZE QUERY VARIABLES */
+                              char *menu, *new, *open, *next, *settings, *text_file, *status;
+                              menu = new = open = next = settings = text_file = status = NULL;
+
+                              /* IF QUERY DATA EXISTS AND IS OF ACCEPTABLE LENGTH... */
+                              if (getenv("QUERY_STRING") && (sizeof(strlen(getenv("QUERY_STRING"))) <= sizeof(INT))) {
+                                char *query;
+                                INT queryLength = strlen(getenv("QUERY_STRING"));
+                                if ((queryLength < 1) || !(query = malloc(queryLength + 1))) {
+                                  /** ERROR | CRUCIAL MEMORY ALLOCATION ERROR FOR QUERY DATA! > CONTINUE WITHOUT QUERY **/
+                                } else {
+                                  free(variableName);
+                                  strcpy(query, getenv("QUERY_STRING"));
+                                  if (!(variableName = malloc(queryLength + 1))) {
+                                    /** ERROR | CANNOT ALLOCATE MEMORY FOR VARIABLE NAME > CONTINUE WITHOUT QUERY **/
+                                  } else {
+                                    free(variableValue);
+                                    if (!(variableValue = malloc(queryLength + 1))) {
+                                      /** ERROR | CANNOT ALLOCATE MEMORY FOR VARIABLE VALUE > CONTINUE WITHOUT QUERY **/
+
+                                    /* IF SUFFICIENT MEMORY FOR QUERY VARIABLES... */
+                                    } else {
+
+                                      /* PROCESS QUERY DATA */
+                                      INT q = 0;
+                                      i = 0;
+                                      while ((q < queryLength) && (query[q] != '\0')) {
+                                        while ((q < queryLength) && (query[q] != '=') && (query[q] != '\0')) {
+                                          variableName[i] = query[q];
+                                          ++q;
+                                          ++i;
+                                        }
+                                        variableName[i] = '\0';
+                                        ++q;
+                                        i = 0;
+                                        while ((query[q] != '&') && (query[q] != '\0')) {
+                                          variableValue[i] = query[q];
+                                          ++q;
+                                          ++i;
+                                        }
+                                        variableValue[i] = '\0';
+                                        if (query[q] != '\0') {
+                                          ++q;
+                                        }
+                                        if (!menu && !strcmp(variableName, "menu")) {
+                                          if ((menu = malloc(strlen(variableValue) + 1)) != 0) {
+                                            strcpy(menu, variableValue);
+                                          }
+                                        } else if (!new && !strcmp(variableName, "new")) {
+                                          if ((new = malloc(strlen(variableValue) + 1)) != 0) {
+                                            strcpy(new, variableValue);
+                                          }
+                                        } else if (!open && !strcmp(variableName, "open")) {
+                                          if ((open = malloc(strlen(variableValue) + 1)) != 0) {
+                                            strcpy(open, variableValue);
+                                          }
+                                        } else if (!next && !strcmp(variableName, "next")) {
+                                          if ((next = malloc(strlen(variableValue) + 1)) != 0) {
+                                            strcpy(next, variableValue);
+                                          }
+                                        } else if (!settings && !strcmp(variableName, "settings")) {
+                                          if ((settings = malloc(strlen(variableValue) + 1)) != 0) {
+                                            strcpy(settings, variableValue);
+                                          }
+                                        } else if (!text_file && !strcmp(variableName, "text_file")) {
+                                          if ((text_file = malloc(strlen(variableValue) + 1)) != 0) {
+                                            strcpy(text_file, variableValue);
+                                          }
+                                        } else if (!status && !strcmp(variableName, "says")) {
+                                          if ((status = malloc(strlen(variableValue) + 1)) != 0) {
+                                            strcpy(status, variableValue);
+                                          }
+                                        }
+                                      }
+                                      free(variableValue);
+                                      variableValue = NULL;
+                                    }
+                                    free(variableName);
+                                    variableName = NULL;
+                                  }
+                                  free(query);
+                                }
+                              }
+
+                              /* IF THIS IS A CONTINUED SESSION... */
+
+                                /* LOAD SESSION FROM FILE */
+
+                              /* OUTPUT GUI COMPONENT(S) BASED ON VARIABLES */
+                              if (settings) {
+                                OutputSettingsMenu(settings);
+                              } else if (new) {
+                                if (!strcmp(new, "text_file")) {
+                                  OutputGUI("new", new);
+                                } else {
+                                  OutputNewMenu();
+                                }
+                              } else if (open) {
+                                OutputOpenMenu(open);
+                              } else if (next) {
+                                if (!strcmp(next, "save_as")) {
+
+                                } else if (!strcmp(next, "save")) {
+
+                                } else if (!strcmp(next, "close")) {
+
+                                } else if (!strcmp(next, "bookmark")) {
+
+                                } else if (!strcmp(next, "logout")) {
+
+                                  /* SET COOKIES */
+                                  printf("Set-Cookie: login=; path=/; secure\r\n");
+                                  printf("Set-Cookie: password=; path=/; secure\r\n");
+
+                                  /* REDIRECT TO LOGIN PANEL */
+                                  printf("Location: login\r\n\r\n");
+                                } else if (status) {
+                                  OutputGUI("status", status);
+                                } else {
+                                  OutputGUI(NULL, NULL);
+                                }
+                              } else if (menu) {
+                                if (!strcmp(menu, "settings")) {
+                                  OutputSettingsMenu(settings);
+                                } else if (!strcmp(menu, "new")) {
+                                  OutputNewMenu();
+                                } else if (!strcmp(menu, "open")) {
+                                  OutputOpenMenu(open);
+                                } else if (!strcmp(menu, "next")) {
+                                  OutputNextMenu(next);
+                                } else if (status) {
+                                  OutputGUI("status", status);
+                                } else {
+                                  OutputGUI(NULL, NULL);
+                                }
+                              } else if (text_file) {
+                                OutputGUI("text_file", text_file);
+                              } else {
+                                if (status) {
+                                  OutputGUI("status", status);
+                                } else {
+                                  OutputGUI(NULL, NULL);
+                                }
+                              }
+                              free(status);
+                              free(text_file);
+                              free(settings);
+                              free(next);
+                              free(open);
+                              free(new);
+                              free(menu);
+                            }
+                            free(filePassword);
+                          }
+                        }
+                      }
+                      free(passwordFileName);
+                    }
+                  }
+                  free(systemDirectory);
+                }
+                free(directory);
+              }
+              free(login);
+            }
+            free(password);
+            free(variableValue);
+          }
+          free(variableName);
+        }
+        free(cookie);
+      }
+    }
+  }
+  return 0;
+}
+
+/* FUNCTION | REDIRECT TO LOGIN PANEL */
+static void RedirectToLoginPanel(void) {
+  printf("Location: login\r\n\r\n");
+}
+
+/* FUNCTION | OUTPUT XHTML FOR interos GRAPHICAL USER INTERFACE */
+static void OutputGUI(const char *variableName, char *variableValue) {
+  BeginXHTMLOutput();
+  printf("<?xml-stylesheet type=\"text/css\" href=\"/style/main.css\"?>\n");
+  printf("<!DOCTYPE html SYSTEM \"http://interos.org/dtd/xhtml1-borderless-frameset.dtd\">\n");
+  printf("<html xmlns=\"http://www.w3.org/1999/xhtml\" xml:lang=\"en-US\" lang=\"en-US\">\n");
+  printf("  <!--========================================================-->\n");
+  printf("  <!--       interos Standard Document Header - Markup        -->\n");
+  printf("  <!--========================================================-->\n");
+  printf("  <!--    URIs:  https://interos.com/                         -->\n");
+  printf("  <!--           https://interos.com/main                     -->\n");
+  printf("  <!--           https://www.interos.com/                     -->\n");
+  printf("  <!--           https://www.interos.com/main                 -->\n");
+  printf("  <!--   Title:  interos                                      -->\n");
+  printf("  <!--  Author:  Brent Angeline                               -->\n");
+  printf("  <!--  Markup:  WDG-Validated XHTML 1.0 Borderless Frameset  -->\n");
+  printf("  <!--========================================================-->\n");
+  printf("  <head>\n");
+  printf("    <meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\" />\n");
+  printf("    <meta name=\"title\" content=\"interos\" />\n");
+  printf("    <meta name=\"description\" content=\"internet operating system\" />\n");
+  printf("    <meta name=\"author\" content=\"Brent Angeline\" />\n");
+  printf("    <meta name=\"copyright\" \n");
+  printf("          content=\"Copyright &copy; 2001-2010 Brent Angeline and interos LLC\" />\n");
+  printf("    <meta name=\"robots\" content=\"noindex, nofollow, noarchive\" />\n");
+  printf("    <title>interos</title>\n");
+  printf("    <link rel=\"shortcut icon\" type=\"image/x-icon\" href=\"/favicon.ico\" />\n");
+  printf("    <link rel=\"icon\" type=\"image/gif\" href=\"/images/favicon.gif\" />\n");
+  printf("    <link rel=\"stylesheet\" type=\"text/css\" href=\"/style/main.css\" \n");
+  printf("          media=\"screen, projection\" />\n");
+  printf("    <script type=\"text/javascript\" src=\"/js/interos.js\"></script>\n");
+  printf("  </head>\n");
+  printf("  <frameset rows=\"72,*,72\" border=\"0\" frameborder=\"0\" framespacing=\"0\">\n");
+  printf("    <frame name=\"top\" src=\"/top\" \n");
+  printf("           frameborder=\"0\" marginwidth=\"0\" marginheight=\"0\" \n");
+  printf("           noresize=\"noresize\" scrolling=\"auto\" />\n");
+  if (variableName && variableValue) {
+    printf("    <frame name=\"content\" src=\"/content?%s=%s\" \n", variableName, variableValue);
+    printf("           frameborder=\"0\" marginwidth=\"0\" marginheight=\"0\" \n");
+    printf("           noresize=\"noresize\" scrolling=\"auto\" />\n");
+  } else {
+    printf("    <frame name=\"content\" src=\"/content\" \n");
+    printf("           frameborder=\"0\" marginwidth=\"0\" marginheight=\"0\" \n");
+    printf("           noresize=\"noresize\" scrolling=\"auto\" />\n");
+  }
+  printf("    <frame name=\"bottom\" src=\"/bottom\" \n");
+  printf("           frameborder=\"0\" marginwidth=\"0\" marginheight=\"0\" \n");
+  printf("           noresize=\"noresize\" scrolling=\"auto\" />\n");
+  printf("    <noframes>\n");
+  printf("      <body id=\"body\">\n");
+  printf("        <h3>\n");
+  printf("          menu\n");
+  printf("        </h3>\n");
+  printf("        <p>\n");
+  printf("          <a id=\"newLink\" href=\"/main?menu=new\">new</a>\n");
+  printf("        </p>\n");
+  printf("        <p>\n");
+  printf("          <a id=\"openLink\" href=\"/main?menu=open\">open</a>\n");
+  printf("        </p>\n");
+  printf("        <p>\n");
+  printf("          <a id=\"nextLink\" href=\"/main?menu=next\">next</a>\n");
+  printf("        </p>\n");
+  printf("        <p>\n");
+  printf("          <a id=\"settingsLink\" href=\"/main?menu=settings\">settings</a>");
+  printf("        </p>\n");
+  printf("      </body>\n");
+  printf("    </noframes>\n");
+  printf("  </frameset>\n");
+  FinishXHTMLOutput();
+}
+
+/* FUNCTION | OUTPUT XHTML FOR NEW MENU */
+static void OutputNewMenu(void) {
+  BeginXHTMLOutput();
+  printf("<?xml-stylesheet type=\"text/css\" href=\"/style/main.css\"?>\n");
+  printf("<!DOCTYPE html SYSTEM \"http://interos.org/dtd/xhtml1-borderless-frameset.dtd\">\n");
+  printf("<html xmlns=\"http://www.w3.org/1999/xhtml\" xml:lang=\"en-US\" lang=\"en-US\">\n");
+  printf("  <!--========================================================-->\n");
+  printf("  <!--       interos Standard Document Header - Markup        -->\n");
+  printf("  <!--========================================================-->\n");
+  printf("  <!--    URIs:  https://interos.com/main?menu=new            -->\n");
+  printf("  <!--           https://interos.com/interos?menu=new         -->\n");
+  printf("  <!--           https://www.interos.com/main?menu=new        -->\n");
+  printf("  <!--           https://www.interos.com/interos?menu=new     -->\n");
+  printf("  <!--   Title:  interos new                                  -->\n");
+  printf("  <!--  Author:  Brent Angeline                               -->\n");
+  printf("  <!--  Markup:  WDG-Validated XHTML 1.0 Borderless Frameset  -->\n");
+  printf("  <!--========================================================-->\n");
+  printf("  <head>\n");
+  printf("    <meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\" />\n");
+  printf("    <meta name=\"title\" content=\"interos new\" />\n");
+  printf("    <meta name=\"description\" content=\"new menu for interos\" />\n");
+  printf("    <meta name=\"author\" content=\"Brent Angeline\" />\n");
+  printf("    <meta name=\"copyright\" \n");
+  printf("          content=\"Copyright &copy; 2001-2010 Brent Angeline and interos LLC\" />\n");
+  printf("    <meta name=\"robots\" content=\"noindex, nofollow, noarchive\" />\n");
+  printf("    <title>interos new</title>\n");
+  printf("    <link rel=\"shortcut icon\" type=\"image/x-icon\" href=\"/favicon.ico\" />\n");
+  printf("    <link rel=\"icon\" type=\"image/gif\" href=\"/images/favicon.gif\" />\n");
+  printf("    <link rel=\"stylesheet\" type=\"text/css\" href=\"/style/main.css\" \n");
+  printf("          media=\"screen, projection\" />\n");
+  printf("    <script type=\"text/javascript\" src=\"/js/interos_new.js\"></script>\n");
+  printf("  </head>\n");
+  printf("  <frameset rows=\"*,72\" border=\"0\" frameborder=\"0\" framespacing=\"0\">\n");
+  printf("    <frame name=\"menu\" src=\"/menu?name=new\" \n");
+  printf("           frameborder=\"0\" marginwidth=\"0\" marginheight=\"0\" \n");
+  printf("           noresize=\"noresize\" scrolling=\"auto\" />\n");
+  printf("    <frame name=\"button\" src=\"/bottom?button=new\" \n");
+  printf("           frameborder=\"0\" marginwidth=\"0\" marginheight=\"0\" \n");
+  printf("           noresize=\"noresize\" scrolling=\"auto\" />\n");
+  printf("    <noframes>\n");
+  printf("      <body id=\"body\">\n");
+  printf("        <div id=\"newEntries\">\n");
+  printf("          <p>\n");
+  printf("            <a href=\"/main?new=text_file\">text file</a>\n");
+  printf("          </p>\n");
+  printf("        </div>\n");
+  printf("        <div id=\"newLink\"><a href=\"/main\">new</a></div>\n");
+  printf("      </body>\n");
+  printf("    </noframes>\n");
+  printf("  </frameset>\n");
+  FinishXHTMLOutput();
+}
+
+/* FUNCTION | OUTPUT XHTML FOR OPEN MENU */
+static void OutputOpenMenu(char *open) {
+  BeginXHTMLOutput();
+  printf("<?xml-stylesheet type=\"text/css\" href=\"/style/main.css\"?>\n");
+  printf("<!DOCTYPE html SYSTEM \"http://interos.org/dtd/xhtml1-borderless-frameset.dtd\">\n");
+  printf("<html xmlns=\"http://www.w3.org/1999/xhtml\" xml:lang=\"en-US\" lang=\"en-US\">\n");
+  printf("  <!--========================================================-->\n");
+  printf("  <!--       interos Standard Document Header - Markup        -->\n");
+  printf("  <!--========================================================-->\n");
+  printf("  <!--    URIs:  https://interos.com/main?menu=open           -->\n");
+  printf("  <!--           https://interos.com/interos?menu=open        -->\n");
+  printf("  <!--           https://www.interos.com/main?menu=open       -->\n");
+  printf("  <!--           https://www.interos.com/interos?menu=open    -->\n");
+  printf("  <!--   Title:  interos open                                 -->\n");
+  printf("  <!--  Author:  Brent Angeline                               -->\n");
+  printf("  <!--  Markup:  WDG-Validated XHTML 1.0 Borderless Frameset  -->\n");
+  printf("  <!--========================================================-->\n");
+  printf("  <head>\n");
+  printf("    <meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\" />\n");
+  printf("    <meta name=\"title\" content=\"interos open\" />\n");
+  printf("    <meta name=\"description\" content=\"open menu for interos\" />\n");
+  printf("    <meta name=\"author\" content=\"Brent Angeline\" />\n");
+  printf("    <meta name=\"copyright\" \n");
+  printf("          content=\"Copyright &copy; 2001-2010 Brent Angeline and interos LLC\" />\n");
+  printf("    <meta name=\"robots\" content=\"noindex, nofollow, noarchive\" />\n");
+  printf("    <title>interos open</title>\n");
+  printf("    <link rel=\"shortcut icon\" type=\"image/x-icon\" href=\"/favicon.ico\" />\n");
+  printf("    <link rel=\"icon\" type=\"image/gif\" href=\"/images/favicon.gif\" />\n");
+  printf("    <link rel=\"stylesheet\" type=\"text/css\" href=\"/style/main.css\" \n");
+  printf("          media=\"screen, projection\" />\n");
+  printf("    <script type=\"text/javascript\" src=\"/js/interos_open.js\"></script>\n");
+  printf("  </head>\n");
+  printf("  <frameset rows=\"72,*\" border=\"0\" frameborder=\"0\" framespacing=\"0\">\n");
+  printf("    <frame name=\"button\" src=\"/top?button=open\" \n");
+  printf("           frameborder=\"0\" marginwidth=\"0\" marginheight=\"0\" \n");
+  printf("           noresize=\"noresize\" scrolling=\"auto\" />\n");
+  if (open) {
+    if (!strcmp(open, "text_file")) {
+      printf("    <frame name=\"menu\" src=\"/menu?open=text_file\" \n");
+      printf("           frameborder=\"0\" marginwidth=\"0\" marginheight=\"0\" \n");
+      printf("           noresize=\"noresize\" scrolling=\"auto\" />\n");
+    } else {
+      printf("    <frame name=\"menu\" src=\"/menu?name=open\" \n");
+      printf("           frameborder=\"0\" marginwidth=\"0\" marginheight=\"0\" \n");
+      printf("           noresize=\"noresize\" scrolling=\"auto\" />\n");
+    }
+  } else {
+    printf("    <frame name=\"menu\" src=\"/menu?name=open\" \n");
+    printf("           frameborder=\"0\" marginwidth=\"0\" marginheight=\"0\" \n");
+    printf("           noresize=\"noresize\" scrolling=\"auto\" />\n");
+  }
+  printf("    <noframes>\n");
+  printf("      <body id=\"body\">\n");
+  printf("        <div id=\"openLink\"><a href=\"/main\">open</a></div>\n");
+  printf("        <div id=\"openEntries\">\n");
+  printf("          <p><a href=\"/main?open=text_file\">text file</a></p>\n");
+  printf("        </div>\n");
+  printf("      </body>\n");
+  printf("    </noframes>\n");
+  printf("  </frameset>\n");
+  FinishXHTMLOutput();
+}
+
+/* FUNCTION | OUTPUT XHTML FOR NEXT MENU */
+static void OutputNextMenu(char *next) {
+  BeginXHTMLOutput();
+  printf("<?xml-stylesheet type=\"text/css\" href=\"/style/main.css\"?>\n");
+  printf("<!DOCTYPE html SYSTEM \"http://interos.org/dtd/xhtml1-borderless-frameset.dtd\">\n");
+  printf("<html xmlns=\"http://www.w3.org/1999/xhtml\" xml:lang=\"en-US\" lang=\"en-US\">\n");
+  printf("  <!--========================================================-->\n");
+  printf("  <!--       interos Standard Document Header - Markup        -->\n");
+  printf("  <!--========================================================-->\n");
+  printf("  <!--    URIs:  https://interos.com/main?menu=next           -->\n");
+  printf("  <!--           https://interos.com/interos?menu=next        -->\n");
+  printf("  <!--           https://www.interos.com/main?menu=next       -->\n");
+  printf("  <!--           https://www.interos.com/interos?menu=next    -->\n");
+  printf("  <!--   Title:  interos next                                 -->\n");
+  printf("  <!--  Author:  Brent Angeline                               -->\n");
+  printf("  <!--  Markup:  WDG-Validated XHTML 1.0 Borderless Frameset  -->\n");
+  printf("  <!--========================================================-->\n");
+  printf("  <head>\n");
+  printf("    <meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\" />\n");
+  printf("    <meta name=\"title\" content=\"interos next\" />\n");
+  printf("    <meta name=\"description\" content=\"next menu for interos\" />\n");
+  printf("    <meta name=\"author\" content=\"Brent Angeline\" />\n");
+  printf("    <meta name=\"copyright\" \n");
+  printf("          content=\"Copyright &copy; 2001-2010 Brent Angeline and interos LLC\" />\n");
+  printf("    <meta name=\"robots\" content=\"noindex, nofollow, noarchive\" />\n");
+  printf("    <title>interos next</title>\n");
+  printf("    <link rel=\"shortcut icon\" type=\"image/x-icon\" href=\"/favicon.ico\" />\n");
+  printf("    <link rel=\"icon\" type=\"image/gif\" href=\"/images/favicon.gif\" />\n");
+  printf("    <link rel=\"stylesheet\" type=\"text/css\" href=\"/style/main.css\" \n");
+  printf("          media=\"screen, projection\" />\n");
+  printf("    <script type=\"text/javascript\" src=\"/js/interos_next.js\"></script>\n");
+  printf("  </head>\n");
+  printf("  <frameset rows=\"72,*\" border=\"0\" frameborder=\"0\" framespacing=\"0\">\n");
+  printf("    <frame name=\"button\" src=\"/top?button=next\" \n");
+  printf("           frameborder=\"0\" marginwidth=\"0\" marginheight=\"0\" \n");
+  printf("           noresize=\"noresize\" scrolling=\"auto\" />\n");
+  printf("    <frame name=\"menu\" src=\"/menu?name=next\" \n");
+  printf("           frameborder=\"0\" marginwidth=\"0\" marginheight=\"0\" \n");
+  printf("           noresize=\"noresize\" scrolling=\"auto\" />\n");
+  printf("    <noframes>\n");
+  printf("      <body id=\"body\">\n");
+  printf("        <div id=\"nextLink\"><a href=\"/main\">next</a></div>\n");
+  printf("        <div id=\"nextEntries\">\n");
+  printf("          <p><a href=\"/logout\">logout</a></p>\n");
+  printf("        </div>\n");
+  printf("      </body>\n");
+  printf("    </noframes>\n");
+  printf("  </frameset>\n");
+  FinishXHTMLOutput();
+}
+
+/* FUNCTION | OUTPUT XHTML FOR SETTINGS MENU */
+void OutputSettingsMenu(char *settings) {
+  BeginXHTMLOutput();
+  printf("<?xml-stylesheet type=\"text/css\" href=\"/style/main.css\"?>\n");
+  printf("<!DOCTYPE html SYSTEM \"http://interos.org/dtd/xhtml1-borderless-frameset.dtd\">\n");
+  printf("<html xmlns=\"http://www.w3.org/1999/xhtml\" xml:lang=\"en-US\" lang=\"en-US\">\n");
+  printf("  <!--==========================================================-->\n");
+  printf("  <!--        interos Standard Document Header - Markup         -->\n");
+  printf("  <!--==========================================================-->\n");
+  printf("  <!--    URIs:  https://interos.com/main?menu=settings         -->\n");
+  printf("  <!--           https://interos.com/interos?menu=settings      -->\n");
+  printf("  <!--           https://www.interos.com/menu?menu=settings     -->\n");
+  printf("  <!--           https://www.interos.com/interos?menu=settings  -->\n");
+  printf("  <!--   Title:  interos settings                               -->\n");
+  printf("  <!--  Author:  Brent Angeline                                 -->\n");
+  printf("  <!--  Markup:  WDG-Validated XHTML 1.0 Borderless Frameset    -->\n");
+  printf("  <!--==========================================================-->\n");
+  printf("  <head>\n");
+  printf("    <meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\" />\n");
+  printf("    <meta name=\"title\" content=\"interos - settings\" />\n");
+  printf("    <meta name=\"description\" content=\"interos settings menu\" />\n");
+  printf("    <meta name=\"author\" content=\"Brent Angeline\" />\n");
+  printf("    <meta name=\"copyright\" \n");
+  printf("          content=\"Copyright &copy; 2001-2010 Brent Angeline and interos LLC\" />\n");
+  printf("    <meta name=\"robots\" content=\"noindex, nofollow, noarchive\" />\n");
+  printf("    <title>interos settings</title>\n");
+  printf("    <link rel=\"shortcut icon\" type=\"image/x-icon\" href=\"/favicon.ico\" />\n");
+  printf("    <link rel=\"icon\" type=\"image/gif\" href=\"/images/favicon.gif\" />\n");
+  printf("    <link rel=\"stylesheet\" type=\"text/css\" href=\"/style/main.css\" \n");
+  printf("          media=\"screen, projection\" />\n");
+  printf("    <script type=\"text/javascript\" src=\"/js/interos_settings.js\"></script>\n");
+  printf("  </head>\n");
+  printf("  <frameset rows=\"*,72\" border=\"0\" frameborder=\"0\" framespacing=\"0\">\n");
+  printf("    <frame name=\"menu\" src=\"/menu?name=settings\" \n");
+  printf("           frameborder=\"0\" marginwidth=\"0\" marginheight=\"0\" \n");
+  printf("           noresize=\"noresize\" scrolling=\"auto\" />\n");
+  printf("    <frame name=\"button\" src=\"/bottom?button=settings\" \n");
+  printf("           frameborder=\"0\" marginwidth=\"0\" marginheight=\"0\" \n");
+  printf("           noresize=\"noresize\" scrolling=\"auto\" />\n");
+  printf("    <noframes>\n");
+  printf("      <body id=\"body\">\n");
+  printf("        <div id=\"settingsEntries\">\n");
+  printf("          <p><a href=\"/main?settings=button_size\">button size</a></p>\n");
+  printf("        </div>\n");
+  printf("        <div id=\"settingsLink\"><a href=\"/main\">settings</a></div>\n");
+  printf("      </body>\n");
+  printf("    </noframes>\n");
+  printf("  </frameset>\n");
+  FinishXHTMLOutput();
+}
+
+static void BeginXHTMLOutput(void) {
+  printf("Content-Type: text/html; charset=utf-8\r\n\r\n");
+  printf("<?xml version=\"1.0\" encoding=\"utf-8\"?>\n");
+}
+
+static void FinishXHTMLOutput(void) {
+  printf("  <!--=====================================================================-->\n");
+  printf("  <!--                  Copyright and Trademark Statement                  -->\n");
+  printf("  <!--=====================================================================-->\n");
+  printf("  <!--                                                                     -->\n");
+  printf("  <!--          All original textual and graphical site content:           -->\n");
+  printf("  <!--                                                                     -->\n");
+  printf("  <!--  Copyright 2001-2010 Brent Angeline and interos LLC.  All rights    -->\n");
+  printf("  <!--  reserved.  Reproduction in whole or in part without written        -->\n");
+  printf("  <!--  permission is prohibited.  interos and the interos logos are       -->\n");
+  printf("  <!--  trademarks of Brent Angeline and interos LLC.  All other company,  -->\n");
+  printf("  <!--  product, and service names mentioned herein may be the properties  -->\n");
+  printf("  <!--  of their respective owners.  Comments in the interos.org forums    -->\n");
+  printf("  <!--  are the properties of their respective authors.  All software      -->\n");
+  printf("  <!--  developed in the forums is open source and belongs to everyone.    -->\n");
+  printf("  <!--                                                                     -->\n");
+  printf("  <!--=====================================================================-->\n");
+  printf("  <!--                      e-mail: info@interos.com                       -->\n");
+  printf("  <!--=====================================================================-->\n");
+  printf("</html>");
+}
+
+/***********************************************************************/
+/*                  Copyright and Trademark Statement                  */
+/***********************************************************************/
+/*                                                                     */
+/*          All original textual and graphical site content:           */
+/*                                                                     */
+/*  Copyright 2001-2010 Brent Angeline and interos LLC.  All rights    */
+/*  reserved.  Reproduction in whole or in part without written        */
+/*  permission is prohibited.  interos and the interos logos are       */
+/*  trademarks of Brent Angeline and interos LLC.  All other company,  */
+/*  product, and service names mentioned herein may be the properties  */
+/*  of their respective owners.  Comments in the interos.org forums    */
+/*  are the properties of their respective authors.  All software      */
+/*  developed in the forums is open source and belongs to everyone.    */
+/*                                                                     */
+/***********************************************************************/
+/*                      e-mail: info@interos.com                       */
+/***********************************************************************/
diff --git a/c/menu_interos.com_ssl.c b/c/menu_interos.com_ssl.c
new file mode 100644 (file)
index 0000000..58fdd66
--- /dev/null
@@ -0,0 +1,812 @@
+/*************************************************/
+/*  interos Standard Document Header - CGI in C  */
+/*************************************************/
+/*         URIs:  https://interos.com/menu       */
+/*                https://www.interos.com/menu   */
+/*       Source:  menu.c                         */
+/*  Description:  FastCGI for interos menu       */
+/*       Author:  Brent Angeline                 */
+/*          CGI:  FastCGI in ISO/ANSI C          */
+/*************************************************/
+
+/* PREPROCESSOR DIRECTIVES */
+#include "fcgi_stdio.h"     /*  FCGI_Accept(), fclose(), fgetc(), fopen(), printf()                                 */
+#include "interos.h"        /*  DIRECTORY, INT, MAX_PASSWORD_SIZE, MENU_ITEM, PASSWORD_FILE_NAME, SYSTEM_DIRECTORY  */
+#include <stdlib.h>         /*  free(), getenv(), malloc()                                                          */
+#include <string.h>         /*  strcat(), strcmp(), strcpy(), strlen()                                              */
+#include <unistd.h>         /*  F_OK, access()                                                                      */
+
+#ifndef INTEROS_H
+
+  /* TYPE DEFINITION */
+  typedef struct {
+    char *name;
+    char *link;
+    char *icon;
+    struct MENU_ITEM *next;
+  } MENU_ITEM;
+
+#endif
+
+/* FUNCTION PROTOTYPE DECLARATIONS */
+static void RedirectToLoginPanel(void);
+static void OutputNewMenu(void);
+static void OutputOpenMenu(char *open);
+static void OutputNextMenu(char *next);
+static void OutputSettingsMenu(char *settings);
+static void BeginXHTMLOutput(void);
+static void FinishXHTMLOutput(void);
+
+/* BEGIN MAIN PROGRAM */
+int main(void) {
+
+  /* BEGIN FASTCGI */
+  while (FCGI_Accept() >= 0) {
+
+    /* IF COOKIE DATA DOESN'T EXIST OR IS TOO LONG... */
+    if (!getenv("HTTP_COOKIE") || (sizeof(strlen(getenv("HTTP_COOKIE"))) > sizeof(INT))) {
+      /** ERROR | COOKIE DATA DOES NOT EXIST OR IS TOO LONG > REDIRECT TO LOGIN PANEL **/
+      RedirectToLoginPanel();
+
+    /* OTHERWISE, IF COOKIE DATA DOES EXIST AND IS OF ACCEPTABLE LENGTH... */
+    } else {
+
+      /* ATTEMPT TO ALLOCATE MEMORY FOR COOKIE VARIABLES */
+      char *cookie;
+      INT cookieLength = strlen(getenv("HTTP_COOKIE"));
+      if ((cookieLength < 1) || !(cookie = malloc(cookieLength + 1))) {
+        /** ERROR | CRUCIAL MEMORY ALLOCATION ERROR FOR COOKIE DATA! > REDIRECT TO LOGIN PANEL **/
+        RedirectToLoginPanel();
+      } else {
+        char *variableName;
+        if (!(variableName = malloc(cookieLength + 1))) {
+          /** ERROR | CANNOT ALLOCATE MEMORY FOR COOKIE VARIABLE NAME > REDIRECT TO LOGIN PANEL **/
+          RedirectToLoginPanel();
+        } else {
+          char *variableValue;
+          if (!(variableValue = malloc(cookieLength + 1))) {
+            /** ERROR | CANNOT ALLOCATE MEMORY FOR COOKIE VARIABLE VALUE > REDIRECT TO LOGIN PANEL **/
+            RedirectToLoginPanel();
+
+          /* IF SUFFICIENT MEMORY FOR COOKIE VARIABLES... */
+          } else {
+
+            /* PROCESS COOKIE DATA */
+            char *login, *password;
+            INT c, i;
+            login = password = NULL;
+            c = 0;
+            strcpy(cookie, getenv("HTTP_COOKIE"));
+            while ((c < cookieLength) && (cookie[c] != '\0')) {
+              i = 0;
+              while ((c < cookieLength) && (cookie[c] != '=') && (cookie[c] != '\0')) {
+                variableName[i] = cookie[c];
+                ++c;
+                ++i;
+              }
+              variableName[i] = '\0';
+              ++c;
+              i = 0;
+              while ((c < cookieLength) && (cookie[c] != ';') && (cookie[c] != '\0')) {
+                variableValue[i] = cookie[c];
+                ++c;
+                ++i;
+              }
+              variableValue[i] = '\0';
+              ++c;
+              while ((c < cookieLength) && (cookie[c] == ' ')) {
+                ++c;
+              }
+              if (!login && !strcmp(variableName, "login")) {
+                if ((login = malloc(strlen(variableValue) + 1)) != 0) {
+                  strcpy(login, variableValue);
+                }
+              } else if (!password && !strcmp(variableName, "password")) {
+                if ((password = malloc(strlen(variableValue) + 1)) != 0) {
+                  strcpy(password, variableValue);
+                }
+              }
+            }
+
+            /* IF LOGIN VALUE IS MISSING... */
+            if (!login) {
+              /** ERROR | LOGIN VALUE IS MISSING > REDIRECT TO LOGIN PANEL **/
+              RedirectToLoginPanel();
+
+            /* OTHERWISE, IF LOGIN VALUE EXISTS... */
+            } else {
+
+              /* VERIFY LOGIN AND PASSWORD */
+              char *directory;
+              if (!(directory = malloc(strlen(login) + strlen(DIRECTORY) + 1))) {
+                /** ERROR | CANNOT ALLOCATE MEMORY FOR DIRECTORY NAME > REDIRECT TO LOGIN PANEL **/
+                RedirectToLoginPanel();
+              } else {
+                char *systemDirectory;
+                if (!(systemDirectory = malloc(strlen(login) + strlen(SYSTEM_DIRECTORY) + 1))) {
+                  /** ERROR | CANNOT ALLOCATE MEMORY FOR SYSTEM DIRECTORY NAME > REDIRECT TO LOGIN PANEL **/
+                  RedirectToLoginPanel();
+                } else {
+                  strcpy(directory, DIRECTORY);
+                  strcat(directory, login);
+                  strcpy(systemDirectory, SYSTEM_DIRECTORY);
+                  strcat(systemDirectory, login);
+
+                  /* IF DIRECTORY CAN'T BE ACCESSED... */
+                  if (access(directory, F_OK) || access(systemDirectory, F_OK)) {
+                    /** ERROR | CANNOT ACCESS DIRECTORY > REDIRECT TO LOGIN PANEL **/
+                    RedirectToLoginPanel();
+
+                  /* OTHERWISE, IF DIRECTORY CAN BE ACCESSED... */
+                  } else {
+
+                    /* ATTEMPT TO ACCESS PASSWORD FILE */
+                    char *passwordFileName;
+                    if (!(passwordFileName = malloc(strlen(systemDirectory) + strlen(PASSWORD_FILE_NAME) + 11))) {
+                      /** ERROR | CANNOT ALLOCATE MEMORY FOR FILE NAME > REDIRECT TO LOGIN PANEL **/
+                      RedirectToLoginPanel();
+                    } else {
+                      strcpy(passwordFileName, systemDirectory);
+                      strcat(passwordFileName, PASSWORD_FILE_NAME);
+
+                      /* IF PASSWORD FILE CAN'T BE ACCESSED... */
+                      if (access(passwordFileName, F_OK)) {
+                        /** ERROR | CANNOT ACCESS FILE > REDIRECT TO LOGIN PANEL **/
+                        RedirectToLoginPanel();
+
+                      /* OTHERWISE, IF PASSWORD FILE CAN BE ACCESSED... */
+                      } else {
+
+                        /* ATTEMPT TO OPEN PASSWORD FILE FOR READING */
+                        FILE *passwordFile;
+
+                        /* IF PASSWORD FILE CAN'T BE OPENED FOR READING... */
+                        if (!(passwordFile = fopen(passwordFileName, "r"))) {
+                          /** ERROR | CANNOT READ FILE > REDIRECT TO LOGIN PANEL **/
+                          RedirectToLoginPanel();
+
+                        /* OTHERWISE, IF PASSWORD FILE CAN BE OPENED FOR READING... */
+                        } else {
+                          char *filePassword;
+                          if (!(filePassword = malloc(MAX_PASSWORD_SIZE + 1))) {
+                            /** ERROR | CANNOT ALLOCATE MEMORY FOR PASSWORD FROM FILE > REDIRECT TO LOGIN PANEL **/
+                            RedirectToLoginPanel();
+                          } else {
+                            char c;
+                            i = 0;
+
+                            /* READ PASSWORD FROM PASSWORD FILE */
+                            while (((c = fgetc(passwordFile)) != '\n') && (i < MAX_PASSWORD_SIZE)) {
+                              filePassword[i] = c;
+                              ++i;
+                            }
+                            filePassword[i] = '\0';
+                            fclose(passwordFile);
+
+                            /* IF PASSWORD FAILS COMPARISON... */
+                            if (strcmp(filePassword, password)) {
+                              /** ERROR | PASSWORD FAILED > REDIRECT TO LOGIN PANEL **/
+                              RedirectToLoginPanel();
+
+                            /* OTHERWISE, IF PASSWORD PASSES COMPARISON... */
+                            } else {
+
+                              /* LOAD SETTINGS VALUES FROM FILES */
+
+                              /* LOAD COMPONENTS FROM FILES */
+
+                              /* DECLARE AND INITIALIZE QUERY VARIABLES */
+                              char *name, *open;
+                              name = open = NULL;
+
+                              /* IF QUERY DATA EXISTS AND IS OF ACCEPTABLE LENGTH... */
+                              if (getenv("QUERY_STRING") && (sizeof(strlen(getenv("QUERY_STRING"))) <= sizeof(INT))) {
+                                char *query;
+                                INT queryLength = strlen(getenv("QUERY_STRING"));
+                                if ((queryLength < 1) || !(query = malloc(queryLength + 1))) {
+                                  /** ERROR | CRUCIAL MEMORY ALLOCATION ERROR FOR QUERY DATA! > CONTINUE WITHOUT QUERY **/
+                                } else {
+                                  strcpy(query, getenv("QUERY_STRING"));
+                                  free(variableName);
+                                  if (!(variableName = malloc(queryLength + 1))) {
+                                    /** ERROR | CANNOT ALLOCATE MEMORY FOR VARIABLE NAME > CONTINUE WITHOUT QUERY **/
+                                  } else {
+                                    free(variableValue);
+                                    if (!(variableValue = malloc(queryLength + 1))) {
+                                      /** ERROR | CANNOT ALLOCATE MEMORY FOR VARIABLE VALUE > CONTINUE WITHOUT QUERY **/
+
+                                    /* IF SUFFICIENT MEMORY FOR QUERY VARIABLES... */
+                                    } else {
+
+                                      /* PROCESS QUERY DATA */
+                                      INT q = 0;
+                                      i = 0;
+                                      while ((q < queryLength) && (query[q] != '\0')) {
+                                        while ((q < queryLength) && (query[q] != '=') && (query[q] != '\0')) {
+                                          variableName[i] = query[q];
+                                          ++q;
+                                          ++i;
+                                        }
+                                        variableName[i] = '\0';
+                                        ++q;
+                                        i = 0;
+                                        while ((query[q] != '&') && (query[q] != '\0')) {
+                                          variableValue[i] = query[q];
+                                          ++q;
+                                          ++i;
+                                        }
+                                        variableValue[i] = '\0';
+                                        if (query[q] != '\0') {
+                                          ++q;
+                                        }
+                                        if (!name && !strcmp(variableName, "name")) {
+                                          if ((name = malloc(strlen(variableValue) + 1)) != 0) {
+                                            strcpy(name, variableValue);
+                                          }
+                                        } else if (!open && !strcmp(variableName, "open")) {
+                                          if ((open = malloc(strlen(variableValue) + 1)) != 0) {
+                                            strcpy(open, variableValue);
+                                          }
+                                        }
+                                      }
+                                      free(variableValue);
+                                      variableValue = NULL;
+                                    }
+                                    free(variableName);
+                                    variableName = NULL;
+                                  }
+                                  free(query);
+                                }
+                              }
+
+                              /* OUTPUT GUI COMPONENT(S) BASED ON VARIABLES */
+                              if (name) {
+                                if (!strcmp(name, "settings")) {
+                                  OutputSettingsMenu(NULL);
+                                } else if (!strcmp(name, "new")) {
+                                  OutputNewMenu();
+                                } else if (!strcmp(name, "open")) {
+                                  OutputOpenMenu(NULL);
+                                } else if (!strcmp(name, "next")) {
+                                  OutputNextMenu(NULL);
+                                } else {
+                                  RedirectToLoginPanel();
+                                }
+                              } else if (open) {
+                                if (!strcmp(open, "text_file")) {
+                                  OutputOpenMenu(open);
+                                } else {
+                                  OutputOpenMenu(NULL);
+                                }
+                              } else {
+                                RedirectToLoginPanel();
+                              }
+                              free(name);
+                              free(open);
+                            }
+                            free(filePassword);
+                          }
+                        }
+                      }
+                      free(passwordFileName);
+                    }
+                  }
+                  free(systemDirectory);
+                }
+                free(directory);
+              }
+              free(login);
+            }
+            free(password);
+            free(variableValue);
+          }
+          free(variableName);
+        }
+        free(cookie);
+      }
+    }
+  }
+  return 0;
+}
+
+/* FUNCTION | REDIRECT TO LOGIN PANEL */
+static void RedirectToLoginPanel(void) {
+  printf("Location: login\r\n\r\n");
+}
+
+static void OutputNewMenu(void) {
+  BeginXHTMLOutput();
+  printf("      class=\"newMenu\">\n");
+  printf("  <!--==================================================-->\n");
+  printf("  <!--    interos Standard Document Header - Markup     -->\n");
+  printf("  <!--==================================================-->\n");
+  printf("  <!--    URIs:  https://interos.com/menu?name=new      -->\n");
+  printf("  <!--           https://www.interos.com/menu?name=new  -->\n");
+  printf("  <!--   Title:  interos new menu                       -->\n");
+  printf("  <!--  Author:  Brent Angeline                         -->\n");
+  printf("  <!--  Markup:  W3C-Validated XHTML 1.0 Transitional   -->\n");
+  printf("  <!--==================================================-->\n");
+  printf("  <head>\n");
+  printf("    <meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\" />\n");
+  printf("    <meta name=\"title\" content=\"interos new menu\" />\n");
+  printf("    <meta name=\"description\" content=\"new menu for interos\" />\n");
+  printf("    <meta name=\"author\" content=\"Brent Angeline\" />\n");
+  printf("    <meta name=\"copyright\" \n");
+  printf("          content=\"Copyright &copy; 2001-2010 Brent Angeline and interos LLC\" />\n");
+  printf("    <meta name=\"robots\" content=\"noindex, nofollow, noarchive\" />\n");
+  printf("    <title>interos new menu</title>\n");
+  printf("    <link rel=\"shortcut icon\" type=\"image/x-icon\" href=\"/favicon.ico\" />\n");
+  printf("    <link rel=\"icon\" type=\"image/gif\" href=\"/images/favicon.gif\" />\n");
+  printf("    <link rel=\"stylesheet\" type=\"text/css\" href=\"/style/menu.css\" \n");
+  printf("          media=\"screen, projection\" />\n");
+  printf("    <script type=\"text/javascript\" src=\"/js/menu.js\"></script>\n");
+  printf("  </head>\n");
+  printf("  <body id=\"body\">\n");
+  printf("    <center>\n");
+  printf("      <div id=\"newMenu\">\n");
+  printf("        <div id=\"newMenuContent\">\n");
+  printf("          <table>\n");
+  printf("            <thead>\n");
+  printf("              <tr>\n");
+  printf("                <th><h1>new menu</h1></th>\n");
+  printf("              </tr>\n");
+  printf("            </thead>\n");
+  printf("            <tbody>\n");
+  printf("              <tr>\n");
+  printf("                <td><a href=\"/new?alarm\" target=\"_top\">\n");
+  printf("                      <img src=\"/images/icons/new/alarm.png\" \n");
+  printf("                           alt=\"alarm\" /><br /><span>alarm</span><br />\n");
+  printf("                      <br />\n");
+  printf("                    </a></td>\n");
+  printf("              </tr>\n");
+  printf("              <tr>\n");
+  printf("                <td><a href=\"/new?bookmark\" target=\"_top\">\n");
+  printf("                     <img src=\"/images/icons/new/bookmark.png\" \n");
+  printf("                           alt=\"bookmark\" /><br /><span>bookmark</span><br />\n");
+  printf("                      <br />\n");
+  printf("                   </a></td>\n");
+  printf("              </tr>\n");
+  printf("             <tr>\n");
+  printf("                <td><a href=\"/new?chat\" target=\"_top\">\n");
+  printf("                      <img src=\"/images/icons/new/chat.png\" \n");
+  printf("                           alt=\"chat\" /><br /><span>chat</span><br />\n");
+  printf("                      <br />\n");
+  printf("                    </a></td>\n");
+  printf("              </tr>\n");
+  printf("              <tr>\n");
+  printf("                <td><a href=\"/new?copy\" target=\"_top\">\n");
+  printf("                     <img src=\"/images/icons/new/copy.png\" \n");
+  printf("                          alt=\"copy\" /><br /><span>copy</span><br />\n");
+  printf("                      <br />\n");
+  printf("                    </a></td>\n");
+  printf("              </tr>\n");
+  printf("              <tr>\n");
+  printf("                <td><a href=\"/new?document\" target=\"_top\">\n");
+  printf("                     <img src=\"/images/icons/new/document.png\" \n");
+  printf("                           alt=\"document\" /><br /><span>document</span><br />\n");
+  printf("                      <br />\n");
+  printf("                    </a></td>\n");
+  printf("              </tr>\n");
+  printf("              <tr>\n");
+  printf("                <td><a href=\"/new?download\" target=\"_top\">\n");
+  printf("                      <img src=\"/images/icons/new/download.png\" \n");
+  printf("                           alt=\"download\" /><br /><span>download</span><br />\n");
+  printf("                      <br />\n");
+  printf("                    </a></td>\n");
+  printf("              </tr>\n");
+  printf("              <tr>\n");
+  printf("                <td><a href=\"/new?e-mail\" target=\"_top\">\n");
+  printf("                     <img src=\"/images/icons/new/e-mail.png\" \n");
+  printf("                          alt=\"e-mail\" /><br /><span>e-mail</span><br />\n");
+  printf("                      <br />\n");
+  printf("                    </a></td>\n");
+  printf("              </tr>\n");
+  printf("              <tr>\n");
+  printf("                <td><a href=\"/new?folder\" target=\"_top\">\n");
+  printf("                      <img src=\"/images/icons/new/folder.png\" \n");
+  printf("                          alt=\"folder\" /><br /><span>folder</span><br />\n");
+  printf("                      <br />\n");
+  printf("                    </a></td>\n");
+  printf("              </tr>\n");
+  printf("              <tr>\n");
+  printf("                <td><a href=\"/new?phone_call\" target=\"_top\">\n");
+  printf("                     <img src=\"/images/icons/new/phone_call.png\" \n");
+  printf("                          alt=\"phone call\" /><br /><span>phone call</span><br />\n");
+  printf("                     <br />\n");
+  printf("                   </a></td>\n");
+  printf("              </tr>\n");
+  printf("              <tr>\n");
+  printf("                <td><a href=\"/new?search\" target=\"_top\">\n");
+  printf("                      <img src=\"/images/icons/new/search.png\" \n");
+  printf("                          alt=\"search\" /><br /><span>search</span><br />\n");
+  printf("                     <br />\n");
+  printf("                    </a></td>\n");
+  printf("             </tr>\n");
+  printf("              <tr>\n");
+  printf("                <td><a href=\"/new?share\" target=\"_top\">\n");
+  printf("                      <img src=\"/images/icons/new/share.png\" \n");
+  printf("                           alt=\"share\" /><br /><span>share</span><br />\n");
+  printf("                      <br />\n");
+  printf("                    </a></td>\n");
+  printf("              </tr>\n");
+  printf("              <tr>\n");
+  printf("               <td><a href=\"/new?text_file\" target=\"_top\">\n");
+  printf("                     <img src=\"/images/icons/new/text_file.png\" \n");
+  printf("                           alt=\"text file\" /><br /><span>text file</span><br />\n");
+  printf("                     <br />\n");
+  printf("                   </a></td>\n");
+  printf("              </tr>\n");
+  printf("              <tr>\n");
+  printf("                <td><a href=\"/new?upload\" target=\"_top\">\n");
+  printf("                     <img src=\"/images/icons/new/upload.png\" \n");
+  printf("                          alt=\"upload\" /><br /><span>upload</span><br />\n");
+  printf("                     <br />\n");
+  printf("                   </a></td>\n");
+  printf("              </tr>\n");
+  printf("           </tbody>\n");
+  printf("          </table>\n");
+  printf("        </div>\n");
+  FinishXHTMLOutput();
+}
+
+static void OutputOpenMenu(char *open) {
+  BeginXHTMLOutput();
+  printf("      class=\"openMenu\">\n");
+  printf("  <!--===================================================-->\n");
+  printf("  <!--       interos Standard Document Header - Markup   -->\n");
+  printf("  <!--===================================================-->\n");
+  printf("  <!--    URIs:  https://interos.com/menu?name=open      -->\n");
+  printf("  <!--           https://www.interos.com/menu?name=open  -->\n");
+  printf("  <!--   Title:  interos open menu                       -->\n");
+  printf("  <!--  Author:  Brent Angeline                          -->\n");
+  printf("  <!--  Markup:  W3C-Validated XHTML 1.0 Transitional    -->\n");
+  printf("  <!--===================================================-->\n");
+  printf("  <head>\n");
+  printf("    <meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\" />\n");
+  printf("    <meta name=\"title\" content=\"interos open menu\" />\n");
+  printf("    <meta name=\"description\" content=\"open menu for interos\" />\n");
+  printf("    <meta name=\"author\" content=\"Brent Angeline\" />\n");
+  printf("    <meta name=\"copyright\" \n");
+  printf("          content=\"Copyright &copy; 2001-2010 Brent Angeline and interos LLC\" />\n");
+  printf("    <meta name=\"robots\" content=\"noindex, nofollow, noarchive\" />\n");
+  printf("    <title>interos - open menu</title>\n");
+  printf("    <link rel=\"shortcut icon\" type=\"image/x-icon\" href=\"/favicon.ico\" />\n");
+  printf("    <link rel=\"icon\" type=\"image/gif\" href=\"/images/favicon.gif\" />\n");
+  printf("    <link rel=\"stylesheet\" type=\"text/css\" href=\"/style/menu.css\" \n");
+  printf("          media=\"screen, projection\" />\n");
+  printf("    <script type=\"text/javascript\" src=\"/js/menu.js\"></script>\n");
+  printf("  </head>\n");
+  printf("  <body id=\"body\">\n");
+  printf("    <center>\n");
+  printf("      <div id=\"openMenu\">\n");
+  printf("        <div id=\"openMenuContent\">\n");
+  printf("          <table>\n");
+  printf("            <thead>\n");
+  printf("              <tr>\n");
+  printf("                <th><h1>open menu</h1></th>\n");
+  printf("              </tr>\n");
+  printf("            </thead>\n");
+  printf("            <tbody>\n");
+  printf("              <tr>\n");
+  if (open && !strcmp(open, "text_file")) {
+    printf("                <td><a href=\"/interos?text_file=empty.txt\" target=\"_top\">\n");
+    printf("                      <img src=\"/images/icons/open/text_file.png\" \n");
+    printf("                           alt=\"empty.txt\" /><br /><span>empty.txt</span><br />\n");
+    printf("                      <br />\n");
+    printf("                    </a></td>\n");
+  } else {
+    printf("                <td><a href=\"/interos?open=alarm\" target=\"_top\">\n");
+    printf("                      <img src=\"/images/icons/open/alarm.png\" \n");
+    printf("                           alt=\"alarm\" /><br /><span>alarm</span><br />\n");
+    printf("                     <br />\n");
+    printf("                   </a></td>\n");
+    printf("              </tr>\n");
+    printf("              <tr>\n");
+    printf("                <td><a href=\"/interos?open=bookmark\" target=\"_top\">\n");
+    printf("                      <img src=\"/images/icons/open/bookmark.png\" \n");
+    printf("                           alt=\"bookmark\" /><br /><span>bookmark</span><br />\n");
+    printf("                      <br />\n");
+    printf("                    </a></td>\n");
+    printf("              </tr>\n");
+    printf("              <tr>\n");
+    printf("                <td><a href=\"/interos?open=document\" target=\"_top\">\n");
+    printf("                      <img src=\"/images/icons/open/document.png\" \n");
+    printf("                           alt=\"document\" /><br /><span>document</span><br />\n");
+    printf("                      <br />\n");
+    printf("                    </a></td>\n");
+    printf("              </tr>\n");
+    printf("              <tr>\n");
+    printf("                <td><a href=\"/interos?open=e-mail\" target=\"_top\">\n");
+    printf("                      <img src=\"/images/icons/open/e-mail.png\" \n");
+    printf("                           alt=\"e-mail\" /><br /><span>e-mail</span><br />\n");
+    printf("                      <br />\n");
+    printf("                    </a></td>\n");
+    printf("              </tr>\n");
+    printf("              <tr>\n");
+    printf("                <td><a href=\"/interos?open=image\" target=\"_top\">\n");
+    printf("                      <img src=\"/images/icons/open/image.png\" \n");
+    printf("                           alt=\"image\" /><br /><span>image</span><br />\n");
+    printf("                      <br />\n");
+    printf("                   </a></td>\n");
+    printf("              </tr>\n");
+    printf("              <tr>\n");
+    printf("                <td><a href=\"/interos?open=incoming\" target=\"_top\">\n");
+    printf("                      <img src=\"/images/icons/open/incoming.png\" \n");
+    printf("                           alt=\"incoming\" /><br /><span>incoming</span><br />\n");
+    printf("                      <br />\n");
+    printf("                    </a></td>\n");
+    printf("              </tr>\n");
+    printf("              <tr>\n");
+    printf("                <td><a href=\"/interos?open=music\" target=\"_top\">\n");
+    printf("                      <img src=\"/images/icons/open/music.png\" \n");
+    printf("                           alt=\"music\" /><br /><span>music</span><br />\n");
+    printf("                     <br />\n");
+    printf("                    </a></td>\n");
+    printf("              </tr>\n");
+    printf("              <tr>\n");
+    printf("                <td><a href=\"/interos?open=shared\" target=\"_top\">\n");
+    printf("                      <img src=\"/images/icons/open/shared.png\" \n");
+    printf("                           alt=\"shared\" /><br /><span>shared</span><br />\n");
+    printf("                      <br />\n");
+    printf("                    </a></td>\n");
+    printf("              </tr>\n");
+    printf("              <tr>\n");
+    printf("                <td><a href=\"/interos?open=text_file\" target=\"_top\">\n");
+    printf("                      <img src=\"/images/icons/open/text_file.png\" \n");
+    printf("                           alt=\"text file\" /><br /><span>text file</span><br />\n");
+    printf("                      <br />\n");
+    printf("                    </a></td>\n");
+    printf("              </tr>\n");
+    printf("              <tr>\n");
+    printf("                <td><a href=\"/interos?open=video\" target=\"_top\">\n");
+    printf("                      <img src=\"/images/icons/open/video.png\" \n");
+    printf("                           alt=\"video\" /><br /><span>video</span><br />\n");
+    printf("                      <br />\n");
+    printf("                    </a></td>\n");
+  }
+  printf("              </tr>\n");
+  printf("            </tbody>\n");
+  printf("          </table>\n");
+  printf("        </center>\n");
+  printf("      </div>\n");
+  FinishXHTMLOutput();
+}
+
+static void OutputNextMenu(char *next) {
+  BeginXHTMLOutput();
+  printf("      class=\"nextMenu\">\n");
+  printf("  <!--===================================================-->\n");
+  printf("  <!--       interos Standard Document Header - Markup   -->\n");
+  printf("  <!--===================================================-->\n");
+  printf("  <!--    URIs:  https://interos.com/menu?name=next      -->\n");
+  printf("  <!--           https://www.interos.com/menu?name=next  -->\n");
+  printf("  <!--   Title:  interos next menu                       -->\n");
+  printf("  <!--  Author:  Brent Angeline                          -->\n");
+  printf("  <!--  Markup:  W3C-Validated XHTML 1.0 Transitional    -->\n");
+  printf("  <!--===================================================-->\n");
+  printf("  <head>\n");
+  printf("    <meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\" />\n");
+  printf("    <meta name=\"title\" content=\"interos next menu\" />\n");
+  printf("    <meta name=\"description\" content=\"next menu for interos\" />\n");
+  printf("    <meta name=\"author\" content=\"Brent Angeline\" />\n");
+  printf("    <meta name=\"copyright\" \n");
+  printf("          content=\"Copyright &copy; 2001-2010 Brent Angeline and interos LLC\" />\n");
+  printf("    <meta name=\"robots\" content=\"noindex, nofollow, noarchive\" />\n");
+  printf("    <title>interos next menu</title>\n");
+  printf("    <link rel=\"shortcut icon\" type=\"image/x-icon\" href=\"/favicon.ico\" />\n");
+  printf("    <link rel=\"icon\" type=\"image/gif\" href=\"/images/favicon.gif\" />\n");
+  printf("    <link rel=\"stylesheet\" type=\"text/css\" href=\"/style/menu.css\" \n");
+  printf("          media=\"screen, projection\" />\n");
+  printf("    <script type=\"text/javascript\" src=\"/js/menu.js\"></script>\n");
+  printf("  </head>\n");
+  printf("  <body id=\"body\">\n");
+  printf("    <center>\n");
+  printf("      <div id=\"nextMenu\">\n");
+  printf("        <div id=\"nextMenuContent\">\n");
+  printf("          <table>\n");
+  printf("            <thead>\n");
+  printf("              <th><h1>next menu</h1></th>\n");
+  printf("            </thead>\n");
+  printf("            <tbody>\n");
+  printf("              <tr>\n");
+  printf("                <td><a href=\"/interos?next=bookmark\" target=\"_top\">\n");
+  printf("                      <img src=\"/images/icons/next/bookmark.png\" \n");
+  printf("                           alt=\"bookmark\" /><br /><span>bookmark</span><br />\n");
+  printf("                      <br />\n");
+  printf("                    </a></td>\n");
+  printf("              </tr>\n");
+  printf("              <tr>\n");
+  printf("                <td><a href=\"/interos?next=close\" target=\"_top\">\n");
+  printf("                      <img src=\"/images/icons/next/close.png\" \n");
+  printf("                           alt=\"close\" /><br /><span>close</span><br />\n");
+  printf("                      <br />\n");
+  printf("                    </a></td>\n");
+  printf("              </tr>\n");
+  printf("              <tr>\n");
+  printf("                <td><a href=\"/logout\" target=\"_top\">\n");
+  printf("                      <img src=\"/images/icons/next/logout.png\" \n");
+  printf("                           alt=\"logout\" /><br /><span>logout</span><br />\n");
+  printf("                      <br />\n");
+  printf("                    </a></td>\n");
+  printf("              </tr>\n");
+  printf("              <tr>\n");
+  printf("                <td><a href=\"/interos?next=save\" target=\"_top\">\n");
+  printf("                      <img src=\"/images/icons/next/save.png\" \n");
+  printf("                           alt=\"save\" /><br /><span>save</span><br />\n");
+  printf("                      <br />\n");
+  printf("                    </a></td>\n");
+  printf("              </tr>\n");
+  printf("              <tr>\n");
+  printf("                <td><a href=\"/interos?next=save_as\" target=\"_top\">\n");
+  printf("                      <img src=\"/images/icons/next/save_as.png\" \n");
+  printf("                           alt=\"save as\" /><br /><span>save as</span><br />\n");
+  printf("                      <br />\n");
+  printf("                    </a></td>\n");
+  printf("              </tr>\n");
+  printf("            </tbody>\n");
+  printf("          </table>\n");
+  printf("        </div>\n");
+  FinishXHTMLOutput();
+}
+
+static void OutputSettingsMenu(char *settings) {
+  BeginXHTMLOutput();
+  printf("      class=\"settingsMenu\">\n");
+  printf("  <!--=======================================================-->\n");
+  printf("  <!--         interos Standard Document Header - Markup     -->\n");
+  printf("  <!--=======================================================-->\n");
+  printf("  <!--    URIs:  https://interos.com/menu?name=settings      -->\n");
+  printf("  <!--           https://www.interos.com/menu?name=settings  -->\n");
+  printf("  <!--   Title:  interos settings menu                       -->\n");
+  printf("  <!--  Author:  Brent Angeline                              -->\n");
+  printf("  <!--  Markup:  W3C-Validated XHTML 1.0 Transitional        -->\n");
+  printf("  <!--=======================================================-->\n");
+  printf("  <head>\n");
+  printf("    <meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\" />\n");
+  printf("    <meta name=\"title\" content=\"interos settings menu\" />\n");
+  printf("    <meta name=\"description\" content=\"settings menu for interos\" />\n");
+  printf("    <meta name=\"author\" content=\"Brent Angeline\" />\n");
+  printf("    <meta name=\"copyright\" \n");
+  printf("          content=\"Copyright &copy; 2001-2010 Brent Angeline and interos LLC\" />\n");
+  printf("    <meta name=\"robots\" content=\"noindex, nofollow, noarchive\" />\n");
+  printf("    <title>interos settings menu</title>\n");
+  printf("    <link rel=\"shortcut icon\" type=\"image/x-icon\" href=\"/favicon.ico\" />\n");
+  printf("    <link rel=\"icon\" type=\"image/gif\" href=\"/images/favicon.gif\" />\n");
+  printf("    <link rel=\"stylesheet\" type=\"text/css\" href=\"/style/menu.css\" \n");
+  printf("          media=\"screen, projection\" />\n");
+  printf("    <script type=\"text/javascript\" src=\"/js/menu.js\"></script>\n");
+  printf("  </head>\n");
+  printf("  <body id=\"body\">\n");
+  printf("    <center>\n");
+  printf("      <div id=\"settingsMenu\">\n");
+  printf("        <div id=\"settingsMenuContent\">\n");
+  printf("          <table>\n");
+  printf("            <thead>\n");
+  printf("              <tr>\n");
+  printf("                <th><h1>settings menu</h1></th>\n");
+  printf("              </tr>\n");
+  printf("            </thead>\n");
+  printf("            <tbody>\n");
+  printf("              <tr>\n");
+  printf("                <td><a href=\"/interos?settings=audio\" target=\"_top\">\n");
+  printf("                      <img src=\"/images/icons/settings/audio.png\" \n");
+  printf("                           alt=\"audio\" /><br /><span>audio</span><br />\n");
+  printf("                      <br />\n");
+  printf("                    </a></td>\n");
+  printf("              </tr>\n");
+  printf("              <tr>\n");
+  printf("                <td><a href=\"/interos?settings=buttons\" target=\"_top\">\n");
+  printf("                      <img src=\"/images/icons/settings/buttons.png\" \n");
+  printf("                           alt=\"buttons\" /><br /><span>buttons</span><br />\n");
+  printf("                      <br />\n");
+  printf("                    </a></td>\n");
+  printf("              </tr>\n");
+  printf("              <tr>\n");
+  printf("                <td><a href=\"/interos?settings=chat\" target=\"_top\">\n");
+  printf("                      <img src=\"/images/icons/settings/chat.png\" \n");
+  printf("                           alt=\"chat\" /><br /><span>chat</span><br />\n");
+  printf("                      <br />\n");
+  printf("                    </a></td>\n");
+  printf("              </tr>\n");
+  printf("              <tr>\n");
+  printf("                <td><a href=\"/interos?settings=clock\" target=\"_top\">\n");
+  printf("                      <img src=\"/images/icons/settings/clock.png\" \n");
+  printf("                           alt=\"clock\" /><br /><span>clock</span><br />\n");
+  printf("                      <br />\n");
+  printf("                    </a></td>\n");
+  printf("              </tr>\n");
+  printf("              <tr>\n");
+  printf("                <td><a href=\"/interos?settings=e-mail\" target=\"_top\">\n");
+  printf("                      <img src=\"/images/icons/settings/e-mail.png\" \n");
+  printf("                           alt=\"e-mail\" /><br /><span>e-mail</span><br />\n");
+  printf("                      <br />\n");
+  printf("                    </a></td>\n");
+  printf("              </tr>\n");
+  printf("              <tr>\n");
+  printf("                <td><a href=\"/interos?settings=images\" target=\"_top\">\n");
+  printf("                      <img src=\"/images/icons/settings/images.png\" \n");
+  printf("                           alt=\"images\" /><br /><span>images</span><br />\n");
+  printf("                      <br />\n");
+  printf("                    </a></td>\n");
+  printf("              </tr>\n");
+  printf("              <tr>\n");
+  printf("                <td><a href=\"/interos?settings=phone\" target=\"_top\">\n");
+  printf("                      <img src=\"/images/icons/settings/phone.png\" \n");
+  printf("                           alt=\"phone\" /><br /><span>phone</span><br />\n");
+  printf("                      <br />\n");
+  printf("                    </a></td>\n");
+  printf("              </tr>\n");
+  printf("              <tr>\n");
+  printf("                <td><a href=\"/interos?settings=search\" target=\"_top\">\n");
+  printf("                      <img src=\"/images/icons/settings/search.png\" \n");
+  printf("                           alt=\"search\" /><br /><span>search</span><br />\n");
+  printf("                      <br />\n");
+  printf("                    </a></td>\n");
+  printf("              </tr>\n");
+  printf("              <tr>\n");
+  printf("                <td><a href=\"/interos?settings=video\" target=\"_top\">\n");
+  printf("                      <img src=\"/images/icons/settings/video.png\" \n");
+  printf("                           alt=\"video\" /><br /><span>video</span><br />\n");
+  printf("                      <br />\n");
+  printf("                    </a></td>\n");
+  printf("              </tr>\n");
+  printf("          </tbody>\n");
+  printf("        </table>\n");
+  printf("      </div>\n");
+  FinishXHTMLOutput();
+}
+
+/* FUNCTION | BEGIN XHTML OUTPUT */
+static void BeginXHTMLOutput(void) {
+  printf("Content-Type: text/html; charset=utf-8\r\n\r\n");
+  printf("<?xml version=\"1.0\" encoding=\"utf-8\"?>\n");
+  printf("<?xml-stylesheet type=\"text/css\" href=\"/style/menu.css\"?>\n");
+  printf("<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \n");
+  printf("                      \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">\n");
+  printf("<html xmlns=\"http://www.w3.org/1999/xhtml\" xml:lang=\"en-US\" lang=\"en-US\" \n");
+}
+
+/* FUNCTION | FINISH XHTML OUTPUT */
+static void FinishXHTMLOutput(void) {
+  printf("      </div>\n");
+  printf("    </center>\n");
+  printf("  </body>\n");
+  printf("  <!--=====================================================================-->\n");
+  printf("  <!--                  Copyright and Trademark Statement                  -->\n");
+  printf("  <!--=====================================================================-->\n");
+  printf("  <!--                                                                     -->\n");
+  printf("  <!--          All original textual and graphical site content:           -->\n");
+  printf("  <!--                                                                     -->\n");
+  printf("  <!--  Copyright 2001-2010 Brent Angeline and interos LLC.  All rights    -->\n");
+  printf("  <!--  reserved.  Reproduction in whole or in part without written        -->\n");
+  printf("  <!--  permission is prohibited.  interos and the interos logos are       -->\n");
+  printf("  <!--  trademarks of Brent Angeline and interos LLC.  All other company,  -->\n");
+  printf("  <!--  product, and service names mentioned herein may be the properties  -->\n");
+  printf("  <!--  of their respective owners.  Comments in the interos.org forums    -->\n");
+  printf("  <!--  are the properties of their respective authors.  All software      -->\n");
+  printf("  <!--  developed in the forums is open source and belongs to everyone.    -->\n");
+  printf("  <!--                                                                     -->\n");
+  printf("  <!--=====================================================================-->\n");
+  printf("  <!--                      e-mail: info@interos.com                       -->\n");
+  printf("  <!--=====================================================================-->\n");
+  printf("</html>");
+}
+
+/***********************************************************************/
+/*                  Copyright and Trademark Statement                  */
+/***********************************************************************/
+/*                                                                     */
+/*          All original textual and graphical site content:           */
+/*                                                                     */
+/*  Copyright 2001-2010 Brent Angeline and interos LLC.  All rights    */
+/*  reserved.  Reproduction in whole or in part without written        */
+/*  permission is prohibited.  interos and the interos logos are       */
+/*  trademarks of Brent Angeline and interos LLC.  All other company,  */
+/*  product, and service names mentioned herein may be the properties  */
+/*  of their respective owners.  Comments in the interos.org forums    */
+/*  are the properties of their respective authors.  All software      */
+/*  developed in the forums is open source and belongs to everyone.    */
+/*                                                                     */
+/***********************************************************************/
+/*                      e-mail: info@interos.com                       */
+/***********************************************************************/
diff --git a/c/new_interos.com_ssl.c b/c/new_interos.com_ssl.c
new file mode 100644 (file)
index 0000000..0770348
--- /dev/null
@@ -0,0 +1,452 @@
+/*************************************************/
+/*  interos Standard Document Header - CGI in C  */
+/*************************************************/
+/*         URIs:  https://interos.com/new        */
+/*                https://www.interos.com/new    */
+/*       Source:  new.c                          */
+/*  Description:  FastCGI for interos new menu   */
+/*       Author:  Brent Angeline                 */
+/*          CGI:  FastCGI in ISO/ANSI C          */
+/*************************************************/
+
+/* PREPROCESSOR DIRECTIVES */
+#include "fcgi_stdio.h"     /*  FCGI_Accept(), fclose(), fgetc(), fopen(), printf()                                 */
+#include "interos.h"        /*  DIRECTORY, INT, MAX_PASSWORD_SIZE, MENU_ITEM, PASSWORD_FILE_NAME, SYSTEM_DIRECTORY  */
+#include <stdlib.h>         /*  free(), getenv(), malloc()                                                          */
+#include <string.h>         /*  strcat(), strcmp(), strcpy, strlen()                                                */
+#include <unistd.h>         /*  F_OK, access()                                                                      */
+
+#ifndef INTEROS_H
+
+  /* TYPE DEFINITION */
+  typedef struct {
+    char *name;
+    char *link;
+    char *icon;
+    struct MENU_ITEM *next;
+  } MENU_ITEM;
+
+#endif
+
+/* FUNCTION PROTOTYPE DECLARATIONS */
+static void RedirectToLoginPanel(void);
+static void OutputNewMenu(void);
+static void OutputGUI(const char *variableName, const char *variableValue);
+static void BeginXHTMLOutput(void);
+static void FinishXHTMLOutput(void);
+
+/* BEGIN MAIN PROGRAM */
+int main(void) {
+
+  /* BEGIN FASTCGI */
+  while (FCGI_Accept() >= 0) {
+
+    /* IF COOKIE DATA DOESN'T EXIST OR IS TOO LONG... */
+    if (!getenv("HTTP_COOKIE") || (sizeof(strlen(getenv("HTTP_COOKIE"))) > sizeof(INT))) {
+      /** ERROR | COOKIE DATA DOES NOT EXIST OR IS TOO LONG > REDIRECT TO LOGIN PANEL **/
+      RedirectToLoginPanel();
+
+    /* OTHERWISE, IF COOKIE DATA DOES EXIST AND IS OF ACCEPTABLE LENGTH... */
+    } else {
+
+      /* ATTEMPT TO ALLOCATE MEMORY FOR COOKIE VARIABLES */
+      char *cookie;
+      INT cookieLength = strlen(getenv("HTTP_COOKIE"));
+      if ((cookieLength < 1) || !(cookie = malloc(cookieLength + 1))) {
+        /** ERROR | CRUCIAL MEMORY ALLOCATION ERROR FOR COOKIE DATA! > REDIRECT TO LOGIN PANEL **/
+        RedirectToLoginPanel();
+      } else {
+        char *variableName;
+        if (!(variableName = malloc(cookieLength + 1))) {
+          /** ERROR | CANNOT ALLOCATE MEMORY FOR COOKIE VARIABLE NAME > REDIRECT TO LOGIN PANEL **/
+          RedirectToLoginPanel();
+        } else {
+          char *variableValue;
+          if (!(variableValue = malloc(cookieLength + 1))) {
+            /** ERROR | CANNOT ALLOCATE MEMORY FOR COOKIE VARIABLE VALUE > REDIRECT TO LOGIN PANEL **/
+            RedirectToLoginPanel();
+
+          /* IF SUFFICIENT MEMORY FOR COOKIE VARIABLES... */
+          } else {
+
+            /* PROCESS COOKIE DATA */
+            char *login, *password;
+            INT c, i;
+            login = password = NULL;
+            c = 0;
+            strcpy(cookie, getenv("HTTP_COOKIE"));
+            while ((c < cookieLength) && (cookie[c] != '\0')) {
+              i = 0;
+              while ((c < cookieLength) && (cookie[c] != '=') && (cookie[c] != '\0')) {
+                variableName[i] = cookie[c];
+                ++c;
+                ++i;
+              }
+              variableName[i] = '\0';
+              ++c;
+              i = 0;
+              while ((c < cookieLength) && (cookie[c] != ';') && (cookie[c] != '\0')) {
+                variableValue[i] = cookie[c];
+                ++c;
+                ++i;
+              }
+              variableValue[i] = '\0';
+              ++c;
+              while ((c < cookieLength) && (cookie[c] == ' ')) {
+                ++c;
+              }
+              if (!login && !strcmp(variableName, "login")) {
+                if ((login = malloc(strlen(variableValue) + 1)) != 0) {
+                  strcpy(login, variableValue);
+                }
+              } else if (!password && !strcmp(variableName, "password")) {
+                if ((password = malloc(strlen(variableValue) + 1)) != 0) {
+                  strcpy(password, variableValue);
+                }
+              }
+            }
+
+            /* IF LOGIN VALUE IS MISSING... */
+            if (!login) {
+              /** ERROR | LOGIN VALUE IS MISSING > REDIRECT TO LOGIN PANEL **/
+              RedirectToLoginPanel();
+
+            /* OTHERWISE, IF LOGIN VALUE EXISTS... */
+            } else {
+
+              /* VERIFY LOGIN AND PASSWORD */
+              char *directory;
+              if (!(directory = malloc(strlen(login) + strlen(DIRECTORY) + 1))) {
+                /** ERROR | CANNOT ALLOCATE MEMORY FOR DIRECTORY NAME > REDIRECT TO LOGIN PANEL **/
+                RedirectToLoginPanel();
+              } else {
+                char *systemDirectory;
+                if (!(systemDirectory = malloc(strlen(login) + strlen(SYSTEM_DIRECTORY) + 1))) {
+                  /** ERROR | CANNOT ALLOCATE MEMORY FOR SYSTEM DIRECTORY NAME > REDIRECT TO LOGIN PANEL **/
+                  RedirectToLoginPanel();
+                } else {
+                  strcpy(directory, DIRECTORY);
+                  strcat(directory, login);
+                  strcpy(systemDirectory, SYSTEM_DIRECTORY);
+                  strcat(systemDirectory, login);
+
+                  /* IF DIRECTORY CAN'T BE ACCESSED... */
+                  if (access(directory, F_OK) || access(systemDirectory, F_OK)) {
+                    /** ERROR | CANNOT ACCESS DIRECTORY > REDIRECT TO LOGIN PANEL **/
+                    RedirectToLoginPanel();
+
+                  /* OTHERWISE, IF DIRECTORY CAN BE ACCESSED... */
+                  } else {
+
+                    /* ATTEMPT TO ACCESS PASSWORD FILE */
+                    char *passwordFileName;
+                    if (!(passwordFileName = malloc(strlen(systemDirectory) + strlen(PASSWORD_FILE_NAME) + 1))) {
+                      /** ERROR | CANNOT ALLOCATE MEMORY FOR FILE NAME > REDIRECT TO LOGIN PANEL **/
+                      RedirectToLoginPanel();
+                    } else {
+                      strcpy(passwordFileName, systemDirectory);
+                      strcat(passwordFileName, PASSWORD_FILE_NAME);
+
+                      /* IF PASSWORD FILE CAN'T BE ACCESSED... */
+                      if (access(passwordFileName, F_OK)) {
+                        /** ERROR | CANNOT ACCESS FILE > REDIRECT TO LOGIN PANEL **/
+                        RedirectToLoginPanel();
+
+                      /* OTHERWISE, IF PASSWORD FILE CAN BE ACCESSED... */
+                      } else {
+
+                        /* ATTEMPT TO OPEN PASSWORD FILE FOR READING */
+                        FILE *passwordFile;
+
+                        /* IF PASSWORD FILE CAN'T BE OPENED FOR READING... */
+                        if (!(passwordFile = fopen(passwordFileName, "r"))) {
+                          /** ERROR | CANNOT READ FILE > REDIRECT TO LOGIN PANEL **/
+                          RedirectToLoginPanel();
+
+                        /* OTHERWISE, IF PASSWORD FILE CAN BE OPENED FOR READING... */
+                        } else {
+                          char *filePassword;
+                          if (!(filePassword = malloc(MAX_PASSWORD_SIZE + 1))) {
+                            /** ERROR | CANNOT ALLOCATE MEMORY FOR PASSWORD FROM FILE > REDIRECT TO LOGIN PANEL **/
+                            RedirectToLoginPanel();
+                          } else {
+                            char c;
+                            i = 0;
+
+                            /* READ PASSWORD FROM PASSWORD FILE */
+                            while (((c = fgetc(passwordFile)) != '\n') && (i < MAX_PASSWORD_SIZE)) {
+                              filePassword[i] = c;
+                              ++i;
+                            }
+                            filePassword[i] = '\0';
+                            fclose(passwordFile);
+
+                            /* IF PASSWORD FAILS COMPARISON... */
+                            if (strcmp(filePassword, password)) {
+                              /** ERROR | PASSWORD FAILED > REDIRECT TO LOGIN PANEL **/
+                              RedirectToLoginPanel();
+
+                            /* OTHERWISE, IF PASSWORD PASSES COMPARISON... */
+                            } else {
+
+                              /* LOAD SETTINGS VALUES FROM FILE(S) */
+
+                              /* LOAD MENU ITEMS FROM FILES */
+
+                              /* READ NEW MENU FILE */
+
+                              /* DECLARE AND INITIALIZE QUERY VARIABLES */
+                              char *text_file;
+                              text_file = NULL;
+
+                              /* IF QUERY DATA EXISTS AND IS OF ACCEPTABLE LENGTH... */
+                              if (getenv("QUERY_STRING") && (sizeof(strlen(getenv("QUERY_STRING"))) <= sizeof(INT))) {
+                                char *query;
+                                INT queryLength = strlen(getenv("QUERY_STRING"));
+                                if ((queryLength < 1) || !(query = malloc(queryLength + 1))) {
+                                  /** ERROR | CRUCIAL MEMORY ALLOCATION ERROR FOR QUERY DATA! > CONTINUE WITHOUT QUERY **/
+                                } else {
+                                  strcpy(query, getenv("QUERY_STRING"));
+                                  free(variableName);
+                                  if (!(variableName = malloc(queryLength + 1))) {
+                                    /** ERROR | CANNOT ALLOCATE MEMORY FOR VARIABLE NAME > CONTINUE WITHOUT QUERY **/
+                                  } else {
+                                    free(variableValue);
+                                    if (!(variableValue = malloc(queryLength + 1))) {
+                                      /** ERROR | CANNOT ALLOCATE MEMORY FOR VARIABLE VALUE > CONTINUE WITHOUT QUERY **/
+
+                                    /* IF SUFFICIENT MEMORY FOR QUERY VARIABLES... */
+                                    } else {
+
+                                      /* PROCESS QUERY DATA */
+                                      INT q = 0;
+                                      i = 0;
+                                      while ((q < queryLength) && (query[q] != '\0')) {
+                                        while ((q < queryLength) && (query[q] != '=') && (query[q] != '\0')) {
+                                          variableName[i] = query[q];
+                                          ++q;
+                                          ++i;
+                                        }
+                                        variableName[i] = '\0';
+                                        ++q;
+                                        i = 0;
+                                        while ((query[q] != '&') && (query[q] != '\0')) {
+                                          variableValue[i] = query[q];
+                                          ++q;
+                                          ++i;
+                                        }
+                                        variableValue[i] = '\0';
+                                        if (query[q] != '\0') {
+                                          ++q;
+                                        }
+                                        if (!text_file && !strcmp(variableName, "text_file")) {
+                                          if ((text_file = malloc(strlen(variableValue) + 1)) != 0) {
+                                            strcpy(text_file, variableValue);
+                                          }
+                                        }
+                                      }
+                                      free(variableValue);
+                                      variableValue = NULL;
+                                    }
+                                    free(variableName);
+                                    variableName = NULL;
+                                  }
+                                  free(query);
+                                }
+                              }
+                              /* IF THIS IS A CONTINUED SESSION... */
+
+                                /* LOAD SESSION FROM FILE */
+
+                              /* OUTPUT GUI COMPONENT(S) BASED ON VARIABLES */
+                              if (text_file) {
+                                OutputGUI("text_file", text_file);
+                              } else {
+
+                                /* OUTPUT XHTML FOR NEW MENU */
+                                OutputNewMenu();
+                              }
+                            }
+                            free(filePassword);
+                          }
+                        }
+                      }
+                      free(passwordFileName);
+                    }
+                  }
+                  free(systemDirectory);
+                }
+                free(directory);
+              }
+              free(login);
+            }
+            free(password);
+            free(variableValue);
+          }
+          free(variableName);
+        }
+        free(cookie);
+      }
+    }
+  }
+  return 0;
+}
+
+/* FUNCTION | OUTPUT XHTML FOR interos FRAMESET GRAPHICAL USER INTERFACE */
+static void OutputGUI(const char *variableName, const char *variableValue) {
+  BeginXHTMLOutput();
+  printf("<?xml-stylesheet type=\"text/css\" href=\"/style/main.css\"?>\n");
+  printf("<!DOCTYPE html SYSTEM \"http://interos.org/dtd/xhtml1-borderless-frameset.dtd\">\n");
+  printf("<html xmlns=\"http://www.w3.org/1999/xhtml\" xml:lang=\"en-US\" lang=\"en-US\">\n");
+  printf("  <!--========================================================-->\n");
+  printf("  <!--       interos Standard Document Header - Markup        -->\n");
+  printf("  <!--========================================================-->\n");
+  printf("  <!--    URIs:  https://interos.com/new?                     -->\n");
+  printf("  <!--           https://www.interos.com/new?                 -->\n");
+  printf("  <!--   Title:  interos                                      -->\n");
+  printf("  <!--  Author:  Brent Angeline                               -->\n");
+  printf("  <!--  Markup:  WDG-Validated XHTML 1.0 Borderless Frameset  -->\n");
+  printf("  <!--========================================================-->\n");
+  printf("  <head>\n");
+  printf("    <meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\" />\n");
+  printf("    <meta name=\"title\" content=\"interos\" />\n");
+  printf("    <meta name=\"description\" content=\"internet operating system\" />\n");
+  printf("    <meta name=\"author\" content=\"Brent Angeline\" />\n");
+  printf("    <meta name=\"copyright\" \n");
+  printf("          content=\"Copyright &copy; 2001-2010 Brent Angeline and interos LLC\" />\n");
+  printf("    <meta name=\"robots\" content=\"noindex, nofollow, noarchive\" />\n");
+  printf("    <title>interos</title>\n");
+  printf("    <link rel=\"shortcut icon\" type=\"image/x-icon\" href=\"/favicon.ico\" />\n");
+  printf("    <link rel=\"icon\" type=\"image/gif\" href=\"/images/favicon.gif\" />\n");
+  printf("    <link rel=\"stylesheet\" type=\"text/css\" href=\"/style/main.css\" \n");
+  printf("          media=\"screen, projection\" />\n");
+  printf("    <script type=\"text/javascript\" src=\"/js/interos.js\"></script>\n");
+  printf("  </head>\n");
+  printf("  <frameset rows=\"72,*,72\" border=\"0\" frameborder=\"0\" framespacing=\"0\">\n");
+  printf("    <frame name=\"top\" src=\"/top\" frameborder=\"0\" marginwidth=\"0\" marginheight=\"0\" noresize=\"noresize\" scrolling=\"no\" />\n");
+  if (variableName && variableValue) {
+    printf("    <frame name=\"content\" src=\"/content?%s=%s\" frameborder=\"0\" marginwidth=\"0\" marginheight=\"0\" noresize=\"noresize\" scrolling=\"no\" />\n", variableName, variableValue);
+  } else {
+    printf("    <frame name=\"content\" src=\"/content\" frameborder=\"0\" marginwidth=\"0\" marginheight=\"0\" noresize=\"noresize\" scrolling=\"no\" />\n");
+  }
+  printf("    <frame name=\"bottom\" src=\"/bottom\" frameborder=\"0\" marginwidth=\"0\" marginheight=\"0\" noresize=\"noresize\" scrolling=\"no\" />\n");
+  printf("    <noframes>\n");
+  printf("      <body id=\"body\">\n");
+  printf("        <div id=\"interosContainer\">\n");
+  printf("          <div id=\"interosContent\">\n");
+  printf("            <h1>interos menu</h1>\n");
+  printf("            <ol>\n");
+  printf("              <li><a id=\"newLink\" href=\"/interos?menu=new\">new</a></li>\n");
+  printf("              <li><a id=\"openLink\" href=\"/interos?menu=open\">open</a></li>\n");
+  printf("              <li><a id=\"nextLink\" href=\"/interos?menu=next\">next</a></li>\n");
+  printf("              <li><a id=\"settingsLink\" href=\"/interos?menu=settings\">settings</a></li>\n");
+  printf("            </ol>\n");
+  printf("          </div>\n");
+  printf("        </div>\n");
+  printf("      </body>\n");
+  printf("    </noframes>\n");
+  printf("  </frameset>\n");
+  FinishXHTMLOutput();
+}
+
+/* FUNCTION | OUTPUT XHTML FOR NEW MENU */
+static void OutputNewMenu(void) {
+  BeginXHTMLOutput();
+  printf("<?xml-stylesheet type=\"text/css\" href=\"/style/main.css\"?>\n");
+  printf("<!DOCTYPE html SYSTEM \"http://interos.org/dtd/xhtml1-borderless-frameset.dtd\">\n");
+  printf("<html xmlns=\"http://www.w3.org/1999/xhtml\" xml:lang=\"en-US\" lang=\"en-US\">\n");
+  printf("  <!--========================================================-->\n");
+  printf("  <!--       interos Standard Document Header - Markup        -->\n");
+  printf("  <!--========================================================-->\n");
+  printf("  <!--    URIs:  https://interos.com/new                      -->\n");
+  printf("  <!--           https://www.interos.com/new                  -->\n");
+  printf("  <!--   Title:  interos new                                  -->\n");
+  printf("  <!--  Author:  Brent Angeline                               -->\n");
+  printf("  <!--  Markup:  WDG-Validated XHTML 1.0 Borderless Frameset  -->\n");
+  printf("  <!--========================================================-->\n");
+  printf("  <head>\n");
+  printf("    <meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\" />\n");
+  printf("    <meta name=\"title\" content=\"interos new\" />\n");
+  printf("    <meta name=\"description\" content=\"new menu for interos\" />\n");
+  printf("    <meta name=\"author\" content=\"Brent Angeline\" />\n");
+  printf("    <meta name=\"copyright\" \n");
+  printf("          content=\"Copyright &copy; 2001-2010 Brent Angeline and interos LLC\" />\n");
+  printf("    <meta name=\"robots\" content=\"noindex, nofollow, noarchive\" />\n");
+  printf("    <title>interos new</title>\n");
+  printf("    <link rel=\"shortcut icon\" type=\"image/x-icon\" href=\"/favicon.ico\" />\n");
+  printf("    <link rel=\"icon\" type=\"image/gif\" href=\"/images/favicon.gif\" />\n");
+  printf("    <link rel=\"stylesheet\" type=\"text/css\" href=\"/style/main.css\" \n");
+  printf("          media=\"screen, projection\" />\n");
+  printf("    <script type=\"text/javascript\" src=\"/js/interos_new.js\"></script>\n");
+  printf("  </head>\n");
+  printf("  <frameset rows=\"*,72\" border=\"0\" frameborder=\"0\" framespacing=\"0\">\n");
+  printf("    <frame name=\"menu\" src=\"/menu?name=new\" frameborder=\"0\" marginwidth=\"0\" marginheight=\"0\" noresize=\"noresize\" scrolling=\"no\" />\n");
+  printf("    <frame name=\"button\" src=\"/bottom?button=new\" frameborder=\"0\" marginwidth=\"0\" marginheight=\"0\" noresize=\"noresize\" scrolling=\"no\" />\n");
+  printf("    <noframes>\n");
+  printf("      <body id=\"body\">\n");
+  printf("        <div id=\"newContainer\">\n");
+  printf("          <div id=\"newContent\">\n");
+  printf("            <div id=\"newEntries\">\n");
+  printf("              <p><a href=\"/interos?new=text_file\">text file</a></p>\n");
+  printf("            </div>\n");
+  printf("            <div id=\"newLink\"><a href=\"/interos\">new</a></div>\n");
+  printf("          </div>\n");
+  printf("        </div>\n");
+  printf("      </body>\n");
+  printf("    </noframes>\n");
+  printf("  </frameset>\n");
+  FinishXHTMLOutput();
+}
+
+/* FUNCTION | BEGIN XHTML OUTPUT */
+static void BeginXHTMLOutput(void) {
+  printf("Content-Type: text/html; charset=utf-8\r\n\r\n");
+  printf("<?xml version=\"1.0\" encoding=\"utf-8\"?>\n");
+}
+
+/* FUNCTION | FINISH XHTML OUTPUT */
+static void FinishXHTMLOutput(void) {
+  printf("  <!--=====================================================================-->\n");
+  printf("  <!--                  Copyright and Trademark Statement                  -->\n");
+  printf("  <!--=====================================================================-->\n");
+  printf("  <!--                                                                     -->\n");
+  printf("  <!--          All original textual and graphical site content:           -->\n");
+  printf("  <!--                                                                     -->\n");
+  printf("  <!--  Copyright 2001-2010 Brent Angeline and interos LLC.  All rights    -->\n");
+  printf("  <!--  reserved.  Reproduction in whole or in part without written        -->\n");
+  printf("  <!--  permission is prohibited.  interos and the interos logos are       -->\n");
+  printf("  <!--  trademarks of Brent Angeline and interos LLC.  All other company,  -->\n");
+  printf("  <!--  product, and service names mentioned herein may be the properties  -->\n");
+  printf("  <!--  of their respective owners.  Comments in the interos.org forums    -->\n");
+  printf("  <!--  are the properties of their respective authors.  All software      -->\n");
+  printf("  <!--  developed in the forums is open source and belongs to everyone.    -->\n");
+  printf("  <!--                                                                     -->\n");
+  printf("  <!--=====================================================================-->\n");
+  printf("  <!--                      e-mail: info@interos.com                       -->\n");
+  printf("  <!--=====================================================================-->\n");
+  printf("</html>");
+}
+
+/* FUNCTION | REDIRECT TO LOGIN PANEL */
+static void RedirectToLoginPanel(void) {
+  printf("Location: login\r\n\r\n");
+}
+
+/***********************************************************************/
+/*                  Copyright and Trademark Statement                  */
+/***********************************************************************/
+/*                                                                     */
+/*          All original textual and graphical site content:           */
+/*                                                                     */
+/*  Copyright 2001-2010 Brent Angeline and interos LLC.  All rights    */
+/*  reserved.  Reproduction in whole or in part without written        */
+/*  permission is prohibited.  interos and the interos logos are       */
+/*  trademarks of Brent Angeline and interos LLC.  All other company,  */
+/*  product, and service names mentioned herein may be the properties  */
+/*  of their respective owners.  Comments in the interos.org forums    */
+/*  are the properties of their respective authors.  All software      */
+/*  developed in the forums is open source and belongs to everyone.    */
+/*                                                                     */
+/***********************************************************************/
+/*                      e-mail: info@interos.com                       */
+/***********************************************************************/
diff --git a/c/new_user_interos.com_ssl.c b/c/new_user_interos.com_ssl.c
new file mode 100644 (file)
index 0000000..b8f0d78
--- /dev/null
@@ -0,0 +1,826 @@
+/****************************************************/
+/*   interos Standard Document Header - CGI in C    */
+/****************************************************/
+/*         URIs:  https://interos.com/new_user      */
+/*                https://www.interos.com/new_user  */
+/*       Source:  new_user.c                        */
+/*  Description:  FastCGI for interos new_user      */
+/*       Author:  Brent Angeline                    */
+/*          CGI:  FastCGI in ISO/ANSI C             */
+/****************************************************/
+
+/* PREPROCESSOR DIRECTIVES */
+#include "fcgi_stdio.h"     /*  FCGI_Accept(), fread(), printf()                                                                           */
+#include "interos.h"        /*  DIRECTORY, INT, DIRECTORY_COMMAND, ECHO_COMMAND, PASSWORD_OUT, SYSTEM_DIRECTORY, SYSTEM_DIRECTORY_COMMAND  */
+#include <ctype.h>          /*  tolower()                                                                                                  */
+#include <stdlib.h>         /*  free(), getenv(), malloc(), system()                                                                       */
+#include <string.h>         /*  strcat(), strcmp(), strcpy(), strlen()                                                                     */
+#include <unistd.h>         /*  F_OK, access()                                                                                             */
+
+static void Old(void);
+
+/* BEGIN MAIN PROGRAM */
+int main(void) {
+
+  /* BEGIN FASTCGI */
+  while (FCGI_Accept() >= 0) {
+
+    /* IF POST DATA DOESN'T EXIST OR IS TOO LONG... */
+    if (!getenv("CONTENT_LENGTH") || (sizeof(STRING_TO_INT(getenv("CONTENT_LENGTH"), (char **) NULL, 10)) > sizeof(INT))) {
+      char *status = NULL;
+
+      /* IF QUERY DATA EXISTS AND IS OF ACCEPTABLE LENGTH... */
+      if (getenv("QUERY_STRING") && (sizeof(strlen(getenv("QUERY_STRING"))) <= sizeof(INT))) {
+
+        /* ATTEMPT TO ALLOCATE MEMORY FOR QUERY VARIABLES */
+        char *query;
+        INT queryLength = strlen(getenv("QUERY_STRING"));
+        if ((queryLength < 1) || !(query = malloc(queryLength + 1))) {
+          /** ERROR | CRUCIAL MEMORY ALLOCATION ERROR FOR QUERY DATA! > CONTINUE WITHOUT QUERY **/
+        } else {
+          char *variableName;
+          strcpy(query, getenv("QUERY_STRING"));
+          if (!(variableName = malloc(queryLength + 1))) {
+            /** ERROR | CANNOT ALLOCATE MEMORY FOR VARIABLE NAME > CONTINUE WITHOUT QUERY **/
+          } else {
+            char *variableValue;
+            if (!(variableValue = malloc(queryLength + 1))) {
+              /** ERROR | CANNOT ALLOCATE MEMORY FOR VARIABLE VALUE > CONTINUE WITHOUT QUERY **/
+
+            /* IF SUFFICIENT MEMORY FOR QUERY VARIABLES... */
+            } else {
+
+              /* PROCESS QUERY DATA */
+              INT q = 0;
+              i = 0;
+              while ((q < queryLength) && (query[q] != '\0')) {
+                while ((q < queryLength) && (query[q] != '=') && (query[q] != '\0')) {
+                  variableName[i] = query[q];
+                  ++q;
+                  ++i;
+                }
+                variableName[i] = '\0';
+                ++q;
+                i = 0;
+                while ((query[q] != '&') && (query[q] != '\0')) {
+                  variableValue[i] = query[q];
+                  ++q;
+                  ++i;
+                }
+                variableValue[i] = '\0';
+                if (query[q] != '\0') {
+                  ++q;
+                }
+                if (!status && !strcmp(variableName, "status")) {
+                  if ((status = malloc(strlen(variableValue) + 1)) != 0) {
+                    strcpy(status, variableValue);
+                  }
+                }
+              }
+              free(variableValue);
+            }
+            free(variableName);
+          }
+          free(query);
+        }
+      }
+
+      /* DISPLAY CREATE LOGIN PANEL */
+      printf("Content-Type: text/html; charset=utf-8\r\n\r\n");
+      printf("<?xml version=\"1.0\" encoding=\"utf-8\"?>\n");
+      printf("<?xml-stylesheet type=\"text/css\" href=\"/style/login.css\"?>\n");
+      printf("<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \n");
+      printf("                      \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">\n");
+      printf("<html xmlns=\"http://www.w3.org/1999/xhtml\" xml:lang=\"en-US\" lang=\"en-US\">\n");
+      printf("  <!--=================================================-->\n");
+      printf("  <!--    interos Standard Document Header - Markup    -->\n");
+      printf("  <!--=================================================-->\n");
+      printf("  <!--    URIs:  https://interos.com/new_user          -->\n");
+      printf("  <!--           https://www.interos.com/new_user      -->\n");
+      printf("  <!--   Title:  new interos user                      -->\n");
+      printf("  <!--  Author:  Brent Angeline                        -->\n");
+      printf("  <!--  Markup:  W3C-Validated XHTML 1.0 Transitional  -->\n");
+      printf("  <!--=================================================-->\n");
+      printf("  <head>\n");
+      printf("    <meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\" />\n");
+      printf("    <meta name=\"title\" content=\"new interos user\" />\n");
+      printf("    <meta name=\"description\" content=\"create your login\" />\n");
+      printf("    <meta name=\"author\" content=\"Brent Angeline\" />\n");
+      printf("    <meta name=\"copyright\" \n");
+      printf("          content=\"Copyright &copy; 2001-2008 Brent Angeline and interos LLC\" />\n");
+      printf("    <meta name=\"robots\" content=\"index, nofollow, noarchive\" />\n");
+      printf("    <title>new interos user</title>\n");
+      printf("    <link rel=\"shortcut icon\" type=\"image/x-icon\" href=\"/favicon.ico\" />\n");
+      printf("    <link rel=\"icon\" type=\"image/gif\" href=\"/images/favicon.gif\" />\n");
+      printf("    <link rel=\"stylesheet\" type=\"text/css\" href=\"/style/login.css\" \n");
+      printf("          media=\"screen, projection\" />\n");
+      printf("    <script type=\"text/javascript\" src=\"/js/login.js\"></script>\n");
+      printf("  </head>\n");
+      printf("  <body id=\"body\">\n");
+      printf("    <center>\n");
+      printf("      <p id=\"navigation\">\n");
+      printf("        <a href=\"/about\">about</a> | \n");
+      printf("        <a href=\"/blog\">blog</a> | \n");
+      printf("        <a href=\"/code\">code</a> | \n");
+      printf("        <a href=\"https://interos.org/\">develop</a> | \n");
+      printf("        <a href=\"/e-mail\">e-mail</a> | \n");
+      printf("        <a href=\"/f.a.q.\">f.a.q.</a> | \n");
+      printf("        <a href=\"/gear\">gear</a> | \n");
+      printf("        <a href=\"/help\">help</a>\n");
+      printf("      </p>\n");
+      printf("      <form id=\"loginForm\" name=\"loginForm\" action=\"new_user\" method=\"post\">\n");
+      printf("        <table id=\"mainPanel\">\n");
+      printf("          <thead>\n");
+      printf("            <tr>\n");
+      printf("              <th colspan=\"3\"><center>\n");
+      printf("                                <div id=\"title\">\n");
+      printf("                                  <h1>\n");
+      printf("                                    <a href=\"/\">interos</a>\n");
+      printf("                                  </h1>\n");
+      printf("                                  <h2>\n");
+      printf("                                    create your login\n");
+      printf("                                  </h2>\n");
+      printf("                                </div>\n");
+      printf("                              </center></th>\n");
+      printf("            </tr>\n");
+      printf("          </thead>\n");
+      printf("          <tfoot>\n");
+      printf("            <tr>\n");
+      printf("              <td colspan=\"3\"><br /></td>\n");
+      printf("            </tr>\n");
+      printf("          </tfoot>\n");
+      printf("          <tbody>\n");
+      printf("            <tr>\n");
+      printf("              <td><label for=\"login\">login:</label>&nbsp;</td>\n");
+      printf("              <td><input id=\"login\" name=\"login\" type=\"text\" \n");
+      printf("                         size=\"16\"  maxlength=\"16\" /></td>\n");
+      printf("            </tr>\n");
+      printf("            <tr>\n");
+      printf("              <td><label for=\"password\">password:</label>&nbsp;</td>\n");
+      printf("              <td><input id=\"password\" name=\"password\" type=\"password\" \n");
+      printf("                         size=\"16\"     maxlength=\"16\" /></td>\n");
+      printf("            </tr>\n");
+      printf("            <tr>\n");
+      printf("              <td><label for=\"verify\">password:</label>&nbsp;</td>\n");
+      printf("              <td><input id=\"verify\" name=\"verify\" type=\"password\" \n");
+      printf("                         size=\"16\"   maxlength=\"16\" /></td>\n");
+      printf("              <td rowspan=\"2\"><div id=\"submitButton\">\n");
+      printf("                                &nbsp;<input type=\"submit\" \n");
+      printf("                                             value=\"login &raquo;\" />\n");
+      printf("                              </div></td>\n");
+      printf("            </tr>\n");
+      printf("          </tbody>\n");
+      printf("        </table>\n");
+      printf("      </form>\n");
+      printf("      <p id=\"newUser\">\n");
+      printf("        <strong>* enter password twice</strong><br />\n");
+      printf("        to create your login<br />\n");
+      printf("        <a href=\"/login\">&laquo; back to login</a>\n");
+      printf("      </p>\n");
+      printf("      <p>\n");
+      printf("        <br />\n");
+      printf("      </p>\n");
+      printf("      <p id=\"copyrightDates\">\n");
+      printf("        &copy; 2001&#8211;2008 interos\n");
+      printf("      </p>\n");
+      printf("    </center>\n");
+      printf("  </body>\n");
+      printf("  <!--=====================================================================-->\n");
+      printf("  <!--                  Copyright and Trademark Statement                  -->\n");
+      printf("  <!--=====================================================================-->\n");
+      printf("  <!--                                                                     -->\n");
+      printf("  <!--          All original textual and graphical site content:           -->\n");
+      printf("  <!--                                                                     -->\n");
+      printf("  <!--  Copyright 2001-2008 Brent Angeline and interos LLC.  All rights    -->\n");
+      printf("  <!--  reserved.  Reproduction in whole or in part without written        -->\n");
+      printf("  <!--  permission is prohibited.  interos and the interos logos are       -->\n");
+      printf("  <!--  trademarks of Brent Angeline and interos LLC.  All other company,  -->\n");
+      printf("  <!--  product, and service names mentioned herein may be the properties  -->\n");
+      printf("  <!--  of their respective owners.  Comments in the interos.org forums    -->\n");
+      printf("  <!--  are the properties of their respective authors.  All software      -->\n");
+      printf("  <!--  developed in the forums is open source and belongs to everyone.    -->\n");
+      printf("  <!--                                                                     -->\n");
+      printf("  <!--=====================================================================-->\n");
+      printf("  <!--                      e-mail: info@interos.com                       -->\n");
+      printf("  <!--=====================================================================-->\n");
+      printf("</html>");
+
+      /* CLEAN UP AFTER QUERY DATA PROCESSING */
+      free(status);
+
+    /* OTHERWISE, IF POST DATA DOES EXIST AND IS OF ACCEPTABLE LENGTH... */
+    } else {
+
+      /* SET VARIABLES BASED ON POST DATA */
+
+      /* ATTEMPT TO ALLOCATE MEMORY FOR POST VARIABLES */
+      char *post;
+      INT postLength = STRING_TO_INT(getenv("CONTENT_LENGTH"), (char **) NULL, 10);
+      if ((postLength < 1) || !(post = malloc(postLength + 1))) {
+        /** ERROR | CANNOT ALLOCATE MEMORY FOR POST DATA > REDIRECT TO LOGIN CREATION PANEL **/
+        printf("Location: new_user?status=try_again\r\n\r\n");
+      } else {
+        char *variableName;
+        if (!(variableName = malloc(postLength + 1))) {
+          /** ERROR | CANNOT ALLOCATE MEMORY FOR VARIABLE NAME > REDIRECT TO LOGIN CREATION PANEL **/
+            printf("Location: new_user?status=try_again\r\n\r\n");
+        } else {
+          char *variableValue;
+          if (!(variableValue = malloc(postLength + 1))) {
+            /** ERROR | CANNOT ALLOCATE MEMORY FOR VARIABLE VALUE > REDIRECT TO LOGIN CREATION PANEL **/
+            printf("Location: new_user?status=try_again\r\n\r\n");
+          } else {
+
+            /* PROCESS POST DATA */
+            char *login, *password, *verify;
+            INT  i, j, p;
+            login = password = verify = NULL;
+            j = p = 0;
+            fread(post, postLength, 1, stdin);
+            post[postLength] = '\0';
+            while ((p < postLength) && (post[p] != '\0')) {
+              i = 0;
+              while ((p < postLength) && (post[p] != '=') && (post[p] != '\0')) {
+                variableName[i] = post[p];
+                ++p;
+