From 46a47811d6ef673e87e4a0edf372be4d49bd150b Mon Sep 17 00:00:00 2001 From: konrad Date: Fri, 14 Sep 2007 20:42:51 +0000 Subject: [PATCH] more useful source docu git-svn-id: https://silmor.de/svn/softmagic/smoke/trunk@24 6e3c4bff-ac9f-4ac1-96c5-d2ea494d3e33 --- Doxyfile | 283 ---------------------------------------------- Doxyfile-cpp | 4 + Doxyfile-php | 4 + Doxyfile.inc | 282 +++++++++++++++++++++++++++++++++++++++++++++ www/inc/cauth_hash.php | 1 + www/inc/cauth_mhash.php | 1 + www/inc/cauth_string.php | 1 + www/inc/db_mysql.php | 1 + www/inc/db_scheme.php | 1 + www/inc/parser.php | 30 +++--- www/inc/session.php | 7 +- www/machine.php | 5 +- 12 files changed, 321 insertions(+), 299 deletions(-) delete mode 100644 Doxyfile create mode 100644 Doxyfile-cpp create mode 100644 Doxyfile-php create mode 100644 Doxyfile.inc diff --git a/Doxyfile b/Doxyfile deleted file mode 100644 index 5c98a5a..0000000 --- a/Doxyfile +++ /dev/null @@ -1,283 +0,0 @@ -# Doxyfile 1.5.1-KDevelop - -#--------------------------------------------------------------------------- -# Project related configuration options -#--------------------------------------------------------------------------- -PROJECT_NAME = MagicSmoke.kdevelop -PROJECT_NUMBER = $VERSION$ -OUTPUT_DIRECTORY = -CREATE_SUBDIRS = NO -OUTPUT_LANGUAGE = English -USE_WINDOWS_ENCODING = NO -BRIEF_MEMBER_DESC = YES -REPEAT_BRIEF = YES -ABBREVIATE_BRIEF = "The $name class" \ - "The $name widget" \ - "The $name file" \ - is \ - provides \ - specifies \ - contains \ - represents \ - a \ - an \ - the -ALWAYS_DETAILED_SEC = NO -INLINE_INHERITED_MEMB = NO -FULL_PATH_NAMES = NO -STRIP_FROM_PATH = /home/konrad/src/smoke/ -STRIP_FROM_INC_PATH = -SHORT_NAMES = NO -JAVADOC_AUTOBRIEF = NO -MULTILINE_CPP_IS_BRIEF = NO -DETAILS_AT_TOP = NO -INHERIT_DOCS = YES -SEPARATE_MEMBER_PAGES = NO -TAB_SIZE = 8 -ALIASES = -OPTIMIZE_OUTPUT_FOR_C = NO -OPTIMIZE_OUTPUT_JAVA = NO -BUILTIN_STL_SUPPORT = NO -DISTRIBUTE_GROUP_DOC = NO -SUBGROUPING = YES -#--------------------------------------------------------------------------- -# Build related configuration options -#--------------------------------------------------------------------------- -EXTRACT_ALL = NO -EXTRACT_PRIVATE = NO -EXTRACT_STATIC = YES -EXTRACT_LOCAL_CLASSES = YES -EXTRACT_LOCAL_METHODS = NO -HIDE_UNDOC_MEMBERS = NO -HIDE_UNDOC_CLASSES = NO -HIDE_FRIEND_COMPOUNDS = NO -HIDE_IN_BODY_DOCS = NO -INTERNAL_DOCS = NO -CASE_SENSE_NAMES = YES -HIDE_SCOPE_NAMES = NO -SHOW_INCLUDE_FILES = YES -INLINE_INFO = YES -SORT_MEMBER_DOCS = YES -SORT_BRIEF_DOCS = NO -SORT_BY_SCOPE_NAME = NO -GENERATE_TODOLIST = YES -GENERATE_TESTLIST = YES -GENERATE_BUGLIST = YES -GENERATE_DEPRECATEDLIST= YES -ENABLED_SECTIONS = -MAX_INITIALIZER_LINES = 30 -SHOW_USED_FILES = YES -SHOW_DIRECTORIES = NO -FILE_VERSION_FILTER = -#--------------------------------------------------------------------------- -# configuration options related to warning and progress messages -#--------------------------------------------------------------------------- -QUIET = NO -WARNINGS = YES -WARN_IF_UNDOCUMENTED = YES -WARN_IF_DOC_ERROR = YES -WARN_NO_PARAMDOC = NO -WARN_FORMAT = "$file:$line: $text" -WARN_LOGFILE = -#--------------------------------------------------------------------------- -# configuration options related to the input files -#--------------------------------------------------------------------------- -INPUT = /home/konrad/src/smoke -FILE_PATTERNS = *.c \ - *.cc \ - *.cxx \ - *.cpp \ - *.c++ \ - *.d \ - *.java \ - *.ii \ - *.ixx \ - *.ipp \ - *.i++ \ - *.inl \ - *.h \ - *.hh \ - *.hxx \ - *.hpp \ - *.h++ \ - *.idl \ - *.odl \ - *.cs \ - *.php \ - *.php3 \ - *.inc \ - *.m \ - *.mm \ - *.dox \ - *.py \ - *.C \ - *.CC \ - *.C++ \ - *.II \ - *.I++ \ - *.H \ - *.HH \ - *.H++ \ - *.CS \ - *.PHP \ - *.PHP3 \ - *.M \ - *.MM \ - *.PY \ - *.C \ - *.H \ - *.tlh \ - *.diff \ - *.patch \ - *.moc \ - *.xpm \ - *.dox -RECURSIVE = yes -EXCLUDE = -EXCLUDE_SYMLINKS = NO -EXCLUDE_PATTERNS = -EXAMPLE_PATH = -EXAMPLE_PATTERNS = * -EXAMPLE_RECURSIVE = NO -IMAGE_PATH = -INPUT_FILTER = -FILTER_PATTERNS = -FILTER_SOURCE_FILES = NO -#--------------------------------------------------------------------------- -# configuration options related to source browsing -#--------------------------------------------------------------------------- -SOURCE_BROWSER = NO -INLINE_SOURCES = NO -STRIP_CODE_COMMENTS = YES -REFERENCED_BY_RELATION = YES -REFERENCES_RELATION = YES -REFERENCES_LINK_SOURCE = YES -USE_HTAGS = NO -VERBATIM_HEADERS = YES -#--------------------------------------------------------------------------- -# configuration options related to the alphabetical class index -#--------------------------------------------------------------------------- -ALPHABETICAL_INDEX = NO -COLS_IN_ALPHA_INDEX = 5 -IGNORE_PREFIX = -#--------------------------------------------------------------------------- -# configuration options related to the HTML output -#--------------------------------------------------------------------------- -GENERATE_HTML = YES -HTML_OUTPUT = html -HTML_FILE_EXTENSION = .html -HTML_HEADER = -HTML_FOOTER = -HTML_STYLESHEET = -HTML_ALIGN_MEMBERS = YES -GENERATE_HTMLHELP = NO -CHM_FILE = -HHC_LOCATION = -GENERATE_CHI = NO -BINARY_TOC = NO -TOC_EXPAND = NO -DISABLE_INDEX = NO -ENUM_VALUES_PER_LINE = 4 -GENERATE_TREEVIEW = YES -TREEVIEW_WIDTH = 250 -#--------------------------------------------------------------------------- -# configuration options related to the LaTeX output -#--------------------------------------------------------------------------- -GENERATE_LATEX = NO -LATEX_OUTPUT = latex -LATEX_CMD_NAME = latex -MAKEINDEX_CMD_NAME = makeindex -COMPACT_LATEX = NO -PAPER_TYPE = a4wide -EXTRA_PACKAGES = -LATEX_HEADER = -PDF_HYPERLINKS = NO -USE_PDFLATEX = NO -LATEX_BATCHMODE = NO -LATEX_HIDE_INDICES = NO -#--------------------------------------------------------------------------- -# configuration options related to the RTF output -#--------------------------------------------------------------------------- -GENERATE_RTF = NO -RTF_OUTPUT = rtf -COMPACT_RTF = NO -RTF_HYPERLINKS = NO -RTF_STYLESHEET_FILE = -RTF_EXTENSIONS_FILE = -#--------------------------------------------------------------------------- -# configuration options related to the man page output -#--------------------------------------------------------------------------- -GENERATE_MAN = NO -MAN_OUTPUT = man -MAN_EXTENSION = .3 -MAN_LINKS = NO -#--------------------------------------------------------------------------- -# configuration options related to the XML output -#--------------------------------------------------------------------------- -GENERATE_XML = yes -XML_OUTPUT = xml -XML_SCHEMA = -XML_DTD = -XML_PROGRAMLISTING = YES -#--------------------------------------------------------------------------- -# configuration options for the AutoGen Definitions output -#--------------------------------------------------------------------------- -GENERATE_AUTOGEN_DEF = NO -#--------------------------------------------------------------------------- -# configuration options related to the Perl module output -#--------------------------------------------------------------------------- -GENERATE_PERLMOD = NO -PERLMOD_LATEX = NO -PERLMOD_PRETTY = YES -PERLMOD_MAKEVAR_PREFIX = -#--------------------------------------------------------------------------- -# Configuration options related to the preprocessor -#--------------------------------------------------------------------------- -ENABLE_PREPROCESSING = YES -MACRO_EXPANSION = NO -EXPAND_ONLY_PREDEF = NO -SEARCH_INCLUDES = YES -INCLUDE_PATH = -INCLUDE_FILE_PATTERNS = -PREDEFINED = -EXPAND_AS_DEFINED = -SKIP_FUNCTION_MACROS = YES -#--------------------------------------------------------------------------- -# Configuration::additions related to external references -#--------------------------------------------------------------------------- -TAGFILES = -GENERATE_TAGFILE = MagicSmoke.tag -ALLEXTERNALS = NO -EXTERNAL_GROUPS = YES -PERL_PATH = /usr/bin/perl -#--------------------------------------------------------------------------- -# Configuration options related to the dot tool -#--------------------------------------------------------------------------- -CLASS_DIAGRAMS = YES -HIDE_UNDOC_RELATIONS = YES -HAVE_DOT = NO -CLASS_GRAPH = YES -COLLABORATION_GRAPH = YES -GROUP_GRAPHS = YES -UML_LOOK = NO -TEMPLATE_RELATIONS = NO -INCLUDE_GRAPH = YES -INCLUDED_BY_GRAPH = YES -CALL_GRAPH = NO -CALLER_GRAPH = NO -GRAPHICAL_HIERARCHY = YES -DIRECTORY_GRAPH = YES -DOT_IMAGE_FORMAT = png -DOT_PATH = -DOTFILE_DIRS = -MAX_DOT_GRAPH_WIDTH = 1024 -MAX_DOT_GRAPH_HEIGHT = 1024 -MAX_DOT_GRAPH_DEPTH = 1000 -DOT_TRANSPARENT = NO -DOT_MULTI_TARGETS = NO -GENERATE_LEGEND = YES -DOT_CLEANUP = YES -#--------------------------------------------------------------------------- -# Configuration::additions related to the search engine -#--------------------------------------------------------------------------- -SEARCHENGINE = NO diff --git a/Doxyfile-cpp b/Doxyfile-cpp new file mode 100644 index 0000000..f6c259d --- /dev/null +++ b/Doxyfile-cpp @@ -0,0 +1,4 @@ +@INCLUDE = Doxyfile.inc +INPUT = src +HTML_OUTPUT = doc/source-cpp + diff --git a/Doxyfile-php b/Doxyfile-php new file mode 100644 index 0000000..82c6e77 --- /dev/null +++ b/Doxyfile-php @@ -0,0 +1,4 @@ +@INCLUDE = Doxyfile.inc +INPUT = www +HTML_OUTPUT = doc/source-php + diff --git a/Doxyfile.inc b/Doxyfile.inc new file mode 100644 index 0000000..b64fa2e --- /dev/null +++ b/Doxyfile.inc @@ -0,0 +1,282 @@ +#--------------------------------------------------------------------------- +# Project related configuration options +#--------------------------------------------------------------------------- +PROJECT_NAME = MagicSmoke +PROJECT_NUMBER = $VERSION$ +OUTPUT_DIRECTORY = +CREATE_SUBDIRS = NO +OUTPUT_LANGUAGE = English +USE_WINDOWS_ENCODING = NO +BRIEF_MEMBER_DESC = YES +REPEAT_BRIEF = YES +ABBREVIATE_BRIEF = "The $name class" \ + "The $name widget" \ + "The $name file" \ + is \ + provides \ + specifies \ + contains \ + represents \ + a \ + an \ + the +ALWAYS_DETAILED_SEC = NO +INLINE_INHERITED_MEMB = NO +FULL_PATH_NAMES = NO +STRIP_FROM_PATH = /home/konrad/src/smoke/ +STRIP_FROM_INC_PATH = +SHORT_NAMES = NO +JAVADOC_AUTOBRIEF = NO +MULTILINE_CPP_IS_BRIEF = NO +DETAILS_AT_TOP = NO +INHERIT_DOCS = YES +SEPARATE_MEMBER_PAGES = NO +TAB_SIZE = 8 +ALIASES = +OPTIMIZE_OUTPUT_FOR_C = NO +OPTIMIZE_OUTPUT_JAVA = NO +BUILTIN_STL_SUPPORT = NO +DISTRIBUTE_GROUP_DOC = NO +SUBGROUPING = YES +#--------------------------------------------------------------------------- +# Build related configuration options +#--------------------------------------------------------------------------- +EXTRACT_ALL = YES +EXTRACT_PRIVATE = NO +EXTRACT_STATIC = YES +EXTRACT_LOCAL_CLASSES = YES +EXTRACT_LOCAL_METHODS = NO +HIDE_UNDOC_MEMBERS = NO +HIDE_UNDOC_CLASSES = NO +HIDE_FRIEND_COMPOUNDS = NO +HIDE_IN_BODY_DOCS = NO +INTERNAL_DOCS = NO +CASE_SENSE_NAMES = YES +HIDE_SCOPE_NAMES = NO +SHOW_INCLUDE_FILES = YES +INLINE_INFO = YES +SORT_MEMBER_DOCS = YES +SORT_BRIEF_DOCS = NO +SORT_BY_SCOPE_NAME = NO +GENERATE_TODOLIST = YES +GENERATE_TESTLIST = YES +GENERATE_BUGLIST = YES +GENERATE_DEPRECATEDLIST= YES +ENABLED_SECTIONS = +MAX_INITIALIZER_LINES = 30 +SHOW_USED_FILES = YES +SHOW_DIRECTORIES = NO +FILE_VERSION_FILTER = +#--------------------------------------------------------------------------- +# configuration options related to warning and progress messages +#--------------------------------------------------------------------------- +QUIET = NO +WARNINGS = YES +WARN_IF_UNDOCUMENTED = YES +WARN_IF_DOC_ERROR = YES +WARN_NO_PARAMDOC = NO +WARN_FORMAT = "$file:$line: $text" +WARN_LOGFILE = +#--------------------------------------------------------------------------- +# configuration options related to the input files +#--------------------------------------------------------------------------- +#INPUT = /home/konrad/src/smoke +FILE_PATTERNS = *.c \ + *.cc \ + *.cxx \ + *.cpp \ + *.c++ \ + *.d \ + *.java \ + *.ii \ + *.ixx \ + *.ipp \ + *.i++ \ + *.inl \ + *.h \ + *.hh \ + *.hxx \ + *.hpp \ + *.h++ \ + *.idl \ + *.odl \ + *.cs \ + *.php \ + *.php3 \ + *.php5 \ + *.inc \ + *.m \ + *.mm \ + *.dox \ + *.py \ + *.C \ + *.CC \ + *.C++ \ + *.II \ + *.I++ \ + *.H \ + *.HH \ + *.H++ \ + *.CS \ + *.PHP \ + *.PHP3 \ + *.M \ + *.MM \ + *.PY \ + *.C \ + *.H \ + *.tlh \ + *.diff \ + *.patch \ + *.moc \ + *.xpm \ + *.dox +RECURSIVE = yes +EXCLUDE = +EXCLUDE_SYMLINKS = NO +EXCLUDE_PATTERNS = +EXAMPLE_PATH = +EXAMPLE_PATTERNS = * +EXAMPLE_RECURSIVE = NO +IMAGE_PATH = +INPUT_FILTER = +FILTER_PATTERNS = +FILTER_SOURCE_FILES = NO +#--------------------------------------------------------------------------- +# configuration options related to source browsing +#--------------------------------------------------------------------------- +SOURCE_BROWSER = NO +INLINE_SOURCES = NO +STRIP_CODE_COMMENTS = YES +REFERENCED_BY_RELATION = YES +REFERENCES_RELATION = YES +REFERENCES_LINK_SOURCE = YES +USE_HTAGS = NO +VERBATIM_HEADERS = YES +#--------------------------------------------------------------------------- +# configuration options related to the alphabetical class index +#--------------------------------------------------------------------------- +ALPHABETICAL_INDEX = NO +COLS_IN_ALPHA_INDEX = 5 +IGNORE_PREFIX = +#--------------------------------------------------------------------------- +# configuration options related to the HTML output +#--------------------------------------------------------------------------- +GENERATE_HTML = YES +#HTML_OUTPUT = html +HTML_FILE_EXTENSION = .html +HTML_HEADER = +HTML_FOOTER = +HTML_STYLESHEET = +HTML_ALIGN_MEMBERS = YES +GENERATE_HTMLHELP = NO +CHM_FILE = +HHC_LOCATION = +GENERATE_CHI = NO +BINARY_TOC = NO +TOC_EXPAND = NO +DISABLE_INDEX = NO +ENUM_VALUES_PER_LINE = 4 +GENERATE_TREEVIEW = YES +TREEVIEW_WIDTH = 250 +#--------------------------------------------------------------------------- +# configuration options related to the LaTeX output +#--------------------------------------------------------------------------- +GENERATE_LATEX = NO +LATEX_OUTPUT = latex +LATEX_CMD_NAME = latex +MAKEINDEX_CMD_NAME = makeindex +COMPACT_LATEX = NO +PAPER_TYPE = a4wide +EXTRA_PACKAGES = +LATEX_HEADER = +PDF_HYPERLINKS = NO +USE_PDFLATEX = NO +LATEX_BATCHMODE = NO +LATEX_HIDE_INDICES = NO +#--------------------------------------------------------------------------- +# configuration options related to the RTF output +#--------------------------------------------------------------------------- +GENERATE_RTF = NO +RTF_OUTPUT = rtf +COMPACT_RTF = NO +RTF_HYPERLINKS = NO +RTF_STYLESHEET_FILE = +RTF_EXTENSIONS_FILE = +#--------------------------------------------------------------------------- +# configuration options related to the man page output +#--------------------------------------------------------------------------- +GENERATE_MAN = NO +MAN_OUTPUT = man +MAN_EXTENSION = .3 +MAN_LINKS = NO +#--------------------------------------------------------------------------- +# configuration options related to the XML output +#--------------------------------------------------------------------------- +GENERATE_XML = NO +XML_OUTPUT = xml +XML_SCHEMA = +XML_DTD = +XML_PROGRAMLISTING = YES +#--------------------------------------------------------------------------- +# configuration options for the AutoGen Definitions output +#--------------------------------------------------------------------------- +GENERATE_AUTOGEN_DEF = NO +#--------------------------------------------------------------------------- +# configuration options related to the Perl module output +#--------------------------------------------------------------------------- +GENERATE_PERLMOD = NO +PERLMOD_LATEX = NO +PERLMOD_PRETTY = YES +PERLMOD_MAKEVAR_PREFIX = +#--------------------------------------------------------------------------- +# Configuration options related to the preprocessor +#--------------------------------------------------------------------------- +ENABLE_PREPROCESSING = YES +MACRO_EXPANSION = NO +EXPAND_ONLY_PREDEF = NO +SEARCH_INCLUDES = YES +INCLUDE_PATH = +INCLUDE_FILE_PATTERNS = +PREDEFINED = +EXPAND_AS_DEFINED = +SKIP_FUNCTION_MACROS = YES +#--------------------------------------------------------------------------- +# Configuration::additions related to external references +#--------------------------------------------------------------------------- +TAGFILES = +GENERATE_TAGFILE = MagicSmoke.tag +ALLEXTERNALS = NO +EXTERNAL_GROUPS = YES +PERL_PATH = /usr/bin/perl +#--------------------------------------------------------------------------- +# Configuration options related to the dot tool +#--------------------------------------------------------------------------- +CLASS_DIAGRAMS = YES +HIDE_UNDOC_RELATIONS = YES +HAVE_DOT = NO +CLASS_GRAPH = YES +COLLABORATION_GRAPH = YES +GROUP_GRAPHS = YES +UML_LOOK = NO +TEMPLATE_RELATIONS = NO +INCLUDE_GRAPH = YES +INCLUDED_BY_GRAPH = YES +CALL_GRAPH = NO +CALLER_GRAPH = NO +GRAPHICAL_HIERARCHY = YES +DIRECTORY_GRAPH = YES +DOT_IMAGE_FORMAT = png +DOT_PATH = +DOTFILE_DIRS = +MAX_DOT_GRAPH_WIDTH = 1024 +MAX_DOT_GRAPH_HEIGHT = 1024 +MAX_DOT_GRAPH_DEPTH = 1000 +DOT_TRANSPARENT = NO +DOT_MULTI_TARGETS = NO +GENERATE_LEGEND = YES +DOT_CLEANUP = YES +#--------------------------------------------------------------------------- +# Configuration::additions related to the search engine +#--------------------------------------------------------------------------- +SEARCHENGINE = NO diff --git a/www/inc/cauth_hash.php b/www/inc/cauth_hash.php index a6eedbb..879ea2b 100644 --- a/www/inc/cauth_hash.php +++ b/www/inc/cauth_hash.php @@ -11,6 +11,7 @@ // // +/**helper for Session::authenticate, using hash module*/ function calcAuth($cha,$tok) { global $ClientAuthAlgo; diff --git a/www/inc/cauth_mhash.php b/www/inc/cauth_mhash.php index 7a1093e..7f32602 100644 --- a/www/inc/cauth_mhash.php +++ b/www/inc/cauth_mhash.php @@ -11,6 +11,7 @@ // // +/**helper for Session::authenticate, using mhash module*/ function calcAuth($cha,$tok) { global $ClientAuthAlgo; diff --git a/www/inc/cauth_string.php b/www/inc/cauth_string.php index bcb2fbc..2f70290 100644 --- a/www/inc/cauth_string.php +++ b/www/inc/cauth_string.php @@ -11,6 +11,7 @@ // // +/**helper for Session::authenticate, using string module*/ function calcAuth($key,$tok) { global $ClientAuthAlgo; diff --git a/www/inc/db_mysql.php b/www/inc/db_mysql.php index a2553ef..b07619d 100644 --- a/www/inc/db_mysql.php +++ b/www/inc/db_mysql.php @@ -1,4 +1,5 @@ cont=$c; reset($this->cont); } - //return next line from array until end is reached + /**return next line from array until end is reached*/ public function getLine() { $r=current($this->cont); @@ -18,12 +18,12 @@ class PHelper } } -//Parser class: see syntax docu for details +/**Parser class: see syntax docu for details*/ class Parser { private $vars=array(); - //create parser object, initialize its internal state with optional file + /**create parser object, initialize its internal state with optional file*/ public function __construct($fname="") { global $_SERVER; @@ -31,38 +31,39 @@ class Parser if($fname!="") $this->parseFile($fname); } - //parse a file, return parser-result + /**parse a file, return parser-result*/ public function parseFile($fname) { global $template; $cont=file_get_contents($template.$fname); return $this->parse($cont); } - //parse a string, return parser-result + /**parse a string, return parser-result*/ public function parse($str) { $cont=explode("\n",str_replace("\r","",$str)); $help=new PHelper($cont); return $this->parseNormal($help); } - //set an internal variable + /**set an internal variable*/ public function setVar($vname,$vval) { $this->vars[$vname]=$vval; } + /**set several internal variables array(variablename=>value)*/ public function setVars(array $vs) { reset($vs); foreach($vs as $k => $v) $this->vars[$k]=$v; } - //unset a variable + /**unset a variable*/ public function unsetVar($vname) { if(isset($this->vars[$vname])) unset($this->vars[$vname]); } - //get value of a variable (returns false if variable does not exist) + /**get value of a variable (returns false if variable does not exist)*/ public function getVar($vname) { if(isset($this->vars[$vname])) @@ -70,13 +71,13 @@ class Parser else return false; } - //returns true if variable exists + /**returns true if variable exists*/ public function haveVar($vname) { return isset($this->vars[$vname]); } - //internal: used by parse to load data + /**internal: used by parse to load data*/ protected function parseNormal($help) { $out=""; @@ -91,7 +92,7 @@ class Parser else $out.=$this->parseLine($line); } } - //internal: replace variables on a line + /**internal: replace variables on a line*/ protected function parseLine($line) { $ak=array(); @@ -102,7 +103,7 @@ class Parser } return str_replace($ak,$av,$line)."\n"; } - //internal: handle an #if statement + /**internal: handle an #if statement*/ protected function parseIf($help,$line) { //parse if-line @@ -155,6 +156,7 @@ class Parser } } } + /**internal: handle #set statement*/ protected function parseSet($help,$line) { //parse set-line diff --git a/www/inc/session.php b/www/inc/session.php index 9f76808..cf30a77 100644 --- a/www/inc/session.php +++ b/www/inc/session.php @@ -14,7 +14,7 @@ //prune session cache $db->deleteRows("session","timeout<=".time()); -/**initiate new session*/ +/**initiate new session - $rand should contain some food for the random number generator (from the host request)*/ function newSession($rand) { global $db,$ClientAuthTimeout; @@ -52,6 +52,7 @@ class Session private $sessid=""; private $user=""; + /**construct the session object, check validity*/ public function __construct() { global $_SERVER,$db; @@ -64,16 +65,19 @@ class Session } } + /**returns true if the session exists, it may still be temporary and unauthenticated*/ public function isValid() { return $this->sessid!=""; } + /**returns true if the session is actually authenticated*/ public function isAuthenticated() { return $this->user!=""; } + /**helber function for authenticate*/ protected function xdie($str) { //debug version: @@ -82,6 +86,7 @@ class Session exit(); } + /**runs authentication against the user request*/ public function authenticate() { global $db,$REQUESTDATA; diff --git a/www/machine.php b/www/machine.php index 06e1474..a248079 100644 --- a/www/machine.php +++ b/www/machine.php @@ -9,17 +9,19 @@ if($_SERVER["REQUEST_METHOD"] != "POST" || !isset($_SERVER["HTTP_X_MAGICSMOKE_RE header("Content-Type: application/x-MagicSmoke"); //check whether the request is known -// all valid requests must be listed here (in lower case) +/**all valid requests must be listed here (in lower case)*/ $ALLOWEDREQUESTS=array( "serverinfo", //info request "startsession","sessionauth","closesession", //session requests "blah" //... ); +/**contains the low-level request name from the client*/ $SMOKEREQUEST=strtolower($_SERVER["HTTP_X_MAGICSMOKE_REQUEST"]); if(!in_array($SMOKEREQUEST,$ALLOWEDREQUESTS)){ header("X-MagicSmoke-Status: InvalidRequest"); die("Invalid Request, please use the MagicSmoke Client with this page."); } +/**contains the low-level request data from the client*/ $REQUESTDATA=""; if(isset($HTTP_RAW_POST_DATA)){ $REQUESTDATA=$HTTP_RAW_POST_DATA; @@ -63,6 +65,7 @@ if($SMOKEREQUEST=="closesession"){ //all others need a valid session, check it //check session +/**session object*/ $session=new Session; if(!$session->isValid()){ header("X-MagicSmoke-Status: Unauthenticated"); -- 1.7.2.5